mod_musicindex  1.4.1
config.h File Reference
#include "mod_musicindex.h"

Go to the source code of this file.

Macros

#define CONF_COOKIE_LIFE   300
 Default lifetime for the cookie in seconds.
#define CONF_RSS_ITEMS   20
 Default number of items to be displayed in a RSS feed.
#define CONF_DIRPERLINE   3
 Number of directories to show per line by default.
#define CF_TITLE   (1 << 0)
 title was set
#define CF_DIR   (1 << 1)
 directory was set - currently impossible
#define CF_CSS   (1 << 2)
 CSS was set.
#define CF_ICES   (1 << 3)
 Icecast server was set.
#define CF_CACHE   (1 << 4)
 Cache backend was set.
#define CF_DPL   (1 << 5)
 Dirs per line was set.
#define CF_CKLF   (1 << 6)
 Cookie life was set.
#define CF_RSS   (1 << 7)
 RSS was set.
#define CF_ORDER   (1 << 8)
 sort order was set
#define CF_FIELDS   (1 << 9)
 display fields were set
#define CF_MERGED   (1 << 15)
 flag for merged config

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.

Variables

const command_rec musicindex_cmds []

Macro Definition Documentation

#define CF_CACHE   (1 << 4)

Cache backend was set.

Definition at line 34 of file config.h.

Referenced by merge_musicindex_configs(), and set_cache_uri().

#define CF_CKLF   (1 << 6)

Cookie life was set.

Definition at line 36 of file config.h.

Referenced by merge_musicindex_configs(), and set_cookie_life().

#define CF_CSS   (1 << 2)

CSS was set.

Definition at line 32 of file config.h.

Referenced by merge_musicindex_configs(), and set_css_default().

#define CF_DIR   (1 << 1)

directory was set - currently impossible

Definition at line 31 of file config.h.

#define CF_DPL   (1 << 5)

Dirs per line was set.

Definition at line 35 of file config.h.

Referenced by merge_musicindex_configs(), and set_dirperline().

#define CF_FIELDS   (1 << 9)

display fields were set

Definition at line 39 of file config.h.

Referenced by merge_musicindex_configs(), and set_fields().

#define CF_ICES   (1 << 3)

Icecast server was set.

Definition at line 33 of file config.h.

Referenced by merge_musicindex_configs(), and set_ice_server().

#define CF_MERGED   (1 << 15)

flag for merged config

Definition at line 41 of file config.h.

Referenced by merge_musicindex_configs().

#define CF_ORDER   (1 << 8)

sort order was set

Definition at line 38 of file config.h.

Referenced by merge_musicindex_configs(), set_display(), and sort_order().

#define CF_RSS   (1 << 7)

RSS was set.

Definition at line 37 of file config.h.

Referenced by merge_musicindex_configs(), and set_display().

#define CF_TITLE   (1 << 0)

title was set

Definition at line 30 of file config.h.

Referenced by merge_musicindex_configs(), and set_page_title().

#define CONF_COOKIE_LIFE   300

Default lifetime for the cookie in seconds.

Definition at line 22 of file config.h.

Referenced by create_musicindex_config().

#define CONF_DIRPERLINE   3

Number of directories to show per line by default.

Definition at line 24 of file config.h.

Referenced by create_musicindex_config(), and set_dirperline().

#define CONF_RSS_ITEMS   20

Default number of items to be displayed in a RSS feed.

Definition at line 23 of file config.h.

Referenced by basic_config(), and set_display().

Function Documentation

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.

Note
It kinda bugs me that we don't need to set options_not = ~0, but it seems to work without it...
Parameters
pApache pool for memory allocation.
dummystring containing the path to the relevant Directory or Location - we don't use it.
Returns
The newly created configuration structure.

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).

Note
In the absence of a .htaccess in the hierarchy of folders being accessed, #basev contains a freshly created config structure (through create_musicindex_config()) and #addv contains another config struct created through create_musicindex_config(), with the configuration parameters modified by <Directory> directive (if any) set appropriately.
#basev: clean #addv: configured => keep #addv
In the presence of a .htaccess file in the directory being accessed, #basev contains the result of the merging of all "parent" configuration directives (<Directory> being the top ancestor, and any subsquent .htaccess being merged using merge_musicindex_configs()) up to the one in the current directory being accessed, which config options are set in #addv.
#basev: merged #addv: configured => merge
In the presence of a .htaccess anywhere in the parent hierarchy of the directory being accessed BUT in said directory, #basev contains a pristine config structure (as per create_musicindex_config()) and #addv contains the result of merging all parent configuration directives (<Directory> being the top ancestor).
#basev: clean #addv: merged => keep #addv

Hence the logic of this function: if #basev contains init data (data setup in create_musicindex_config()), use #addv element. Otherwise, merge both configs.

Parameters
pApache pool for memory allocation.
basevPointer to main configuration structure.
addvPointer to parent dir configuration structure,
Returns
The newly created 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.

Variable Documentation

const command_rec musicindex_cmds[]

Definition at line 499 of file config.c.