mod_musicindex
1.4.1
|
#include "mod_musicindex.h"
Go to the source code of this file.
Data Structures | |
struct | ftype |
struct used to associate a filetype name and its corresponding mimetype. More... | |
struct | mu_ent_names |
first struct to handle yet unparsed files. More... |
Macros | |
#define | NEW_ENT(pool) ((mu_ent *)apr_pcalloc(pool, sizeof(mu_ent))) |
#define | P_FLAGS_OPTIONS(p, soptions) |
this is used in several places; make it a define to avoid duplicating code |
Typedefs | |
typedef mu_ent *(* | make_entry_ptr )(request_rec *, apr_pool_t *, FILE *const, const char *const) |
Function pointer type, as we need it. | |
typedef struct mu_ent_names | mu_ent_names |
first struct to handle yet unparsed files. |
Enumerations | |
enum | { FT_MP3, FT_OGG, FT_FLAC, FT_MP4, FT_MAX } |
Enumerate handlers to access relevant data in struct filetype. More... |
Functions | |
void | make_music_entry (request_rec *, apr_pool_t *, mu_pack *const, mu_ent_names *, unsigned long) |
Add a file (and the content of the directory if requested) to the chain. | |
void | build_custom_list (request_rec *, mu_pack *const) |
Creates a link list based on the custom list. |
Variables | |
struct ftype const | filetype [] |
Array of common strings widely used. |
#define NEW_ENT | ( | pool | ) | ((mu_ent *)apr_pcalloc(pool, sizeof(mu_ent))) |
Definition at line 61 of file playlist.h.
Referenced by file_make_cache_entry(), make_flac_entry(), make_mp3_entry(), make_mp4_entry(), make_music_entry(), make_ogg_entry(), and mysql_cache_new_ent().
#define P_FLAGS_OPTIONS | ( | p, | |
soptions | |||
) |
this is used in several places; make it a define to avoid duplicating code
Definition at line 69 of file playlist.h.
Referenced by make_music_entry(), and mysql_cache_dircontents().
typedef mu_ent*(* make_entry_ptr)(request_rec *, apr_pool_t *, FILE *const, const char *const) |
Function pointer type, as we need it.
Here comes the declaration of the funny part... We will (again) use function pointers which will allocate a new entry from the apache pool, fill it, and close the "in" file if they recognise the file.
Definition at line 29 of file playlist.h.
typedef struct mu_ent_names mu_ent_names |
first struct to handle yet unparsed files.
DEV NOTE: filename is the path to the file on the filesystem, while uri is the path to the file on the webserver.
anonymous enum |
Enumerate handlers to access relevant data in struct filetype.
FT_MAX is the last element of the enum, it's a marker that gives us the size of the corresponding array.
Definition at line 40 of file playlist.h.
void build_custom_list | ( | request_rec * | r, |
mu_pack *const | pack | ||
) |
Creates a link list based on the custom list.
This function generates a list containing all the files referenced in the conf->custom_list string. It handles parameters in a way so that it can handle indifferently strings for cookies or on-the-fly playlists.
r | Apache request_rec struct |
pack | A pack to which the generated list will be hooked |
Definition at line 556 of file playlist.c.
References ap_sub_req_lookup_uri, apr_base64_decode, apr_base64_decode_len, mu_config::custom_list, mu_pack::fhead, mu_ent_names::filename, mu_pack::head, make_music_entry(), MI_ALLOWFETCH, MI_CUSTOM, musicindex_module, mu_ent::next, options, and mu_ent_names::uri.
Referenced by handle_musicindex().
void make_music_entry | ( | request_rec * | r, |
apr_pool_t * | pool, | ||
mu_pack *const | pack, | ||
mu_ent_names * | names, | ||
unsigned long | soptions | ||
) |
Add a file (and the content of the directory if requested) to the chain.
This function creates a new entry from a file. If the file is a directory and the recursive option is set, all its content is also added. Otherwise, if the file is "recognized", it is simply added.
pool | Pool |
r | Apache request_rec struct to handle log writings (debugging) |
pack | A pack of music entries to populate |
names | Names |
soptions | bitwise special options: these are made of the extended options flag set and are used to fiddle with the algorithms (regis please docu...) |
Definition at line 307 of file playlist.c.
References mu_ent::album, ap_is_directory, ap_sub_req_lookup_uri, apr_palloc, apr_pstrdup, apr_pstrndup, mu_ent::artist, mu_config::cache, mu_dir::dir, mu_config::dir_per_line, mu_pack::dirnb, EF_INCACHE, FALSE, mu_ent::file, mu_ent_names::filename, mu_ent::filename, mu_pack::filenb, mu_ent::filetype, mu_ent::flags, mu_pack::fsize, go_through_directory(), mu_pack::head, likely, make_entry, make_music_entry(), MAX_STRING, MI_ALLOWFETCH, MI_ALLOWRSS, MI_CUSTOM, MI_QUICKPL, MI_RECURSIVE, mi_rerror, MI_RSS, MI_STREAM, MI_TARBALL, musicindex_closedir(), musicindex_module, musicindex_opendir(), musicindex_readdir(), NEW_ENT, mu_ent::next, options, mu_config::options, P_FLAGS_OPTIONS, mu_config::search, mu_ent::size, mu_ent::title, unlikely, mu_ent_names::uri, mu_ent::uri, and cache_backend::write.
Referenced by build_custom_list(), cookie_addall(), handle_musicfile(), handle_musicindex(), and make_music_entry().
struct ftype const filetype[] |
Array of common strings widely used.
http://filext.com/detaillist.php?extdetail=M3U http://filext.com/detaillist.php?extdetail=MP3 http://filext.com/detaillist.php?extdetail=OGG http://filext.com/detaillist.php?extdetail=FLAC http://filext.com/detaillist.php?extdetail=MP4
Definition at line 65 of file playlist.c.
Referenced by file_make_cache_entry(), list_songs(), and send_rss().