Return-Path: Delivered-To: apache-cvs-archive@hyperreal.org Received: (qmail 3464 invoked by uid 6000); 28 Jul 1999 20:00:23 -0000 Received: (qmail 3458 invoked by alias); 28 Jul 1999 20:00:21 -0000 Delivered-To: apache-apr-cvs@hyperreal.org Received: (qmail 3456 invoked by uid 236); 28 Jul 1999 20:00:21 -0000 Date: 28 Jul 1999 20:00:21 -0000 Message-ID: <19990728200021.3455.qmail@hyperreal.org> From: rbb@hyperreal.org To: apache-apr-cvs@hyperreal.org Subject: cvs commit: apache-apr/apr/misc/unix getopt.c start.c Sender: apache-cvs-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org rbb 99/07/28 13:00:20 Modified: apr/file_io/unix fileacc.c apr/misc/unix getopt.c start.c Log: Another directory documented. Revision Changes Path 1.16 +2 -2 apache-apr/apr/file_io/unix/fileacc.c Index: fileacc.c =================================================================== RCS file: /home/cvs/apache-apr/apr/file_io/unix/fileacc.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- fileacc.c 1999/07/27 19:26:13 1.15 +++ fileacc.c 1999/07/28 20:00:12 1.16 @@ -216,7 +216,7 @@ /* ***APRDOC******************************************************** * ap_status_t ap_get_filedata(ap_file_t *, void *) - * Return the context associated with the current file. + * Return the data associated with the current file. * arg 1) The currently open file. * arg 2) The user data associated with the file. */ @@ -233,7 +233,7 @@ /* ***APRDOC******************************************************** * ap_status_t ap_set_filedata(ap_file_t *, void *) - * Return the context associated with the current file. + * Set the data associated with the current file. * arg 1) The currently open file. * arg 2) The user data to associate with the file. */ 1.2 +21 -8 apache-apr/apr/misc/unix/getopt.c Index: getopt.c =================================================================== RCS file: /home/cvs/apache-apr/apr/misc/unix/getopt.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- getopt.c 1999/07/27 17:58:32 1.1 +++ getopt.c 1999/07/28 20:00:15 1.2 @@ -42,16 +42,29 @@ optreset; /* reset getopt */ char *optarg; /* argument associated with option */ -#define BADCH (int)'?' -#define BADARG (int)':' #define EMSG "" -/* - * getopt -- - * Parse argc/argv argument vector. +/* ***APRDOC******************************************************** + * ap_status_t ap_getopt(ap_context_t *, ap_int32_t, char *const *, + * const char *, ap_int32_t) + * Parse the command line options passed to the program. + * arg 1) The context to operate on. + * arg 2) The number of arguments passed to ap_getopt to parse + * arg 3) The array of command line options to parse + * arg 4) A string of characters that are acceptable options to the program. + * characters followed by ":" are required to have an option + * associated + * arg 5) The next option found. There are four potential values for + * this variable on exit. They are: + * APR_EOF -- No more options to parse + * APR_BADCH -- Found a bad option character + * APR_BADARG -- Missing parameter for the found option + * Other -- The next option found. + * NOTE: Arguments 2 and 3 are most commonly argc and argv from + * main(argc, argv) */ -ap_status_t ap_getopt(struct context_t *cont, int nargc, char *const *nargv, - const char *ostr, ap_int32_t *rv) +ap_status_t ap_getopt(struct context_t *cont, ap_int32_t nargc, + char *const *nargv, const char *ostr, ap_int32_t *rv) { char *p; static char *place = EMSG; /* option letter processing */ @@ -91,7 +104,7 @@ "%s: illegal option -- %c\n", p, optopt); } *rv = optopt; - return (BADCH); + return APR_BADCH; } if (*++oli != ':') { /* don't need argument */ optarg = NULL; 1.10 +54 -3 apache-apr/apr/misc/unix/start.c Index: start.c =================================================================== RCS file: /home/cvs/apache-apr/apr/misc/unix/start.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- start.c 1999/07/23 14:41:42 1.9 +++ start.c 1999/07/28 20:00:16 1.10 @@ -62,7 +62,20 @@ #include #include -ap_status_t ap_create_context(struct context_t *cont, void *data, ap_context_t **newcont) +/* ***APRDOC******************************************************** + * ap_status_t ap_create_context(ap_context_t *, void *, ap_context_t **) + * Create a new context. + * arg 1) The parent context. If this is NULL, the new context is a root + * context. If it is non-NULL, the new context will inherit all + * of it's parent context's attributes, except the pool will be a + * sub-pool. + * arg 2) Any data to be assocaited with the context. If this is a + * sub-context, and this value is NULL, the new context will + * inherit the data from it's parent. + * arg 3) The context we have just created. + */ +ap_status_t ap_create_context(struct context_t *cont, void *data, + struct context_t **newcont) { struct context_t *new; ap_pool_t *pool; @@ -105,6 +118,13 @@ return APR_SUCCESS; } +/* ***APRDOC******************************************************** + * ap_status_t ap_set_signal_safe(ap_context_t *, ap_int16_t) + * Set the signal safe attribute of the program. If this bit-is on, then + * any apr function which uses this context IS signal safe. + * arg 1) The context to modify. + * arg 2) Should functions be signal safe or not? + */ ap_status_t ap_set_signal_safe(struct context_t *cont, ap_int16_t safe) { if (cont) { @@ -114,6 +134,14 @@ return APR_ENOCONT; } +/* ***APRDOC******************************************************** + * ap_status_t ap_set_cancel_safe(ap_context_t *, ap_int16_t) + * Set the cancel safe attribute of the program. If this bit-is off, then + * any thread which is in a function using this context IS NOT allowed + * to be cancelled. + * arg 1) The context to modify. + * arg 2) Should functions be cancellable or not? + */ ap_status_t ap_set_cancel_safe(struct context_t *cont, ap_int16_t safe) { if (cont) { @@ -123,12 +151,23 @@ return APR_ENOCONT; } +/* ***APRDOC******************************************************** + * ap_status_t ap_destroy_context(ap_context_t *) + * Free the context and all of it's child contexts'. + * arg 1) The context to free. + */ ap_status_t ap_destroy_context(struct context_t *cont) { ap_destroy_pool(cont); return APR_SUCCESS; } +/* ***APRDOC******************************************************** + * ap_status_t ap_set_userdata(ap_context_t *, void *) + * Set the data associated with the current context. + * arg 1) The current context. + * arg 2) The user data associated with the context. + */ ap_status_t ap_set_userdata(struct context_t *cont, void *data) { if (cont) { @@ -138,6 +177,12 @@ return APR_ENOCONT; } +/* ***APRDOC******************************************************** + * ap_status_t ap_get_userdata(ap_context_t *, void **) + * Return the data associated with the current context. + * arg 1) The current context. + * arg 2) The user data associated with the context. + */ ap_status_t ap_get_userdata(struct context_t *cont, void **data) { if (cont) { @@ -147,13 +192,19 @@ return APR_ENOCONT; } -#ifdef HAVE_PTHREAD_H +/* ***APRDOC******************************************************** + * ap_status_t ap_initialize() + * Setup any APR internal data structures. This MUST be the first + * function called for any APR program. + */ ap_status_t ap_initialize(void) { +#ifdef HAVE_PTHREAD_H sigset_t sigset; sigfillset(&sigset); pthread_sigmask(SIG_BLOCK, &sigset, NULL); -} #endif + return APR_SUCCESS; +}