|
Namespaces |
namespace | mod_countm |
Defines |
#define | APR_WANT_STRINGS |
#define | APR_WANT_MEMFUNC |
#define | MOD_COUNTM_SET_MUTEX_PERMS |
#define | ap_filter_flush countm_filter_flush |
#define | IS_SLASH(s) (s == '/') |
Functions |
static void * | countm_per_server_config (apr_pool_t *p, server_rec *s) |
| Server startup configuration routine. This routine is called until it returns a non NULL value twice. If either call returns NULL, then will call again. The first call receives pconf, which is released. The second call receives pconf, which exists till server reset. Countm allocates per server memory here. No need to be concerned with which call currently processing (first, second). GDB seems to not like to display any variables within the function. Must be a caller stack issue? Only APLOG_STARTUP, APLOG_CRIT seems to generate any output, and that is to stderr.
|
static void * | countm_merge_per_server_config (apr_pool_t *p, void *base, void *virt) |
static void * | countm_per_dir_config (apr_pool_t *p, char *dir) |
| allocate Director (Location) information.
|
static void * | countm_merge_per_dir_config (apr_pool_t *p, void *basev, void *newv) |
| merge the directories into r->per_dir_config
|
static int | countm_hook_post_config (apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) |
static apr_status_t | countm_pool_post_config_cleanup (void *data) |
| Close the initial process. All other children should have terminated. Closes all databases for this process. Closes all environments for this process.
|
static void | countm_process_init () |
| Initialize process globals Really only required for BDB.
|
static void | countm_hook_child_init (apr_pool_t *p, server_rec *s) |
| Sets up child process for forking MPMs. For forking MPMs: This child process joins the environment to aquire ENV handles. This child process opens the databases to aquire DB handles. Transfer the proc mutexes into this process. For threaded MPMs, create a threaded mutex. Setup the database close process for child termination. Non forking MPMs will never call this.
|
static apr_status_t | countm_pool_child_init_cleanup (void *parm) |
| Child/process termination cleanup. Closes open databases for this child/process at termination. Other child/process may or may not have the DB open. If threaded MPM, destroys thread mutex. Closes the process BDB handles (both environment and database).
|
static void | countm_process_cleanup (apr_pool_t *p, int bSS) |
| Destroy/cleanup a process/child/parent data. Use globals to: Destroy the thread mutex for parent/child process, if necessary. Close any opened databases for parent/child process Only APLOG_STARTUP, APLOG_CRIT generate output to logs. removes any session cache entries for this pid.
|
static int | countm_method_handler (request_rec *r) |
| Handles the request. The server config will be returned by ap_get_module_config. The per directory config will be r->per_dir_config The database handles are in the global proc_dbinfo for this process/child. If threads, then the global lib_lock will be the one for this process/child.
|
static const char * | countm_set_fontdir (cmd_parms *parms, void *dummy, const char *arg) |
| Sets the p_cc->sza_fontdir string from value given in the httpd configuration file. Associated with "CountmFontDir" httpd configuration file directive. Called during the per-server-configuration. If not specified in the httpd config file, this routine is not called.
|
static const char * | countm_set_font (cmd_parms *parms, void *dummy, const char *arg) |
| Sets the p_cc->sza_font string from value given in configuration file. Called during the per-server-configuration if specified in the config file.
|
static const char * | countm_set_db_lockfile (cmd_parms *parms, void *dummy, const char *arg) |
| Sets the p_cc->sza_lockfile string from value given in configuration file. Called during the per-server-configuration if specified in the config file.
|
static const char * | countm_set_bgfile_dir (cmd_parms *parms, void *dummy, const char *arg) |
| Sets the p_cc->sza_bgfile_dir string from value given in configuration file. Called during the per-server-configuration if specified in the config file.
|
static const char * | countm_set_activate (cmd_parms *parms, void *dummy, int bool) |
| Sets the p_cc->bActivate string from value given in configuration file. Called during the per-server-configuration if specified in the config file.
|
static const char * | countm_set_allow_fonts_query (cmd_parms *parms, void *dummy, const int arg) |
| Sets the p_cdc->allow_fonts_queries from value given in configuration file. Called during the per-server-configuration if specified in the config file.
|
static const char * | countm_set_allow_reset (cmd_parms *parms, void *dummy, const int arg) |
| Sets the p_cdc->allow_reset from value given in configuration file. Called during the per-server-configuration if specified in the config file.
|
static const char * | countm_set_db_priority (cmd_parms *parms, void *dummy, const int arg) |
| Sets p_cdc->bDBpriorty from value given in configuration file. Called during the per-server-configuration if specified in the config file.
|
static int | countm_strcmp (const char *s1, const char *s2) |
static apr_status_t | countm_listfonts (p_countent_t p_ce) |
| Lists available server fonts. depends on CountmFontDir, GDFONTPATH, and DEFAULT_FONTPATH settings. If CountmFontsDir is set, then ONLY that directory is used. Otherwise, GDFONTPATH or DEFAULT_FONTPATH is used, and font names may not be relative, and should not have extensions. If environmental variable GDFONTPATH is defined, it is used as the directories, otherwise, gd.h compile time option DEFAULT_FONTPATH is used. If, when gd was compiled, DEFAULT_FONTPATH was overriden, then may fail. GD version prior to 2.0.18 used a space, otherwise, a ':' gd.h compiletime option PATHSEPARATOR is used.
|
static apr_status_t | countm_listdirs (request_rec *r, char *dir, char *rel_dir, p_countm_listdirs_data_t p_ldd) |
| Lists the contents of the directory. If p_ldd->bFontDir==1: Listing absolute. rel_dir is used preg is not used. Directories are recursed. If p_ldd->bFontDir==0: Listing relative, without any extensions. No recursive directory searching.
|
char * | countm_next_fontdir (apr_pool_t *p, const char *fontdirs, unsigned int *pos) |
| Returns the next directory in list of directories.
|
static apr_status_t | countm_get_querystring (p_countent_t p_ce) |
| Obtains the query string for the request. If method is GET, then returns parsed_uri.query If method is POST, then reads input to obtain query string. Places into ce_qs.
|
static apr_status_t | countm_parse_cmdline (p_countent_t p_ce) |
| Parses the URI. Processes the request given in r->args into parameters, If p_ce->ce_string is defined, end the query. The database will not be accessed. Values up to the error will be used to construct returned image. All missing values will be used to construct return image (if possible). Duplicate command line paramaters are ignored (except insert=). Fills in p_ce-> ce_link ce_cmd_rec ce_ignore ce_insert ce_insert_buffer[INSERT_BUFFER_SIZE] ce_reset ce_reset_val.
|
static int | countm_verify_bgfile (p_countent_t p_ce, char *fn, enum imagetype *img) |
| Attempts to determine file type via extension and then attempts open file.
|
static apr_status_t | countm_unescape_url (apr_pool_t *p, char *s, apr_status_t *sNorm, apr_status_t *sKeep2f) |
| unescapes s using ap_unescape_url
|
static int | countm_mergeinfo_cmdpriority (p_countent_t p_ce) |
| merges the info from DB_COUNTER with cmdline info with command line priority. Merges p_ce->ce_dbcounter_data with/into p_ce->ce_cmd_data. p_ce->ce_dbcounter_data is not altered!! (for insertion into DB_COUNTER) Assumes DB_COUNTER info is accurate and correct. That bgfile (if one) exists.
|
static int | countm_mergeinfo_dbpriority (p_countent_t p_ce) |
| merges the info from DB_COUNTER with command info with database priority. Merges p_ce->ce_dbcounter_data with/into p_ce->ce_cmd_data. p_ce->ce_dbcounter_data is not altered!! (for insertion into DB_COUNTER) Assumes DB_COUNTER info is accurate and correct. That bgfile (if one) exists.
|
static apr_status_t | countm_process_command (p_countent_t p_ce, int *bDisplay) |
| Processes the reset commands. Display string after this.
|
static apr_status_t | countm_reset_value (p_countent_t p_ce, int *bDisplay) |
| Handles the reset=value command. If link is not present in DB_COUNTER, DISPLAY_STR_NOLINK. If link successfully updated, display the old count value.
|
static int | countm_reset_delete (p_countent_t p_ce, int *bDisplay) |
| Handles the reset delete command. Deletes the link from DB_COUTNER. If link is not present, DISPLAY_STR_NOLINK. If link is deleted, DISPLAY_STR_CDELETE. bDisplay is really not necessary, but maintains a standard.
|
static int | countm_reset_access (p_countent_t p_ce, int *bDisplay) |
| Handles the reset access command Deletes a links entire access list from DB_ACCESS. If link is not present, DISPLAY_STR_NOLINK. If link is deleted, DISPLAY_STR_ADELETE.
|
static int | countm_reset_init (p_countent_t p_ce, int *bDisplay) |
| Handles the reset init command Adds a new link to DB_COUNTER. If link is already present in DB_COUNTER, DISPLAY_STR_LINK. If link is added, DISPLAY_STR_CADD. In some cases, the link may be added to DB_COUNTER, but return error. IE if ignore= parameter inserts cause BDB errors. p_ce->ce_cmd_data contains all the info to insert.
|
static int | countm_update_counter (p_countent_t p_ce, int *bDisplay) |
| Process a normal update counter request. If link is not in DB_COUNTER, DISPLAY_STR_NOLINK.
|
static int | countm_setdefaults (p_countent_t p_ce) |
| Set any undefined value in p_ce->ce_cmd_data to default values. Process the information one last time. Set any undefined values to default values.
|
static void | countm_rgb_color (const char *hexnum, p_rgb_t rgb) |
| Manipulates rgb color values.
|
static apr_status_t | countm_display_string (p_countent_t p_ce) |
| displays the string back to the requesting client.
|
static int | countm_match_extension (request_rec *r, const char *fname, const char *pattern) |
| Determines if fname matches pattern.
|
static int | countm_misc_dza_strcat (char *const buf, char const *const szstr, const int bsize) |
| countm miscellaneous double zero ascii string concat function appends a zero terminated ascii string to a double zero terminated list of zero terminated strings. A nice double zero terminated string library would be nice.
|
static apr_status_t | countm_filter_flush (apr_bucket_brigade *bb, void *ctx) |
| flushes the brigade upon overflow Not sure if this is necessary, as NULL, NULL in apr_brigade_puts works just as well.
|
static void | countm_adjust_string_width (p_countent_t p_ce) |
| Adjust the string width for numbers.
|
static void | countm_print_enum_imagetype (enum imagetype it, char **r_str) |
| converts imagetype to string for printing.
|
static int | countm_enum_imagetype (const char *buf, enum imagetype *p_it) |
| converts imagetype string to enum imagetype value.
|
static void | countm_print_enum_randomtype (enum randomtype rt, char **r_str) |
| converts the randomtype string to a enum randomtype.
|
static int | countm_enum_randomtype (const char *buf, enum randomtype *p_rt) |
| converts the randomtype to a string for printing.
|
static void | countm_print_enum_counttype (enum counttype ct, char **r_str) |
| Converts counttype to string for printing.
|
static int | countm_enum_counttype (const char *buf, enum counttype *p_ct) |
| Converts counttype string to enum counttype.
|
static void | countm_print_struct_rgb (p_rgb_t p_rgb, char *buf) |
| Converts struct rgb to string for printing.
|
static int | countm_set_atime (p_dbcounter_data_t p_dbcd, request_rec *r) |
| creates the atime field from the request time. localtime just seems better. Can easily use gmttime if desired. return 0
|
static int | countm_absolute_path (const char *path) |
static int | countm_check_filename (const char *file) |
static char | x2c (const char *what) |
| AP_DECLARE (int) |
void | countm_initialize_config (p_countm_config_t p) |
| Intialized the countm_config_t structure.
|
static void | countm_register_hooks (apr_pool_t *p) |
| Registers required hooks. Called by API to register hooks necessary for various stages.
|
Variables |
module AP_MODULE_DECLARE_DATA | countm_module |
command_rec | countm_cmds [] |