Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

mod_countm.c File Reference

countm module routines More...


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 []


Detailed Description

countm module routines

Author:
Byron Young
Remarks:
A simple apache2 DSO module page counter returning

jpeg or png images.

Version:
5.4
Bug:
report to spamiccling@yahoo.com

report to bkyoung@users.sourceforge.net


Function Documentation

static int countm_absolute_path const char *  path  )  [static]
 

OS DEPENDENT: check that path is: absolute ends in a directory separator. does not contain a ..

Returns:
0 not an absolute or invalid path. 1 yes, a valid absolute path.

countm_adjust_string_width p_countent_t  p_ce  )  [static]
 

Adjust the string width for numbers.

Parameters:
p_ce Request information.
Returns:
void

static int countm_check_filename const char *  file  )  [static]
 

Parameters:
file The filename to check.
Returns:
0 filename failed

1 filename passed. OS Dependent: Verifies filename is only a filename. does not contain any ".." does not contain any directory separator characters. '/'

countm_display_string p_countent_t  p_ce  )  [static]
 

displays the string back to the requesting client.

Parameters:
p_ce Request Information. Uses info from p_ce->ce_cmd_data.
Returns:
APR_SUCCESS.

countm_enum_counttype const char *  buf,
enum counttype p_ct
[static]
 

Converts counttype string to enum counttype.

Parameters:
p_ct counttype of string.
buf buffer of counttype string.
Returns:
int

countm_enum_imagetype const char *  buf,
enum imagetype p_it
[static]
 

converts imagetype string to enum imagetype value.

Parameters:
buf the string.
p_it OUT:the enum imagetype of string.
Returns:
0=success, 1=failure.

countm_enum_randomtype const char *  buf,
enum randomtype p_rt
[static]
 

converts the randomtype to a string for printing.

Parameters:
p_rt randomtype to convert
buf buffer of adequate size.
Returns:
0=success, 1=failure.

countm_filter_flush apr_bucket_brigade *  bb,
void *  ctx
[static]
 

flushes the brigade upon overflow Not sure if this is necessary, as NULL, NULL in apr_brigade_puts works just as well.

Parameters:
bb the bucket brigade
ctx the paramter to ap_pass_brigade
Returns:
apr_status_t

countm_get_querystring p_countent_t  p_ce  )  [static]
 

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.

Parameters:
p_ce The request information.
Returns:
APR_SUCCESS

HTTP_INTERNAL_SERVER_ERROR

HTTP_NOT_IMPLEMENTED

countm_hook_child_init apr_pool_t *  p,
server_rec *  s
[static]
 

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.

Parameters:
p The child process pool.
s The server record.
Returns:
void

countm_initialize_config p_countm_config_t  p  ) 
 

Intialized the countm_config_t structure.

Parameters:
p The structure to initialize
Returns:
The initialized structure.

countm_listdirs request_rec *  r,
char *  dir,
char *  rel_dir,
p_countm_listdirs_data_t  p_ldd
[static]
 

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.

Parameters:
r The request record.
dir The directory to traverse/ list.
rel_dir A relative directory to prepend to output files. Only used for bFontDir.
p_ldd The listdirs data.
Returns:
APR_SUCCESS

HTTP_INTERNAL_SERVER_ERROR

countm_listfonts p_countent_t  p_ce  )  [static]
 

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.

Parameters:
p_ce All the information.
Returns:
OK

HTTP_INTERNAL_SERVER_ERROR

countm_match_extension request_rec *  r,
const char *  fname,
const char *  pattern
[static]
 

Determines if fname matches pattern.

Parameters:
r request record
fname The file name to check.
pattern The RE to use.
Returns:
0 No, does not match.

1 Yes, they match.

countm_merge_per_dir_config apr_pool_t *  p,
void *  basev,
void *  newv
[static]
 

merge the directories into r->per_dir_config

Parameters:
p The config pool.
basev The base dir config.
newv The new dir config.
Returns:
Pointer to the config structure. If the basev->dir parameter is NULL, then the top config.

countm_merge_per_server_config apr_pool_t *  p,
void *  base,
void *  virt
[static]
 

Parameters:
p the pool
base the base server config.
virt The new virtual server config.
Returns:
void * pointer to merged virtual config Okay to modify base, and changes are maintained. The first valid database will open the global environment (if any). The first valid database will open the global database (if any). Opens valid virtual server environments. Opens valid virtual server databases. Creates DBD handles for the initiating process. Child process will use the information to create their own handles.

countm_mergeinfo_cmdpriority p_countent_t  p_ce  )  [static]
 

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.

Parameters:
p_ce Request information.
Returns:

countm_mergeinfo_dbpriority p_countent_t  p_ce  )  [static]
 

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.

Parameters:
p_ce Request information.
Returns:

countm_method_handler request_rec *  r  )  [static]
 

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.

Parameters:
r request_rec.
Returns:
Status value.

countm_misc_dza_strcat char *const   buf,
char const *const   szstr,
const int  bsize
[static]
 

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.

Parameters:
buf The buffer to append
szstr the string to append.
bsize The buffer size, in bytes.
Returns:
0=failed, buffer too small, invalid szstr, 1=success

char* countm_next_fontdir apr_pool_t *  p,
const char *  fontdirs,
unsigned int *  pos
 

Returns the next directory in list of directories.

(apr_pool_t * p, const char * fontdirs, unsigned int * pos)

Parameters:
p The memory pool.
fontdirs The list of directories.
pos IN:the starting position in fontdirs. OUT:the first char after separator.
Returns:
NULL no more directories in list. the next directory. Example: ":abc::" Returns abc on first call, and NULL on next call.

countm_parse_cmdline p_countent_t  p_ce  )  [static]
 

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.

Parameters:
p_ce The countent information.
Returns:

countm_per_dir_config apr_pool_t *  p,
char *  dir
[static]
 

allocate Director (Location) information.

Parameters:
p the config pool
dir the directory/location processing.
Returns:
Pointer to allocated stucture.

countm_per_server_config apr_pool_t *  p,
server_rec *  s
[static]
 

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.

Parameters:
p The config pool.
s The server record.
p The configuration pool. The parent is pglobal.
s The server record.
Returns:
Pointer to the module_config record.

countm_pool_child_init_cleanup void *  parm  )  [static]
 

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

Parameters:
parm pointer to global server countm_config.

countm_pool_post_config_cleanup void *  data  )  [static]
 

Close the initial process. All other children should have terminated. Closes all databases for this process. Closes all environments for this process.

Parameters:
data pointer to global server countm_config
Returns:
status

countm_print_enum_counttype enum counttype  ct,
char **  r_str
[static]
 

Converts counttype to string for printing.

Parameters:
ct counttype.
r_str Return string.
Returns:
void

countm_print_enum_imagetype enum imagetype  it,
char **  r_str
[static]
 

converts imagetype to string for printing.

Parameters:
it the image type.
r_str Return string.
Returns:
void

countm_print_enum_randomtype enum randomtype  rt,
char **  r_str
[static]
 

converts the randomtype string to a enum randomtype.

Parameters:
rt the enum randomtype.
r_str Return string.
Returns:
void.

countm_print_struct_rgb p_rgb_t  p_rgb,
char *  buf
[static]
 

Converts struct rgb to string for printing.

Parameters:
p_rgb pointer to rgb structure.
buf The return buffer of adequate size.
Returns:
void

countm_process_cleanup apr_pool_t *  p,
int  bSS
[static]
 

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.

Parameters:
p The memory pool.
bSS True if the Startup/Stop process.
Returns:
void

countm_process_command p_countent_t  p_ce,
int *  bDisplay
[static]
 

Processes the reset commands. Display string after this.

Parameters:
p_ce Request Information.
bDisplay OUT:True if display string directly. Implies an error.
Returns:
APR_SUCCESS

countm_register_hooks apr_pool_t *  p  )  [static]
 

Registers required hooks. Called by API to register hooks necessary for various stages.

Parameters:
p The memory pool. The pconf, ptemp, or other pool?
Returns:
none

countm_reset_access p_countent_t  p_ce,
int *  bDisplay
[static]
 

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.

Parameters:
p_ce The request data.
bDisplay OUT:True if display string directly.
Returns:
0 Success.

1 Error, end query.

countm_reset_delete p_countent_t  p_ce,
int *  bDisplay
[static]
 

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.

Parameters:
p_ce Request information.
bDisplay OUT:True if display string directly. Implies error.
Returns:
0

1 Error, end query.

countm_reset_init p_countent_t  p_ce,
int *  bDisplay
[static]
 

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.

Parameters:
p_ce request data
bDisplay OUT:True if display string directly.
Returns:
0 Success

1 DB Error, end query.

countm_reset_value p_countent_t  p_ce,
int *  bDisplay
[static]
 

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.

Parameters:
p_ce Request information.
bDisplay OUT:True if display string direclty.
Returns:
APR_SUCCESS

countm_rgb_color const char *  hexnum,
p_rgb_t  rgb
[static]
 

Manipulates rgb color values.

Parameters:
hexnum String representing 6 consecutive hex digits.
rgb Pointer to allocated return structure.
Returns:
The colors within the rgb structure.

countm_set_activate cmd_parms *  parms,
void *  dummy,
int  bool
[static]
 

Sets the p_cc->bActivate string from value given in configuration file. Called during the per-server-configuration if specified in the config file.

Parameters:
parms The command data structure.
dummy Unused, since no per-directory-configuration possible.
bool The value specified in the configuration script.
Returns:
NULL

countm_set_allow_fonts_query cmd_parms *  parms,
void *  dummy,
const int  arg
[static]
 

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.

Parameters:
parms The command data structure.
dummy Used, because per-directory-configuration active for directive.
arg The value specified in the configuration script.
Returns:
NULL

countm_set_allow_reset cmd_parms *  parms,
void *  dummy,
const int  arg
[static]
 

Sets the p_cdc->allow_reset from value given in configuration file. Called during the per-server-configuration if specified in the config file.

Parameters:
parms The command data structure.
dummy Unused, since no per-directory-configuration possible.
arg The value specified in the configuration script.
Returns:
NULL

countm_set_atime p_dbcounter_data_t  p_dbcd,
request_rec *  r
[static]
 

creates the atime field from the request time. localtime just seems better. Can easily use gmttime if desired. return 0

Parameters:
p_dbcd structure containing atime to fill in.
r request record.

countm_set_bgfile_dir cmd_parms *  parms,
void *  dummy,
const char *  arg
[static]
 

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.

Parameters:
parms The command data structure.
dummy Unused, since no per-directory-configuration possible.
arg The value specified in the configuration script.
Returns:
NULL

countm_set_db_lockfile cmd_parms *  parms,
void *  dummy,
const char *  arg
[static]
 

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.

Parameters:
parms The command data structure.
dummy Unused, since no per-directory-configuration possible.
arg The value specified in the configuration script.
Returns:
NULL

countm_set_db_priority cmd_parms *  parms,
void *  dummy,
const int  arg
[static]
 

Sets p_cdc->bDBpriorty from value given in configuration file. Called during the per-server-configuration if specified in the config file.

Parameters:
parms The command data structure.
dummy Unused, since no per-directory-configuration possible.
arg The value specified in the configuration script.
Returns:
NULL

static const char * countm_set_font cmd_parms *  parms,
void *  dummy,
const char *  arg
[static]
 

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.

Parameters:
parms The command data structure.
dummy Unused, since no per-directory-configuration possible.
arg The value specified in the configuration script.
Returns:
NULL

static const char * countm_set_fontdir cmd_parms *  parms,
void *  dummy,
const char *  arg
[static]
 

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.

Parameters:
parms The command data structure.
dummy Unused, since no per-directory-configuration possible.
arg The value specified in the configuration script.
Returns:
NULL: Success.

Valid Pointer: string to display as error, along with syntax error message at line of directive.

DECLINE_CMD: If a subsequent module decalres the directive, let it handle it.

countm_setdefaults p_countent_t  p_ce  )  [static]
 

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.

Parameters:
p_ce Request information.
Returns:
Always returns 0

countm_strcmp const char *  s1,
const char *  s2
[static]
 

Parameters:
s1 String one.
s2 String two.
Returns:
<0 s1 < s2

0 Strings are equal

>0 s1 > s2 brief Compares strings based on COUNTM_CONFIG_ICASE value.

countm_unescape_url apr_pool_t *  p,
char *  s,
apr_status_t *  sNorm,
apr_status_t *  sKeep2f
[static]
 

unescapes s using ap_unescape_url

Parameters:
p The memory pool.
s The string to unescape.
sNorm OUT:ap_unescape_url return value.
sKeep2f OUT:ap_unescape_url_keep2f value.
Returns:
APR_SUCCESS

HTTP_INTERNAL_SERVER_ERROR

countm_update_counter p_countent_t  p_ce,
int *  bDisplay
[static]
 

Process a normal update counter request. If link is not in DB_COUNTER, DISPLAY_STR_NOLINK.

Returns:
BDB error.

static int countm_verify_bgfile p_countent_t  p_ce,
char *  fn,
enum imagetype img
[static]
 

Attempts to determine file type via extension and then attempts open file.

Parameters:
p_ce Request information.
fn The file name to verify.
img OUT:The image type.
Returns:
1 Success. fn verified, img set.

0 Failure. fn incorrect.


Variable Documentation

module AP_MODULE_DECLARE_DATA countm_module
 

Initial value:


Generated on Sat Jan 7 15:48:40 2006 for mod_countm by  doxygen 1.4.2