cvs commit: apache-1.3/src/include alloc.h
dgaudet 98/02/01 12:54:46 Modified:src/main alloc.c src/include alloc.h Log: the new table_xxxn() API should use const char * pointers Revision ChangesPath 1.74 +10 -10apache-1.3/src/main/alloc.c Index: alloc.c === RCS file: /export/home/cvs/apache-1.3/src/main/alloc.c,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- alloc.c 1998/01/31 00:24:32 1.73 +++ alloc.c 1998/02/01 20:54:44 1.74 @@ -1003,7 +1003,7 @@ } } -API_EXPORT(void) table_setn(table *t, char *key, char *val) +API_EXPORT(void) table_setn(table *t, const char *key, const char *val) { register int i, j, k; table_entry *elts = (table_entry *) t->a.elts; @@ -1025,7 +1025,7 @@ for (i = 0; i < t->a.nelts; ) { if (!strcasecmp(elts[i].key, key)) { if (!done) { - elts[i].val = val; + elts[i].val = (char *)val; done = 1; ++i; } @@ -1044,8 +1044,8 @@ if (!done) { elts = (table_entry *) table_push(t); - elts->key = key; - elts->val = val; + elts->key = (char *)key; + elts->val = (char *)val; } } @@ -1090,7 +1090,7 @@ elts->val = pstrdup(t->a.pool, val); } -API_EXPORT(void) table_mergen(table *t, char *key, char *val) +API_EXPORT(void) table_mergen(table *t, const char *key, const char *val) { table_entry *elts = (table_entry *) t->a.elts; int i; @@ -1116,8 +1116,8 @@ } elts = (table_entry *) table_push(t); -elts->key = key; -elts->val = val; +elts->key = (char *)key; +elts->val = (char *)val; } API_EXPORT(void) table_add(table *t, const char *key, const char *val) @@ -1129,7 +1129,7 @@ elts->val = pstrdup(t->a.pool, val); } -API_EXPORT(void) table_addn(table *t, char *key, char *val) +API_EXPORT(void) table_addn(table *t, const char *key, const char *val) { table_entry *elts = (table_entry *) t->a.elts; @@ -1147,8 +1147,8 @@ #endif elts = (table_entry *) table_push(t); -elts->key = key; -elts->val = val; +elts->key = (char *)key; +elts->val = (char *)val; } API_EXPORT(table *) overlay_tables(pool *p, const table *overlay, const table *base) 1.45 +3 -3 apache-1.3/src/include/alloc.h Index: alloc.h === RCS file: /export/home/cvs/apache-1.3/src/include/alloc.h,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- alloc.h 1998/01/27 10:00:40 1.44 +++ alloc.h 1998/02/01 20:54:45 1.45 @@ -164,12 +164,12 @@ API_EXPORT(void) clear_table(table *); API_EXPORT(char *) table_get(const table *, const char *); API_EXPORT(void) table_set(table *, const char *name, const char *val); -API_EXPORT(void) table_setn(table *, char *name, char *val); +API_EXPORT(void) table_setn(table *, const char *name, const char *val); API_EXPORT(void) table_merge(table *, const char *name, const char *more_val); -API_EXPORT(void) table_mergen(table *, char *name, char *more_val); +API_EXPORT(void) table_mergen(table *, const char *name, const char *more_val); API_EXPORT(void) table_unset(table *, const char *key); API_EXPORT(void) table_add(table *, const char *name, const char *val); -API_EXPORT(void) table_addn(table *, char *name, char *val); +API_EXPORT(void) table_addn(table *, const char *name, const char *val); API_EXPORT(void) table_do(int (*comp) (void *, const char *, const char *), void *rec, const table *t,...);
cvs commit: apache-1.3/src/include alloc.h
dgaudet 99/05/13 12:44:15 Modified:src/include alloc.h Log: add a bunch more info to the pool/ancestor documentation... Raymond's comments made it clear to me that what I'd written wasn't so clear ;) Revision ChangesPath 1.68 +36 -2 apache-1.3/src/include/alloc.h Index: alloc.h === RCS file: /home/cvs/apache-1.3/src/include/alloc.h,v retrieving revision 1.67 retrieving revision 1.68 diff -u -r1.67 -r1.68 --- alloc.h 1999/03/07 14:05:33 1.67 +++ alloc.h 1999/05/13 19:44:14 1.68 @@ -95,8 +95,42 @@ API_EXPORT(pool *) ap_make_sub_pool(pool *); /* All pools are subpools of permanent_pool */ API_EXPORT(void) ap_destroy_pool(pool *); -/* used to guarantee to the pool debugging code that the sub pool will not be - * destroyed before the parent pool +/* pools have nested lifetimes -- sub_pools are destroyed when the + * parent pool is cleared. We allow certain liberties with operations + * on things such as tables (and on other structures in a more general + * sense) where we allow the caller to insert values into a table which + * were not allocated from the table's pool. The table's data will + * remain valid as long as all the pools from which its values are + * allocated remain valid. + * + * For example, if B is a sub pool of A, and you build a table T in + * pool B, then it's safe to insert data allocated in A or B into T + * (because B lives at most as long as A does, and T is destroyed when + * B is cleared/destroyed). On the other hand, if S is a table in + * pool A, it is safe to insert data allocated in A into S, but it + * is *not safe* to insert data allocated from B into S... because + * B can be cleared/destroyed before A is (which would leave dangling + * pointers in T's data structures). + * + * In general we say that it is safe to insert data into a table T + * if the data is allocated in any ancestor of T's pool. This is the + * basis on which the POOL_DEBUG code works -- it tests these ancestor + * relationships for all data inserted into tables. POOL_DEBUG also + * provides tools (ap_find_pool, and ap_pool_is_ancestor) for other + * folks to implement similar restrictions for their own data + * structures. + * + * However, sometimes this ancestor requirement is inconvenient -- + * sometimes we're forced to create a sub pool (such as through + * ap_sub_req_lookup_uri), and the sub pool is guaranteed to have + * the same lifetime as the parent pool. This is a guarantee implemented + * by the *caller*, not by the pool code. That is, the caller guarantees + * they won't destroy the sub pool individually prior to destroying the + * parent pool. + * + * In this case the caller must call ap_pool_join() to indicate this + * guarantee to the POOL_DEBUG code. There are a few examples spread + * through the standard modules. */ #ifndef POOL_DEBUG #ifdef ap_pool_join
cvs commit: apache-1.3/src/include alloc.h hide.h
dgaudet 98/03/04 01:57:29 Modified:src/helpers UpdateHide src/include alloc.h hide.h Log: When you define ALLOC_DEBUG and POOL_DEBUG you get a few more symbols that would be nice to hide. Revision ChangesPath 1.4 +3 -0 apache-1.3/src/helpers/UpdateHide Index: UpdateHide === RCS file: /export/home/cvs/apache-1.3/src/helpers/UpdateHide,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- UpdateHide1998/03/04 09:47:37 1.3 +++ UpdateHide1998/03/04 09:57:26 1.4 @@ -23,6 +23,9 @@ @included = qw( D:db_auth_module D:dbm_auth_module +T:find_pool +T:pool_is_ancestor +T:pool_join ); # determine os-dependend stuff 1.46 +4 -0 apache-1.3/src/include/alloc.h Index: alloc.h === RCS file: /export/home/cvs/apache-1.3/src/include/alloc.h,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- alloc.h 1998/02/01 20:54:45 1.45 +++ alloc.h 1998/03/04 09:57:27 1.46 @@ -91,6 +91,10 @@ * destroyed before the parent pool */ #ifndef POOL_DEBUG +/* could be defined when we're using HIDE */ +#ifdef pool_join +#undef pool_join +#endif #define pool_join(a,b) #else API_EXPORT(void) pool_join(pool *p, pool *sub); 1.4 +3 -0 apache-1.3/src/include/hide.h Index: hide.h === RCS file: /export/home/cvs/apache-1.3/src/include/hide.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- hide.h1998/03/04 09:48:38 1.3 +++ hide.h1998/03/04 09:57:28 1.4 @@ -294,6 +294,7 @@ #define find_linked_module AP_find_linked_module #define find_module_name AP_find_module_name #define find_path_info AP_find_path_info +#define find_pool AP_find_pool #define find_token AP_find_token #define find_types AP_find_types #define fini_vhost_config AP_fini_vhost_config @@ -415,6 +416,8 @@ #define pfopen AP_pfopen #define pgethostbyname AP_pgethostbyname #define plustospaceAP_plustospace +#define pool_is_ancestor AP_pool_is_ancestor +#define pool_join AP_pool_join #define popendir AP_popendir #define popenf AP_popenf #define pregcomp AP_pregcomp
cvs commit: apache-1.3/src/include alloc.h ap.h buff.h compat.h conf.h explain.h fnmatch.h http_conf_globals.h http_config.h http_core.h http_log.h http_main.h http_protocol.h http_request.h http_vhost.h httpd.h md5.h multithread.h rfc1413.h scoreboard.h util_date.h util_md5.h util_script.h util_uri.h
jim 98/05/03 10:31:16 Modified:.STATUS src CHANGES src/include alloc.h ap.h buff.h compat.h conf.h explain.h fnmatch.h http_conf_globals.h http_config.h http_core.h http_log.h http_main.h http_protocol.h http_request.h http_vhost.h httpd.h md5.h multithread.h rfc1413.h scoreboard.h util_date.h util_md5.h util_script.h util_uri.h Log: Submitted by: Michael Anderson's <[EMAIL PROTECTED]> Reviewed by: Jim Jagielski, Dean Gaudet, Ben Laurie Apache header files, and some variable name/types, are more C++ friendly Revision ChangesPath 1.356 +1 -4 apache-1.3/STATUS Index: STATUS === RCS file: /export/home/cvs/apache-1.3/STATUS,v retrieving revision 1.355 retrieving revision 1.356 diff -u -r1.355 -r1.356 --- STATUS1998/05/03 17:16:56 1.355 +++ STATUS1998/05/03 17:31:02 1.356 @@ -85,16 +85,13 @@ * Jim's fix for MIME type case sensitivity disparity, PR#2112 * Child processes can now "signal" to the parent process that it (the parent process) should abort, shutting down the server. +* Michael Anderson's <[EMAIL PROTECTED]> C++ friendly patch Available Patches: * Dean's mod_alias.c, translate_alias_redir patch <[EMAIL PROTECTED]> Status: Dean, Ben, Jim +1 - -* Michael Anderson's <[EMAIL PROTECTED]> C++ friendly patch - <[EMAIL PROTECTED]> - Status: Ben, Jim +1, Dean +1, Ralf +1 * Arnt Gulbrandsen <[EMAIL PROTECTED]> 03 Apr 1998 21:28:17 +0200 <[EMAIL PROTECTED]> mod_usertrack.c patch: 1.812 +3 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.811 retrieving revision 1.812 diff -u -r1.811 -r1.812 --- CHANGES 1998/05/03 17:16:57 1.811 +++ CHANGES 1998/05/03 17:31:02 1.812 @@ -1,5 +1,8 @@ Changes with Apache 1.3b7 + *) Make Apache header files, and some variables, C++ friendly. + [Michael Anderson's <[EMAIL PROTECTED]>] + *) Child processes can now "signal" (by exiting with a status of APEXIT_CHILDFATAL) the parent process to abort and shutdown the server if the error in the child process was 1.56 +10 -1 apache-1.3/src/include/alloc.h Index: alloc.h === RCS file: /export/home/cvs/apache-1.3/src/include/alloc.h,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- alloc.h 1998/04/11 12:00:18 1.55 +++ alloc.h 1998/05/03 17:31:06 1.56 @@ -58,6 +58,10 @@ #ifndef APACHE_ALLOC_H #define APACHE_ALLOC_H +#ifdef __cplusplus +extern "C" { +#endif + /* * Resource allocation routines... * @@ -85,6 +89,7 @@ #endif typedef struct pool pool; +typedef struct pool ap_pool; pool * ap_init_alloc(void); /* Set up everything */ API_EXPORT(pool *) ap_make_sub_pool(pool *); /* All pools are subpools of permanent_pool */ @@ -131,7 +136,7 @@ */ typedef struct { -pool *pool; +ap_pool *pool; int elt_size; int nelts; int nalloc; @@ -310,5 +315,9 @@ API_EXPORT(long) ap_bytes_in_pool(pool *p); API_EXPORT(long) ap_bytes_in_free_blocks(void); + +#ifdef __cplusplus +} +#endif #endif /* !APACHE_ALLOC_H */ 1.13 +8 -0 apache-1.3/src/include/ap.h Index: ap.h === RCS file: /export/home/cvs/apache-1.3/src/include/ap.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- ap.h 1998/04/19 19:19:37 1.12 +++ ap.h 1998/05/03 17:31:06 1.13 @@ -61,6 +61,10 @@ #ifndef APACHE_AP_H #define APACHE_AP_H +#ifdef __cplusplus +extern "C" { +#endif + API_EXPORT(char *) ap_cpystrn(char *, const char *, size_t); int ap_slack(int, int); API_EXPORT(char *) ap_escape_quotes(pool *, const char *); @@ -146,5 +150,9 @@ __attribute__((format(printf,3,4))); API_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap); + +#ifdef __cplusplus +} +#endif #endif /* !APACHE_AP_H */ 1.39 +9 -1 apache-1.3/src/include/buff.h Index: buff.h === RCS file: /export/home/cvs/apache-1.3/src/include/buff.h,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- buff.h1998/04/27 06:59:33 1.