mod_musicindex
1.4.1
|
Configuration handling and default settings. More...
Go to the source code of this file.
Typedefs | |
typedef int(* | cache_backend_setup )(cmd_parms *cmd, const char *setup_string, mu_config *const conf) |
Functions | |
void * | create_musicindex_config (apr_pool_t *p, char *dummy) |
Generates a per-directory configuration. | |
void * | merge_musicindex_configs (apr_pool_t *p, void *basev, void *addv) |
Merge per-directory configurations. | |
static unsigned short | sort_or_fields (cmd_parms *cmd, unsigned char *restrict list, const char *optstr) |
static const char * | sort_order (cmd_parms *cmd, void *d, const char *optstr) |
static const char * | set_fields (cmd_parms *cmd, void *d, const char *optstr) |
static const char * | basic_config (cmd_parms *cmd, void *d, const char *optstr) |
Enables the module options. | |
static const char * | set_cache_uri (cmd_parms *cmd, void *d, const char *optstr) |
Configures the cache location in the filesystem. | |
static const char * | set_page_title (cmd_parms *cmd, void *d, const char *optstr) |
Sets the title of the page. | |
static const char * | set_ice_server (cmd_parms *cmd, void *d, const char *optstr) |
Sets the icecast server address. | |
static const char * | set_css_default (cmd_parms *cmd, void *d, const char *optstr) |
Sets the default CSS file. | |
static const char * | set_cookie_life (cmd_parms *cmd, void *d, const char *optstr) |
Sets the cookie lifetime. | |
static const char * | set_dirperline (cmd_parms *cmd, void *d, const char *optstr) |
Sets the number of directories to display per line. | |
static const char * | set_display (cmd_parms *cmd, void *d, const char *optstr) |
Sets the default display. |
Variables | |
static const cache_backend_setup const | cache_setups [] |
list of cache setup functions, to be handled manually | |
static const unsigned char const | default_order [] |
Default sort order. | |
static const unsigned char const | default_fields [] |
Default fields displayed. | |
static const char const | default_directory [] = "/musicindex" |
Default musicindex directory. | |
static const char const | default_rootname [] = "Music" |
Default root directory name. | |
static const char const | default_css [] = "musicindex.css" |
Default CSS file name. | |
struct { | |
const char *const string | |
const char value | |
} | options [] |
const command_rec | musicindex_cmds [] |
Configuration handling and default settings.
That file takes care of the module configuration, either via setting some known default values, and/or by getting them from environmental configuration variables passed to apache in its config file.
http://www.apachetutor.org/dev/config
http://www.kuzbass.ru/docs/apache_c_mod_perl/147.htm
Definition in file config.c.
typedef int(* cache_backend_setup)(cmd_parms *cmd, const char *setup_string, mu_config *const conf) |
|
static |
Enables the module options.
Read the different options given as parameters, and set the various flags.
cmd | I don't use it. |
d | Pointer to configuration structure. |
optstr | The string given as parameter in the configuration. |
Definition at line 291 of file config.c.
References CONF_RSS_ITEMS, MI_ACTIVE, MI_ALLOWDWNLD, MI_ALLOWSEARCH, MI_ALLOWSTREAM, MI_ALLOWTARBALL, mu_config::options, mu_config::options_not, and mu_config::rss_items.
void* create_musicindex_config | ( | apr_pool_t * | p, |
char * | dummy | ||
) |
Generates a per-directory configuration.
This function creates a new configuration structure and fills it with default values.
p | Apache pool for memory allocation. |
dummy | string containing the path to the relevant Directory or Location - we don't use it. |
Definition at line 108 of file config.c.
References apr_pcalloc, CONF_COOKIE_LIFE, CONF_DIRPERLINE, default_css, default_directory, default_fields, default_order, and default_rootname.
void* merge_musicindex_configs | ( | apr_pool_t * | p, |
void * | basev, | ||
void * | addv | ||
) |
Merge per-directory configurations.
This function is supposed to merge two per-directory configurations. We apply a simple inheritance pattern from the parent directory(ies).
Hence the logic of this function: if #basev contains init data (data setup in create_musicindex_config()), use #addv element. Otherwise, merge both configs.
p | Apache pool for memory allocation. |
basev | Pointer to main configuration structure. |
addv | Pointer to parent dir configuration structure, |
Definition at line 161 of file config.c.
References apr_pcalloc, CF_CACHE, CF_CKLF, CF_CSS, CF_DPL, CF_FIELDS, CF_ICES, CF_MERGED, CF_ORDER, CF_RSS, CF_TITLE, and default_directory.
|
static |
Configures the cache location in the filesystem.
This function sets the configuration string for the cache subsystem.
cmd | Struct containing a pointer to the pool I have to use. |
d | Pointer to configuration structure. |
optstr | The string given as parameter in the configuration. |
Definition at line 360 of file config.c.
References cache_setups, CF_CACHE, and mu_config::sets.
|
static |
Sets the cookie lifetime.
This function sets the lifetime in seconds of the cookie used for custom playlist constructs.
cmd | I don't use it. |
d | Pointer to configuration structure. |
optstr | The string given as parameter in the configuration. |
Definition at line 441 of file config.c.
References CF_CKLF, mu_config::cookie_life, and mu_config::sets.
|
static |
Sets the default CSS file.
This function sets which CSS file will be used by default
cmd | Struct containing a pointer to the pool I have to use. |
d | Pointer to configuration structure. |
optstr | The string given as parameter in the configuration. |
Definition at line 422 of file config.c.
References apr_pstrdup, CF_CSS, mu_config::css, and mu_config::sets.
|
static |
Sets the number of directories to display per line.
Negative values will disable the "pretty folders" system.
cmd | I don't use it. |
d | Pointer to configuration structure. |
optstr | The string given as parameter in the configuration. |
Definition at line 459 of file config.c.
References CF_DPL, CONF_DIRPERLINE, mu_config::dir_per_line, and mu_config::sets.
|
static |
Sets the default display.
cmd | Struct containing a pointer to the pool I have to use. |
d | Pointer to configuration structure. |
optstr | The string given as parameter in the configuration. |
Definition at line 478 of file config.c.
References CF_ORDER, CF_RSS, CONF_RSS_ITEMS, default_order, MI_RECURSIVE, MI_RSS, mu_config::options, mu_config::options_not, mu_config::order, mu_config::rss_items, SB_MTIME, SB_URI, and mu_config::sets.
|
static |
Definition at line 272 of file config.c.
References CF_FIELDS, mu_config::fields, mu_config::sets, and sort_or_fields().
|
static |
Sets the icecast server address.
This function sets an icecast server for streaming.
cmd | Struct containing a pointer to the pool I have to use. |
d | Pointer to configuration structure. |
optstr | The string given as parameter in the configuration. |
Definition at line 404 of file config.c.
References apr_pstrdup, CF_ICES, mu_config::iceserver, and mu_config::sets.
|
static |
Sets the title of the page.
This function simply chages the name of the root.
cmd | Struct containing a pointer to the pool I have to use. |
d | Pointer to configuration structure. |
optstr | The string given as parameter in the configuration. |
Definition at line 383 of file config.c.
References apr_pstrdup, CF_TITLE, mu_config::sets, and mu_config::title.
|
static |
Definition at line 244 of file config.c.
References options, and SB_MAX.
Referenced by set_fields(), and sort_order().
|
static |
Definition at line 263 of file config.c.
References CF_ORDER, mu_config::order, SB_URI, mu_config::sets, and sort_or_fields().
|
static |
list of cache setup functions, to be handled manually
Definition at line 56 of file config.c.
Referenced by set_cache_uri().
|
static |
Default CSS file name.
Definition at line 92 of file config.c.
Referenced by create_musicindex_config().
|
static |
Default musicindex directory.
Definition at line 90 of file config.c.
Referenced by create_musicindex_config(), and merge_musicindex_configs().
|
static |
Default fields displayed.
Definition at line 82 of file config.c.
Referenced by create_musicindex_config().
|
static |
Default sort order.
Definition at line 67 of file config.c.
Referenced by create_musicindex_config(), and set_display().
|
static |
Default root directory name.
Definition at line 91 of file config.c.
Referenced by create_musicindex_config().
const command_rec musicindex_cmds[] |
struct { ... } options[] |
Referenced by build_custom_list(), make_music_entry(), and sort_or_fields().