diff options
121 files changed, 674 insertions, 674 deletions
diff --git a/dso/aix/dso.c b/dso/aix/dso.c index c1a26f2e8..83e47664e 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -134,7 +134,7 @@ ap_status_t ap_dso_init(void){ return APR_SUCCESS; } -ap_status_t ap_dso_load(struct dso_handle_t **res_handle, const char *path, +ap_status_t ap_dso_load(struct ap_dso_handle_t **res_handle, const char *path, ap_context_t *ctx) { void *os_handle = dlopen((char *)path, RTLD_NOW | RTLD_GLOBAL); @@ -148,7 +148,7 @@ ap_status_t ap_dso_load(struct dso_handle_t **res_handle, const char *path, return APR_SUCCESS; } -ap_status_t ap_dso_unload(struct dso_handle_t *handle) +ap_status_t ap_dso_unload(struct ap_dso_handle_t *handle) { if (dlclose(handle->handle) != 0) return APR_EINIT; @@ -157,7 +157,7 @@ ap_status_t ap_dso_unload(struct dso_handle_t *handle) } ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, - struct dso_handle_t *handle, + struct ap_dso_handle_t *handle, const char *symname) { void *retval = dlsym(handle->handle, symname); diff --git a/dso/aix/dso.h b/dso/aix/dso.h index f5d186d51..89c33f5c0 100644 --- a/dso/aix/dso.h +++ b/dso/aix/dso.h @@ -65,7 +65,7 @@ void *dlsym(void *handle, const char *symbol); const char *dlerror(void); int dlclose(void *handle); -struct dso_handle_t { +struct ap_dso_handle_t { ap_context_t *cont; void *handle; }; diff --git a/dso/beos/dso.h b/dso/beos/dso.h index 4305bba6c..d863ae1cc 100644 --- a/dso/beos/dso.h +++ b/dso/beos/dso.h @@ -62,7 +62,7 @@ #include "apr_dso.h" #include <kernel/image.h> -struct dso_handle_t { +struct ap_dso_handle_t { image_id handle; /* Handle to the DSO loaded */ ap_context_t *cont; }; diff --git a/dso/os2/dso.h b/dso/os2/dso.h index 0ef121ea1..947793aa4 100644 --- a/dso/os2/dso.h +++ b/dso/os2/dso.h @@ -63,7 +63,7 @@ #include "apr_pools.h" #include "apr_dso.h" -struct dso_handle_t { +struct ap_dso_handle_t { HMODULE handle; /* Handle to the DSO loaded */ ap_context_t *cont; /* Context for returning error strings */ }; diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 6466a94c6..c9a2d34a8 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -70,7 +70,7 @@ ap_status_t ap_dso_init(void){ * arg 2) Path to the DSO library * arg 3) Context to use. */ -ap_status_t ap_dso_load(struct dso_handle_t **res_handle, const char *path, +ap_status_t ap_dso_load(struct ap_dso_handle_t **res_handle, const char *path, ap_context_t *ctx) { #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) @@ -96,7 +96,7 @@ ap_status_t ap_dso_load(struct dso_handle_t **res_handle, const char *path, * Close a DSO library. * arg 1) handle to close. */ -ap_status_t ap_dso_unload(struct dso_handle_t *handle) +ap_status_t ap_dso_unload(struct ap_dso_handle_t *handle) { #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) shl_unload((shl_t)handle->handle); @@ -117,7 +117,7 @@ ap_status_t ap_dso_unload(struct dso_handle_t *handle) * arg 3) Name of the symbol to load. */ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, - struct dso_handle_t *handle, + struct ap_dso_handle_t *handle, const char *symname) { #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) diff --git a/dso/unix/dso.h b/dso/unix/dso.h index ca12945d4..6eb2de665 100644 --- a/dso/unix/dso.h +++ b/dso/unix/dso.h @@ -82,7 +82,7 @@ #define DLSYM_NEEDS_UNDERSCORE #endif -struct dso_handle_t { +struct ap_dso_handle_t { ap_context_t *cont; void *handle; }; diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 40d7cfb1b..601db8d22 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -62,15 +62,15 @@ static ap_status_t dir_cleanup(void *thedir) { - struct dir_t *dir = thedir; + struct ap_dir_t *dir = thedir; return ap_closedir(dir); } -ap_status_t ap_opendir(struct dir_t **new, const char *dirname, ap_context_t *cntxt) +ap_status_t ap_opendir(struct ap_dir_t **new, const char *dirname, ap_context_t *cntxt) { - struct dir_t *thedir = (struct dir_t *)ap_palloc(cntxt, sizeof(struct dir_t)); + struct ap_dir_t *thedir = (struct ap_dir_t *)ap_palloc(cntxt, sizeof(struct ap_dir_t)); if (thedir == NULL) return APR_ENOMEM; @@ -90,7 +90,7 @@ ap_status_t ap_opendir(struct dir_t **new, const char *dirname, ap_context_t *cn -ap_status_t ap_closedir(struct dir_t *thedir) +ap_status_t ap_closedir(struct ap_dir_t *thedir) { int rv = 0; @@ -107,7 +107,7 @@ ap_status_t ap_closedir(struct dir_t *thedir) -ap_status_t ap_readdir(struct dir_t *thedir) +ap_status_t ap_readdir(struct ap_dir_t *thedir) { int rv; ULONG entries = 1; @@ -136,7 +136,7 @@ ap_status_t ap_readdir(struct dir_t *thedir) -ap_status_t ap_rewinddir(struct dir_t *thedir) +ap_status_t ap_rewinddir(struct ap_dir_t *thedir) { return ap_closedir(thedir); } @@ -157,7 +157,7 @@ ap_status_t ap_remove_dir(const char *path, ap_context_t *cont) -ap_status_t ap_dir_entry_size(ap_ssize_t *size, struct dir_t *thedir) +ap_status_t ap_dir_entry_size(ap_ssize_t *size, struct ap_dir_t *thedir) { if (thedir->validentry) { *size = thedir->entry.cbFile; @@ -169,7 +169,7 @@ ap_status_t ap_dir_entry_size(ap_ssize_t *size, struct dir_t *thedir) -ap_status_t ap_dir_entry_mtime(ap_time_t *time, struct dir_t *thedir) +ap_status_t ap_dir_entry_mtime(ap_time_t *time, struct ap_dir_t *thedir) { if (thedir->validentry) { ap_os2_time_to_ap_time(time, thedir->entry.fdateLastWrite, thedir->entry.ftimeLastWrite); @@ -181,7 +181,7 @@ ap_status_t ap_dir_entry_mtime(ap_time_t *time, struct dir_t *thedir) -ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, struct dir_t *thedir) +ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, struct ap_dir_t *thedir) { int rc; HFILE hFile; @@ -216,7 +216,7 @@ ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, struct dir_t *thedir) -ap_status_t ap_get_dir_filename(char **new, struct dir_t *thedir) +ap_status_t ap_get_dir_filename(char **new, struct ap_dir_t *thedir) { if (thedir->validentry) { *new = thedir->entry.achName; diff --git a/file_io/os2/fileio.h b/file_io/os2/fileio.h index 1706c95dc..68d93881f 100644 --- a/file_io/os2/fileio.h +++ b/file_io/os2/fileio.h @@ -82,7 +82,7 @@ struct ap_file_t { unsigned long filePtr; // position in file of handle }; -struct dir_t { +struct ap_dir_t { ap_context_t *cntxt; char *dirname; ULONG handle; diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index ad90506f6..c1e7231b4 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -57,7 +57,7 @@ static ap_status_t dir_cleanup(void *thedir) { - struct dir_t *dir = thedir; + struct ap_dir_t *dir = thedir; if (closedir(dir->dirstruct) == 0) { return APR_SUCCESS; } @@ -73,14 +73,14 @@ static ap_status_t dir_cleanup(void *thedir) * arg 2) The full path to the directory (use / on all systems) * arg 3) The context to use. */ -ap_status_t ap_opendir(struct dir_t **new, const char *dirname, ap_context_t *cont) +ap_status_t ap_opendir(struct ap_dir_t **new, const char *dirname, ap_context_t *cont) { if (new == NULL) return APR_EBADARG; if (cont == NULL) return APR_ENOCONT; - (*new) = (struct dir_t *)ap_palloc(cont, sizeof(struct dir_t)); + (*new) = (struct ap_dir_t *)ap_palloc(cont, sizeof(struct ap_dir_t)); (*new)->cntxt = cont; (*new)->dirname = ap_pstrdup(cont, dirname); @@ -102,7 +102,7 @@ ap_status_t ap_opendir(struct dir_t **new, const char *dirname, ap_context_t *co * close the specified directory. * arg 1) the directory descriptor to close. */ -ap_status_t ap_closedir(struct dir_t *thedir) +ap_status_t ap_closedir(struct ap_dir_t *thedir) { ap_status_t rv; @@ -122,7 +122,7 @@ ap_status_t ap_closedir(struct dir_t *thedir) * arg 1) the directory descriptor to read from, and fill out. * NOTE: All systems return . and .. as the first two files. */ -ap_status_t ap_readdir(struct dir_t *thedir) +ap_status_t ap_readdir(struct ap_dir_t *thedir) { #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ && !defined(READDIR_IS_THREAD_SAFE) @@ -159,7 +159,7 @@ ap_status_t ap_readdir(struct dir_t *thedir) * Rewind the directory to the first entry. * arg 1) the directory descriptor to rewind. */ -ap_status_t ap_rewinddir(struct dir_t *thedir) +ap_status_t ap_rewinddir(struct ap_dir_t *thedir) { if (thedir == NULL) return APR_EBADARG; @@ -216,7 +216,7 @@ ap_status_t ap_remove_dir(const char *path, ap_context_t *cont) * arg 1) the size of the directory entry. * arg 2) the currently open directory. */ -ap_status_t ap_dir_entry_size(ap_ssize_t *size, struct dir_t *thedir) +ap_status_t ap_dir_entry_size(ap_ssize_t *size, struct ap_dir_t *thedir) { struct stat filestat; char *fname = NULL; @@ -245,7 +245,7 @@ ap_status_t ap_dir_entry_size(ap_ssize_t *size, struct dir_t *thedir) * arg 1) the last modified time of the directory entry. * arg 2) the currently open directory. */ -ap_status_t ap_dir_entry_mtime(ap_time_t *mtime, struct dir_t *thedir) +ap_status_t ap_dir_entry_mtime(ap_time_t *mtime, struct ap_dir_t *thedir) { struct stat filestat; char *fname = NULL; @@ -275,7 +275,7 @@ ap_status_t ap_dir_entry_mtime(ap_time_t *mtime, struct dir_t *thedir) * arg 1) the file type of the directory entry. * arg 2) the currently open directory. */ -ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, struct dir_t *thedir) +ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, struct ap_dir_t *thedir) { struct stat filestat; char *fname = NULL; @@ -320,7 +320,7 @@ ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, struct dir_t *thedir) * arg 1) the file name of the directory entry. * arg 2) the currently open directory. */ -ap_status_t ap_get_dir_filename(char **new, struct dir_t *thedir) +ap_status_t ap_get_dir_filename(char **new, struct ap_dir_t *thedir) { if (new == NULL) return APR_EBADARG; @@ -340,7 +340,7 @@ ap_status_t ap_get_dir_filename(char **new, struct dir_t *thedir) * arg 1) The os specific dir we are converting to * arg 2) The apr dir to convert. */ -ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, struct dir_t *dir) +ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, struct ap_dir_t *dir) { if (dir == NULL) { return APR_ENODIR; @@ -357,14 +357,14 @@ ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, struct dir_t *dir) * arg 2) The os specific dir to convert * arg 3) The context to use when creating to apr directory. */ -ap_status_t ap_put_os_dir(struct dir_t **dir, ap_os_dir_t *thedir, +ap_status_t ap_put_os_dir(struct ap_dir_t **dir, ap_os_dir_t *thedir, ap_context_t *cont) { if (cont == NULL) { return APR_ENOCONT; } if ((*dir) == NULL) { - (*dir) = (struct dir_t *)ap_palloc(cont, sizeof(struct dir_t)); + (*dir) = (struct ap_dir_t *)ap_palloc(cont, sizeof(struct ap_dir_t)); (*dir)->cntxt = cont; } (*dir)->dirstruct = thedir; diff --git a/file_io/unix/fileio.h b/file_io/unix/fileio.h index a8a5683c4..ce3904f07 100644 --- a/file_io/unix/fileio.h +++ b/file_io/unix/fileio.h @@ -112,7 +112,7 @@ struct ap_file_t { int timeout; }; -struct dir_t { +struct ap_dir_t { ap_context_t *cntxt; char *dirname; DIR *dirstruct; diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 7dd1e38dc..cf5ca4cb7 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -75,17 +75,17 @@ ap_status_t dir_cleanup(void *thedir) { - struct dir_t *dir = thedir; + struct ap_dir_t *dir = thedir; if (!CloseHandle(dir->dirhand)) { return GetLastError(); } return APR_SUCCESS; } -ap_status_t ap_opendir(struct dir_t **new, const char *dirname, ap_context_t *cont) +ap_status_t ap_opendir(struct ap_dir_t **new, const char *dirname, ap_context_t *cont) { char * temp; - (*new) = ap_palloc(cont, sizeof(struct dir_t)); + (*new) = ap_palloc(cont, sizeof(struct ap_dir_t)); (*new)->cntxt = cont; (*new)->entry = NULL; temp = canonical_filename((*new)->cntxt, dirname); @@ -101,7 +101,7 @@ ap_status_t ap_opendir(struct dir_t **new, const char *dirname, ap_context_t *co return APR_SUCCESS; } -ap_status_t ap_closedir(struct dir_t *thedir) +ap_status_t ap_closedir(struct ap_dir_t *thedir) { if (!FindClose(thedir->dirhand)) { return GetLastError(); @@ -110,7 +110,7 @@ ap_status_t ap_closedir(struct dir_t *thedir) return APR_SUCCESS; } -ap_status_t ap_readdir(struct dir_t *thedir) +ap_status_t ap_readdir(struct ap_dir_t *thedir) { if (thedir->dirhand == INVALID_HANDLE_VALUE) { thedir->entry = ap_palloc(thedir->cntxt, sizeof(WIN32_FIND_DATA)); @@ -126,7 +126,7 @@ ap_status_t ap_readdir(struct dir_t *thedir) return APR_SUCCESS; } -ap_status_t ap_rewinddir(struct dir_t *thedir) +ap_status_t ap_rewinddir(struct ap_dir_t *thedir) { ap_status_t stat; ap_context_t *cont = thedir->cntxt; @@ -161,7 +161,7 @@ ap_status_t ap_remove_dir(const char *path, ap_context_t *cont) return APR_SUCCESS; } -ap_status_t ap_dir_entry_size(ap_ssize_t *size, struct dir_t *thedir) +ap_status_t ap_dir_entry_size(ap_ssize_t *size, struct ap_dir_t *thedir) { if (thedir == NULL || thedir->entry == NULL) { return APR_ENODIR; @@ -171,7 +171,7 @@ ap_status_t ap_dir_entry_size(ap_ssize_t *size, struct dir_t *thedir) return APR_SUCCESS; } -ap_status_t ap_dir_entry_mtime(time_t *time, struct dir_t *thedir) +ap_status_t ap_dir_entry_mtime(time_t *time, struct ap_dir_t *thedir) { if (thedir == NULL || thedir->entry == NULL) { return APR_ENODIR; @@ -180,7 +180,7 @@ ap_status_t ap_dir_entry_mtime(time_t *time, struct dir_t *thedir) return APR_SUCCESS; } -ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, struct dir_t *thedir) +ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, struct ap_dir_t *thedir) { switch(thedir->entry->dwFileAttributes) { case FILE_ATTRIBUTE_DIRECTORY: { @@ -198,13 +198,13 @@ ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, struct dir_t *thedir) } } -ap_status_t ap_get_dir_filename(char **new, struct dir_t *thedir) +ap_status_t ap_get_dir_filename(char **new, struct ap_dir_t *thedir) { (*new) = ap_pstrdup(thedir->cntxt, thedir->entry->cFileName); return APR_SUCCESS; } -ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, struct dir_t *dir) +ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, struct ap_dir_t *dir) { if (dir == NULL) { return APR_ENODIR; @@ -213,13 +213,13 @@ ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, struct dir_t *dir) return APR_SUCCESS; } -ap_status_t ap_put_os_dir(struct dir_t **dir, ap_os_dir_t *thedir, ap_context_t *cont) +ap_status_t ap_put_os_dir(struct ap_dir_t **dir, ap_os_dir_t *thedir, ap_context_t *cont) { if (cont == NULL) { return APR_ENOCONT; } if ((*dir) == NULL) { - (*dir) = (struct dir_t *)ap_palloc(cont, sizeof(struct dir_t)); + (*dir) = (struct ap_dir_t *)ap_palloc(cont, sizeof(struct ap_dir_t)); (*dir)->cntxt = cont; } (*dir)->dirhand = thedir; diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h index 850b8bac1..2ec1ca07b 100644 --- a/file_io/win32/fileio.h +++ b/file_io/win32/fileio.h @@ -112,7 +112,7 @@ struct ap_file_t { time_t ctime; }; -struct dir_t { +struct ap_dir_t { ap_context_t *cntxt; char *dirname; HANDLE dirhand; @@ -122,9 +122,9 @@ struct dir_t { ap_status_t file_cleanup(void *); /*mode_t get_fileperms(ap_fileperms_t); */ -API_EXPORT(char *) ap_os_systemcase_filename(struct context_t *pCont, +API_EXPORT(char *) ap_os_systemcase_filename(struct ap_context_t *pCont, const char *szFile); -char * canonical_filename(struct context_t *pCont, const char *szFile); +char * canonical_filename(struct ap_context_t *pCont, const char *szFile); #endif /* ! FILE_IO_H */ diff --git a/include/apr_dso.h b/include/apr_dso.h index cfae2f5be..b0ff714b6 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -62,7 +62,7 @@ extern "C" { #endif -typedef struct dso_handle_t ap_dso_handle_t; +typedef struct ap_dso_handle_t ap_dso_handle_t; typedef void * ap_dso_handle_sym_t; ap_status_t ap_dso_init(void); diff --git a/include/apr_file_io.h b/include/apr_file_io.h index aa087367c..81178a202 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -106,7 +106,7 @@ typedef ap_int32_t ap_seek_where_t; typedef struct ap_file_t ap_file_t; typedef struct ap_finfo_t ap_finfo_t; -typedef struct dir_t ap_dir_t; +typedef struct ap_dir_t ap_dir_t; typedef ap_int32_t ap_fileperms_t; typedef uid_t ap_uid_t; typedef gid_t ap_gid_t; diff --git a/include/apr_general.h b/include/apr_general.h index 38ef0ada8..7efab6392 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -81,7 +81,7 @@ extern "C" { #define MAXIMUM_WAIT_OBJECTS 64 -typedef struct context_t ap_context_t; +typedef struct ap_context_t ap_context_t; typedef int ap_signum_t; #ifdef SIGHUP @@ -220,7 +220,7 @@ typedef int ap_signum_t; /* Context functions */ ap_status_t ap_create_context(ap_context_t **newcont, ap_context_t *cont); -ap_status_t ap_destroy_context(struct context_t *cont); +ap_status_t ap_destroy_context(struct ap_context_t *cont); ap_status_t ap_exit(ap_context_t *); ap_status_t ap_set_userdata(void *data, char *key, ap_status_t (*cleanup) (void *), diff --git a/include/apr_lib.h b/include/apr_lib.h index 731385319..0ac0d4f25 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -264,8 +264,8 @@ API_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, * APR memory structure manipulators (pools, tables, and arrays). */ API_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)); -API_EXPORT(void) ap_clear_pool(struct context_t *p); -API_EXPORT(void) ap_destroy_pool(struct context_t *p); +API_EXPORT(void) ap_clear_pool(struct ap_context_t *p); +API_EXPORT(void) ap_destroy_pool(struct ap_context_t *p); API_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p); API_EXPORT(long) ap_bytes_in_free_blocks(void); API_EXPORT(ap_pool_t *) ap_find_pool(const void *ts); @@ -283,32 +283,32 @@ API_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub); #endif /* POOL_DEBUG */ -API_EXPORT(void *) ap_palloc(struct context_t *c, int reqsize); -API_EXPORT(void *) ap_pcalloc(struct context_t *p, int size); -API_EXPORT(char *) ap_pstrdup(struct context_t *p, const char *s); -API_EXPORT(char *) ap_pstrndup(struct context_t *p, const char *s, int n); -API_EXPORT_NONSTD(char *) ap_pstrcat(struct context_t *p, ...); -API_EXPORT(char *) ap_pvsprintf(struct context_t *p, const char *fmt, va_list ap); -API_EXPORT_NONSTD(char *) ap_psprintf(struct context_t *p, const char *fmt, ...); -API_EXPORT(ap_array_header_t *) ap_make_array(struct context_t *p, int nelts, +API_EXPORT(void *) ap_palloc(struct ap_context_t *c, int reqsize); +API_EXPORT(void *) ap_pcalloc(struct ap_context_t *p, int size); +API_EXPORT(char *) ap_pstrdup(struct ap_context_t *p, const char *s); +API_EXPORT(char *) ap_pstrndup(struct ap_context_t *p, const char *s, int n); +API_EXPORT_NONSTD(char *) ap_pstrcat(struct ap_context_t *p, ...); +API_EXPORT(char *) ap_pvsprintf(struct ap_context_t *p, const char *fmt, va_list ap); +API_EXPORT_NONSTD(char *) ap_psprintf(struct ap_context_t *p, const char *fmt, ...); +API_EXPORT(ap_array_header_t *) ap_make_array(struct ap_context_t *p, int nelts, int elt_size); API_EXPORT(void *) ap_push_array(ap_array_header_t *arr); API_EXPORT(void) ap_array_cat(ap_array_header_t *dst, const ap_array_header_t *src); -API_EXPORT(ap_array_header_t *) ap_copy_array(struct context_t *p, +API_EXPORT(ap_array_header_t *) ap_copy_array(struct ap_context_t *p, const ap_array_header_t *arr); API_EXPORT(ap_array_header_t *) - ap_copy_array_hdr(struct context_t *p, + ap_copy_array_hdr(struct ap_context_t *p, const ap_array_header_t *arr); API_EXPORT(ap_array_header_t *) - ap_append_arrays(struct context_t *p, + ap_append_arrays(struct ap_context_t *p, const ap_array_header_t *first, const ap_array_header_t *second); -API_EXPORT(char *) ap_array_pstrcat(struct context_t *p, +API_EXPORT(char *) ap_array_pstrcat(struct ap_context_t *p, const ap_array_header_t *arr, const char sep); -API_EXPORT(ap_table_t *) ap_make_table(struct context_t *p, int nelts); -API_EXPORT(ap_table_t *) ap_copy_table(struct context_t *p, const ap_table_t *t); +API_EXPORT(ap_table_t *) ap_make_table(struct ap_context_t *p, int nelts); +API_EXPORT(ap_table_t *) ap_copy_table(struct ap_context_t *p, const ap_table_t *t); API_EXPORT(void) ap_clear_table(ap_table_t *t); API_EXPORT(const char *) ap_table_get(const ap_table_t *t, const char *key); API_EXPORT(void) ap_table_set(ap_table_t *t, const char *key, @@ -324,7 +324,7 @@ API_EXPORT(void) ap_table_add(ap_table_t *t, const char *key, const char *val); API_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key, const char *val); -API_EXPORT(ap_table_t *) ap_overlay_tables(struct context_t *p, +API_EXPORT(ap_table_t *) ap_overlay_tables(struct ap_context_t *p, const ap_table_t *overlay, const ap_table_t *base); API_EXPORT(void) @@ -334,18 +334,18 @@ API_EXPORT(void) #define AP_OVERLAP_TABLES_MERGE (1) API_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, unsigned flags); -API_EXPORT(void) ap_register_cleanup(struct context_t *p, void *data, +API_EXPORT(void) ap_register_cleanup(struct ap_context_t *p, void *data, ap_status_t (*plain_cleanup) (void *), ap_status_t (*child_cleanup) (void *)); -API_EXPORT(void) ap_kill_cleanup(struct context_t *p, void *data, +API_EXPORT(void) ap_kill_cleanup(struct ap_context_t *p, void *data, ap_status_t (*cleanup) (void *)); -API_EXPORT(void) ap_run_cleanup(struct context_t *p, void *data, +API_EXPORT(void) ap_run_cleanup(struct ap_context_t *p, void *data, ap_status_t (*cleanup) (void *)); API_EXPORT(void) ap_cleanup_for_exec(void); API_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize); API_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data); -API_EXPORT(void) ap_note_subprocess(struct context_t *a, ap_proc_t *pid, +API_EXPORT(void) ap_note_subprocess(struct ap_context_t *a, ap_proc_t *pid, enum kill_conditions how); API_EXPORT(int) ap_spawn_child(ap_context_t *p, diff --git a/include/apr_lock.h b/include/apr_lock.h index 3cb1c79d1..bf6372232 100644 --- a/include/apr_lock.h +++ b/include/apr_lock.h @@ -66,7 +66,7 @@ typedef enum {APR_CROSS_PROCESS, APR_INTRAPROCESS, APR_LOCKALL} ap_lockscope_e; typedef enum {APR_MUTEX, APR_READWRITE} ap_locktype_e; -typedef struct lock_t ap_lock_t; +typedef struct ap_lock_t ap_lock_t; /* Function definitions */ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, diff --git a/include/apr_mmap.h b/include/apr_mmap.h index bae221793..76aff543c 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -65,7 +65,7 @@ extern "C" { #endif /* __cplusplus */ -typedef struct mmap_t ap_mmap_t; +typedef struct ap_mmap_t ap_mmap_t; /* Function definitions */ diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 4efb3f12f..7d0799a11 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -120,14 +120,14 @@ struct in_addr { #define ap_inet_addr inet_network #endif -typedef struct socket_t ap_socket_t; -typedef struct pollfd_t ap_pollfd_t; -typedef struct hdtr_t ap_hdtr_t; +typedef struct ap_socket_t ap_socket_t; +typedef struct ap_pollfd_t ap_pollfd_t; +typedef struct ap_hdtr_t ap_hdtr_t; typedef struct in_addr ap_in_addr; #if APR_HAS_SENDFILE /* A structure to encapsulate headers and trailers for ap_sendfile */ -struct hdtr_t { +struct ap_hdtr_t { struct iovec* headers; int numheaders; struct iovec* trailers; diff --git a/include/apr_pools.h b/include/apr_pools.h index 8b57f8cb9..6199cde3c 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -153,7 +153,7 @@ void ap_term_alloc(void); /* Tear down everything */ /* routines to allocate memory from an pool... */ -API_EXPORT_NONSTD(char *) ap_psprintf(struct context_t *, const char *fmt, ...) +API_EXPORT_NONSTD(char *) ap_psprintf(struct ap_context_t *, const char *fmt, ...) __attribute__((format(printf,2,3))); /* array and alist management... keeping lists of things. diff --git a/include/apr_portable.h b/include/apr_portable.h index 4e94b50d5..815b70126 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -112,7 +112,7 @@ typedef struct tm ap_os_exp_time_t; #elif defined(BEOS) #include <kernel/OS.h> -struct os_lock_t { +struct ap_os_lock_t { /* Inter proc */ sem_id sem_interproc; int32 ben_interproc; @@ -124,7 +124,7 @@ struct os_lock_t { typedef int ap_os_file_t; typedef DIR ap_os_dir_t; typedef int ap_os_sock_t; -typedef struct os_lock_t ap_os_lock_t; +typedef struct ap_os_lock_t ap_os_lock_t; typedef thread_id ap_os_thread_t; typedef thread_id ap_os_proc_t; typedef int ap_os_threadkey_t; @@ -145,7 +145,7 @@ union semun { }; #endif -struct os_lock_t { +struct ap_os_lock_t { #if APR_USE_SYSVSEM_SERIALIZE int crossproc; #elif APR_USE_FCNTL_SERIALIZE @@ -168,7 +168,7 @@ struct os_lock_t { typedef int ap_os_file_t; typedef DIR ap_os_dir_t; typedef int ap_os_sock_t; -typedef struct os_lock_t ap_os_lock_t; +typedef struct ap_os_lock_t ap_os_lock_t; #if APR_HAS_THREADS && APR_HAVE_PTHREAD_H typedef pthread_t ap_os_thread_t; typedef pthread_key_t ap_os_threadkey_t; diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 340ec566a..a7581a141 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -77,12 +77,12 @@ typedef enum {APR_WAIT, APR_NOWAIT} ap_wait_how_e; #define APR_CANCEL_ENABLE 3 #define APR_CANCEL_DISABLE 4 -typedef struct thread_t ap_thread_t; -typedef struct threadattr_t ap_threadattr_t; -typedef struct proc_t ap_proc_t; -typedef struct procattr_t ap_procattr_t; +typedef struct ap_thread_t ap_thread_t; +typedef struct ap_threadattr_t ap_threadattr_t; +typedef struct ap_proc_t ap_proc_t; +typedef struct ap_procattr_t ap_procattr_t; -typedef struct threadkey_t ap_key_t; +typedef struct ap_threadkey_t ap_key_t; typedef void *(API_THREAD_FUNC *ap_thread_start_t)(void *); @@ -119,12 +119,12 @@ ap_status_t ap_set_threadkeydata(void *data, char *key, ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_context_t *cont); ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, ap_int32_t out, ap_int32_t err); -ap_status_t ap_setprocattr_childin(struct procattr_t *attr, ap_file_t *child_in, +ap_status_t ap_setprocattr_childin(struct ap_procattr_t *attr, ap_file_t *child_in, ap_file_t *parent_in); -ap_status_t ap_setprocattr_childout(struct procattr_t *attr, +ap_status_t ap_setprocattr_childout(struct ap_procattr_t *attr, ap_file_t *child_out, ap_file_t *parent_out); -ap_status_t ap_setprocattr_childerr(struct procattr_t *attr, +ap_status_t ap_setprocattr_childerr(struct ap_procattr_t *attr, ap_file_t *child_err, ap_file_t *parent_err); ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, const char *dir); diff --git a/include/arch/aix/dso.h b/include/arch/aix/dso.h index f5d186d51..89c33f5c0 100644 --- a/include/arch/aix/dso.h +++ b/include/arch/aix/dso.h @@ -65,7 +65,7 @@ void *dlsym(void *handle, const char *symbol); const char *dlerror(void); int dlclose(void *handle); -struct dso_handle_t { +struct ap_dso_handle_t { ap_context_t *cont; void *handle; }; diff --git a/include/arch/beos/dso.h b/include/arch/beos/dso.h index 4305bba6c..d863ae1cc 100644 --- a/include/arch/beos/dso.h +++ b/include/arch/beos/dso.h @@ -62,7 +62,7 @@ #include "apr_dso.h" #include <kernel/image.h> -struct dso_handle_t { +struct ap_dso_handle_t { image_id handle; /* Handle to the DSO loaded */ ap_context_t *cont; }; diff --git a/include/arch/beos/locks.h b/include/arch/beos/locks.h index 7f5dabd3b..d88f2fcde 100644 --- a/include/arch/beos/locks.h +++ b/include/arch/beos/locks.h @@ -61,7 +61,7 @@ #include "apr_general.h" #include "apr_lib.h" -struct lock_t { +struct ap_lock_t { ap_context_t *cntxt; ap_locktype_e type; ap_lockscope_e scope; diff --git a/include/arch/beos/networkio.h b/include/arch/beos/networkio.h index 91253c0c1..c085fc332 100644 --- a/include/arch/beos/networkio.h +++ b/include/arch/beos/networkio.h @@ -85,7 +85,7 @@ #define POLLHUP 16 #define POLLNVAL 32 -struct socket_t { +struct ap_socket_t { ap_context_t *cntxt; int socketdes; struct sockaddr_in *local_addr; @@ -95,9 +95,9 @@ struct socket_t { int connected; }; -struct pollfd_t { +struct ap_pollfd_t { ap_context_t *cntxt; - struct socket_t *sock; + struct ap_socket_t *sock; fd_set *read; fd_set *write; fd_set *except; diff --git a/include/arch/beos/threadproc.h b/include/arch/beos/threadproc.h index 73ea8ef54..70b0f2eab 100644 --- a/include/arch/beos/threadproc.h +++ b/include/arch/beos/threadproc.h @@ -77,19 +77,19 @@ #define BEOS_MAX_DATAKEYS 128 -struct thread_t { +struct ap_thread_t { ap_context_t *cntxt; thread_id td; }; -struct threadattr_t { +struct ap_threadattr_t { ap_context_t *cntxt; int32 attr; int detached; int joinable; }; -struct threadkey_t { +struct ap_threadkey_t { ap_context_t *cntxt; int32 key; }; @@ -108,7 +108,7 @@ struct beos_key { void (* destructor) (); }; -struct procattr_t { +struct ap_procattr_t { ap_context_t *cntxt; ap_file_t *parent_in; ap_file_t *child_in; @@ -121,11 +121,11 @@ struct procattr_t { ap_int32_t detached; }; -struct proc_t { +struct ap_proc_t { ap_context_t *cntxt; pid_t pid; thread_id tid; - struct procattr_t *attr; + struct ap_procattr_t *attr; }; /* we need a structure to pass off to the thread that will run any diff --git a/include/arch/os2/dso.h b/include/arch/os2/dso.h index 0ef121ea1..947793aa4 100644 --- a/include/arch/os2/dso.h +++ b/include/arch/os2/dso.h @@ -63,7 +63,7 @@ #include "apr_pools.h" #include "apr_dso.h" -struct dso_handle_t { +struct ap_dso_handle_t { HMODULE handle; /* Handle to the DSO loaded */ ap_context_t *cont; /* Context for returning error strings */ }; diff --git a/include/arch/os2/fileio.h b/include/arch/os2/fileio.h index 1706c95dc..68d93881f 100644 --- a/include/arch/os2/fileio.h +++ b/include/arch/os2/fileio.h @@ -82,7 +82,7 @@ struct ap_file_t { unsigned long filePtr; // position in file of handle }; -struct dir_t { +struct ap_dir_t { ap_context_t *cntxt; char *dirname; ULONG handle; diff --git a/include/arch/os2/locks.h b/include/arch/os2/locks.h index 5678f79a1..9dcf0f293 100644 --- a/include/arch/os2/locks.h +++ b/include/arch/os2/locks.h @@ -60,7 +60,7 @@ #define INCL_DOS #include <os2.h> -struct lock_t { +struct ap_lock_t { ap_context_t *cntxt; ap_locktype_e type; ap_lockscope_e scope; diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h index d64f038b3..de7324e24 100644 --- a/include/arch/os2/networkio.h +++ b/include/arch/os2/networkio.h @@ -61,7 +61,7 @@ int os2errno( unsigned long oserror ); -struct socket_t { +struct ap_socket_t { ap_context_t *cntxt; int socketdes; struct sockaddr_in *local_addr; @@ -71,7 +71,7 @@ struct socket_t { int nonblock; }; -struct pollfd_t { +struct ap_pollfd_t { ap_context_t *cntxt; int *socket_list; int *r_socket_list; diff --git a/include/arch/os2/threadproc.h b/include/arch/os2/threadproc.h index 37915daa8..a4f2e3ce4 100644 --- a/include/arch/os2/threadproc.h +++ b/include/arch/os2/threadproc.h @@ -63,26 +63,26 @@ #define SHELL_PATH "cmd.exe" #define APR_THREAD_STACKSIZE 65536 -struct threadattr_t { +struct ap_threadattr_t { ap_context_t *cntxt; unsigned long attr; }; -struct thread_t { +struct ap_thread_t { ap_context_t *cntxt; - struct threadattr_t *attr; + struct ap_threadattr_t *attr; unsigned long tid; ap_thread_start_t func; void *data; void *rv; }; -struct threadkey_t { +struct ap_threadkey_t { ap_context_t *cntxt; unsigned long *key; }; -struct procattr_t { +struct ap_procattr_t { ap_context_t *cntxt; ap_file_t *parent_in; ap_file_t *child_in; @@ -95,10 +95,10 @@ struct procattr_t { ap_int32_t detached; }; -struct proc_t { +struct ap_proc_t { ap_context_t *cntxt; pid_t pid; - struct procattr_t *attr; + struct ap_procattr_t *attr; int running; }; diff --git a/include/arch/unix/dso.h b/include/arch/unix/dso.h index ca12945d4..6eb2de665 100644 --- a/include/arch/unix/dso.h +++ b/include/arch/unix/dso.h @@ -82,7 +82,7 @@ #define DLSYM_NEEDS_UNDERSCORE #endif -struct dso_handle_t { +struct ap_dso_handle_t { ap_context_t *cont; void *handle; }; diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index a8a5683c4..ce3904f07 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -112,7 +112,7 @@ struct ap_file_t { int timeout; }; -struct dir_t { +struct ap_dir_t { ap_context_t *cntxt; char *dirname; DIR *dirstruct; diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index ce910d3d2..efff844a2 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/unix/locks.h @@ -108,7 +108,7 @@ union semun { }; #endif -struct lock_t { +struct ap_lock_t { ap_context_t *cntxt; ap_locktype_e type; ap_lockscope_e scope; @@ -138,19 +138,19 @@ struct lock_t { }; #if APR_HAS_THREADS -ap_status_t create_intra_lock(struct lock_t *new); -ap_status_t lock_intra(struct lock_t *lock); -ap_status_t unlock_intra(struct lock_t *lock); -ap_status_t destroy_intra_lock(struct lock_t *lock); +ap_status_t create_intra_lock(struct ap_lock_t *new); +ap_status_t lock_intra(struct ap_lock_t *lock); +ap_status_t unlock_intra(struct ap_lock_t *lock); +ap_status_t destroy_intra_lock(struct ap_lock_t *lock); #endif void setup_lock(); -ap_status_t create_inter_lock(struct lock_t *new); -ap_status_t lock_inter(struct lock_t *lock); -ap_status_t unlock_inter(struct lock_t *lock); -ap_status_t destroy_inter_lock(struct lock_t *lock); +ap_status_t create_inter_lock(struct ap_lock_t *new); +ap_status_t lock_inter(struct ap_lock_t *lock); +ap_status_t unlock_inter(struct ap_lock_t *lock); +ap_status_t destroy_inter_lock(struct ap_lock_t *lock); -ap_status_t child_init_lock(struct lock_t **lock, ap_context_t *cont, +ap_status_t child_init_lock(struct ap_lock_t **lock, ap_context_t *cont, char *fname); #endif /* LOCKS_H */ diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h index aa6d1260f..fffa9365f 100644 --- a/include/arch/unix/misc.h +++ b/include/arch/unix/misc.h @@ -82,7 +82,7 @@ typedef struct datastruct { struct datastruct *prev; } datastruct; -struct context_t { +struct ap_context_t { struct ap_pool_t *pool; datastruct *prog_data; int (*apr_abort)(int retcode); diff --git a/include/arch/unix/mmap.c b/include/arch/unix/mmap.c index dd24215db..3cfcda7b3 100644 --- a/include/arch/unix/mmap.c +++ b/include/arch/unix/mmap.c @@ -64,7 +64,7 @@ ap_status_t mmap_cleanup(void *themmap) { - struct mmap_t *mm = themmap; + struct ap_mmap_t *mm = themmap; int rv; rv = munmap(mm->mm, mm->size); @@ -93,7 +93,7 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, if (file == NULL || file->buffered || file->filedes == -1) return APR_EBADF; - (*new) = (struct mmap_t *)ap_palloc(cont, sizeof(struct mmap_t)); + (*new) = (struct ap_mmap_t *)ap_palloc(cont, sizeof(struct ap_mmap_t)); ap_seek(file, APR_SET, &offset); mm = mmap(NULL, size, PROT_READ, MAP_SHARED, file->filedes ,0); @@ -117,7 +117,7 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, * Remove a mmap'ed. * arg 1) The mmap'ed file. */ -ap_status_t ap_mmap_delete(struct mmap_t *mmap) +ap_status_t ap_mmap_delete(struct ap_mmap_t *mmap) { ap_status_t rv; diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index d919ba9b1..98fbda7e9 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -105,7 +105,7 @@ #endif /* End System Headers */ -struct socket_t { +struct ap_socket_t { ap_context_t *cntxt; int socketdes; struct sockaddr_in *local_addr; @@ -117,7 +117,7 @@ struct socket_t { #endif }; -struct pollfd_t { +struct ap_pollfd_t { ap_context_t *cntxt; #ifdef HAVE_POLL int *sock; diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/threadproc.h index 98b32fa8d..7aba340f7 100644 --- a/include/arch/unix/threadproc.h +++ b/include/arch/unix/threadproc.h @@ -82,23 +82,23 @@ #define SHELL_PATH "/bin/sh" #if APR_HAS_THREADS -struct thread_t { +struct ap_thread_t { ap_context_t *cntxt; pthread_t *td; }; -struct threadattr_t { +struct ap_threadattr_t { ap_context_t *cntxt; pthread_attr_t *attr; }; -struct threadkey_t { +struct ap_threadkey_t { ap_context_t *cntxt; pthread_key_t key; }; #endif -struct procattr_t { +struct ap_procattr_t { ap_context_t *cntxt; ap_file_t *parent_in; ap_file_t *child_in; @@ -111,16 +111,16 @@ struct procattr_t { ap_int32_t detached; }; -struct proc_t { +struct ap_proc_t { ap_context_t *cntxt; pid_t pid; - struct procattr_t *attr; + struct ap_procattr_t *attr; }; /*This will move to ap_threadproc.h in time, but I need to figure it out * on windows first. :) */ -ap_status_t ap_detach(struct proc_t **, ap_context_t *); +ap_status_t ap_detach(struct ap_proc_t **, ap_context_t *); #endif /* ! THREAD_PROC_H */ diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 850b8bac1..2ec1ca07b 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -112,7 +112,7 @@ struct ap_file_t { time_t ctime; }; -struct dir_t { +struct ap_dir_t { ap_context_t *cntxt; char *dirname; HANDLE dirhand; @@ -122,9 +122,9 @@ struct dir_t { ap_status_t file_cleanup(void *); /*mode_t get_fileperms(ap_fileperms_t); */ -API_EXPORT(char *) ap_os_systemcase_filename(struct context_t *pCont, +API_EXPORT(char *) ap_os_systemcase_filename(struct ap_context_t *pCont, const char *szFile); -char * canonical_filename(struct context_t *pCont, const char *szFile); +char * canonical_filename(struct ap_context_t *pCont, const char *szFile); #endif /* ! FILE_IO_H */ diff --git a/include/arch/win32/locks.h b/include/arch/win32/locks.h index 7f1e2df33..7c89002f0 100644 --- a/include/arch/win32/locks.h +++ b/include/arch/win32/locks.h @@ -57,7 +57,7 @@ #include "apr_lock.h" -struct lock_t { +struct ap_lock_t { ap_context_t *cntxt; ap_locktype_e type; ap_lockscope_e scope; diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index aa6d1260f..fffa9365f 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -82,7 +82,7 @@ typedef struct datastruct { struct datastruct *prev; } datastruct; -struct context_t { +struct ap_context_t { struct ap_pool_t *pool; datastruct *prog_data; int (*apr_abort)(int retcode); diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index 9b934e8aa..a008062ea 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -58,7 +58,7 @@ #include "apr_network_io.h" #include "apr_general.h" -struct socket_t { +struct ap_socket_t { ap_context_t *cntxt; SOCKET sock; struct sockaddr_in *local_addr; @@ -67,7 +67,7 @@ struct socket_t { int timeout; }; -struct pollfd_t { +struct ap_pollfd_t { ap_context_t *cntxt; fd_set *read; int numread; diff --git a/include/arch/win32/threadproc.h b/include/arch/win32/threadproc.h index e9d3bcf72..2388bd7e2 100644 --- a/include/arch/win32/threadproc.h +++ b/include/arch/win32/threadproc.h @@ -62,24 +62,24 @@ #define SHELL_PATH "cmd.exe" -struct thread_t { +struct ap_thread_t { ap_context_t *cntxt; HANDLE td; ap_int32_t cancel; ap_int32_t cancel_how; }; -struct threadattr_t { +struct ap_threadattr_t { ap_context_t *cntxt; ap_int32_t detach; }; -struct threadkey_t { +struct ap_threadkey_t { ap_context_t *cntxt; DWORD key; }; -struct procattr_t { +struct ap_procattr_t { ap_context_t *cntxt; STARTUPINFO si; ap_file_t *parent_in; @@ -93,10 +93,10 @@ struct procattr_t { ap_int32_t detached; }; -struct proc_t { +struct ap_proc_t { ap_context_t *cntxt; PROCESS_INFORMATION pi; - struct procattr_t *attr; + struct ap_procattr_t *attr; }; #endif /* ! THREAD_PROC_H */ diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 522aba584..4e1045466 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -598,7 +598,7 @@ static void ap_register_pool_cleanup(struct ap_pool_t *p, void *data, } #endif -API_EXPORT(void) ap_register_cleanup(struct context_t *p, void *data, +API_EXPORT(void) ap_register_cleanup(struct ap_context_t *p, void *data, ap_status_t (*plain_cleanup) (void *), ap_status_t (*child_cleanup) (void *)) { @@ -614,7 +614,7 @@ API_EXPORT(void) ap_register_cleanup(struct context_t *p, void *data, } } -API_EXPORT(void) ap_kill_cleanup(struct context_t *p, void *data, +API_EXPORT(void) ap_kill_cleanup(struct ap_context_t *p, void *data, ap_status_t (*cleanup) (void *)) { struct cleanup *c; @@ -635,7 +635,7 @@ API_EXPORT(void) ap_kill_cleanup(struct context_t *p, void *data, } } -API_EXPORT(void) ap_run_cleanup(struct context_t *p, void *data, +API_EXPORT(void) ap_run_cleanup(struct ap_context_t *p, void *data, ap_status_t (*cleanup) (void *)) { ap_block_alarms(); /* Run cleanup only once! */ @@ -780,7 +780,7 @@ static void ap_clear_real_pool(ap_pool_t *a) ap_unblock_alarms(); } -API_EXPORT(void) ap_clear_pool(struct context_t *a) +API_EXPORT(void) ap_clear_pool(struct ap_context_t *a) { ap_clear_real_pool(a->pool); } @@ -811,7 +811,7 @@ API_EXPORT(void) ap_destroy_real_pool(ap_pool_t *a) ap_unblock_alarms(); } -API_EXPORT(void) ap_destroy_pool(struct context_t *a) +API_EXPORT(void) ap_destroy_pool(struct ap_context_t *a) { ap_destroy_real_pool(a->pool); } @@ -1028,7 +1028,7 @@ static void * ap_pool_palloc(ap_pool_t *a, int reqsize, int (*apr_abort)(int ret #endif } -API_EXPORT(void *) ap_palloc(struct context_t *c, int reqsize) +API_EXPORT(void *) ap_palloc(struct ap_context_t *c, int reqsize) { if (c == NULL) { return malloc(reqsize); @@ -1036,14 +1036,14 @@ API_EXPORT(void *) ap_palloc(struct context_t *c, int reqsize) return ap_pool_palloc(c->pool, reqsize, c->apr_abort); } -API_EXPORT(void *) ap_pcalloc(struct context_t *a, int size) +API_EXPORT(void *) ap_pcalloc(struct ap_context_t *a, int size) { void *res = ap_palloc(a, size); memset(res, '\0', size); return res; } -API_EXPORT(char *) ap_pstrdup(struct context_t *a, const char *s) +API_EXPORT(char *) ap_pstrdup(struct ap_context_t *a, const char *s) { char *res; size_t len; @@ -1057,7 +1057,7 @@ API_EXPORT(char *) ap_pstrdup(struct context_t *a, const char *s) return res; } -API_EXPORT(char *) ap_pstrndup(struct context_t *a, const char *s, int n) +API_EXPORT(char *) ap_pstrndup(struct ap_context_t *a, const char *s, int n) { char *res; @@ -1070,7 +1070,7 @@ API_EXPORT(char *) ap_pstrndup(struct context_t *a, const char *s, int n) return res; } -API_EXPORT_NONSTD(char *) ap_pstrcat(struct context_t *a, ...) +API_EXPORT_NONSTD(char *) ap_pstrcat(struct ap_context_t *a, ...) { char *cp, *argp, *res; @@ -1195,7 +1195,7 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) #endif } -API_EXPORT(char *) ap_pvsprintf(struct context_t *c, const char *fmt, va_list ap) +API_EXPORT(char *) ap_pvsprintf(struct ap_context_t *c, const char *fmt, va_list ap) { #ifdef ALLOC_USE_MALLOC ap_pool_t *p = c->pool; @@ -1260,7 +1260,7 @@ API_EXPORT(char *) ap_pvsprintf(struct context_t *c, const char *fmt, va_list ap #endif } -API_EXPORT_NONSTD(char *) ap_psprintf(struct context_t *p, const char *fmt, ...) +API_EXPORT_NONSTD(char *) ap_psprintf(struct ap_context_t *p, const char *fmt, ...) { va_list ap; char *res; @@ -1283,7 +1283,7 @@ API_EXPORT_NONSTD(char *) ap_psprintf(struct context_t *p, const char *fmt, ...) * generic interface, but for now, it's a special case */ -API_EXPORT(void) ap_note_subprocess(struct context_t *a, ap_proc_t *pid, +API_EXPORT(void) ap_note_subprocess(struct ap_context_t *a, ap_proc_t *pid, enum kill_conditions how) { struct process_chain *new = diff --git a/lib/apr_tables.c b/lib/apr_tables.c index 0aee2d193..5b8198e48 100644 --- a/lib/apr_tables.c +++ b/lib/apr_tables.c @@ -88,7 +88,7 @@ * The 'array' functions... */ -static void make_array_core(ap_array_header_t *res, struct context_t *c, +static void make_array_core(ap_array_header_t *res, struct ap_context_t *c, int nelts, int elt_size) { /* @@ -107,7 +107,7 @@ static void make_array_core(ap_array_header_t *res, struct context_t *c, res->nalloc = nelts; /* ...but this many allocated */ } -API_EXPORT(ap_array_header_t *) ap_make_array(struct context_t *p, +API_EXPORT(ap_array_header_t *) ap_make_array(struct ap_context_t *p, int nelts, int elt_size) { ap_array_header_t *res; @@ -159,7 +159,7 @@ API_EXPORT(void) ap_array_cat(ap_array_header_t *dst, dst->nelts += src->nelts; } -API_EXPORT(ap_array_header_t *) ap_copy_array(struct context_t *p, +API_EXPORT(ap_array_header_t *) ap_copy_array(struct ap_context_t *p, const ap_array_header_t *arr) { ap_array_header_t *res = ap_make_array(p, arr->nalloc, arr->elt_size); @@ -186,7 +186,7 @@ static APR_INLINE void copy_array_hdr_core(ap_array_header_t *res, } API_EXPORT(ap_array_header_t *) - ap_copy_array_hdr(struct context_t *p, + ap_copy_array_hdr(struct ap_context_t *p, const ap_array_header_t *arr) { ap_array_header_t *res; @@ -200,7 +200,7 @@ API_EXPORT(ap_array_header_t *) /* The above is used here to avoid consing multiple new array bodies... */ API_EXPORT(ap_array_header_t *) - ap_append_arrays(struct context_t *p, + ap_append_arrays(struct ap_context_t *p, const ap_array_header_t *first, const ap_array_header_t *second) { @@ -216,7 +216,7 @@ API_EXPORT(ap_array_header_t *) * or if there are no elements in the array. * If sep is non-NUL, it will be inserted between elements as a separator. */ -API_EXPORT(char *) ap_array_pstrcat(struct context_t *p, +API_EXPORT(char *) ap_array_pstrcat(struct ap_context_t *p, const ap_array_header_t *arr, const char sep) { @@ -293,7 +293,7 @@ static ap_table_entry_t *table_push(ap_table_t *t) #endif /* MAKE_TABLE_PROFILE */ -API_EXPORT(ap_table_t *) ap_make_table(struct context_t *p, int nelts) +API_EXPORT(ap_table_t *) ap_make_table(struct ap_context_t *p, int nelts) { ap_table_t *t = ap_palloc(p, sizeof(ap_table_t)); @@ -304,7 +304,7 @@ API_EXPORT(ap_table_t *) ap_make_table(struct context_t *p, int nelts) return t; } -API_EXPORT(ap_table_t *) ap_copy_table(struct context_t *p, const ap_table_t *t) +API_EXPORT(ap_table_t *) ap_copy_table(struct ap_context_t *p, const ap_table_t *t) { ap_table_t *new = ap_palloc(p, sizeof(ap_table_t)); @@ -534,7 +534,7 @@ API_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key, elts->val = (char *)val; } -API_EXPORT(ap_table_t *) ap_overlay_tables(struct context_t *p, +API_EXPORT(ap_table_t *) ap_overlay_tables(struct ap_context_t *p, const ap_table_t *overlay, const ap_table_t *base) { diff --git a/locks/beos/crossproc.c b/locks/beos/crossproc.c index 8b2c4165e..e85e0a7bd 100644 --- a/locks/beos/crossproc.c +++ b/locks/beos/crossproc.c @@ -123,7 +123,7 @@ ap_status_t destroy_inter_lock(ap_lock_t *lock) return stat; } -ap_status_t child_init_lock(struct lock_t **lock, ap_context_t *cont, char *fname) +ap_status_t child_init_lock(struct ap_lock_t **lock, ap_context_t *cont, char *fname) { return APR_SUCCESS; } diff --git a/locks/beos/intraproc.c b/locks/beos/intraproc.c index 54c1efb42..d1a1f538c 100644 --- a/locks/beos/intraproc.c +++ b/locks/beos/intraproc.c @@ -68,7 +68,7 @@ ap_status_t lock_intra_cleanup(void *data) return APR_SUCCESS; } -ap_status_t create_intra_lock(struct lock_t *new) +ap_status_t create_intra_lock(struct ap_lock_t *new) { int32 stat; new->sem_intraproc = (sem_id)ap_palloc(new->cntxt, sizeof(sem_id)); diff --git a/locks/beos/locks.c b/locks/beos/locks.c index f7d1ed5d5..3bc544756 100644 --- a/locks/beos/locks.c +++ b/locks/beos/locks.c @@ -54,14 +54,14 @@ #include "locks.h" -ap_status_t ap_create_lock(struct lock_t **lock, ap_locktype_e type, +ap_status_t ap_create_lock(struct ap_lock_t **lock, ap_locktype_e type, ap_lockscope_e scope, char *fname, ap_context_t *cont) { - struct lock_t *new; + struct ap_lock_t *new; ap_status_t stat; - new = (struct lock_t *)ap_palloc(cont, sizeof(struct lock_t)); + new = (struct ap_lock_t *)ap_palloc(cont, sizeof(struct ap_lock_t)); if (new == NULL){ return APR_ENOMEM; } @@ -134,7 +134,7 @@ ap_status_t ap_destroy_lock(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_child_init_lock(struct lock_t **lock, char *fname, ap_context_t *cont) +ap_status_t ap_child_init_lock(struct ap_lock_t **lock, char *fname, ap_context_t *cont) { ap_status_t stat; if ((*lock)->scope != APR_CROSS_PROCESS) { @@ -145,7 +145,7 @@ ap_status_t ap_child_init_lock(struct lock_t **lock, char *fname, ap_context_t * return APR_SUCCESS; } -ap_status_t ap_get_lockdata(struct lock_t *lock, char *key, void *data) +ap_status_t ap_get_lockdata(struct ap_lock_t *lock, char *key, void *data) { if (lock != NULL) { return ap_get_userdata(data, key, lock->cntxt); @@ -156,7 +156,7 @@ ap_status_t ap_get_lockdata(struct lock_t *lock, char *key, void *data) } } -ap_status_t ap_set_lockdata(struct lock_t *lock, void *data, char *key, +ap_status_t ap_set_lockdata(struct ap_lock_t *lock, void *data, char *key, ap_status_t (*cleanup) (void *)) { if (lock != NULL) { diff --git a/locks/beos/locks.h b/locks/beos/locks.h index 7f5dabd3b..d88f2fcde 100644 --- a/locks/beos/locks.h +++ b/locks/beos/locks.h @@ -61,7 +61,7 @@ #include "apr_general.h" #include "apr_lib.h" -struct lock_t { +struct ap_lock_t { ap_context_t *cntxt; ap_locktype_e type; ap_lockscope_e scope; diff --git a/locks/os2/locks.c b/locks/os2/locks.c index 7234cfd73..c70ef5e60 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -71,20 +71,20 @@ void setup_lock() static ap_status_t lock_cleanup(void *thelock) { - struct lock_t *lock = thelock; + struct ap_lock_t *lock = thelock; return ap_destroy_lock(lock); } -ap_status_t ap_create_lock(struct lock_t **lock, ap_locktype_e type, ap_lockscope_e scope, char *fname, ap_context_t *cont) +ap_status_t ap_create_lock(struct ap_lock_t **lock, ap_locktype_e type, ap_lockscope_e scope, char *fname, ap_context_t *cont) { - struct lock_t *new; + struct ap_lock_t *new; ULONG rc; char *semname; PIB *ppib; - new = (struct lock_t *)ap_palloc(cont, sizeof(struct lock_t)); + new = (struct ap_lock_t *)ap_palloc(cont, sizeof(struct ap_lock_t)); new->cntxt = cont; new->type = type; new->scope = scope; @@ -114,7 +114,7 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, char *fname, ap_context_t *cont int rc; PIB *ppib; - *lock = (struct lock_t *)ap_palloc(cont, sizeof(struct lock_t)); + *lock = (struct ap_lock_t *)ap_palloc(cont, sizeof(struct ap_lock_t)); if (lock == NULL) return APR_ENOMEM; @@ -132,7 +132,7 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, char *fname, ap_context_t *cont -ap_status_t ap_lock(struct lock_t *lock) +ap_status_t ap_lock(struct ap_lock_t *lock) { ULONG rc; @@ -148,7 +148,7 @@ ap_status_t ap_lock(struct lock_t *lock) -ap_status_t ap_unlock(struct lock_t *lock) +ap_status_t ap_unlock(struct ap_lock_t *lock) { ULONG rc; @@ -163,7 +163,7 @@ ap_status_t ap_unlock(struct lock_t *lock) -ap_status_t ap_destroy_lock(struct lock_t *lock) +ap_status_t ap_destroy_lock(struct ap_lock_t *lock) { ULONG rc; ap_status_t stat = APR_SUCCESS; diff --git a/locks/os2/locks.h b/locks/os2/locks.h index 5678f79a1..9dcf0f293 100644 --- a/locks/os2/locks.h +++ b/locks/os2/locks.h @@ -60,7 +60,7 @@ #define INCL_DOS #include <os2.h> -struct lock_t { +struct ap_lock_t { ap_context_t *cntxt; ap_locktype_e type; ap_lockscope_e scope; diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index fb51a4b91..26beb71e1 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -70,7 +70,7 @@ void setup_lock() { ap_status_t lock_cleanup(void *lock_) { - struct lock_t *lock=lock_; + struct ap_lock_t *lock=lock_; union semun ick; if (lock->interproc != -1) { @@ -80,7 +80,7 @@ ap_status_t lock_cleanup(void *lock_) return APR_SUCCESS; } -ap_status_t create_inter_lock(struct lock_t *new) +ap_status_t create_inter_lock(struct ap_lock_t *new) { union semun ick; struct semid_ds buf; @@ -101,7 +101,7 @@ ap_status_t create_inter_lock(struct lock_t *new) return APR_SUCCESS; } -ap_status_t lock_inter(struct lock_t *lock) +ap_status_t lock_inter(struct ap_lock_t *lock) { lock->curr_locked = 1; if (semop(lock->interproc, &op_on, 1) < 0) { @@ -110,7 +110,7 @@ ap_status_t lock_inter(struct lock_t *lock) return APR_SUCCESS; } -ap_status_t unlock_inter(struct lock_t *lock) +ap_status_t unlock_inter(struct ap_lock_t *lock) { if (semop(lock->interproc, &op_off, 1) < 0) { return errno; @@ -119,7 +119,7 @@ ap_status_t unlock_inter(struct lock_t *lock) return APR_SUCCESS; } -ap_status_t destroy_inter_lock(struct lock_t *lock) +ap_status_t destroy_inter_lock(struct ap_lock_t *lock) { ap_status_t stat; @@ -130,7 +130,7 @@ ap_status_t destroy_inter_lock(struct lock_t *lock) return stat; } -ap_status_t child_init_lock(struct lock_t **lock, ap_context_t *cont, char *fname) +ap_status_t child_init_lock(struct ap_lock_t **lock, ap_context_t *cont, char *fname) { return APR_SUCCESS; } @@ -142,7 +142,7 @@ void setup_lock() { ap_status_t lock_cleanup(void *lock_) { - struct lock_t *lock=lock_; + struct ap_lock_t *lock=lock_; if (lock->curr_locked == 1) { if (pthread_mutex_unlock(lock->interproc)) { @@ -155,7 +155,7 @@ ap_status_t lock_cleanup(void *lock_) return APR_SUCCESS; } -ap_status_t create_inter_lock(struct lock_t *new) +ap_status_t create_inter_lock(struct ap_lock_t *new) { ap_status_t stat; int fd; @@ -198,7 +198,7 @@ ap_status_t create_inter_lock(struct lock_t *new) return APR_SUCCESS; } -ap_status_t lock_inter(struct lock_t *lock) +ap_status_t lock_inter(struct ap_lock_t *lock) { ap_status_t stat; lock->curr_locked = 1; @@ -208,7 +208,7 @@ ap_status_t lock_inter(struct lock_t *lock) return APR_SUCCESS; } -ap_status_t unlock_inter(struct lock_t *lock) +ap_status_t unlock_inter(struct ap_lock_t *lock) { ap_status_t stat; @@ -219,7 +219,7 @@ ap_status_t unlock_inter(struct lock_t *lock) return APR_SUCCESS; } -ap_status_t destroy_inter_lock(struct lock_t *lock) +ap_status_t destroy_inter_lock(struct ap_lock_t *lock) { ap_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { @@ -229,7 +229,7 @@ ap_status_t destroy_inter_lock(struct lock_t *lock) return stat; } -ap_status_t child_init_lock(struct lock_t **lock, ap_context_t *cont, char *fname) +ap_status_t child_init_lock(struct ap_lock_t **lock, ap_context_t *cont, char *fname) { return APR_SUCCESS; } @@ -254,7 +254,7 @@ void setup_lock() { static ap_status_t lock_cleanup(void *lock_) { - struct lock_t *lock=lock_; + struct ap_lock_t *lock=lock_; if (lock->curr_locked == 1) { if (fcntl(lock->interproc, F_SETLKW, &unlock_it) < 0) { @@ -265,7 +265,7 @@ static ap_status_t lock_cleanup(void *lock_) return APR_SUCCESS; } -ap_status_t create_inter_lock(struct lock_t *new) +ap_status_t create_inter_lock(struct ap_lock_t *new) { new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0644); @@ -280,7 +280,7 @@ ap_status_t create_inter_lock(struct lock_t *new) return APR_SUCCESS; } -ap_status_t lock_inter(struct lock_t *lock) +ap_status_t lock_inter(struct ap_lock_t *lock) { lock->curr_locked=1; if (fcntl(lock->interproc, F_SETLKW, &lock_it) < 0) { @@ -289,7 +289,7 @@ ap_status_t lock_inter(struct lock_t *lock) return APR_SUCCESS; } -ap_status_t unlock_inter(struct lock_t *lock) +ap_status_t unlock_inter(struct ap_lock_t *lock) { if (fcntl(lock->interproc, F_SETLKW, &unlock_it) < 0) { return errno; @@ -298,7 +298,7 @@ ap_status_t unlock_inter(struct lock_t *lock) return APR_SUCCESS; } -ap_status_t destroy_inter_lock(struct lock_t *lock) +ap_status_t destroy_inter_lock(struct ap_lock_t *lock) { ap_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { @@ -308,7 +308,7 @@ ap_status_t destroy_inter_lock(struct lock_t *lock) return stat; } -ap_status_t child_init_lock(struct lock_t **lock, ap_context_t *cont, char *fname) +ap_status_t child_init_lock(struct ap_lock_t **lock, ap_context_t *cont, char *fname) { return APR_SUCCESS; } @@ -320,7 +320,7 @@ void setup_lock() { ap_status_t lock_cleanup(void *lock_) { - struct lock_t *lock=lock_; + struct ap_lock_t *lock=lock_; if (lock->curr_locked == 1) { if (flock(lock->interproc, LOCK_UN) < 0) { @@ -332,7 +332,7 @@ ap_status_t lock_cleanup(void *lock_) return APR_SUCCESS; } -ap_status_t create_inter_lock(struct lock_t *new) +ap_status_t create_inter_lock(struct ap_lock_t *new) { new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0600); @@ -345,7 +345,7 @@ ap_status_t create_inter_lock(struct lock_t *new) return APR_SUCCESS; } -ap_status_t lock_inter(struct lock_t *lock) +ap_status_t lock_inter(struct ap_lock_t *lock) { lock->curr_locked = 1; if (flock(lock->interproc, LOCK_EX) < 0) { @@ -354,7 +354,7 @@ ap_status_t lock_inter(struct lock_t *lock) return APR_SUCCESS; } -ap_status_t unlock_inter(struct lock_t *lock) +ap_status_t unlock_inter(struct ap_lock_t *lock) { if (flock(lock->interproc, LOCK_UN) < 0) { return errno; @@ -363,7 +363,7 @@ ap_status_t unlock_inter(struct lock_t *lock) return APR_SUCCESS; } -ap_status_t destroy_inter_lock(struct lock_t *lock) +ap_status_t destroy_inter_lock(struct ap_lock_t *lock) { ap_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { @@ -373,11 +373,11 @@ ap_status_t destroy_inter_lock(struct lock_t *lock) return stat; } -ap_status_t child_init_lock(struct lock_t **lock, ap_context_t *cont, char *fname) +ap_status_t child_init_lock(struct ap_lock_t **lock, ap_context_t *cont, char *fname) { - struct lock_t *new; + struct ap_lock_t *new; - new = (struct lock_t *)ap_palloc(cont, sizeof(struct lock_t)); + new = (struct ap_lock_t *)ap_palloc(cont, sizeof(struct ap_lock_t)); new->fname = ap_pstrdup(cont, fname); new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0600); diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c index fc379b79e..e04867053 100644 --- a/locks/unix/intraproc.c +++ b/locks/unix/intraproc.c @@ -60,11 +60,11 @@ ap_status_t lock_intra_cleanup(void *data) { - struct lock_t *lock = (struct lock_t *) data; + struct ap_lock_t *lock = (struct ap_lock_t *) data; return pthread_mutex_unlock(lock->intraproc); } -ap_status_t create_intra_lock(struct lock_t *new) +ap_status_t create_intra_lock(struct ap_lock_t *new) { ap_status_t stat; pthread_mutexattr_t mattr; @@ -95,12 +95,12 @@ ap_status_t create_intra_lock(struct lock_t *new) return APR_SUCCESS; } -ap_status_t lock_intra(struct lock_t *lock) +ap_status_t lock_intra(struct ap_lock_t *lock) { return pthread_mutex_lock(lock->intraproc); } -ap_status_t unlock_intra(struct lock_t *lock) +ap_status_t unlock_intra(struct ap_lock_t *lock) { ap_status_t status; @@ -108,7 +108,7 @@ ap_status_t unlock_intra(struct lock_t *lock) return status; } -ap_status_t destroy_intra_lock(struct lock_t *lock) +ap_status_t destroy_intra_lock(struct ap_lock_t *lock) { ap_status_t stat; if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) { diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 0d7bb4b84..ac111493a 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -76,14 +76,14 @@ * NOTE: APR_CROSS_PROCESS may lock both processes and threads, but it is * only guaranteed to lock processes. */ -ap_status_t ap_create_lock(struct lock_t **lock, ap_locktype_e type, +ap_status_t ap_create_lock(struct ap_lock_t **lock, ap_locktype_e type, ap_lockscope_e scope, char *fname, ap_context_t *cont) { - struct lock_t *new; + struct ap_lock_t *new; ap_status_t stat; - new = (struct lock_t *)ap_palloc(cont, sizeof(struct lock_t)); + new = (struct ap_lock_t *)ap_palloc(cont, sizeof(struct ap_lock_t)); new->cntxt = cont; new->type = type; @@ -124,7 +124,7 @@ ap_status_t ap_create_lock(struct lock_t **lock, ap_locktype_e type, * Lock a protected region. * arg 1) The lock to set. */ -ap_status_t ap_lock(struct lock_t *lock) +ap_status_t ap_lock(struct ap_lock_t *lock) { ap_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { @@ -149,7 +149,7 @@ ap_status_t ap_lock(struct lock_t *lock) * Unlock a protected region. * arg 1) The lock to reset. */ -ap_status_t ap_unlock(struct lock_t *lock) +ap_status_t ap_unlock(struct ap_lock_t *lock) { ap_status_t stat; @@ -177,7 +177,7 @@ ap_status_t ap_unlock(struct lock_t *lock) * NOTE: If the lock is currently active when it is destroyed, it * will be unlocked first. */ -ap_status_t ap_destroy_lock(struct lock_t *lock) +ap_status_t ap_destroy_lock(struct ap_lock_t *lock) { ap_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { @@ -212,7 +212,7 @@ ap_status_t ap_destroy_lock(struct lock_t *lock) * idea to call it regardless, because it makes the code more * portable. */ -ap_status_t ap_child_init_lock(struct lock_t **lock, char *fname, ap_context_t *cont) +ap_status_t ap_child_init_lock(struct ap_lock_t **lock, char *fname, ap_context_t *cont) { ap_status_t stat; if ((*lock)->scope != APR_CROSS_PROCESS) { @@ -230,7 +230,7 @@ ap_status_t ap_child_init_lock(struct lock_t **lock, char *fname, ap_context_t * * arg 2) The key to use when retreiving data associated with this lock * arg 3) The user data associated with the lock. */ -ap_status_t ap_get_lockdata(struct lock_t *lock, char *key, void *data) +ap_status_t ap_get_lockdata(struct ap_lock_t *lock, char *key, void *data) { if (lock != NULL) { return ap_get_userdata(data, key, lock->cntxt); @@ -250,7 +250,7 @@ ap_status_t ap_get_lockdata(struct lock_t *lock, char *key, void *data) * arg 3) The key to use when associating data with this lock * arg 4) The cleanup to use when the lock is destroyed. */ -ap_status_t ap_set_lockdata(struct lock_t *lock, void *data, char *key, +ap_status_t ap_set_lockdata(struct ap_lock_t *lock, void *data, char *key, ap_status_t (*cleanup) (void *)) { if (lock != NULL) { @@ -268,7 +268,7 @@ ap_status_t ap_set_lockdata(struct lock_t *lock, void *data, char *key, * arg 1) The os specific lock we are converting to. * arg 2) The apr lock to convert. */ -ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, struct lock_t *lock) +ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, struct ap_lock_t *lock) { if (lock == NULL) { return APR_ENOLOCK; @@ -291,14 +291,14 @@ ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, struct lock_t *lock) * arg 2) The os specific lock to convert. * arg 3) The context to use if it is needed. */ -ap_status_t ap_put_os_lock(struct lock_t **lock, ap_os_lock_t *thelock, +ap_status_t ap_put_os_lock(struct ap_lock_t **lock, ap_os_lock_t *thelock, ap_context_t *cont) { if (cont == NULL) { return APR_ENOCONT; } if ((*lock) == NULL) { - (*lock) = (struct lock_t *)ap_palloc(cont, sizeof(struct lock_t)); + (*lock) = (struct ap_lock_t *)ap_palloc(cont, sizeof(struct ap_lock_t)); (*lock)->cntxt = cont; } (*lock)->interproc = thelock->crossproc; diff --git a/locks/unix/locks.h b/locks/unix/locks.h index ce910d3d2..efff844a2 100644 --- a/locks/unix/locks.h +++ b/locks/unix/locks.h @@ -108,7 +108,7 @@ union semun { }; #endif -struct lock_t { +struct ap_lock_t { ap_context_t *cntxt; ap_locktype_e type; ap_lockscope_e scope; @@ -138,19 +138,19 @@ struct lock_t { }; #if APR_HAS_THREADS -ap_status_t create_intra_lock(struct lock_t *new); -ap_status_t lock_intra(struct lock_t *lock); -ap_status_t unlock_intra(struct lock_t *lock); -ap_status_t destroy_intra_lock(struct lock_t *lock); +ap_status_t create_intra_lock(struct ap_lock_t *new); +ap_status_t lock_intra(struct ap_lock_t *lock); +ap_status_t unlock_intra(struct ap_lock_t *lock); +ap_status_t destroy_intra_lock(struct ap_lock_t *lock); #endif void setup_lock(); -ap_status_t create_inter_lock(struct lock_t *new); -ap_status_t lock_inter(struct lock_t *lock); -ap_status_t unlock_inter(struct lock_t *lock); -ap_status_t destroy_inter_lock(struct lock_t *lock); +ap_status_t create_inter_lock(struct ap_lock_t *new); +ap_status_t lock_inter(struct ap_lock_t *lock); +ap_status_t unlock_inter(struct ap_lock_t *lock); +ap_status_t destroy_inter_lock(struct ap_lock_t *lock); -ap_status_t child_init_lock(struct lock_t **lock, ap_context_t *cont, +ap_status_t child_init_lock(struct ap_lock_t **lock, ap_context_t *cont, char *fname); #endif /* LOCKS_H */ diff --git a/locks/win32/locks.c b/locks/win32/locks.c index fe7122d1c..f245999ab 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -57,14 +57,14 @@ #include "locks.h" #include "apr_portable.h" -ap_status_t ap_create_lock(struct lock_t **lock, ap_locktype_e type, +ap_status_t ap_create_lock(struct ap_lock_t **lock, ap_locktype_e type, ap_lockscope_e scope, char *fname, ap_context_t *cont) { - struct lock_t *newlock; + struct ap_lock_t *newlock; SECURITY_ATTRIBUTES sec; - newlock = (struct lock_t *)ap_palloc(cont, sizeof(struct lock_t)); + newlock = (struct ap_lock_t *)ap_palloc(cont, sizeof(struct ap_lock_t)); newlock->cntxt = cont; /* ToDo: How to handle the case when no context is available? @@ -92,12 +92,12 @@ ap_status_t ap_create_lock(struct lock_t **lock, ap_locktype_e type, return APR_SUCCESS; } -ap_status_t ap_child_init_lock(struct lock_t **lock, char *fname, ap_context_t *cont) +ap_status_t ap_child_init_lock(struct ap_lock_t **lock, char *fname, ap_context_t *cont) { /* This routine should not be called (and OpenMutex will fail if called) * on a INTRAPROCESS lock */ - (*lock) = (struct lock_t *)ap_palloc(cont, sizeof(struct lock_t)); + (*lock) = (struct ap_lock_t *)ap_palloc(cont, sizeof(struct ap_lock_t)); if ((*lock) == NULL) { return APR_ENOMEM; @@ -111,7 +111,7 @@ ap_status_t ap_child_init_lock(struct lock_t **lock, char *fname, ap_context_t * return APR_SUCCESS; } -ap_status_t ap_lock(struct lock_t *lock) +ap_status_t ap_lock(struct ap_lock_t *lock) { DWORD rv; if (lock->scope == APR_INTRAPROCESS) { @@ -130,7 +130,7 @@ ap_status_t ap_lock(struct lock_t *lock) return APR_EEXIST; } -ap_status_t ap_unlock(struct lock_t *lock) +ap_status_t ap_unlock(struct ap_lock_t *lock) { if (lock->scope == APR_INTRAPROCESS) { LeaveCriticalSection(&lock->section); @@ -143,7 +143,7 @@ ap_status_t ap_unlock(struct lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_destroy_lock(struct lock_t *lock) +ap_status_t ap_destroy_lock(struct ap_lock_t *lock) { if (lock->scope == APR_INTRAPROCESS) { DeleteCriticalSection(&lock->section); @@ -156,7 +156,7 @@ ap_status_t ap_destroy_lock(struct lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_get_lockdata(struct lock_t *lock, char *key, void *data) +ap_status_t ap_get_lockdata(struct ap_lock_t *lock, char *key, void *data) { if (lock != NULL) { return ap_get_userdata(data, key, lock->cntxt); @@ -167,7 +167,7 @@ ap_status_t ap_get_lockdata(struct lock_t *lock, char *key, void *data) } } -ap_status_t ap_set_lockdata(struct lock_t *lock, void *data, char *key, +ap_status_t ap_set_lockdata(struct ap_lock_t *lock, void *data, char *key, ap_status_t (*cleanup) (void *)) { if (lock != NULL) { @@ -179,7 +179,7 @@ ap_status_t ap_set_lockdata(struct lock_t *lock, void *data, char *key, } } -ap_status_t ap_get_os_lock(ap_os_lock_t *thelock, struct lock_t *lock) +ap_status_t ap_get_os_lock(ap_os_lock_t *thelock, struct ap_lock_t *lock) { if (lock == NULL) { return APR_ENOFILE; @@ -188,14 +188,14 @@ ap_status_t ap_get_os_lock(ap_os_lock_t *thelock, struct lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_put_os_lock(struct lock_t **lock, ap_os_lock_t *thelock, +ap_status_t ap_put_os_lock(struct ap_lock_t **lock, ap_os_lock_t *thelock, ap_context_t *cont) { if (cont == NULL) { return APR_ENOCONT; } if ((*lock) == NULL) { - (*lock) = (struct lock_t *)ap_palloc(cont, sizeof(struct lock_t)); + (*lock) = (struct ap_lock_t *)ap_palloc(cont, sizeof(struct ap_lock_t)); (*lock)->cntxt = cont; } (*lock)->mutex = *thelock; diff --git a/locks/win32/locks.h b/locks/win32/locks.h index 7f1e2df33..7c89002f0 100644 --- a/locks/win32/locks.h +++ b/locks/win32/locks.h @@ -57,7 +57,7 @@ #include "apr_lock.h" -struct lock_t { +struct ap_lock_t { ap_context_t *cntxt; ap_locktype_e type; ap_lockscope_e scope; diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 522aba584..4e1045466 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -598,7 +598,7 @@ static void ap_register_pool_cleanup(struct ap_pool_t *p, void *data, } #endif -API_EXPORT(void) ap_register_cleanup(struct context_t *p, void *data, +API_EXPORT(void) ap_register_cleanup(struct ap_context_t *p, void *data, ap_status_t (*plain_cleanup) (void *), ap_status_t (*child_cleanup) (void *)) { @@ -614,7 +614,7 @@ API_EXPORT(void) ap_register_cleanup(struct context_t *p, void *data, } } -API_EXPORT(void) ap_kill_cleanup(struct context_t *p, void *data, +API_EXPORT(void) ap_kill_cleanup(struct ap_context_t *p, void *data, ap_status_t (*cleanup) (void *)) { struct cleanup *c; @@ -635,7 +635,7 @@ API_EXPORT(void) ap_kill_cleanup(struct context_t *p, void *data, } } -API_EXPORT(void) ap_run_cleanup(struct context_t *p, void *data, +API_EXPORT(void) ap_run_cleanup(struct ap_context_t *p, void *data, ap_status_t (*cleanup) (void *)) { ap_block_alarms(); /* Run cleanup only once! */ @@ -780,7 +780,7 @@ static void ap_clear_real_pool(ap_pool_t *a) ap_unblock_alarms(); } -API_EXPORT(void) ap_clear_pool(struct context_t *a) +API_EXPORT(void) ap_clear_pool(struct ap_context_t *a) { ap_clear_real_pool(a->pool); } @@ -811,7 +811,7 @@ API_EXPORT(void) ap_destroy_real_pool(ap_pool_t *a) ap_unblock_alarms(); } -API_EXPORT(void) ap_destroy_pool(struct context_t *a) +API_EXPORT(void) ap_destroy_pool(struct ap_context_t *a) { ap_destroy_real_pool(a->pool); } @@ -1028,7 +1028,7 @@ static void * ap_pool_palloc(ap_pool_t *a, int reqsize, int (*apr_abort)(int ret #endif } -API_EXPORT(void *) ap_palloc(struct context_t *c, int reqsize) +API_EXPORT(void *) ap_palloc(struct ap_context_t *c, int reqsize) { if (c == NULL) { return malloc(reqsize); @@ -1036,14 +1036,14 @@ API_EXPORT(void *) ap_palloc(struct context_t *c, int reqsize) return ap_pool_palloc(c->pool, reqsize, c->apr_abort); } -API_EXPORT(void *) ap_pcalloc(struct context_t *a, int size) +API_EXPORT(void *) ap_pcalloc(struct ap_context_t *a, int size) { void *res = ap_palloc(a, size); memset(res, '\0', size); return res; } -API_EXPORT(char *) ap_pstrdup(struct context_t *a, const char *s) +API_EXPORT(char *) ap_pstrdup(struct ap_context_t *a, const char *s) { char *res; size_t len; @@ -1057,7 +1057,7 @@ API_EXPORT(char *) ap_pstrdup(struct context_t *a, const char *s) return res; } -API_EXPORT(char *) ap_pstrndup(struct context_t *a, const char *s, int n) +API_EXPORT(char *) ap_pstrndup(struct ap_context_t *a, const char *s, int n) { char *res; @@ -1070,7 +1070,7 @@ API_EXPORT(char *) ap_pstrndup(struct context_t *a, const char *s, int n) return res; } -API_EXPORT_NONSTD(char *) ap_pstrcat(struct context_t *a, ...) +API_EXPORT_NONSTD(char *) ap_pstrcat(struct ap_context_t *a, ...) { char *cp, *argp, *res; @@ -1195,7 +1195,7 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) #endif } -API_EXPORT(char *) ap_pvsprintf(struct context_t *c, const char *fmt, va_list ap) +API_EXPORT(char *) ap_pvsprintf(struct ap_context_t *c, const char *fmt, va_list ap) { #ifdef ALLOC_USE_MALLOC ap_pool_t *p = c->pool; @@ -1260,7 +1260,7 @@ API_EXPORT(char *) ap_pvsprintf(struct context_t *c, const char *fmt, va_list ap #endif } -API_EXPORT_NONSTD(char *) ap_psprintf(struct context_t *p, const char *fmt, ...) +API_EXPORT_NONSTD(char *) ap_psprintf(struct ap_context_t *p, const char *fmt, ...) { va_list ap; char *res; @@ -1283,7 +1283,7 @@ API_EXPORT_NONSTD(char *) ap_psprintf(struct context_t *p, const char *fmt, ...) * generic interface, but for now, it's a special case */ -API_EXPORT(void) ap_note_subprocess(struct context_t *a, ap_proc_t *pid, +API_EXPORT(void) ap_note_subprocess(struct ap_context_t *a, ap_proc_t *pid, enum kill_conditions how) { struct process_chain *new = diff --git a/misc/beos/misc.h b/misc/beos/misc.h index 5840c3aaf..71d3fdb2a 100644 --- a/misc/beos/misc.h +++ b/misc/beos/misc.h @@ -79,7 +79,7 @@ typedef struct datastruct { struct datastruct *prev; } datastruct; -struct context_t { +struct ap_context_t { struct ap_pool_t *pool; void *prog_data; int (*apr_abort)(int retcode); diff --git a/misc/beos/start.c b/misc/beos/start.c index f009e6a4d..32d8ebf08 100644 --- a/misc/beos/start.c +++ b/misc/beos/start.c @@ -54,7 +54,7 @@ #include "misc.h" -ap_status_t ap_create_context(struct context_t **newcont, struct context_t *cont) +ap_status_t ap_create_context(struct ap_context_t **newcont, struct ap_context_t *cont) { ap_context_t *new; ap_pool_t *pool; @@ -70,7 +70,7 @@ ap_status_t ap_create_context(struct context_t **newcont, struct context_t *cont return APR_ENOPOOL; } - new = (struct context_t *)ap_palloc(cont, sizeof(struct context_t)); + new = (struct ap_context_t *)ap_palloc(cont, sizeof(struct ap_context_t)); new->pool = pool; new->prog_data = NULL; @@ -87,7 +87,7 @@ ap_status_t ap_destroy_context(ap_context_t *cont) ap_status_t ap_set_userdata(void *data, char *key, ap_status_t (*cleanup) (void *), - struct context_t *cont) + struct ap_context_t *cont) { datastruct *dptr = NULL, *dptr2 = NULL; if (cont) { @@ -117,7 +117,7 @@ ap_status_t ap_set_userdata(void *data, char *key, return APR_ENOCONT; } -ap_status_t ap_get_userdata(void **data, char *key, struct context_t *cont) +ap_status_t ap_get_userdata(void **data, char *key, struct ap_context_t *cont) { datastruct *dptr = NULL; if (cont) { diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 1bedb46d5..49f6049b4 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -60,7 +60,7 @@ char *ap_optarg = ""; /* argument associated with option */ * NOTE: Arguments 2 and 3 are most commonly argc and argv from * main(argc, argv) */ -ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, ap_int32_t *rv, struct context_t *cont) +ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, ap_int32_t *rv, struct ap_context_t *cont) { char *p; static char *place = EMSG; /* option letter processing */ diff --git a/misc/unix/misc.h b/misc/unix/misc.h index aa6d1260f..fffa9365f 100644 --- a/misc/unix/misc.h +++ b/misc/unix/misc.h @@ -82,7 +82,7 @@ typedef struct datastruct { struct datastruct *prev; } datastruct; -struct context_t { +struct ap_context_t { struct ap_pool_t *pool; datastruct *prog_data; int (*apr_abort)(int retcode); diff --git a/misc/unix/start.c b/misc/unix/start.c index c1d1cc0fc..95b3a3d60 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -64,9 +64,9 @@ * of it's parent context's attributes, except the ap_context_t will be a * sub-pool. */ -ap_status_t ap_create_context(struct context_t **newcont, struct context_t *cont) +ap_status_t ap_create_context(struct ap_context_t **newcont, struct ap_context_t *cont) { - struct context_t *new; + struct ap_context_t *new; ap_pool_t *pool; if (cont) { @@ -80,7 +80,7 @@ ap_status_t ap_create_context(struct context_t **newcont, struct context_t *cont return APR_ENOPOOL; } - new = (struct context_t *)ap_palloc(cont, sizeof(struct context_t)); + new = (struct ap_context_t *)ap_palloc(cont, sizeof(struct ap_context_t)); new->pool = pool; new->prog_data = NULL; @@ -95,7 +95,7 @@ ap_status_t ap_create_context(struct context_t **newcont, struct context_t *cont * 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_status_t ap_destroy_context(struct ap_context_t *cont) { ap_destroy_pool(cont); return APR_SUCCESS; @@ -121,7 +121,7 @@ ap_status_t ap_destroy_context(struct context_t *cont) */ ap_status_t ap_set_userdata(void *data, char *key, ap_status_t (*cleanup) (void *), - struct context_t *cont) + struct ap_context_t *cont) { datastruct *dptr = NULL, *dptr2 = NULL; if (cont) { @@ -158,7 +158,7 @@ ap_status_t ap_set_userdata(void *data, char *key, * arg 2) The user data associated with the context. * arg 3) The current context. */ -ap_status_t ap_get_userdata(void **data, char *key, struct context_t *cont) +ap_status_t ap_get_userdata(void **data, char *key, struct ap_context_t *cont) { datastruct *dptr = NULL; if (cont) { @@ -215,7 +215,7 @@ void ap_terminate(void) * then APR will return an error and expect the calling program to * deal with the error accordingly. */ -ap_status_t ap_set_abort(int (*apr_abort)(int retcode), struct context_t *cont) +ap_status_t ap_set_abort(int (*apr_abort)(int retcode), struct ap_context_t *cont) { if (cont == NULL) { return APR_ENOCONT; diff --git a/misc/win32/getopt.c b/misc/win32/getopt.c index 59544a76f..c17b41389 100644 --- a/misc/win32/getopt.c +++ b/misc/win32/getopt.c @@ -63,7 +63,7 @@ char *ap_optarg = ""; /* argument associated with option */ * NOTE: Arguments 2 and 3 are most commonly argc and argv from * main(argc, argv) */ -ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, ap_int32_t *rv, struct context_t *cont) +ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, ap_int32_t *rv, struct ap_context_t *cont) { char *p; static char *place = EMSG; /* option letter processing */ diff --git a/misc/win32/misc.h b/misc/win32/misc.h index db9c1420a..a241c1e47 100644 --- a/misc/win32/misc.h +++ b/misc/win32/misc.h @@ -67,7 +67,7 @@ typedef struct datastruct { struct datastruct *prev; } datastruct; -struct context_t { +struct ap_context_t { struct ap_pool_t *pool; datastruct *prog_data; int (*apr_abort)(int retcode); diff --git a/misc/win32/names.c b/misc/win32/names.c index f818f4e01..c06c21766 100644 --- a/misc/win32/names.c +++ b/misc/win32/names.c @@ -84,7 +84,7 @@ static BOOL OnlyDots(char *pString) * is present on the existing path. This routine also * converts alias names to long names. */ -API_EXPORT(char *) ap_os_systemcase_filename(struct context_t *pCont, +API_EXPORT(char *) ap_os_systemcase_filename(struct ap_context_t *pCont, const char *szFile) { char buf[HUGE_STRING_LEN]; @@ -203,7 +203,7 @@ API_EXPORT(char *) ap_os_systemcase_filename(struct context_t *pCont, /* Perform canonicalization with the exception that the * input case is preserved. */ -char * canonical_filename(struct context_t *pCont, const char *szFile) +char * canonical_filename(struct ap_context_t *pCont, const char *szFile) { char *pNewStr; char *s; diff --git a/misc/win32/start.c b/misc/win32/start.c index 780ed828f..67d6041de 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -144,7 +144,7 @@ ap_status_t ap_get_oslevel(ap_context_t *cont, ap_oslevel_e *level) ap_status_t ap_set_userdata(void *data, char *key, ap_status_t (*cleanup) (void *), - struct context_t *cont) + struct ap_context_t *cont) { datastruct *dptr = NULL, *dptr2 = NULL; if (cont) { @@ -174,7 +174,7 @@ ap_status_t ap_set_userdata(void *data, char *key, return APR_ENOCONT; } -ap_status_t ap_get_userdata(void **data, char *key, struct context_t *cont) +ap_status_t ap_get_userdata(void **data, char *key, struct ap_context_t *cont) { datastruct *dptr = NULL; if (cont) { diff --git a/mmap/beos/mmap.c b/mmap/beos/mmap.c index 07b95e914..567be9e2c 100644 --- a/mmap/beos/mmap.c +++ b/mmap/beos/mmap.c @@ -56,7 +56,7 @@ ap_status_t mmap_cleanup(void *themmap) { - struct mmap_t *mm = themmap; + struct ap_mmap_t *mm = themmap; int rv; rv = delete_area(mm->area); @@ -69,7 +69,7 @@ ap_status_t mmap_cleanup(void *themmap) return errno; } -ap_status_t ap_mmap_create(struct mmap_t **new, ap_file_t *file, ap_off_t offset, ap_size_t size, +ap_status_t ap_mmap_create(struct ap_mmap_t **new, ap_file_t *file, ap_off_t offset, ap_size_t size, ap_context_t *cont) { void *mm; @@ -79,7 +79,7 @@ ap_status_t ap_mmap_create(struct mmap_t **new, ap_file_t *file, ap_off_t offset if (file == NULL || file->buffered || file->filedes == -1) return APR_EBADF; - (*new) = (struct mmap_t *)ap_palloc(cont, sizeof(struct mmap_t)); + (*new) = (struct ap_mmap_t *)ap_palloc(cont, sizeof(struct ap_mmap_t)); pages = ((size -1) / B_PAGE_SIZE) + 1; @@ -108,7 +108,7 @@ ap_status_t ap_mmap_create(struct mmap_t **new, ap_file_t *file, ap_off_t offset return APR_SUCCESS; } -ap_status_t ap_mmap_delete(struct mmap_t *mmap) +ap_status_t ap_mmap_delete(struct ap_mmap_t *mmap) { ap_status_t rv; if (mmap->area == -1) diff --git a/mmap/beos/mmap_h.h b/mmap/beos/mmap_h.h index 949c4a459..4445e0d98 100644 --- a/mmap/beos/mmap_h.h +++ b/mmap/beos/mmap_h.h @@ -68,7 +68,7 @@ #include <string.h> #include <stdio.h> -struct mmap_t { +struct ap_mmap_t { ap_context_t *cntxt; area_id area; void *mm; diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index dd24215db..3cfcda7b3 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -64,7 +64,7 @@ ap_status_t mmap_cleanup(void *themmap) { - struct mmap_t *mm = themmap; + struct ap_mmap_t *mm = themmap; int rv; rv = munmap(mm->mm, mm->size); @@ -93,7 +93,7 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, if (file == NULL || file->buffered || file->filedes == -1) return APR_EBADF; - (*new) = (struct mmap_t *)ap_palloc(cont, sizeof(struct mmap_t)); + (*new) = (struct ap_mmap_t *)ap_palloc(cont, sizeof(struct ap_mmap_t)); ap_seek(file, APR_SET, &offset); mm = mmap(NULL, size, PROT_READ, MAP_SHARED, file->filedes ,0); @@ -117,7 +117,7 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, * Remove a mmap'ed. * arg 1) The mmap'ed file. */ -ap_status_t ap_mmap_delete(struct mmap_t *mmap) +ap_status_t ap_mmap_delete(struct ap_mmap_t *mmap) { ap_status_t rv; diff --git a/mmap/unix/mmap_h.h b/mmap/unix/mmap_h.h index 6965e58c0..6959cb36b 100644 --- a/mmap/unix/mmap_h.h +++ b/mmap/unix/mmap_h.h @@ -84,7 +84,7 @@ #endif /* End System Headers */ -struct mmap_t { +struct ap_mmap_t { ap_context_t *cntxt; void *mm; size_t size; diff --git a/network_io/beos/networkio.h b/network_io/beos/networkio.h index 91253c0c1..c085fc332 100644 --- a/network_io/beos/networkio.h +++ b/network_io/beos/networkio.h @@ -85,7 +85,7 @@ #define POLLHUP 16 #define POLLNVAL 32 -struct socket_t { +struct ap_socket_t { ap_context_t *cntxt; int socketdes; struct sockaddr_in *local_addr; @@ -95,9 +95,9 @@ struct socket_t { int connected; }; -struct pollfd_t { +struct ap_pollfd_t { ap_context_t *cntxt; - struct socket_t *sock; + struct ap_socket_t *sock; fd_set *read; fd_set *write; fd_set *except; diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index 297f1bd5a..cf2f82dc6 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -63,9 +63,9 @@ /* select for R4.5 of BeOS. So here we use code that uses the write */ /* bits. */ -ap_status_t ap_setup_poll(struct pollfd_t **new, ap_int32_t num, ap_context_t *cont) +ap_status_t ap_setup_poll(struct ap_pollfd_t **new, ap_int32_t num, ap_context_t *cont) { - (*new) = (struct pollfd_t *)ap_palloc(cont, sizeof(struct pollfd_t) * num); + (*new) = (struct ap_pollfd_t *)ap_palloc(cont, sizeof(struct ap_pollfd_t) * num); if ((*new) == NULL) { return APR_ENOMEM; } @@ -80,8 +80,8 @@ ap_status_t ap_setup_poll(struct pollfd_t **new, ap_int32_t num, ap_context_t *c return APR_SUCCESS; } -ap_status_t ap_add_poll_socket(struct pollfd_t *aprset, - struct socket_t *sock, ap_int16_t event) +ap_status_t ap_add_poll_socket(struct ap_pollfd_t *aprset, + struct ap_socket_t *sock, ap_int16_t event) { if (event & APR_POLLIN) { FD_SET(sock->socketdes, aprset->read); @@ -98,7 +98,7 @@ ap_status_t ap_add_poll_socket(struct pollfd_t *aprset, return APR_SUCCESS; } -ap_status_t ap_poll(struct pollfd_t *aprset, ap_int32_t *nsds, ap_int32_t timeout) +ap_status_t ap_poll(struct ap_pollfd_t *aprset, ap_int32_t *nsds, ap_int32_t timeout) { int rv; struct timeval *thetime; @@ -127,7 +127,7 @@ ap_status_t ap_poll(struct pollfd_t *aprset, ap_int32_t *nsds, ap_int32_t timeou return APR_SUCCESS; } -ap_status_t ap_get_revents(ap_int16_t *event, struct socket_t *sock, struct pollfd_t *aprset) +ap_status_t ap_get_revents(ap_int16_t *event, struct ap_socket_t *sock, struct ap_pollfd_t *aprset) { ap_int16_t revents = 0; char data[256]; @@ -172,8 +172,8 @@ ap_status_t ap_get_revents(ap_int16_t *event, struct socket_t *sock, struct poll return APR_SUCCESS; } -ap_status_t ap_remove_poll_socket(struct pollfd_t *aprset, - struct socket_t *sock, ap_int16_t events) +ap_status_t ap_remove_poll_socket(struct ap_pollfd_t *aprset, + struct ap_socket_t *sock, ap_int16_t events) { if (events & APR_POLLIN) { FD_CLR(sock->socketdes, aprset->read); @@ -187,7 +187,7 @@ ap_status_t ap_remove_poll_socket(struct pollfd_t *aprset, return APR_SUCCESS; } -ap_status_t ap_clear_poll_sockets(struct pollfd_t *aprset, ap_int16_t event) +ap_status_t ap_clear_poll_sockets(struct ap_pollfd_t *aprset, ap_int16_t event) { if (event & APR_POLLIN) { FD_ZERO(aprset->read); @@ -202,7 +202,7 @@ ap_status_t ap_clear_poll_sockets(struct pollfd_t *aprset, ap_int16_t event) return APR_SUCCESS; } -ap_status_t ap_get_polldata(struct pollfd_t *pollfd, char *key, void *data) +ap_status_t ap_get_polldata(struct ap_pollfd_t *pollfd, char *key, void *data) { if (pollfd != NULL) { return ap_get_userdata(data, key, pollfd->cntxt); @@ -213,7 +213,7 @@ ap_status_t ap_get_polldata(struct pollfd_t *pollfd, char *key, void *data) } } -ap_status_t ap_set_polldata(struct pollfd_t *pollfd, void *data, char *key, +ap_status_t ap_set_polldata(struct ap_pollfd_t *pollfd, void *data, char *key, ap_status_t (*cleanup) (void *)) { if (pollfd != NULL) { diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 7d59c4130..e25aa9241 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -54,7 +54,7 @@ #include "networkio.h" -ap_status_t ap_send(struct socket_t *sock, const char *buf, ap_ssize_t *len) +ap_status_t ap_send(struct ap_socket_t *sock, const char *buf, ap_ssize_t *len) { ssize_t rv; @@ -99,7 +99,7 @@ ap_status_t ap_send(struct socket_t *sock, const char *buf, ap_ssize_t *len) return APR_SUCCESS; } -ap_status_t ap_recv(struct socket_t *sock, char *buf, ap_ssize_t *len) +ap_status_t ap_recv(struct ap_socket_t *sock, char *buf, ap_ssize_t *len) { ap_ssize_t rv; diff --git a/network_io/beos/sockaddr.c b/network_io/beos/sockaddr.c index 2dbd28d8b..bf4f5b534 100644 --- a/network_io/beos/sockaddr.c +++ b/network_io/beos/sockaddr.c @@ -54,7 +54,7 @@ #include "networkio.h" -ap_status_t ap_set_local_port(struct socket_t *sock, ap_uint32_t port) +ap_status_t ap_set_local_port(struct ap_socket_t *sock, ap_uint32_t port) { if (!sock) { return APR_EBADF; @@ -63,7 +63,7 @@ ap_status_t ap_set_local_port(struct socket_t *sock, ap_uint32_t port) return APR_SUCCESS; } -ap_status_t ap_set_remote_port(struct socket_t *sock, ap_uint32_t port) +ap_status_t ap_set_remote_port(struct ap_socket_t *sock, ap_uint32_t port) { if (!sock) { return APR_EBADF; @@ -72,7 +72,7 @@ ap_status_t ap_set_remote_port(struct socket_t *sock, ap_uint32_t port) return APR_SUCCESS; } -ap_status_t ap_get_local_port(ap_uint32_t *port, struct socket_t *sock) +ap_status_t ap_get_local_port(ap_uint32_t *port, struct ap_socket_t *sock) { if (!sock) { return APR_EBADF; @@ -81,7 +81,7 @@ ap_status_t ap_get_local_port(ap_uint32_t *port, struct socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_get_remote_port(ap_uint32_t *port, struct socket_t *sock) +ap_status_t ap_get_remote_port(ap_uint32_t *port, struct ap_socket_t *sock) { if (!sock) { return APR_EBADF; @@ -90,7 +90,7 @@ ap_status_t ap_get_remote_port(ap_uint32_t *port, struct socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_set_local_ipaddr(struct socket_t *sock, const char *addr) +ap_status_t ap_set_local_ipaddr(struct ap_socket_t *sock, const char *addr) { u_long ipaddr; @@ -113,7 +113,7 @@ ap_status_t ap_set_local_ipaddr(struct socket_t *sock, const char *addr) return APR_SUCCESS; } -ap_status_t ap_set_remote_ipaddr(struct socket_t *sock, const char *addr) +ap_status_t ap_set_remote_ipaddr(struct ap_socket_t *sock, const char *addr) { u_long ipaddr; @@ -136,7 +136,7 @@ ap_status_t ap_set_remote_ipaddr(struct socket_t *sock, const char *addr) return APR_SUCCESS; } -ap_status_t ap_get_local_ipaddr(char **addr, const struct socket_t *sock) +ap_status_t ap_get_local_ipaddr(char **addr, const struct ap_socket_t *sock) { if (!sock) { return APR_EBADF; @@ -146,7 +146,7 @@ ap_status_t ap_get_local_ipaddr(char **addr, const struct socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_get_remote_ipaddr(char **addr, const struct socket_t *sock) +ap_status_t ap_get_remote_ipaddr(char **addr, const struct ap_socket_t *sock) { if (!sock) { return APR_EBADF; @@ -157,7 +157,7 @@ ap_status_t ap_get_remote_ipaddr(char **addr, const struct socket_t *sock) } -ap_status_t ap_get_local_name(struct sockaddr_in **name, const struct socket_t *sock) +ap_status_t ap_get_local_name(struct sockaddr_in **name, const struct ap_socket_t *sock) { if (!sock) { return APR_EBADF; @@ -167,7 +167,7 @@ ap_status_t ap_get_local_name(struct sockaddr_in **name, const struct socket_t * return APR_SUCCESS; } -ap_status_t ap_get_remote_name(struct sockaddr_in **name, const struct socket_t *sock) +ap_status_t ap_get_remote_name(struct sockaddr_in **name, const struct ap_socket_t *sock) { if (!sock) { return APR_EBADF; diff --git a/network_io/beos/sockets.c b/network_io/beos/sockets.c index ddfc92db4..d06f2d65b 100644 --- a/network_io/beos/sockets.c +++ b/network_io/beos/sockets.c @@ -56,7 +56,7 @@ ap_status_t socket_cleanup(void *sock) { - struct socket_t *thesocket = sock; + struct ap_socket_t *thesocket = sock; if (closesocket(thesocket->socketdes) == 0) { thesocket->socketdes = -1; return APR_SUCCESS; @@ -66,9 +66,9 @@ ap_status_t socket_cleanup(void *sock) } } -ap_status_t ap_create_tcp_socket(struct socket_t **new, ap_context_t *cont) +ap_status_t ap_create_tcp_socket(struct ap_socket_t **new, ap_context_t *cont) { - (*new) = (struct socket_t *)ap_palloc(cont,sizeof(struct socket_t)); + (*new) = (struct ap_socket_t *)ap_palloc(cont,sizeof(struct ap_socket_t)); if ((*new) == NULL){ return APR_ENOMEM; @@ -100,18 +100,18 @@ ap_status_t ap_create_tcp_socket(struct socket_t **new, ap_context_t *cont) return APR_SUCCESS; } -ap_status_t ap_shutdown(struct socket_t *thesocket, ap_shutdown_how_e how) +ap_status_t ap_shutdown(struct ap_socket_t *thesocket, ap_shutdown_how_e how) { return APR_SUCCESS; } -ap_status_t ap_close_socket(struct socket_t *thesocket) +ap_status_t ap_close_socket(struct ap_socket_t *thesocket) { ap_kill_cleanup(thesocket->cntxt,thesocket,socket_cleanup); return socket_cleanup(thesocket); } -ap_status_t ap_bind(struct socket_t *sock) +ap_status_t ap_bind(struct ap_socket_t *sock) { if (bind(sock->socketdes, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) return errno; @@ -119,7 +119,7 @@ ap_status_t ap_bind(struct socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_listen(struct socket_t *sock, ap_int32_t backlog) +ap_status_t ap_listen(struct ap_socket_t *sock, ap_int32_t backlog) { if (listen(sock->socketdes, backlog) == -1) return errno; @@ -127,9 +127,9 @@ ap_status_t ap_listen(struct socket_t *sock, ap_int32_t backlog) return APR_SUCCESS; } -ap_status_t ap_accept(struct socket_t **new, const struct socket_t *sock, struct context_t *connection_context) +ap_status_t ap_accept(struct ap_socket_t **new, const struct ap_socket_t *sock, struct ap_context_t *connection_context) { - (*new) = (struct socket_t *)ap_palloc(connection_context, + (*new) = (struct ap_socket_t *)ap_palloc(connection_context, sizeof(ap_socket_t)); (*new)->cntxt = connection_context; @@ -157,7 +157,7 @@ ap_status_t ap_accept(struct socket_t **new, const struct socket_t *sock, struct return APR_SUCCESS; } -ap_status_t ap_connect(struct socket_t *sock, char *hostname) +ap_status_t ap_connect(struct ap_socket_t *sock, char *hostname) { struct hostent *hp; @@ -186,7 +186,7 @@ ap_status_t ap_connect(struct socket_t *sock, char *hostname) return APR_SUCCESS; } -ap_status_t ap_get_socketdata(void **data, char *key, struct socket_t *sock) +ap_status_t ap_get_socketdata(void **data, char *key, struct ap_socket_t *sock) { if (socket != NULL) { return ap_get_userdata(data, key, sock->cntxt); @@ -197,7 +197,7 @@ ap_status_t ap_get_socketdata(void **data, char *key, struct socket_t *sock) } } -ap_status_t ap_set_socketdata(struct socket_t *sock, void *data, char *key, +ap_status_t ap_set_socketdata(struct ap_socket_t *sock, void *data, char *key, ap_status_t (*cleanup) (void *)) { if (sock != NULL) { @@ -209,7 +209,7 @@ ap_status_t ap_set_socketdata(struct socket_t *sock, void *data, char *key, } } -ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, struct socket_t *sock) +ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, struct ap_socket_t *sock) { if (sock == NULL) { return APR_ENOSOCKET; @@ -218,14 +218,14 @@ ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, struct socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_put_os_sock(struct socket_t **sock, ap_os_sock_t *thesock, +ap_status_t ap_put_os_sock(struct ap_socket_t **sock, ap_os_sock_t *thesock, ap_context_t *cont) { if (cont == NULL) { return APR_ENOCONT; } if ((*sock) == NULL) { - (*sock) = (struct socket_t *)ap_palloc(cont, sizeof(struct socket_t)); + (*sock) = (struct ap_socket_t *)ap_palloc(cont, sizeof(struct ap_socket_t)); (*sock)->cntxt = cont; } (*sock)->socketdes = *thesock; diff --git a/network_io/beos/sockopt.c b/network_io/beos/sockopt.c index ff424e131..ef340639c 100644 --- a/network_io/beos/sockopt.c +++ b/network_io/beos/sockopt.c @@ -54,7 +54,7 @@ #include "networkio.h" -ap_status_t ap_setsocketopt(struct socket_t *sock, ap_int32_t opt, ap_int32_t on) +ap_status_t ap_setsocketopt(struct ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) { int one; if (on){ @@ -92,7 +92,7 @@ ap_status_t ap_gethostname(char * buf, int len, ap_context_t *cont) } } -ap_status_t ap_get_remote_hostname(char **name, struct socket_t *sock) +ap_status_t ap_get_remote_hostname(char **name, struct ap_socket_t *sock) { struct hostent *hptr; diff --git a/network_io/os2/networkio.h b/network_io/os2/networkio.h index d64f038b3..de7324e24 100644 --- a/network_io/os2/networkio.h +++ b/network_io/os2/networkio.h @@ -61,7 +61,7 @@ int os2errno( unsigned long oserror ); -struct socket_t { +struct ap_socket_t { ap_context_t *cntxt; int socketdes; struct sockaddr_in *local_addr; @@ -71,7 +71,7 @@ struct socket_t { int nonblock; }; -struct pollfd_t { +struct ap_pollfd_t { ap_context_t *cntxt; int *socket_list; int *r_socket_list; diff --git a/network_io/os2/poll.c b/network_io/os2/poll.c index f0b02a0e1..692f3cd99 100644 --- a/network_io/os2/poll.c +++ b/network_io/os2/poll.c @@ -64,9 +64,9 @@ /* OS/2 doesn't have a poll function, implement using OS/2 style select */ -ap_status_t ap_setup_poll(struct pollfd_t **new, ap_int32_t num, ap_context_t *cont) +ap_status_t ap_setup_poll(struct ap_pollfd_t **new, ap_int32_t num, ap_context_t *cont) { - *new = (struct pollfd_t *)ap_palloc(cont, sizeof(struct pollfd_t)); + *new = (struct ap_pollfd_t *)ap_palloc(cont, sizeof(struct ap_pollfd_t)); if (*new == NULL) { return APR_ENOMEM; @@ -95,8 +95,8 @@ ap_status_t ap_setup_poll(struct pollfd_t **new, ap_int32_t num, ap_context_t *c -ap_status_t ap_add_poll_socket(struct pollfd_t *aprset, - struct socket_t *sock, ap_int16_t events) +ap_status_t ap_add_poll_socket(struct ap_pollfd_t *aprset, + struct ap_socket_t *sock, ap_int16_t events) { int i; @@ -126,7 +126,7 @@ ap_status_t ap_add_poll_socket(struct pollfd_t *aprset, -ap_status_t ap_poll(struct pollfd_t *pollfdset, ap_int32_t *nsds, ap_int32_t timeout) +ap_status_t ap_poll(struct ap_pollfd_t *pollfdset, ap_int32_t *nsds, ap_int32_t timeout) { int i; int rv = 0; @@ -164,7 +164,7 @@ ap_status_t ap_poll(struct pollfd_t *pollfdset, ap_int32_t *nsds, ap_int32_t tim -ap_status_t ap_get_revents(ap_int16_t *event, struct socket_t *sock, struct pollfd_t *aprset) +ap_status_t ap_get_revents(ap_int16_t *event, struct ap_socket_t *sock, struct ap_pollfd_t *aprset) { int i; @@ -186,8 +186,8 @@ ap_status_t ap_get_revents(ap_int16_t *event, struct socket_t *sock, struct poll -ap_status_t ap_remove_poll_socket(struct pollfd_t *aprset, - struct socket_t *sock, ap_int16_t events) +ap_status_t ap_remove_poll_socket(struct ap_pollfd_t *aprset, + struct ap_socket_t *sock, ap_int16_t events) { int start, *count, pos; diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index 4aa4ce210..723ea82bb 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -59,7 +59,7 @@ #include "apr_lib.h" #include <sys/time.h> -ap_status_t ap_send(struct socket_t *sock, const char *buf, ap_ssize_t *len) +ap_status_t ap_send(struct ap_socket_t *sock, const char *buf, ap_ssize_t *len) { ssize_t rv; int fds, err = 0; @@ -98,7 +98,7 @@ ap_status_t ap_send(struct socket_t *sock, const char *buf, ap_ssize_t *len) -ap_status_t ap_recv(struct socket_t *sock, char *buf, ap_ssize_t *len) +ap_status_t ap_recv(struct ap_socket_t *sock, char *buf, ap_ssize_t *len) { ssize_t rv; int fds, err = 0; diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 84ce2a8e8..dd00f70d3 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -68,7 +68,7 @@ ap_status_t socket_cleanup(void *sock) { - struct socket_t *thesocket = sock; + struct ap_socket_t *thesocket = sock; if (soclose(thesocket->socketdes) == 0) { thesocket->socketdes = -1; return APR_SUCCESS; @@ -78,9 +78,9 @@ ap_status_t socket_cleanup(void *sock) } } -ap_status_t ap_create_tcp_socket(struct socket_t **new, ap_context_t *cont) +ap_status_t ap_create_tcp_socket(struct ap_socket_t **new, ap_context_t *cont) { - (*new) = (struct socket_t *)ap_palloc(cont, sizeof(struct socket_t)); + (*new) = (struct ap_socket_t *)ap_palloc(cont, sizeof(struct ap_socket_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -112,7 +112,7 @@ ap_status_t ap_create_tcp_socket(struct socket_t **new, ap_context_t *cont) return APR_SUCCESS; } -ap_status_t ap_shutdown(struct socket_t *thesocket, ap_shutdown_how_e how) +ap_status_t ap_shutdown(struct ap_socket_t *thesocket, ap_shutdown_how_e how) { if (shutdown(thesocket->socketdes, how) == 0) { return APR_SUCCESS; @@ -122,7 +122,7 @@ ap_status_t ap_shutdown(struct socket_t *thesocket, ap_shutdown_how_e how) } } -ap_status_t ap_close_socket(struct socket_t *thesocket) +ap_status_t ap_close_socket(struct ap_socket_t *thesocket) { ap_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); @@ -131,7 +131,7 @@ ap_status_t ap_close_socket(struct socket_t *thesocket) -ap_status_t ap_bind(struct socket_t *sock) +ap_status_t ap_bind(struct ap_socket_t *sock) { if (bind(sock->socketdes, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) return os2errno(sock_errno()); @@ -139,7 +139,7 @@ ap_status_t ap_bind(struct socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_listen(struct socket_t *sock, ap_int32_t backlog) +ap_status_t ap_listen(struct ap_socket_t *sock, ap_int32_t backlog) { if (listen(sock->socketdes, backlog) == -1) return os2errno(sock_errno()); @@ -147,10 +147,10 @@ ap_status_t ap_listen(struct socket_t *sock, ap_int32_t backlog) return APR_SUCCESS; } -ap_status_t ap_accept(struct socket_t **new, const struct socket_t *sock, struct context_t *connection_context) +ap_status_t ap_accept(struct ap_socket_t **new, const struct ap_socket_t *sock, struct ap_context_t *connection_context) { - (*new) = (struct socket_t *)ap_palloc(connection_context, - sizeof(struct socket_t)); + (*new) = (struct ap_socket_t *)ap_palloc(connection_context, + sizeof(struct ap_socket_t)); (*new)->cntxt = connection_context; (*new)->remote_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, @@ -170,7 +170,7 @@ ap_status_t ap_accept(struct socket_t **new, const struct socket_t *sock, struct return APR_SUCCESS; } -ap_status_t ap_connect(struct socket_t *sock, char *hostname) +ap_status_t ap_connect(struct ap_socket_t *sock, char *hostname) { struct hostent *hp; @@ -204,7 +204,7 @@ ap_status_t ap_connect(struct socket_t *sock, char *hostname) -ap_status_t ap_get_socketdata(void **data, char *key, struct socket_t *socket) +ap_status_t ap_get_socketdata(void **data, char *key, struct ap_socket_t *socket) { if (socket != NULL) { return ap_get_userdata(data, key, socket->cntxt); @@ -217,7 +217,7 @@ ap_status_t ap_get_socketdata(void **data, char *key, struct socket_t *socket) -ap_status_t ap_set_socketdata(struct socket_t *socket, void *data, char *key, +ap_status_t ap_set_socketdata(struct ap_socket_t *socket, void *data, char *key, ap_status_t (*cleanup) (void *)) { if (socket != NULL) { @@ -229,7 +229,7 @@ ap_status_t ap_set_socketdata(struct socket_t *socket, void *data, char *key, } } -ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, struct socket_t *sock) +ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, struct ap_socket_t *sock) { if (sock == NULL) { return APR_ENOSOCKET; @@ -240,13 +240,13 @@ ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, struct socket_t *sock) -ap_status_t ap_put_os_sock(struct socket_t **sock, ap_os_sock_t *thesock, ap_context_t *cont) +ap_status_t ap_put_os_sock(struct ap_socket_t **sock, ap_os_sock_t *thesock, ap_context_t *cont) { if (cont == NULL) { return APR_ENOCONT; } if ((*sock) == NULL) { - (*sock) = (struct socket_t *)ap_palloc(cont, sizeof(struct socket_t)); + (*sock) = (struct ap_socket_t *)ap_palloc(cont, sizeof(struct ap_socket_t)); (*sock)->cntxt = cont; } (*sock)->socketdes = *thesock; diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index b09201036..387e422ba 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -66,7 +66,7 @@ #include <sys/so_ioctl.h> -ap_status_t ap_setsocketopt(struct socket_t *sock, ap_int32_t opt, ap_int32_t on) +ap_status_t ap_setsocketopt(struct ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) { int one; struct linger li; @@ -128,7 +128,7 @@ ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_context_t *cont) -ap_status_t ap_get_remote_hostname(char **name, struct socket_t *sock) +ap_status_t ap_get_remote_hostname(char **name, struct ap_socket_t *sock) { struct hostent *hptr; diff --git a/network_io/unix/networkio.h b/network_io/unix/networkio.h index d919ba9b1..98fbda7e9 100644 --- a/network_io/unix/networkio.h +++ b/network_io/unix/networkio.h @@ -105,7 +105,7 @@ #endif /* End System Headers */ -struct socket_t { +struct ap_socket_t { ap_context_t *cntxt; int socketdes; struct sockaddr_in *local_addr; @@ -117,7 +117,7 @@ struct socket_t { #endif }; -struct pollfd_t { +struct ap_pollfd_t { ap_context_t *cntxt; #ifdef HAVE_POLL int *sock; diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index 9f38b450f..ad9f55ece 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -64,10 +64,10 @@ * arg 2) The number of socket descriptors to be polled. * arg 3) The context to operate on. */ -ap_status_t ap_setup_poll(struct pollfd_t **new, ap_int32_t num, ap_context_t *cont) +ap_status_t ap_setup_poll(struct ap_pollfd_t **new, ap_int32_t num, ap_context_t *cont) { - (*new) = (struct pollfd_t *)ap_palloc(cont, sizeof(struct pollfd_t)); - (*new)->sock = ap_palloc(cont, sizeof(struct socket_t) * num); + (*new) = (struct ap_pollfd_t *)ap_palloc(cont, sizeof(struct ap_pollfd_t)); + (*new)->sock = ap_palloc(cont, sizeof(struct ap_socket_t) * num); (*new)->events = ap_palloc(cont, sizeof(ap_int16_t) * num); (*new)->revents = ap_palloc(cont, sizeof(ap_int16_t) * num); @@ -130,8 +130,8 @@ ap_int16_t get_revent(ap_int16_t event) * APR_POLLPRI -- signal if prioirty data is availble to be read * APR_POLLOUT -- signal if write will not block */ -ap_status_t ap_add_poll_socket(struct pollfd_t *aprset, - struct socket_t *sock, ap_int16_t event) +ap_status_t ap_add_poll_socket(struct ap_pollfd_t *aprset, + struct ap_socket_t *sock, ap_int16_t event) { int i = 0; @@ -160,7 +160,7 @@ ap_status_t ap_add_poll_socket(struct pollfd_t *aprset, * time. A negative number means wait until a socket is signalled. * NOTE: The number of sockets signalled is returned in the second argument. */ -ap_status_t ap_poll(struct pollfd_t *aprset, ap_int32_t *nsds, ap_int32_t timeout) +ap_status_t ap_poll(struct ap_pollfd_t *aprset, ap_int32_t *nsds, ap_int32_t timeout) { int i; struct pollfd *pollset; @@ -206,7 +206,7 @@ ap_status_t ap_poll(struct pollfd_t *aprset, ap_int32_t *nsds, ap_int32_t timeou * arg 2) The socket we wish to get information about. * arg 3) The poll structure we will be using. */ -ap_status_t ap_get_revents(ap_int16_t *event, struct socket_t *sock, struct pollfd_t *aprset) +ap_status_t ap_get_revents(ap_int16_t *event, struct ap_socket_t *sock, struct ap_pollfd_t *aprset) { int i = 0; @@ -231,8 +231,8 @@ ap_status_t ap_get_revents(ap_int16_t *event, struct socket_t *sock, struct poll * APR_POLLPRI -- signal if prioirty data is availble to be read * APR_POLLOUT -- signal if write will not block */ -ap_status_t ap_remove_poll_socket(struct pollfd_t *aprset, - struct socket_t *sock, ap_int16_t events) +ap_status_t ap_remove_poll_socket(struct ap_pollfd_t *aprset, + struct ap_socket_t *sock, ap_int16_t events) { ap_int16_t newevents; int i = 0; @@ -260,7 +260,7 @@ ap_status_t ap_remove_poll_socket(struct pollfd_t *aprset, * APR_POLLPRI -- signal if prioirty data is availble to be read * APR_POLLOUT -- signal if write will not block */ -ap_status_t ap_clear_poll_sockets(struct pollfd_t *aprset, ap_int16_t events) +ap_status_t ap_clear_poll_sockets(struct ap_pollfd_t *aprset, ap_int16_t events) { int i = 0; ap_int16_t newevents; @@ -278,9 +278,9 @@ ap_status_t ap_clear_poll_sockets(struct pollfd_t *aprset, ap_int16_t events) #else /* Use select to mimic poll */ -ap_status_t ap_setup_poll(struct pollfd_t **new, ap_int32_t num, ap_context_t *cont) +ap_status_t ap_setup_poll(struct ap_pollfd_t **new, ap_int32_t num, ap_context_t *cont) { - (*new) = (struct pollfd_t *)ap_palloc(cont, sizeof(struct pollfd_t) * num); + (*new) = (struct ap_pollfd_t *)ap_palloc(cont, sizeof(struct ap_pollfd_t) * num); if ((*new) == NULL) { return APR_ENOMEM; } @@ -295,8 +295,8 @@ ap_status_t ap_setup_poll(struct pollfd_t **new, ap_int32_t num, ap_context_t *c return APR_SUCCESS; } -ap_status_t ap_add_poll_socket(struct pollfd_t *aprset, - struct socket_t *sock, ap_int16_t event) +ap_status_t ap_add_poll_socket(struct ap_pollfd_t *aprset, + struct ap_socket_t *sock, ap_int16_t event) { if (event & APR_POLLIN) { FD_SET(sock->socketdes, aprset->read); @@ -313,7 +313,7 @@ ap_status_t ap_add_poll_socket(struct pollfd_t *aprset, return APR_SUCCESS; } -ap_status_t ap_poll(struct pollfd_t *aprset, ap_int32_t *nsds, ap_int32_t timeout) +ap_status_t ap_poll(struct ap_pollfd_t *aprset, ap_int32_t *nsds, ap_int32_t timeout) { int rv; struct timeval *thetime; @@ -341,7 +341,7 @@ ap_status_t ap_poll(struct pollfd_t *aprset, ap_int32_t *nsds, ap_int32_t timeou return APR_SUCCESS; } -ap_status_t ap_get_revents(ap_int16_t *event, struct socket_t *sock, struct pollfd_t *aprset) +ap_status_t ap_get_revents(ap_int16_t *event, struct ap_socket_t *sock, struct ap_pollfd_t *aprset) { ap_int16_t revents = 0; char data[1]; @@ -388,8 +388,8 @@ ap_status_t ap_get_revents(ap_int16_t *event, struct socket_t *sock, struct poll return APR_SUCCESS; } -ap_status_t ap_remove_poll_socket(struct pollfd_t *aprset, - struct socket_t *sock, ap_int16_t events) +ap_status_t ap_remove_poll_socket(struct ap_pollfd_t *aprset, + struct ap_socket_t *sock, ap_int16_t events) { if (events & APR_POLLIN) { FD_CLR(sock->socketdes, aprset->read); @@ -403,7 +403,7 @@ ap_status_t ap_remove_poll_socket(struct pollfd_t *aprset, return APR_SUCCESS; } -ap_status_t ap_clear_poll_sockets(struct pollfd_t *aprset, ap_int16_t event) +ap_status_t ap_clear_poll_sockets(struct ap_pollfd_t *aprset, ap_int16_t event) { if (event & APR_POLLIN) { FD_ZERO(aprset->read); @@ -427,7 +427,7 @@ ap_status_t ap_clear_poll_sockets(struct pollfd_t *aprset, ap_int16_t event) * arg 2) The key to use for retreiving data associated with a poll struct. * arg 3) The user data associated with the pollfd. */ -ap_status_t ap_get_polldata(struct pollfd_t *pollfd, char *key, void *data) +ap_status_t ap_get_polldata(struct ap_pollfd_t *pollfd, char *key, void *data) { if (pollfd != NULL) { return ap_get_userdata(data, key, pollfd->cntxt); @@ -446,7 +446,7 @@ ap_status_t ap_get_polldata(struct pollfd_t *pollfd, char *key, void *data) * arg 2) The user data to associate with the pollfd. */ -ap_status_t ap_set_polldata(struct pollfd_t *pollfd, void *data, char *key, +ap_status_t ap_set_polldata(struct ap_pollfd_t *pollfd, void *data, char *key, ap_status_t (*cleanup) (void *)) { if (pollfd != NULL) { diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index a6d0c41e1..e15880486 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -67,7 +67,7 @@ #endif /* HAVE_SENDFILE */ -static ap_status_t wait_for_io_or_timeout(struct socket_t *sock, int for_read) +static ap_status_t wait_for_io_or_timeout(struct ap_socket_t *sock, int for_read) { struct timeval tv; fd_set fdset; @@ -104,7 +104,7 @@ static ap_status_t wait_for_io_or_timeout(struct socket_t *sock, int for_read) * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. * The number of bytes actually sent is stored in argument 3. */ -ap_status_t ap_send(struct socket_t *sock, const char *buf, ap_ssize_t *len) +ap_status_t ap_send(struct ap_socket_t *sock, const char *buf, ap_ssize_t *len) { ssize_t rv; @@ -142,7 +142,7 @@ ap_status_t ap_send(struct socket_t *sock, const char *buf, ap_ssize_t *len) * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. * The number of bytes actually sent is stored in argument 3. */ -ap_status_t ap_recv(struct socket_t *sock, char *buf, ap_ssize_t *len) +ap_status_t ap_recv(struct ap_socket_t *sock, char *buf, ap_ssize_t *len) { ssize_t rv; @@ -182,7 +182,7 @@ ap_status_t ap_recv(struct socket_t *sock, char *buf, ap_ssize_t *len) * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. * The number of bytes actually sent is stored in argument 3. */ -ap_status_t ap_sendv(struct socket_t * sock, const struct iovec *vec, +ap_status_t ap_sendv(struct ap_socket_t * sock, const struct iovec *vec, ap_int32_t nvec, ap_int32_t *len) { ssize_t rv; diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index d8bafd5eb..ee187b799 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -63,7 +63,7 @@ * that this socket is going to use this port if possible. If * the port is already used, we won't find out about it here. */ -ap_status_t ap_set_local_port(struct socket_t *sock, ap_uint32_t port) +ap_status_t ap_set_local_port(struct ap_socket_t *sock, ap_uint32_t port) { sock->local_addr->sin_port = htons((short)port); return APR_SUCCESS; @@ -79,7 +79,7 @@ ap_status_t ap_set_local_port(struct socket_t *sock, ap_uint32_t port) * NOTE: This does not make a connection to the remote port, it is just * telling apr which port ap_connect() should attempt to connect to. */ -ap_status_t ap_set_remote_port(struct socket_t *sock, ap_uint32_t port) +ap_status_t ap_set_remote_port(struct ap_socket_t *sock, ap_uint32_t port) { sock->remote_addr->sin_port = htons((short)port); return APR_SUCCESS; @@ -93,7 +93,7 @@ ap_status_t ap_set_remote_port(struct socket_t *sock, ap_uint32_t port) * arg 1) The local port this socket is associated with. * arg 2) The socket to enquire about. */ -ap_status_t ap_get_local_port(ap_uint32_t *port, struct socket_t *sock) +ap_status_t ap_get_local_port(ap_uint32_t *port, struct ap_socket_t *sock) { *port = ntohs(sock->local_addr->sin_port); return APR_SUCCESS; @@ -107,7 +107,7 @@ ap_status_t ap_get_local_port(ap_uint32_t *port, struct socket_t *sock) * arg 1) The remote port this socket is associated with. * arg 2) The socket to enquire about. */ -ap_status_t ap_get_remote_port(ap_uint32_t *port, struct socket_t *sock) +ap_status_t ap_get_remote_port(ap_uint32_t *port, struct ap_socket_t *sock) { *port = ntohs(sock->remote_addr->sin_port); return APR_SUCCESS; @@ -124,7 +124,7 @@ ap_status_t ap_get_remote_port(ap_uint32_t *port, struct socket_t *sock) * NOTE: This does not bind the two together, it is just telling apr * that this socket is going to use this address if possible. */ -ap_status_t ap_set_local_ipaddr(struct socket_t *sock, const char *addr) +ap_status_t ap_set_local_ipaddr(struct ap_socket_t *sock, const char *addr) { u_long ipaddr; @@ -153,7 +153,7 @@ ap_status_t ap_set_local_ipaddr(struct socket_t *sock, const char *addr) * NOTE: This does not make a connection to the remote address, it is just * telling apr which address ap_connect() should attempt to connect to. */ -ap_status_t ap_set_remote_ipaddr(struct socket_t *sock, const char *addr) +ap_status_t ap_set_remote_ipaddr(struct ap_socket_t *sock, const char *addr) { u_long ipaddr; @@ -180,7 +180,7 @@ ap_status_t ap_set_remote_ipaddr(struct socket_t *sock, const char *addr) * arg 1) The local IP address associated with the socket. * arg 2) The socket to use */ -ap_status_t ap_get_local_ipaddr(char **addr, const struct socket_t *sock) +ap_status_t ap_get_local_ipaddr(char **addr, const struct ap_socket_t *sock) { *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); return APR_SUCCESS; @@ -194,7 +194,7 @@ ap_status_t ap_get_local_ipaddr(char **addr, const struct socket_t *sock) * arg 1) The remote IP address associated with the socket. * arg 2) The socket to use */ -ap_status_t ap_get_remote_ipaddr(char **addr, const struct socket_t *sock) +ap_status_t ap_get_remote_ipaddr(char **addr, const struct ap_socket_t *sock) { *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); return APR_SUCCESS; @@ -210,7 +210,7 @@ ap_status_t ap_get_remote_ipaddr(char **addr, const struct socket_t *sock) * arg 1) The local name associated with the socket. * arg 2) The socket to use */ -ap_status_t ap_get_local_name(struct sockaddr_in **name, const struct socket_t *sock) +ap_status_t ap_get_local_name(struct sockaddr_in **name, const struct ap_socket_t *sock) { *name = sock->local_addr; return APR_SUCCESS; @@ -225,7 +225,7 @@ ap_status_t ap_get_local_name(struct sockaddr_in **name, const struct socket_t * * arg 1) The remote name associated with the socket. * arg 2) The socket to use */ -ap_status_t ap_get_remote_name(struct sockaddr_in **name, const struct socket_t *sock) +ap_status_t ap_get_remote_name(struct sockaddr_in **name, const struct ap_socket_t *sock) { *name = sock->remote_addr; return APR_SUCCESS; diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 68c9a887c..36dabd712 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -57,7 +57,7 @@ static ap_status_t socket_cleanup(void *sock) { - struct socket_t *thesocket = sock; + struct ap_socket_t *thesocket = sock; if (close(thesocket->socketdes) == 0) { thesocket->socketdes = -1; return APR_SUCCESS; @@ -73,9 +73,9 @@ static ap_status_t socket_cleanup(void *sock) * arg 1) The new socket that has been setup. * arg 2) The context to use */ -ap_status_t ap_create_tcp_socket(struct socket_t **new, ap_context_t *cont) +ap_status_t ap_create_tcp_socket(struct ap_socket_t **new, ap_context_t *cont) { - (*new) = (struct socket_t *)ap_palloc(cont, sizeof(struct socket_t)); + (*new) = (struct ap_socket_t *)ap_palloc(cont, sizeof(struct ap_socket_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -117,7 +117,7 @@ ap_status_t ap_create_tcp_socket(struct socket_t **new, ap_context_t *cont) * NOTE: This does not actually close the socket descriptor, it just * controls which calls are still valid on the socket. */ -ap_status_t ap_shutdown(struct socket_t *thesocket, ap_shutdown_how_e how) +ap_status_t ap_shutdown(struct ap_socket_t *thesocket, ap_shutdown_how_e how) { if (shutdown(thesocket->socketdes, how) == 0) { return APR_SUCCESS; @@ -132,7 +132,7 @@ ap_status_t ap_shutdown(struct socket_t *thesocket, ap_shutdown_how_e how) * Close a tcp socket. * arg 1) The socket to close */ -ap_status_t ap_close_socket(struct socket_t *thesocket) +ap_status_t ap_close_socket(struct ap_socket_t *thesocket) { ap_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); @@ -145,7 +145,7 @@ ap_status_t ap_close_socket(struct socket_t *thesocket) * NOTE: This is where we will find out if there is any other process * using the selected port. */ -ap_status_t ap_bind(struct socket_t *sock) +ap_status_t ap_bind(struct ap_socket_t *sock) { if (bind(sock->socketdes, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) return errno; @@ -161,7 +161,7 @@ ap_status_t ap_bind(struct socket_t *sock) * listen queue. If this value is less than zero, the listen * queue size is set to zero. */ -ap_status_t ap_listen(struct socket_t *sock, ap_int32_t backlog) +ap_status_t ap_listen(struct ap_socket_t *sock, ap_int32_t backlog) { if (listen(sock->socketdes, backlog) == -1) return errno; @@ -179,10 +179,10 @@ ap_status_t ap_listen(struct socket_t *sock, ap_int32_t backlog) * arg 2) The socket we are listening on. * arg 3) The context for the new socket. */ -ap_status_t ap_accept(struct socket_t **new, const struct socket_t *sock, struct context_t *connection_context) +ap_status_t ap_accept(struct ap_socket_t **new, const struct ap_socket_t *sock, struct ap_context_t *connection_context) { - (*new) = (struct socket_t *)ap_palloc(connection_context, - sizeof(struct socket_t)); + (*new) = (struct ap_socket_t *)ap_palloc(connection_context, + sizeof(struct ap_socket_t)); (*new)->cntxt = connection_context; (*new)->local_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, @@ -220,7 +220,7 @@ ap_status_t ap_accept(struct socket_t **new, const struct socket_t *sock, struct * APR assumes that the sockaddr_in in the apr_socket is completely * filled out. */ -ap_status_t ap_connect(struct socket_t *sock, char *hostname) +ap_status_t ap_connect(struct ap_socket_t *sock, char *hostname) { struct hostent *hp; @@ -259,7 +259,7 @@ ap_status_t ap_connect(struct socket_t *sock, char *hostname) * arg 1) The currently open socket. * arg 2) The user data associated with the socket. */ -ap_status_t ap_get_socketdata(void **data, char *key, struct socket_t *sock) +ap_status_t ap_get_socketdata(void **data, char *key, struct ap_socket_t *sock) { if (sock != NULL) { return ap_get_userdata(data, key, sock->cntxt); @@ -279,7 +279,7 @@ ap_status_t ap_get_socketdata(void **data, char *key, struct socket_t *sock) * arg 3) The key to associate with the data. * arg 4) The cleanup to call when the socket is destroyed. */ -ap_status_t ap_set_socketdata(struct socket_t *sock, void *data, char *key, +ap_status_t ap_set_socketdata(struct ap_socket_t *sock, void *data, char *key, ap_status_t (*cleanup) (void *)) { if (sock != NULL) { @@ -297,7 +297,7 @@ ap_status_t ap_set_socketdata(struct socket_t *sock, void *data, char *key, * arg 1) The socket to convert. * arg 2) The os specifc equivelant of the apr socket.. */ -ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, struct socket_t *sock) +ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, struct ap_socket_t *sock) { if (sock == NULL) { return APR_ENOSOCKET; @@ -314,14 +314,14 @@ ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, struct socket_t *sock) * arg 2) The socket to convert to. * arg 3) The socket we are converting to an apr type. */ -ap_status_t ap_put_os_sock(struct socket_t **sock, ap_os_sock_t *thesock, +ap_status_t ap_put_os_sock(struct ap_socket_t **sock, ap_os_sock_t *thesock, ap_context_t *cont) { if (cont == NULL) { return APR_ENOCONT; } if ((*sock) == NULL) { - (*sock) = (struct socket_t *)ap_palloc(cont, sizeof(struct socket_t)); + (*sock) = (struct ap_socket_t *)ap_palloc(cont, sizeof(struct ap_socket_t)); (*sock)->cntxt = cont; (*sock)->local_addr = (struct sockaddr_in *)ap_palloc((*sock)->cntxt, sizeof(struct sockaddr_in)); diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 9c53d9727..5e09f1c2c 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -114,7 +114,7 @@ static ap_status_t sononblock(int sd) * APR_SO_SNDBUF -- Set the SendBufferSize * arg 3) Are we turning the option on or off. */ -ap_status_t ap_setsocketopt(struct socket_t *sock, ap_int32_t opt, ap_int32_t on) +ap_status_t ap_setsocketopt(struct ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) { int one; struct linger li; @@ -193,7 +193,7 @@ ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_context_t *cont) * arg 1) A buffer to store the hostname in. * arg 2) The socket to examine. */ -ap_status_t ap_get_remote_hostname(char **name, struct socket_t *sock) +ap_status_t ap_get_remote_hostname(char **name, struct ap_socket_t *sock) { struct hostent *hptr; diff --git a/network_io/win32/networkio.h b/network_io/win32/networkio.h index 9b934e8aa..a008062ea 100644 --- a/network_io/win32/networkio.h +++ b/network_io/win32/networkio.h @@ -58,7 +58,7 @@ #include "apr_network_io.h" #include "apr_general.h" -struct socket_t { +struct ap_socket_t { ap_context_t *cntxt; SOCKET sock; struct sockaddr_in *local_addr; @@ -67,7 +67,7 @@ struct socket_t { int timeout; }; -struct pollfd_t { +struct ap_pollfd_t { ap_context_t *cntxt; fd_set *read; int numread; diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index 94ff4fa0b..90781c92d 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -61,9 +61,9 @@ #include <time.h> -ap_status_t ap_setup_poll(struct pollfd_t **new, ap_int32_t num, ap_context_t *cont) +ap_status_t ap_setup_poll(struct ap_pollfd_t **new, ap_int32_t num, ap_context_t *cont) { - (*new) = (struct pollfd_t *)ap_palloc(cont, sizeof(struct pollfd_t) * num); + (*new) = (struct ap_pollfd_t *)ap_palloc(cont, sizeof(struct ap_pollfd_t) * num); if ((*new) == NULL) { return APR_ENOMEM; } @@ -80,8 +80,8 @@ ap_status_t ap_setup_poll(struct pollfd_t **new, ap_int32_t num, ap_context_t *c return APR_SUCCESS; } -ap_status_t ap_add_poll_socket(struct pollfd_t *aprset, - struct socket_t *sock, ap_int16_t event) +ap_status_t ap_add_poll_socket(struct ap_pollfd_t *aprset, + struct ap_socket_t *sock, ap_int16_t event) { if (event & APR_POLLIN) { FD_SET(sock->sock, aprset->read); @@ -98,7 +98,7 @@ ap_status_t ap_add_poll_socket(struct pollfd_t *aprset, return APR_SUCCESS; } -ap_status_t ap_poll(struct pollfd_t *aprset, ap_int32_t *nsds, ap_int32_t timeout) +ap_status_t ap_poll(struct ap_pollfd_t *aprset, ap_int32_t *nsds, ap_int32_t timeout) { int rv; struct timeval *thetime; @@ -142,7 +142,7 @@ ap_status_t ap_poll(struct pollfd_t *aprset, ap_int32_t *nsds, ap_int32_t timeou return APR_SUCCESS; } -ap_status_t ap_get_revents(ap_int16_t *event, struct socket_t *sock, struct pollfd_t *aprset) +ap_status_t ap_get_revents(ap_int16_t *event, struct ap_socket_t *sock, struct ap_pollfd_t *aprset) { ap_int16_t revents = 0; WSABUF data; @@ -195,7 +195,7 @@ ap_status_t ap_get_revents(ap_int16_t *event, struct socket_t *sock, struct poll return APR_SUCCESS; } -ap_status_t ap_get_polldata(struct pollfd_t *pollfd, char *key, void *data) +ap_status_t ap_get_polldata(struct ap_pollfd_t *pollfd, char *key, void *data) { if (pollfd != NULL) { return ap_get_userdata(data, key, pollfd->cntxt); @@ -206,7 +206,7 @@ ap_status_t ap_get_polldata(struct pollfd_t *pollfd, char *key, void *data) } } -ap_status_t ap_set_polldata(struct pollfd_t *pollfd, void *data, char *key, +ap_status_t ap_set_polldata(struct ap_pollfd_t *pollfd, void *data, char *key, ap_status_t (*cleanup) (void *)) { if (pollfd != NULL) { @@ -218,8 +218,8 @@ ap_status_t ap_set_polldata(struct pollfd_t *pollfd, void *data, char *key, } } -ap_status_t ap_remove_poll_socket(struct pollfd_t *aprset, - struct socket_t *sock, ap_int16_t events) +ap_status_t ap_remove_poll_socket(struct ap_pollfd_t *aprset, + struct ap_socket_t *sock, ap_int16_t events) { if (events & APR_POLLIN) { FD_CLR(sock->sock, aprset->read); @@ -236,7 +236,7 @@ ap_status_t ap_remove_poll_socket(struct pollfd_t *aprset, return APR_SUCCESS; } -ap_status_t ap_clear_poll_sockets(struct pollfd_t *aprset, ap_int16_t events) +ap_status_t ap_clear_poll_sockets(struct ap_pollfd_t *aprset, ap_int16_t events) { if (events & APR_POLLIN) { FD_ZERO(aprset->read); diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 038bc2707..d00df8a34 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -60,7 +60,7 @@ #include "fileio.h" #include <time.h> -ap_status_t ap_send(struct socket_t *sock, const char *buf, ap_ssize_t *len) +ap_status_t ap_send(struct ap_socket_t *sock, const char *buf, ap_ssize_t *len) { ap_ssize_t rv; WSABUF wsaData; @@ -81,7 +81,7 @@ ap_status_t ap_send(struct socket_t *sock, const char *buf, ap_ssize_t *len) return APR_SUCCESS; } -ap_status_t ap_recv(struct socket_t *sock, char *buf, ap_ssize_t *len) +ap_status_t ap_recv(struct ap_socket_t *sock, char *buf, ap_ssize_t *len) { ap_ssize_t rv; WSABUF wsaData; @@ -102,7 +102,7 @@ ap_status_t ap_recv(struct socket_t *sock, char *buf, ap_ssize_t *len) return APR_SUCCESS; } -ap_status_t ap_sendv(struct socket_t *sock, const struct iovec *vec, +ap_status_t ap_sendv(struct ap_socket_t *sock, const struct iovec *vec, ap_int32_t nvec, ap_int32_t *nbytes) { ap_ssize_t rv; diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index d2c12d54b..1f6e38f54 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -68,7 +68,7 @@ * that this socket is going to use this port if possible. If * the port is already used, we won't find out about it here. */ -ap_status_t ap_set_local_port(struct socket_t *sock, ap_uint32_t port) +ap_status_t ap_set_local_port(struct ap_socket_t *sock, ap_uint32_t port) { sock->local_addr->sin_port = htons((short)port); return APR_SUCCESS; @@ -84,7 +84,7 @@ ap_status_t ap_set_local_port(struct socket_t *sock, ap_uint32_t port) * NOTE: This does not make a connection to the remote port, it is just * telling apr which port ap_connect() should attempt to connect to. */ -ap_status_t ap_set_remote_port(struct socket_t *sock, ap_uint32_t port) +ap_status_t ap_set_remote_port(struct ap_socket_t *sock, ap_uint32_t port) { sock->remote_addr->sin_port = htons((short)port); return APR_SUCCESS; @@ -98,7 +98,7 @@ ap_status_t ap_set_remote_port(struct socket_t *sock, ap_uint32_t port) * arg 1) The local port this socket is associated with. * arg 2) The socket to enquire about. */ -ap_status_t ap_get_local_port(ap_uint32_t *port, struct socket_t *sock) +ap_status_t ap_get_local_port(ap_uint32_t *port, struct ap_socket_t *sock) { *port = ntohs(sock->local_addr->sin_port); return APR_SUCCESS; @@ -112,7 +112,7 @@ ap_status_t ap_get_local_port(ap_uint32_t *port, struct socket_t *sock) * arg 1) The remote port this socket is associated with. * arg 2) The socket to enquire about. */ -ap_status_t ap_get_remote_port(ap_uint32_t *port, struct socket_t *sock) +ap_status_t ap_get_remote_port(ap_uint32_t *port, struct ap_socket_t *sock) { *port = ntohs(sock->remote_addr->sin_port); return APR_SUCCESS; @@ -129,7 +129,7 @@ ap_status_t ap_get_remote_port(ap_uint32_t *port, struct socket_t *sock) * NOTE: This does not bind the two together, it is just telling apr * that this socket is going to use this address if possible. */ -ap_status_t ap_set_local_ipaddr(struct socket_t *sock, const char *addr) +ap_status_t ap_set_local_ipaddr(struct ap_socket_t *sock, const char *addr) { u_long ipaddr; @@ -156,7 +156,7 @@ ap_status_t ap_set_local_ipaddr(struct socket_t *sock, const char *addr) * NOTE: This does not make a connection to the remote address, it is just * telling apr which address ap_connect() should attempt to connect to. */ -ap_status_t ap_set_remote_ipaddr(struct socket_t *sock, const char *addr) +ap_status_t ap_set_remote_ipaddr(struct ap_socket_t *sock, const char *addr) { u_long ipaddr; @@ -181,7 +181,7 @@ ap_status_t ap_set_remote_ipaddr(struct socket_t *sock, const char *addr) * arg 1) The local IP address associated with the socket. * arg 2) The socket to use */ -ap_status_t ap_get_local_ipaddr(char **addr, const struct socket_t *sock) +ap_status_t ap_get_local_ipaddr(char **addr, const struct ap_socket_t *sock) { *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); return APR_SUCCESS; @@ -195,7 +195,7 @@ ap_status_t ap_get_local_ipaddr(char **addr, const struct socket_t *sock) * arg 1) The remote IP address associated with the socket. * arg 2) The socket to use */ -ap_status_t ap_get_remote_ipaddr(char **addr, const struct socket_t *sock) +ap_status_t ap_get_remote_ipaddr(char **addr, const struct ap_socket_t *sock) { *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); return APR_SUCCESS; @@ -208,7 +208,7 @@ ap_status_t ap_get_remote_ipaddr(char **addr, const struct socket_t *sock) * arg 1) The local name associated with the socket. * arg 2) The socket to use */ -ap_status_t ap_get_local_name(struct sockaddr_in **name, const struct socket_t *sock) +ap_status_t ap_get_local_name(struct sockaddr_in **name, const struct ap_socket_t *sock) { *name = sock->local_addr; return APR_SUCCESS; @@ -222,7 +222,7 @@ ap_status_t ap_get_local_name(struct sockaddr_in **name, const struct socket_t * * arg 1) The remote name associated with the socket. * arg 2) The socket to use */ -ap_status_t ap_get_remote_name(struct sockaddr_in **name, const struct socket_t *sock) +ap_status_t ap_get_remote_name(struct sockaddr_in **name, const struct ap_socket_t *sock) { *name = sock->remote_addr; return APR_SUCCESS; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 3d42a8ca6..a4e80588b 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -64,7 +64,7 @@ static ap_status_t socket_cleanup(void *sock) { - struct socket_t *thesocket = sock; + struct ap_socket_t *thesocket = sock; if (closesocket(thesocket->sock) != SOCKET_ERROR) { thesocket->sock = INVALID_SOCKET; return APR_SUCCESS; @@ -74,9 +74,9 @@ static ap_status_t socket_cleanup(void *sock) } } -ap_status_t ap_create_tcp_socket(struct socket_t **new, ap_context_t *cont) +ap_status_t ap_create_tcp_socket(struct ap_socket_t **new, ap_context_t *cont) { - (*new) = (struct socket_t *)ap_palloc(cont, sizeof(struct socket_t)); + (*new) = (struct ap_socket_t *)ap_palloc(cont, sizeof(struct ap_socket_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -109,7 +109,7 @@ ap_status_t ap_create_tcp_socket(struct socket_t **new, ap_context_t *cont) return APR_SUCCESS; } -ap_status_t ap_shutdown(struct socket_t *thesocket, ap_shutdown_how_e how) +ap_status_t ap_shutdown(struct ap_socket_t *thesocket, ap_shutdown_how_e how) { int winhow; @@ -135,13 +135,13 @@ ap_status_t ap_shutdown(struct socket_t *thesocket, ap_shutdown_how_e how) } } -ap_status_t ap_close_socket(struct socket_t *thesocket) +ap_status_t ap_close_socket(struct ap_socket_t *thesocket) { ap_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); } -ap_status_t ap_bind(struct socket_t *sock) +ap_status_t ap_bind(struct ap_socket_t *sock) { if (bind(sock->sock, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) { return errno; @@ -150,7 +150,7 @@ ap_status_t ap_bind(struct socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_listen(struct socket_t *sock, ap_int32_t backlog) +ap_status_t ap_listen(struct ap_socket_t *sock, ap_int32_t backlog) { if (listen(sock->sock, backlog) == SOCKET_ERROR) return APR_EEXIST; @@ -158,10 +158,10 @@ ap_status_t ap_listen(struct socket_t *sock, ap_int32_t backlog) return APR_SUCCESS; } -ap_status_t ap_accept(struct socket_t **new, const struct socket_t *sock, struct context_t *connection_context) +ap_status_t ap_accept(struct ap_socket_t **new, const struct ap_socket_t *sock, struct ap_context_t *connection_context) { - (*new) = (struct socket_t *)ap_palloc(connection_context, - sizeof(struct socket_t)); + (*new) = (struct ap_socket_t *)ap_palloc(connection_context, + sizeof(struct ap_socket_t)); (*new)->cntxt = connection_context; (*new)->local_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, @@ -184,7 +184,7 @@ ap_status_t ap_accept(struct socket_t **new, const struct socket_t *sock, struct return APR_SUCCESS; } -ap_status_t ap_connect(struct socket_t *sock, char *hostname) +ap_status_t ap_connect(struct ap_socket_t *sock, char *hostname) { struct hostent *hp; int lasterror; @@ -226,7 +226,7 @@ ap_status_t ap_connect(struct socket_t *sock, char *hostname) } } -ap_status_t ap_get_socketdata(void **data, char *key, struct socket_t *socket) +ap_status_t ap_get_socketdata(void **data, char *key, struct ap_socket_t *socket) { if (socket != NULL) { return ap_get_userdata(data, key, socket->cntxt); @@ -237,7 +237,7 @@ ap_status_t ap_get_socketdata(void **data, char *key, struct socket_t *socket) } } -ap_status_t ap_set_socketdata(struct socket_t *socket, void *data, char *key, +ap_status_t ap_set_socketdata(struct ap_socket_t *socket, void *data, char *key, ap_status_t (*cleanup) (void *)) { if (socket != NULL) { @@ -249,7 +249,7 @@ ap_status_t ap_set_socketdata(struct socket_t *socket, void *data, char *key, } } -ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, struct socket_t *sock) +ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, struct ap_socket_t *sock) { if (sock == NULL) { return APR_ENOSOCKET; @@ -258,14 +258,14 @@ ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, struct socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_put_os_sock(struct socket_t **sock, ap_os_sock_t *thesock, +ap_status_t ap_put_os_sock(struct ap_socket_t **sock, ap_os_sock_t *thesock, ap_context_t *cont) { if (cont == NULL) { return APR_ENOCONT; } if ((*sock) == NULL) { - (*sock) = (struct socket_t *)ap_palloc(cont, sizeof(struct socket_t)); + (*sock) = (struct ap_socket_t *)ap_palloc(cont, sizeof(struct ap_socket_t)); (*sock)->cntxt = cont; (*sock)->local_addr = (struct sockaddr_in *)ap_palloc((*sock)->cntxt, sizeof(struct sockaddr_in)); diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 413886516..37801b06f 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -79,7 +79,7 @@ ap_status_t sononblock(SOCKET sd) return APR_SUCCESS; } -ap_status_t ap_setsocketopt(struct socket_t *sock, ap_int32_t opt, ap_int32_t on) +ap_status_t ap_setsocketopt(struct ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) { int one; struct linger li; @@ -141,7 +141,7 @@ ap_status_t ap_gethostname(char *buf, int len, ap_context_t *cont) return APR_SUCCESS; } -ap_status_t ap_get_remote_hostname(char **name, struct socket_t *sock) +ap_status_t ap_get_remote_hostname(char **name, struct ap_socket_t *sock) { struct hostent *hptr; diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 872ffddd7..a3b8be766 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -60,10 +60,10 @@ struct send_pipe { int err; }; -ap_status_t ap_createprocattr_init(struct procattr_t **new, ap_context_t *cont) +ap_status_t ap_createprocattr_init(struct ap_procattr_t **new, ap_context_t *cont) { - (*new) = (struct procattr_t *)ap_palloc(cont, - sizeof(struct procattr_t)); + (*new) = (struct ap_procattr_t *)ap_palloc(cont, + sizeof(struct ap_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -81,7 +81,7 @@ ap_status_t ap_createprocattr_init(struct procattr_t **new, ap_context_t *cont) return APR_SUCCESS; } -ap_status_t ap_setprocattr_io(struct procattr_t *attr, ap_int32_t in, +ap_status_t ap_setprocattr_io(struct ap_procattr_t *attr, ap_int32_t in, ap_int32_t out, ap_int32_t err) { ap_status_t status; @@ -133,7 +133,7 @@ ap_status_t ap_setprocattr_io(struct procattr_t *attr, ap_int32_t in, return APR_SUCCESS; } -ap_status_t ap_setprocattr_dir(struct procattr_t *attr, +ap_status_t ap_setprocattr_dir(struct ap_procattr_t *attr, const char *dir) { char * cwd; @@ -153,24 +153,24 @@ ap_status_t ap_setprocattr_dir(struct procattr_t *attr, return APR_ENOMEM; } -ap_status_t ap_setprocattr_cmdtype(struct procattr_t *attr, +ap_status_t ap_setprocattr_cmdtype(struct ap_procattr_t *attr, ap_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -ap_status_t ap_setprocattr_detach(struct procattr_t *attr, ap_int32_t detach) +ap_status_t ap_setprocattr_detach(struct ap_procattr_t *attr, ap_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -ap_status_t ap_fork(struct proc_t **proc, ap_context_t *cont) +ap_status_t ap_fork(struct ap_proc_t **proc, ap_context_t *cont) { int pid; - (*proc) = (struct proc_t *)ap_palloc(cont, sizeof(struct proc_t)); + (*proc) = (struct ap_proc_t *)ap_palloc(cont, sizeof(struct ap_proc_t)); if ((pid = fork()) < 0) { return errno; @@ -186,9 +186,9 @@ ap_status_t ap_fork(struct proc_t **proc, ap_context_t *cont) } -ap_status_t ap_create_process(struct proc_t **new, const char *progname, +ap_status_t ap_create_process(struct ap_proc_t **new, const char *progname, char *const args[], char **env, - struct procattr_t *attr, ap_context_t *cont) + struct ap_procattr_t *attr, ap_context_t *cont) { int i=0,nargs=0; char **newargs = NULL; @@ -198,7 +198,7 @@ ap_status_t ap_create_process(struct proc_t **new, const char *progname, struct send_pipe *sp; char * dir = NULL; - (*new) = (struct proc_t *)ap_palloc(cont, sizeof(struct proc_t)); + (*new) = (struct ap_proc_t *)ap_palloc(cont, sizeof(struct ap_proc_t)); sp = (struct send_pipe *)ap_palloc(cont, sizeof(struct send_pipe)); if ((*new) == NULL){ @@ -270,25 +270,25 @@ ap_status_t ap_create_process(struct proc_t **new, const char *progname, return APR_SUCCESS; } -ap_status_t ap_get_childin(ap_file_t **new, struct proc_t *proc) +ap_status_t ap_get_childin(ap_file_t **new, struct ap_proc_t *proc) { (*new) = proc->attr->parent_in; return APR_SUCCESS; } -ap_status_t ap_get_childout(ap_file_t **new, struct proc_t *proc) +ap_status_t ap_get_childout(ap_file_t **new, struct ap_proc_t *proc) { (*new) = proc->attr->parent_out; return APR_SUCCESS; } -ap_status_t ap_get_childerr(ap_file_t **new, struct proc_t *proc) +ap_status_t ap_get_childerr(ap_file_t **new, struct ap_proc_t *proc) { (*new) = proc->attr->parent_err; return APR_SUCCESS; } -ap_status_t ap_wait_proc(struct proc_t *proc, +ap_status_t ap_wait_proc(struct ap_proc_t *proc, ap_wait_how_e wait) { status_t exitval; @@ -313,7 +313,7 @@ ap_status_t ap_wait_proc(struct proc_t *proc, return APR_CHILD_NOTDONE; } -ap_status_t ap_setprocattr_childin(struct procattr_t *attr, ap_file_t *child_in, +ap_status_t ap_setprocattr_childin(struct ap_procattr_t *attr, ap_file_t *child_in, ap_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) @@ -328,7 +328,7 @@ ap_status_t ap_setprocattr_childin(struct procattr_t *attr, ap_file_t *child_in, return APR_SUCCESS; } -ap_status_t ap_setprocattr_childout(struct procattr_t *attr, ap_file_t *child_out, +ap_status_t ap_setprocattr_childout(struct ap_procattr_t *attr, ap_file_t *child_out, ap_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) @@ -343,7 +343,7 @@ ap_status_t ap_setprocattr_childout(struct procattr_t *attr, ap_file_t *child_ou return APR_SUCCESS; } -ap_status_t ap_setprocattr_childerr(struct procattr_t *attr, ap_file_t *child_err, +ap_status_t ap_setprocattr_childerr(struct ap_procattr_t *attr, ap_file_t *child_err, ap_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) @@ -367,14 +367,14 @@ ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc) return APR_SUCCESS; } -ap_status_t ap_put_os_proc(struct proc_t **proc, ap_os_proc_t *theproc, +ap_status_t ap_put_os_proc(struct ap_proc_t **proc, ap_os_proc_t *theproc, ap_context_t *cont) { if (cont == NULL) { return APR_ENOCONT; } if ((*proc) == NULL) { - (*proc) = (struct proc_t *)ap_palloc(cont, sizeof(struct proc_t)); + (*proc) = (struct ap_proc_t *)ap_palloc(cont, sizeof(struct ap_proc_t)); (*proc)->cntxt = cont; } (*proc)->tid = *theproc; diff --git a/threadproc/beos/procsup.c b/threadproc/beos/procsup.c index ff3a60501..811e53b84 100644 --- a/threadproc/beos/procsup.c +++ b/threadproc/beos/procsup.c @@ -54,11 +54,11 @@ #include "threadproc.h" -ap_status_t ap_detach(struct proc_t **new, ap_context_t *cont) +ap_status_t ap_detach(struct ap_proc_t **new, ap_context_t *cont) { int x; - (*new) = (struct proc_t *)ap_palloc(cont, sizeof(struct proc_t)); + (*new) = (struct ap_proc_t *)ap_palloc(cont, sizeof(struct ap_proc_t)); (*new)->cntxt = cont; (*new)->attr = NULL; @@ -89,7 +89,7 @@ ap_status_t ap_detach(struct proc_t **new, ap_context_t *cont) } } -ap_status_t ap_get_procdata(char *key, void *data, struct proc_t *proc) +ap_status_t ap_get_procdata(char *key, void *data, struct ap_proc_t *proc) { if (proc != NULL) { return ap_get_userdata(data, key, proc->cntxt); @@ -102,7 +102,7 @@ ap_status_t ap_get_procdata(char *key, void *data, struct proc_t *proc) ap_status_t ap_set_procdata(void *data, char *key, ap_status_t (*cleanup) (void *), - struct proc_t *proc) + struct ap_proc_t *proc) { if (proc != NULL) { return ap_set_userdata(data, key, cleanup, proc->cntxt); diff --git a/threadproc/beos/signals.c b/threadproc/beos/signals.c index c23077e00..7a43e9d2f 100644 --- a/threadproc/beos/signals.c +++ b/threadproc/beos/signals.c @@ -54,7 +54,7 @@ #include "threadproc.h" -ap_status_t ap_kill(struct proc_t *proc, int signal) +ap_status_t ap_kill(struct ap_proc_t *proc, int signal) { /* I've changed this to use kill_thread instead of kill() as kill() tended to kill the whole server! This isn't as good as it ignores diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index e9ec347e2..1d4acefaa 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -54,12 +54,12 @@ #include "threadproc.h" -ap_status_t ap_create_threadattr(struct threadattr_t **new, ap_context_t *cont) +ap_status_t ap_create_threadattr(struct ap_threadattr_t **new, ap_context_t *cont) { ap_status_t stat; - (*new) = (struct threadattr_t *)ap_palloc(cont, - sizeof(struct threadattr_t)); + (*new) = (struct ap_threadattr_t *)ap_palloc(cont, + sizeof(struct ap_threadattr_t)); (*new)->attr = (int32)ap_palloc(cont, sizeof(int32)); @@ -73,7 +73,7 @@ ap_status_t ap_create_threadattr(struct threadattr_t **new, ap_context_t *cont) return APR_SUCCESS; } -ap_status_t ap_setthreadattr_detach(struct threadattr_t *attr, ap_int32_t on) +ap_status_t ap_setthreadattr_detach(struct ap_threadattr_t *attr, ap_int32_t on) { if (on == 1){ attr->detached = 1; @@ -83,7 +83,7 @@ ap_status_t ap_setthreadattr_detach(struct threadattr_t *attr, ap_int32_t on) return APR_SUCCESS; } -ap_status_t ap_getthreadattr_detach(struct threadattr_t *attr) +ap_status_t ap_getthreadattr_detach(struct ap_threadattr_t *attr) { if (attr->detached == 1){ return APR_DETACH; @@ -91,14 +91,14 @@ ap_status_t ap_getthreadattr_detach(struct threadattr_t *attr) return APR_NOTDETACH; } -ap_status_t ap_create_thread(struct thread_t **new, struct threadattr_t *attr, +ap_status_t ap_create_thread(struct ap_thread_t **new, struct ap_threadattr_t *attr, ap_thread_start_t func, void *data, ap_context_t *cont) { int32 temp; ap_status_t stat; - (*new) = (struct thread_t *)ap_palloc(cont, sizeof(struct thread_t)); + (*new) = (struct ap_thread_t *)ap_palloc(cont, sizeof(struct ap_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; } diff --git a/threadproc/beos/threadcancel.c b/threadproc/beos/threadcancel.c index 6462dbaf5..7cfac36b1 100644 --- a/threadproc/beos/threadcancel.c +++ b/threadproc/beos/threadcancel.c @@ -55,7 +55,7 @@ #include "threadproc.h" -ap_status_t ap_cancel_thread(struct thread_t *thd) +ap_status_t ap_cancel_thread(struct ap_thread_t *thd) { if (kill_thread(thd->td) == 0) { return APR_SUCCESS; diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c index 3602c37cf..662ae4bac 100644 --- a/threadproc/beos/threadpriv.c +++ b/threadproc/beos/threadpriv.c @@ -58,10 +58,10 @@ static struct beos_key key_table[BEOS_MAX_DATAKEYS]; static struct beos_private_data *beos_data[BEOS_MAX_DATAKEYS]; static sem_id lock; -ap_status_t ap_create_thread_private(struct threadkey_t **key, +ap_status_t ap_create_thread_private(struct ap_threadkey_t **key, void (*dest)(void *), ap_context_t *cont) { - (*key) = (struct threadkey_t *)ap_palloc(cont, sizeof(struct threadkey_t)); + (*key) = (struct ap_threadkey_t *)ap_palloc(cont, sizeof(struct ap_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; } @@ -82,7 +82,7 @@ ap_status_t ap_create_thread_private(struct threadkey_t **key, return APR_ENOMEM; } -ap_status_t ap_get_thread_private(void **new, struct threadkey_t *key) +ap_status_t ap_get_thread_private(void **new, struct ap_threadkey_t *key) { thread_id tid; int i, index=0; @@ -114,7 +114,7 @@ ap_status_t ap_get_thread_private(void **new, struct threadkey_t *key) return APR_SUCCESS; } -ap_status_t ap_set_thread_private(void *priv, struct threadkey_t *key) +ap_status_t ap_set_thread_private(void *priv, struct ap_threadkey_t *key) { thread_id tid; int i,index = 0, ret; @@ -169,7 +169,7 @@ ap_status_t ap_set_thread_private(void *priv, struct threadkey_t *key) return APR_ENOMEM; } -ap_status_t ap_delete_thread_private(struct threadkey_t *key) +ap_status_t ap_delete_thread_private(struct ap_threadkey_t *key) { if (key->key < BEOS_MAX_DATAKEYS){ acquire_sem(key_table[key->key].lock); diff --git a/threadproc/beos/threadproc.h b/threadproc/beos/threadproc.h index 73ea8ef54..70b0f2eab 100644 --- a/threadproc/beos/threadproc.h +++ b/threadproc/beos/threadproc.h @@ -77,19 +77,19 @@ #define BEOS_MAX_DATAKEYS 128 -struct thread_t { +struct ap_thread_t { ap_context_t *cntxt; thread_id td; }; -struct threadattr_t { +struct ap_threadattr_t { ap_context_t *cntxt; int32 attr; int detached; int joinable; }; -struct threadkey_t { +struct ap_threadkey_t { ap_context_t *cntxt; int32 key; }; @@ -108,7 +108,7 @@ struct beos_key { void (* destructor) (); }; -struct procattr_t { +struct ap_procattr_t { ap_context_t *cntxt; ap_file_t *parent_in; ap_file_t *child_in; @@ -121,11 +121,11 @@ struct procattr_t { ap_int32_t detached; }; -struct proc_t { +struct ap_proc_t { ap_context_t *cntxt; pid_t pid; thread_id tid; - struct procattr_t *attr; + struct ap_procattr_t *attr; }; /* we need a structure to pass off to the thread that will run any diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 8bdf43fda..38f44ff92 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -71,10 +71,10 @@ #include <stdlib.h> #include <os2.h> -ap_status_t ap_createprocattr_init(struct procattr_t **new, ap_context_t *cont) +ap_status_t ap_createprocattr_init(struct ap_procattr_t **new, ap_context_t *cont) { - (*new) = (struct procattr_t *)ap_palloc(cont, - sizeof(struct procattr_t)); + (*new) = (struct ap_procattr_t *)ap_palloc(cont, + sizeof(struct ap_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -92,7 +92,7 @@ ap_status_t ap_createprocattr_init(struct procattr_t **new, ap_context_t *cont) return APR_SUCCESS; } -ap_status_t ap_setprocattr_io(struct procattr_t *attr, ap_int32_t in, +ap_status_t ap_setprocattr_io(struct ap_procattr_t *attr, ap_int32_t in, ap_int32_t out, ap_int32_t err) { ap_status_t stat; @@ -117,7 +117,7 @@ ap_status_t ap_setprocattr_io(struct procattr_t *attr, ap_int32_t in, return APR_SUCCESS; } -ap_status_t ap_setprocattr_dir(struct procattr_t *attr, const char *dir) +ap_status_t ap_setprocattr_dir(struct ap_procattr_t *attr, const char *dir) { attr->currdir = ap_pstrdup(attr->cntxt, dir); if (attr->currdir) { @@ -126,24 +126,24 @@ ap_status_t ap_setprocattr_dir(struct procattr_t *attr, const char *dir) return APR_ENOMEM; } -ap_status_t ap_setprocattr_cmdtype(struct procattr_t *attr, +ap_status_t ap_setprocattr_cmdtype(struct ap_procattr_t *attr, ap_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -ap_status_t ap_setprocattr_detach(struct procattr_t *attr, ap_int32_t detach) +ap_status_t ap_setprocattr_detach(struct ap_procattr_t *attr, ap_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -ap_status_t ap_fork(struct proc_t **proc, ap_context_t *cont) +ap_status_t ap_fork(struct ap_proc_t **proc, ap_context_t *cont) { int pid; - (*proc) = ap_palloc(cont, sizeof(struct proc_t)); + (*proc) = ap_palloc(cont, sizeof(struct ap_proc_t)); if ((pid = fork()) < 0) { return errno; @@ -165,7 +165,7 @@ ap_status_t ap_fork(struct proc_t **proc, ap_context_t *cont) /* quotes in the string are doubled up. * Used to escape quotes in args passed to OS/2's cmd.exe */ -static char *double_quotes(struct context_t *cntxt, char *str) +static char *double_quotes(struct ap_context_t *cntxt, char *str) { int num_quotes = 0; int len = 0; @@ -190,9 +190,9 @@ static char *double_quotes(struct context_t *cntxt, char *str) -ap_status_t ap_create_process(struct proc_t **new, const char *progname, +ap_status_t ap_create_process(struct ap_proc_t **new, const char *progname, char *const args[], char **env, - struct procattr_t *attr, ap_context_t *cont) + struct ap_procattr_t *attr, ap_context_t *cont) { int i, arg, numargs, cmdlen; ap_status_t status; @@ -208,7 +208,7 @@ ap_status_t ap_create_process(struct proc_t **new, const char *progname, char *env_block, *env_block_pos; RESULTCODES rescodes; - (*new) = (struct proc_t *)ap_palloc(cont, sizeof(struct proc_t)); + (*new) = (struct ap_proc_t *)ap_palloc(cont, sizeof(struct ap_proc_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -412,25 +412,25 @@ ap_status_t ap_create_process(struct proc_t **new, const char *progname, -ap_status_t ap_get_childin(ap_file_t **new, struct proc_t *proc) +ap_status_t ap_get_childin(ap_file_t **new, struct ap_proc_t *proc) { (*new) = proc->attr->parent_in; return APR_SUCCESS; } -ap_status_t ap_get_childout(ap_file_t **new, struct proc_t *proc) +ap_status_t ap_get_childout(ap_file_t **new, struct ap_proc_t *proc) { (*new) = proc->attr->parent_out; return APR_SUCCESS; } -ap_status_t ap_get_childerr(ap_file_t **new, struct proc_t *proc) +ap_status_t ap_get_childerr(ap_file_t **new, struct ap_proc_t *proc) { (*new) = proc->attr->parent_err; return APR_SUCCESS; } -ap_status_t ap_wait_proc(struct proc_t *proc, +ap_status_t ap_wait_proc(struct ap_proc_t *proc, ap_wait_how_e wait) { RESULTCODES codes; diff --git a/threadproc/os2/signals.c b/threadproc/os2/signals.c index 1c563d644..d4db268d0 100644 --- a/threadproc/os2/signals.c +++ b/threadproc/os2/signals.c @@ -63,7 +63,7 @@ #define INCL_DOS #include <os2.h> -ap_status_t ap_kill(struct proc_t *proc, int signal) +ap_status_t ap_kill(struct ap_proc_t *proc, int signal) { /* SIGTERM's don't work too well in OS/2 (only affects other EMX programs). CGIs may not be, esp. REXX scripts, so use a native call instead */ diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 8f63e984c..108377fbf 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -61,9 +61,9 @@ #define INCL_DOS #include <os2.h> -ap_status_t ap_create_threadattr(struct threadattr_t **new, ap_context_t *cont) +ap_status_t ap_create_threadattr(struct ap_threadattr_t **new, ap_context_t *cont) { - (*new) = (struct threadattr_t *)ap_palloc(cont, sizeof(struct threadattr_t)); + (*new) = (struct ap_threadattr_t *)ap_palloc(cont, sizeof(struct ap_threadattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -76,7 +76,7 @@ ap_status_t ap_create_threadattr(struct threadattr_t **new, ap_context_t *cont) -ap_status_t ap_setthreadattr_detach(struct threadattr_t *attr, ap_int32_t on) +ap_status_t ap_setthreadattr_detach(struct ap_threadattr_t *attr, ap_int32_t on) { attr->attr |= APR_THREADATTR_DETACHED; return APR_SUCCESS; @@ -84,7 +84,7 @@ ap_status_t ap_setthreadattr_detach(struct threadattr_t *attr, ap_int32_t on) -ap_status_t ap_getthreadattr_detach(struct threadattr_t *attr) +ap_status_t ap_getthreadattr_detach(struct ap_threadattr_t *attr) { return (attr->attr & APR_THREADATTR_DETACHED) ? APR_DETACH : APR_NOTDETACH; } @@ -93,20 +93,20 @@ ap_status_t ap_getthreadattr_detach(struct threadattr_t *attr) static void ap_thread_begin(void *arg) { - struct thread_t *thread = (struct thread_t *)arg; + struct ap_thread_t *thread = (struct ap_thread_t *)arg; thread->rv = thread->func(thread->data); } -ap_status_t ap_create_thread(struct thread_t **new, struct threadattr_t *attr, +ap_status_t ap_create_thread(struct ap_thread_t **new, struct ap_threadattr_t *attr, ap_thread_start_t func, void *data, ap_context_t *cont) { ap_status_t stat; ap_thread_t *thread; - thread = (struct thread_t *)ap_palloc(cont, sizeof(struct thread_t)); + thread = (struct ap_thread_t *)ap_palloc(cont, sizeof(struct ap_thread_t)); *new = thread; if (thread == NULL) { @@ -154,7 +154,7 @@ ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) -ap_status_t ap_thread_join(ap_status_t *retval, struct thread_t *thd) +ap_status_t ap_thread_join(ap_status_t *retval, struct ap_thread_t *thd) { ULONG rc; TID waittid = thd->tid; @@ -169,7 +169,7 @@ ap_status_t ap_thread_join(ap_status_t *retval, struct thread_t *thd) -ap_status_t ap_thread_detach(struct thread_t *thd) +ap_status_t ap_thread_detach(struct ap_thread_t *thd) { thd->attr->attr |= APR_THREADATTR_DETACHED; return APR_SUCCESS; diff --git a/threadproc/os2/threadcancel.c b/threadproc/os2/threadcancel.c index f0f153af9..64bb2719d 100644 --- a/threadproc/os2/threadcancel.c +++ b/threadproc/os2/threadcancel.c @@ -57,7 +57,7 @@ #include "apr_general.h" #include "fileio.h" -ap_status_t ap_cancel_thread(struct thread_t *thd) +ap_status_t ap_cancel_thread(struct ap_thread_t *thd) { return os2errno(DosKillThread(thd->tid)); } diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c index a89e0fef0..0022ed871 100644 --- a/threadproc/os2/threadpriv.c +++ b/threadproc/os2/threadpriv.c @@ -59,10 +59,10 @@ #include "apr_lib.h" #include "fileio.h" -ap_status_t ap_create_thread_private(struct threadkey_t **key, +ap_status_t ap_create_thread_private(struct ap_threadkey_t **key, void (*dest)(void *), ap_context_t *cont) { - (*key) = (struct threadkey_t *)ap_palloc(cont, sizeof(struct threadkey_t)); + (*key) = (struct ap_threadkey_t *)ap_palloc(cont, sizeof(struct ap_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; @@ -72,19 +72,19 @@ ap_status_t ap_create_thread_private(struct threadkey_t **key, return os2errno(DosAllocThreadLocalMemory(1, &((*key)->key))); } -ap_status_t ap_get_thread_private(void **new, struct threadkey_t *key) +ap_status_t ap_get_thread_private(void **new, struct ap_threadkey_t *key) { (*new) = (void *)*(key->key); return APR_SUCCESS; } -ap_status_t ap_set_thread_private(void *priv, struct threadkey_t *key) +ap_status_t ap_set_thread_private(void *priv, struct ap_threadkey_t *key) { *(key->key) = (ULONG)priv; return APR_SUCCESS; } -ap_status_t ap_delete_thread_private(struct threadkey_t *key) +ap_status_t ap_delete_thread_private(struct ap_threadkey_t *key) { return os2errno(DosFreeThreadLocalMemory(key->key)); } diff --git a/threadproc/os2/threadproc.h b/threadproc/os2/threadproc.h index 37915daa8..a4f2e3ce4 100644 --- a/threadproc/os2/threadproc.h +++ b/threadproc/os2/threadproc.h @@ -63,26 +63,26 @@ #define SHELL_PATH "cmd.exe" #define APR_THREAD_STACKSIZE 65536 -struct threadattr_t { +struct ap_threadattr_t { ap_context_t *cntxt; unsigned long attr; }; -struct thread_t { +struct ap_thread_t { ap_context_t *cntxt; - struct threadattr_t *attr; + struct ap_threadattr_t *attr; unsigned long tid; ap_thread_start_t func; void *data; void *rv; }; -struct threadkey_t { +struct ap_threadkey_t { ap_context_t *cntxt; unsigned long *key; }; -struct procattr_t { +struct ap_procattr_t { ap_context_t *cntxt; ap_file_t *parent_in; ap_file_t *child_in; @@ -95,10 +95,10 @@ struct procattr_t { ap_int32_t detached; }; -struct proc_t { +struct ap_proc_t { ap_context_t *cntxt; pid_t pid; - struct procattr_t *attr; + struct ap_procattr_t *attr; int running; }; diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index d36fcd099..425a21953 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -61,10 +61,10 @@ * arg 1) The newly created procattr. * arg 2) The context to use */ -ap_status_t ap_createprocattr_init(struct procattr_t **new, ap_context_t *cont) +ap_status_t ap_createprocattr_init(struct ap_procattr_t **new, ap_context_t *cont) { - (*new) = (struct procattr_t *)ap_palloc(cont, - sizeof(struct procattr_t)); + (*new) = (struct ap_procattr_t *)ap_palloc(cont, + sizeof(struct ap_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -92,7 +92,7 @@ ap_status_t ap_createprocattr_init(struct procattr_t **new, ap_context_t *cont) * arg 3) Should stdout be a pipe bnack to the parent? * arg 4) Should stderr be a pipe bnack to the parent? */ -ap_status_t ap_setprocattr_io(struct procattr_t *attr, ap_int32_t in, +ap_status_t ap_setprocattr_io(struct ap_procattr_t *attr, ap_int32_t in, ap_int32_t out, ap_int32_t err) { ap_status_t status; @@ -159,7 +159,7 @@ ap_status_t ap_setprocattr_io(struct procattr_t *attr, ap_int32_t in, * arg 2) ap_file_t value to use as child_in. Must be a valid file. * arg 3) ap_file_t value to use as parent_in. Must be a valid file. */ -ap_status_t ap_setprocattr_childin(struct procattr_t *attr, ap_file_t *child_in, +ap_status_t ap_setprocattr_childin(struct ap_procattr_t *attr, ap_file_t *child_in, ap_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) @@ -188,7 +188,7 @@ ap_status_t ap_setprocattr_childin(struct procattr_t *attr, ap_file_t *child_in, * arg 2) ap_file_t value to use as child_out. Must be a valid file. * arg 3) ap_file_t value to use as parent_out. Must be a valid file. */ -ap_status_t ap_setprocattr_childout(struct procattr_t *attr, ap_file_t *child_out, +ap_status_t ap_setprocattr_childout(struct ap_procattr_t *attr, ap_file_t *child_out, ap_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) @@ -217,7 +217,7 @@ ap_status_t ap_setprocattr_childout(struct procattr_t *attr, ap_file_t *child_ou * arg 2) ap_file_t value to use as child_err. Must be a valid file. * arg 3) ap_file_t value to use as parent_err. Must be a valid file. */ -ap_status_t ap_setprocattr_childerr(struct procattr_t *attr, ap_file_t *child_err, +ap_status_t ap_setprocattr_childerr(struct ap_procattr_t *attr, ap_file_t *child_err, ap_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) @@ -241,7 +241,7 @@ ap_status_t ap_setprocattr_childerr(struct procattr_t *attr, ap_file_t *child_er * the parent currently resides in, when the createprocess call * is made. */ -ap_status_t ap_setprocattr_dir(struct procattr_t *attr, +ap_status_t ap_setprocattr_dir(struct ap_procattr_t *attr, const char *dir) { attr->currdir = ap_pstrdup(attr->cntxt, dir); @@ -259,7 +259,7 @@ ap_status_t ap_setprocattr_dir(struct procattr_t *attr, * APR_SHELLCMD -- Shell script * APR_PROGRAM -- Executable program (default) */ -ap_status_t ap_setprocattr_cmdtype(struct procattr_t *attr, +ap_status_t ap_setprocattr_cmdtype(struct ap_procattr_t *attr, ap_cmdtype_e cmd) { attr->cmdtype = cmd; @@ -272,7 +272,7 @@ ap_status_t ap_setprocattr_cmdtype(struct procattr_t *attr, * arg 1) The procattr we care about. * arg 2) Should the child start in detached state? Default is no. */ -ap_status_t ap_setprocattr_detach(struct procattr_t *attr, ap_int32_t detach) +ap_status_t ap_setprocattr_detach(struct ap_procattr_t *attr, ap_int32_t detach) { attr->detached = detach; return APR_SUCCESS; @@ -285,11 +285,11 @@ ap_status_t ap_setprocattr_detach(struct procattr_t *attr, ap_int32_t detach) * arg 1) The resulting process handle. * arg 2) The context to use. */ -ap_status_t ap_fork(struct proc_t **proc, ap_context_t *cont) +ap_status_t ap_fork(struct ap_proc_t **proc, ap_context_t *cont) { int pid; - (*proc) = ap_palloc(cont, sizeof(struct proc_t)); + (*proc) = ap_palloc(cont, sizeof(struct ap_proc_t)); if ((pid = fork()) < 0) { return errno; @@ -319,16 +319,16 @@ ap_status_t ap_fork(struct proc_t **proc, ap_context_t *cont) * process * arg 6) The context to use. */ -ap_status_t ap_create_process(struct proc_t **new, const char *progname, +ap_status_t ap_create_process(struct ap_proc_t **new, const char *progname, char *const args[], char **env, - struct procattr_t *attr, ap_context_t *cont) + struct ap_procattr_t *attr, ap_context_t *cont) { int i; typedef const char *my_stupid_string; my_stupid_string *newargs; - struct proc_t *pgrp; + struct ap_proc_t *pgrp; - (*new) = (struct proc_t *)ap_palloc(cont, sizeof(struct proc_t)); + (*new) = (struct ap_proc_t *)ap_palloc(cont, sizeof(struct ap_proc_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -417,7 +417,7 @@ ap_status_t ap_create_process(struct proc_t **new, const char *progname, * arg 1) The returned file handle. * arg 2) The process handle that corresponds to the desired child process */ -ap_status_t ap_get_childin(ap_file_t **new, struct proc_t *proc) +ap_status_t ap_get_childin(ap_file_t **new, struct ap_proc_t *proc) { (*new) = proc->attr->parent_in; return APR_SUCCESS; @@ -429,7 +429,7 @@ ap_status_t ap_get_childin(ap_file_t **new, struct proc_t *proc) * arg 1) The returned file handle. * arg 2) The process handle that corresponds to the desired child process */ -ap_status_t ap_get_childout(ap_file_t **new, struct proc_t *proc) +ap_status_t ap_get_childout(ap_file_t **new, struct ap_proc_t *proc) { (*new) = proc->attr->parent_out; return APR_SUCCESS; @@ -441,7 +441,7 @@ ap_status_t ap_get_childout(ap_file_t **new, struct proc_t *proc) * arg 1) The returned file handle. * arg 2) The process handle that corresponds to the desired child process */ -ap_status_t ap_get_childerr(ap_file_t **new, struct proc_t *proc) +ap_status_t ap_get_childerr(ap_file_t **new, struct ap_proc_t *proc) { (*new) = proc->attr->parent_err; return APR_SUCCESS; @@ -460,7 +460,7 @@ ap_status_t ap_get_childerr(ap_file_t **new, struct proc_t *proc) * APR_CHILD_DONE -- child is no longer running. * APR_CHILD_NOTDONE -- child is still running. */ -ap_status_t ap_wait_proc(struct proc_t *proc, +ap_status_t ap_wait_proc(struct ap_proc_t *proc, ap_wait_how_e waithow) { pid_t status; @@ -507,14 +507,14 @@ ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc) * arg 2) The os specific proc to convert * arg 3) The context to use if it is needed. */ -ap_status_t ap_put_os_proc(struct proc_t **proc, ap_os_proc_t *theproc, +ap_status_t ap_put_os_proc(struct ap_proc_t **proc, ap_os_proc_t *theproc, ap_context_t *cont) { if (cont == NULL) { return APR_ENOCONT; } if ((*proc) == NULL) { - (*proc) = (struct proc_t *)ap_palloc(cont, sizeof(struct proc_t)); + (*proc) = (struct ap_proc_t *)ap_palloc(cont, sizeof(struct ap_proc_t)); (*proc)->cntxt = cont; } (*proc)->pid = *theproc; diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index c7e1ccf2b..b878b622d 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -60,11 +60,11 @@ * arg 1) The new process handler * arg 2) The context to use if it is needed. */ -ap_status_t ap_detach(struct proc_t **new, ap_context_t *cont) +ap_status_t ap_detach(struct ap_proc_t **new, ap_context_t *cont) { int x; - (*new) = (struct proc_t *)ap_palloc(cont, sizeof(struct proc_t)); + (*new) = (struct ap_proc_t *)ap_palloc(cont, sizeof(struct ap_proc_t)); (*new)->cntxt = cont; (*new)->attr = NULL; @@ -131,7 +131,7 @@ ap_status_t ap_detach(struct proc_t **new, ap_context_t *cont) * arg 2) The user data associated with the proc. * arg 3) The currently open proc. */ -ap_status_t ap_get_procdata(char *key, void *data, struct proc_t *proc) +ap_status_t ap_get_procdata(char *key, void *data, struct ap_proc_t *proc) { if (proc != NULL) { return ap_get_userdata(data, key, proc->cntxt); @@ -153,7 +153,7 @@ ap_status_t ap_get_procdata(char *key, void *data, struct proc_t *proc) */ ap_status_t ap_set_procdata(void *data, char *key, ap_status_t (*cleanup) (void *), - struct proc_t *proc) + struct ap_proc_t *proc) { if (proc != NULL) { return ap_set_userdata(data, key, cleanup, proc->cntxt); diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 186353cc5..68bb18245 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -60,7 +60,7 @@ * arg 1) The process to terminate. * arg 2) How to kill the process. */ -ap_status_t ap_kill(struct proc_t *proc, int sig) +ap_status_t ap_kill(struct ap_proc_t *proc, int sig) { if (kill(proc->pid, sig) == -1) { return errno; diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index ab8d5c5ba..d90d27053 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -64,12 +64,12 @@ * arg 1) The newly created threadattr. * arg 2) The context to use */ -ap_status_t ap_create_threadattr(struct threadattr_t **new, ap_context_t *cont) +ap_status_t ap_create_threadattr(struct ap_threadattr_t **new, ap_context_t *cont) { ap_status_t stat; - (*new) = (struct threadattr_t *)ap_palloc(cont, - sizeof(struct threadattr_t)); + (*new) = (struct ap_threadattr_t *)ap_palloc(cont, + sizeof(struct ap_threadattr_t)); (*new)->attr = (pthread_attr_t *)ap_palloc(cont, sizeof(pthread_attr_t)); @@ -92,7 +92,7 @@ ap_status_t ap_create_threadattr(struct threadattr_t **new, ap_context_t *cont) * arg 1) The threadattr to affect * arg 2) Thread detach state on or off */ -ap_status_t ap_setthreadattr_detach(struct threadattr_t *attr, ap_int32_t on) +ap_status_t ap_setthreadattr_detach(struct ap_threadattr_t *attr, ap_int32_t on) { ap_status_t stat; if ((stat = pthread_attr_setdetachstate(attr->attr, on)) == 0) { @@ -108,7 +108,7 @@ ap_status_t ap_setthreadattr_detach(struct threadattr_t *attr, ap_int32_t on) * Get the detach mode for this threadattr. * arg 1) The threadattr to reference */ -ap_status_t ap_getthreadattr_detach(struct threadattr_t *attr) +ap_status_t ap_getthreadattr_detach(struct ap_threadattr_t *attr) { int state; @@ -129,14 +129,14 @@ ap_status_t ap_getthreadattr_detach(struct threadattr_t *attr) * arg 4) Any data to be passed to the starting function * arg 5) The context to use */ -ap_status_t ap_create_thread(struct thread_t **new, struct threadattr_t *attr, +ap_status_t ap_create_thread(struct ap_thread_t **new, struct ap_threadattr_t *attr, ap_thread_start_t func, void *data, ap_context_t *cont) { ap_status_t stat; pthread_attr_t *temp; - (*new) = (struct thread_t *)ap_palloc(cont, sizeof(struct thread_t)); + (*new) = (struct ap_thread_t *)ap_palloc(cont, sizeof(struct ap_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -187,7 +187,7 @@ ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) * arg 1) The return value from the dead thread. * arg 2) The thread to join */ -ap_status_t ap_thread_join(ap_status_t *retval, struct thread_t *thd) +ap_status_t ap_thread_join(ap_status_t *retval, struct ap_thread_t *thd) { ap_status_t stat; @@ -204,7 +204,7 @@ ap_status_t ap_thread_join(ap_status_t *retval, struct thread_t *thd) * detach a thread * arg 1) The thread to detach */ -ap_status_t ap_thread_detach(struct thread_t *thd) +ap_status_t ap_thread_detach(struct ap_thread_t *thd) { ap_status_t stat; @@ -223,7 +223,7 @@ ap_status_t ap_thread_detach(struct thread_t *thd) * arg 2) The key to associate with the data * arg 3) The currently open thread. */ -ap_status_t ap_get_threaddata(void **data, char *key, struct thread_t *thread) +ap_status_t ap_get_threaddata(void **data, char *key, struct ap_thread_t *thread) { if (thread != NULL) { return ap_get_userdata(data, key, thread->cntxt); @@ -246,7 +246,7 @@ ap_status_t ap_get_threaddata(void **data, char *key, struct thread_t *thread) */ ap_status_t ap_set_threaddata(void *data, char *key, ap_status_t (*cleanup) (void *), - struct thread_t *thread) + struct ap_thread_t *thread) { if (thread != NULL) { return ap_set_userdata(data, key, cleanup, thread->cntxt); @@ -263,7 +263,7 @@ ap_status_t ap_set_threaddata(void *data, char *key, * arg 1) The apr thread to convert * arg 2) The os specific thread we are converting to */ -ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, struct thread_t *thd) +ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, struct ap_thread_t *thd) { if (thd == NULL) { return APR_ENOTHREAD; @@ -280,14 +280,14 @@ ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, struct thread_t *thd) * arg 2) The os specific thread to convert * arg 3) The context to use if it is needed. */ -ap_status_t ap_put_os_thread(struct thread_t **thd, ap_os_thread_t *thethd, +ap_status_t ap_put_os_thread(struct ap_thread_t **thd, ap_os_thread_t *thethd, ap_context_t *cont) { if (cont == NULL) { return APR_ENOCONT; } if ((*thd) == NULL) { - (*thd) = (struct thread_t *)ap_palloc(cont, sizeof(struct thread_t)); + (*thd) = (struct ap_thread_t *)ap_palloc(cont, sizeof(struct ap_thread_t)); (*thd)->cntxt = cont; } (*thd)->td = thethd; diff --git a/threadproc/unix/threadcancel.c b/threadproc/unix/threadcancel.c index c7dae7b2d..d16fcac4b 100644 --- a/threadproc/unix/threadcancel.c +++ b/threadproc/unix/threadcancel.c @@ -63,7 +63,7 @@ * Asynchronously kill a thread * arg 1) The thread to kill. */ -ap_status_t ap_cancel_thread(struct thread_t *thd) +ap_status_t ap_cancel_thread(struct ap_thread_t *thd) { ap_status_t stat; if ((stat = pthread_cancel(*thd->td)) == 0) { diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 5e47837e8..c00efde61 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -67,11 +67,11 @@ * arg 2) The destructor to use when freeing the private memory. * arg 3) The context to use */ -ap_status_t ap_create_thread_private(struct threadkey_t **key, +ap_status_t ap_create_thread_private(struct ap_threadkey_t **key, void (*dest)(void *), ap_context_t *cont) { ap_status_t stat; - (*key) = (struct threadkey_t *)ap_palloc(cont, sizeof(struct threadkey_t)); + (*key) = (struct ap_threadkey_t *)ap_palloc(cont, sizeof(struct ap_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; @@ -91,7 +91,7 @@ ap_status_t ap_create_thread_private(struct threadkey_t **key, * arg 1) The data stored in private memory * arg 2) The handle for the desired thread private memory */ -ap_status_t ap_get_thread_private(void **new, struct threadkey_t *key) +ap_status_t ap_get_thread_private(void **new, struct ap_threadkey_t *key) { (*new) = pthread_getspecific(key->key); return APR_SUCCESS; @@ -103,7 +103,7 @@ ap_status_t ap_get_thread_private(void **new, struct threadkey_t *key) * arg 1) The data to be stored in private memory * arg 2) The handle for the desired thread private memory */ -ap_status_t ap_set_thread_private(void *priv, struct threadkey_t *key) +ap_status_t ap_set_thread_private(void *priv, struct ap_threadkey_t *key) { ap_status_t stat; if ((stat = pthread_setspecific(key->key, priv)) == 0) { @@ -119,7 +119,7 @@ ap_status_t ap_set_thread_private(void *priv, struct threadkey_t *key) * Free the thread private memory * arg 1) The handle for the desired thread private memory */ -ap_status_t ap_delete_thread_private(struct threadkey_t *key) +ap_status_t ap_delete_thread_private(struct ap_threadkey_t *key) { ap_status_t stat; if ((stat = pthread_key_delete(key->key)) == 0) { @@ -136,7 +136,7 @@ ap_status_t ap_delete_thread_private(struct threadkey_t *key) * arg 2) The key associated with the data * arg 3) The currently open threadkey. */ -ap_status_t ap_get_threadkeydata(void **data, char *key, struct threadkey_t *threadkey) +ap_status_t ap_get_threadkeydata(void **data, char *key, struct ap_threadkey_t *threadkey) { if (threadkey != NULL) { return ap_get_userdata(data, key, threadkey->cntxt); @@ -159,7 +159,7 @@ ap_status_t ap_get_threadkeydata(void **data, char *key, struct threadkey_t *thr */ ap_status_t ap_set_threadkeydata(void *data, char *key, ap_status_t (*cleanup) (void *), - struct threadkey_t *threadkey) + struct ap_threadkey_t *threadkey) { if (threadkey != NULL) { return ap_set_userdata(data, key, cleanup, threadkey->cntxt); @@ -177,7 +177,7 @@ ap_status_t ap_set_threadkeydata(void *data, * arg 1) The apr handle we are converting from. * arg 2) The os specific handle we are converting to. */ -ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, struct threadkey_t *key) +ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, struct ap_threadkey_t *key) { if (key == NULL) { return APR_ENOFILE; @@ -194,14 +194,14 @@ ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, struct threadkey_t *k * arg 2) The os specific handle to convert * arg 3) The context to use if it is needed. */ -ap_status_t ap_put_os_threadkey(struct threadkey_t **key, +ap_status_t ap_put_os_threadkey(struct ap_threadkey_t **key, ap_os_threadkey_t *thekey, ap_context_t *cont) { if (cont == NULL) { return APR_ENOCONT; } if ((*key) == NULL) { - (*key) = (struct threadkey_t *)ap_palloc(cont, sizeof(struct threadkey_t)); + (*key) = (struct ap_threadkey_t *)ap_palloc(cont, sizeof(struct ap_threadkey_t)); (*key)->cntxt = cont; } (*key)->key = *thekey; diff --git a/threadproc/unix/threadproc.h b/threadproc/unix/threadproc.h index 98b32fa8d..7aba340f7 100644 --- a/threadproc/unix/threadproc.h +++ b/threadproc/unix/threadproc.h @@ -82,23 +82,23 @@ #define SHELL_PATH "/bin/sh" #if APR_HAS_THREADS -struct thread_t { +struct ap_thread_t { ap_context_t *cntxt; pthread_t *td; }; -struct threadattr_t { +struct ap_threadattr_t { ap_context_t *cntxt; pthread_attr_t *attr; }; -struct threadkey_t { +struct ap_threadkey_t { ap_context_t *cntxt; pthread_key_t key; }; #endif -struct procattr_t { +struct ap_procattr_t { ap_context_t *cntxt; ap_file_t *parent_in; ap_file_t *child_in; @@ -111,16 +111,16 @@ struct procattr_t { ap_int32_t detached; }; -struct proc_t { +struct ap_proc_t { ap_context_t *cntxt; pid_t pid; - struct procattr_t *attr; + struct ap_procattr_t *attr; }; /*This will move to ap_threadproc.h in time, but I need to figure it out * on windows first. :) */ -ap_status_t ap_detach(struct proc_t **, ap_context_t *); +ap_status_t ap_detach(struct ap_proc_t **, ap_context_t *); #endif /* ! THREAD_PROC_H */ diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index d32df2c95..c2049f698 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -65,10 +65,10 @@ #include <string.h> #include <process.h> -ap_status_t ap_createprocattr_init(struct procattr_t **new, ap_context_t *cont) +ap_status_t ap_createprocattr_init(struct ap_procattr_t **new, ap_context_t *cont) { - (*new) = (struct procattr_t *)ap_palloc(cont, - sizeof(struct procattr_t)); + (*new) = (struct ap_procattr_t *)ap_palloc(cont, + sizeof(struct ap_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -89,7 +89,7 @@ ap_status_t ap_createprocattr_init(struct procattr_t **new, ap_context_t *cont) return APR_SUCCESS; } -ap_status_t ap_setprocattr_io(struct procattr_t *attr, ap_int32_t in, +ap_status_t ap_setprocattr_io(struct ap_procattr_t *attr, ap_int32_t in, ap_int32_t out, ap_int32_t err) { ap_status_t stat; @@ -114,11 +114,11 @@ ap_status_t ap_setprocattr_io(struct procattr_t *attr, ap_int32_t in, return APR_SUCCESS; } #if 0 -ap_status_t ap_setprocattr_childin(struct procattr_t *attr, ap_file_t *child_in, +ap_status_t ap_setprocattr_childin(struct ap_procattr_t *attr, ap_file_t *child_in, ap_file_t *parent_in) { } -ap_status_t ap_setprocattr_childout(struct procattr_t *attr, ap_file_t *child_out, +ap_status_t ap_setprocattr_childout(struct ap_procattr_t *attr, ap_file_t *child_out, ap_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) @@ -132,7 +132,7 @@ ap_status_t ap_setprocattr_childout(struct procattr_t *attr, ap_file_t *child_ou return APR_SUCCESS; } -ap_status_t ap_setprocattr_childerr(struct procattr_t *attr, ap_file_t *child_err, +ap_status_t ap_setprocattr_childerr(struct ap_procattr_t *attr, ap_file_t *child_err, ap_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) @@ -146,7 +146,7 @@ ap_status_t ap_setprocattr_childerr(struct procattr_t *attr, ap_file_t *child_er return APR_SUCCESS; } #endif -ap_status_t ap_setprocattr_dir(struct procattr_t *attr, +ap_status_t ap_setprocattr_dir(struct ap_procattr_t *attr, const char *dir) { char path[MAX_PATH]; @@ -170,22 +170,22 @@ ap_status_t ap_setprocattr_dir(struct procattr_t *attr, return APR_ENOMEM; } -ap_status_t ap_setprocattr_cmdtype(struct procattr_t *attr, +ap_status_t ap_setprocattr_cmdtype(struct ap_procattr_t *attr, ap_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -ap_status_t ap_setprocattr_detach(struct procattr_t *attr, ap_int32_t det) +ap_status_t ap_setprocattr_detach(struct ap_procattr_t *attr, ap_int32_t det) { attr->detached = det; return APR_SUCCESS; } -ap_status_t ap_create_process(struct proc_t **new, const char *progname, +ap_status_t ap_create_process(struct ap_proc_t **new, const char *progname, char *const args[], char **env, - struct procattr_t *attr, ap_context_t *cont) + struct ap_procattr_t *attr, ap_context_t *cont) { int i, iEnvBlockLen; char *cmdline; @@ -195,7 +195,7 @@ ap_status_t ap_create_process(struct proc_t **new, const char *progname, char *envstr; char *pEnvBlock, *pNext; - (*new) = (struct proc_t *)ap_palloc(cont, sizeof(struct proc_t)); + (*new) = (struct ap_proc_t *)ap_palloc(cont, sizeof(struct ap_proc_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -364,25 +364,25 @@ ap_status_t ap_create_process(struct proc_t **new, const char *progname, return GetLastError(); } -ap_status_t ap_get_childin(ap_file_t **new, struct proc_t *proc) +ap_status_t ap_get_childin(ap_file_t **new, struct ap_proc_t *proc) { (*new) = proc->attr->parent_in; return APR_SUCCESS; } -ap_status_t ap_get_childout(ap_file_t **new, struct proc_t *proc) +ap_status_t ap_get_childout(ap_file_t **new, struct ap_proc_t *proc) { (*new) = proc->attr->parent_out; return APR_SUCCESS; } -ap_status_t ap_get_childerr(ap_file_t **new, struct proc_t *proc) +ap_status_t ap_get_childerr(ap_file_t **new, struct ap_proc_t *proc) { (*new) = proc->attr->parent_err; return APR_SUCCESS; } -ap_status_t ap_wait_proc(struct proc_t *proc, +ap_status_t ap_wait_proc(struct ap_proc_t *proc, ap_wait_how_e wait) { DWORD stat; @@ -406,7 +406,7 @@ ap_status_t ap_wait_proc(struct proc_t *proc, return GetLastError(); } -ap_status_t ap_get_procdata(char *key, void *data, struct proc_t *proc) +ap_status_t ap_get_procdata(char *key, void *data, struct ap_proc_t *proc) { if (proc != NULL) { return ap_get_userdata(data, key, proc->cntxt); @@ -419,7 +419,7 @@ ap_status_t ap_get_procdata(char *key, void *data, struct proc_t *proc) ap_status_t ap_set_procdata(void *data, char *key, ap_status_t (*cleanup) (void *), - struct proc_t *proc) + struct ap_proc_t *proc) { if (proc != NULL) { return ap_set_userdata(data, key, cleanup, proc->cntxt); @@ -439,14 +439,14 @@ ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc) return APR_SUCCESS; } -ap_status_t ap_put_os_proc(struct proc_t **proc, ap_os_proc_t *theproc, +ap_status_t ap_put_os_proc(struct ap_proc_t **proc, ap_os_proc_t *theproc, ap_context_t *cont) { if (cont == NULL) { return APR_ENOCONT; } if ((*proc) == NULL) { - (*proc) = (struct proc_t *)ap_palloc(cont, sizeof(struct proc_t)); + (*proc) = (struct ap_proc_t *)ap_palloc(cont, sizeof(struct ap_proc_t)); (*proc)->cntxt = cont; } (*proc)->pi = *theproc; diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index 1a0ac8861..dad479834 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -64,7 +64,7 @@ #endif /* Windows only really support killing process, but that will do for now. */ -ap_status_t ap_kill(struct proc_t *proc, int signal) +ap_status_t ap_kill(struct ap_proc_t *proc, int signal) { if (TerminateProcess(proc->pi.hProcess, signal) == 0) { return errno; diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index e5a5692ff..30e0562fd 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -61,10 +61,10 @@ #include <process.h> -ap_status_t ap_create_threadattr(struct threadattr_t **new, ap_context_t *cont) +ap_status_t ap_create_threadattr(struct ap_threadattr_t **new, ap_context_t *cont) { - (*new) = (struct threadattr_t *)ap_palloc(cont, - sizeof(struct threadattr_t)); + (*new) = (struct ap_threadattr_t *)ap_palloc(cont, + sizeof(struct ap_threadattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -74,20 +74,20 @@ ap_status_t ap_create_threadattr(struct threadattr_t **new, ap_context_t *cont) return APR_SUCCESS; } -ap_status_t ap_setthreadattr_detach(struct threadattr_t *attr, ap_int32_t on) +ap_status_t ap_setthreadattr_detach(struct ap_threadattr_t *attr, ap_int32_t on) { attr->detach = on; return APR_SUCCESS; } -ap_status_t ap_getthreadattr_detach(struct threadattr_t *attr) +ap_status_t ap_getthreadattr_detach(struct ap_threadattr_t *attr) { if (attr->detach == 1) return APR_DETACH; return APR_NOTDETACH; } -ap_status_t ap_create_thread(struct thread_t **new, struct threadattr_t *attr, +ap_status_t ap_create_thread(struct ap_thread_t **new, struct ap_threadattr_t *attr, ap_thread_start_t func, void *data, ap_context_t *cont) { @@ -95,7 +95,7 @@ ap_status_t ap_create_thread(struct thread_t **new, struct threadattr_t *attr, unsigned temp; int lasterror; - (*new) = (struct thread_t *)ap_palloc(cont, sizeof(struct thread_t)); + (*new) = (struct ap_thread_t *)ap_palloc(cont, sizeof(struct ap_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -131,7 +131,7 @@ ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) return APR_SUCCESS; } -ap_status_t ap_thread_join(ap_status_t *retval, struct thread_t *thd) +ap_status_t ap_thread_join(ap_status_t *retval, struct ap_thread_t *thd) { ap_status_t stat; @@ -146,7 +146,7 @@ ap_status_t ap_thread_join(ap_status_t *retval, struct thread_t *thd) } } -ap_status_t ap_thread_detach(struct thread_t *thd) +ap_status_t ap_thread_detach(struct ap_thread_t *thd) { if (CloseHandle(thd->td)) { return APR_SUCCESS; @@ -156,7 +156,7 @@ ap_status_t ap_thread_detach(struct thread_t *thd) } } -ap_status_t ap_get_threaddata(void **data, char *key, struct thread_t *thread) +ap_status_t ap_get_threaddata(void **data, char *key, struct ap_thread_t *thread) { if (thread != NULL) { return ap_get_userdata(data, key, thread->cntxt); @@ -169,7 +169,7 @@ ap_status_t ap_get_threaddata(void **data, char *key, struct thread_t *thread) ap_status_t ap_set_threaddata(void *data, char *key, ap_status_t (*cleanup) (void *), - struct thread_t *thread) + struct ap_thread_t *thread) { if (thread != NULL) { return ap_set_userdata(data, key, cleanup, thread->cntxt); @@ -180,7 +180,7 @@ ap_status_t ap_set_threaddata(void *data, char *key, } } -ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, struct thread_t *thd) +ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, struct ap_thread_t *thd) { if (thd == NULL) { return APR_ENOTHREAD; @@ -189,14 +189,14 @@ ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, struct thread_t *thd) return APR_SUCCESS; } -ap_status_t ap_put_os_thread(struct thread_t **thd, ap_os_thread_t *thethd, +ap_status_t ap_put_os_thread(struct ap_thread_t **thd, ap_os_thread_t *thethd, ap_context_t *cont) { if (cont == NULL) { return APR_ENOCONT; } if ((*thd) == NULL) { - (*thd) = (struct thread_t *)ap_palloc(cont, sizeof(struct thread_t)); + (*thd) = (struct ap_thread_t *)ap_palloc(cont, sizeof(struct ap_thread_t)); (*thd)->cntxt = cont; } (*thd)->td = thethd; diff --git a/threadproc/win32/threadcancel.c b/threadproc/win32/threadcancel.c index b907e7b63..c92ee3078 100644 --- a/threadproc/win32/threadcancel.c +++ b/threadproc/win32/threadcancel.c @@ -57,7 +57,7 @@ #include "apr_general.h" -ap_status_t ap_cancel_thread(struct thread_t *thd) +ap_status_t ap_cancel_thread(struct ap_thread_t *thd) { if (TerminateThread(thd->td, APR_SUCCESS) == 0) { return APR_EEXIST; diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index 058b5f44d..513c73178 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -59,14 +59,14 @@ #include "apr_errno.h" #include "apr_portable.h" -ap_status_t ap_create_thread_private(struct threadkey_t **key, +ap_status_t ap_create_thread_private(struct ap_threadkey_t **key, void (*dest)(void *), ap_context_t *cont) { (*key)->key = TlsAlloc(); return APR_SUCCESS; } -ap_status_t ap_get_thread_private(void **new, struct threadkey_t *key) +ap_status_t ap_get_thread_private(void **new, struct ap_threadkey_t *key) { if ((*new) = TlsGetValue(key->key)) { return APR_SUCCESS; @@ -74,7 +74,7 @@ ap_status_t ap_get_thread_private(void **new, struct threadkey_t *key) return APR_EEXIST; } -ap_status_t ap_set_thread_private(void *priv, struct threadkey_t *key) +ap_status_t ap_set_thread_private(void *priv, struct ap_threadkey_t *key) { if (TlsSetValue(key->key, priv)) { return APR_SUCCESS; @@ -82,7 +82,7 @@ ap_status_t ap_set_thread_private(void *priv, struct threadkey_t *key) return APR_EEXIST; } -ap_status_t ap_delete_thread_private(struct threadkey_t *key) +ap_status_t ap_delete_thread_private(struct ap_threadkey_t *key) { if (TlsFree(key->key)) { return APR_SUCCESS; @@ -90,7 +90,7 @@ ap_status_t ap_delete_thread_private(struct threadkey_t *key) return APR_EEXIST; } -ap_status_t ap_get_threadkeydata(void **data, char *key, struct threadkey_t *threadkey) +ap_status_t ap_get_threadkeydata(void **data, char *key, struct ap_threadkey_t *threadkey) { if (threadkey != NULL) { return ap_get_userdata(data, key, threadkey->cntxt); @@ -102,7 +102,7 @@ ap_status_t ap_get_threadkeydata(void **data, char *key, struct threadkey_t *thr } ap_status_t ap_set_threadkeydata(void *data, char *key, ap_status_t (*cleanup) (void *), - struct threadkey_t *threadkey) + struct ap_threadkey_t *threadkey) { if (threadkey != NULL) { return ap_set_userdata(data, key, cleanup, threadkey->cntxt); @@ -113,7 +113,7 @@ ap_status_t ap_set_threadkeydata(void *data, char *key, ap_status_t (*cleanup) ( } } -ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, struct threadkey_t *key) +ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, struct ap_threadkey_t *key) { if (key == NULL) { return APR_ENOFILE; @@ -122,14 +122,14 @@ ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, struct threadkey_t *k return APR_SUCCESS; } -ap_status_t ap_put_os_threadkey(struct threadkey_t **key, +ap_status_t ap_put_os_threadkey(struct ap_threadkey_t **key, ap_os_threadkey_t *thekey, ap_context_t *cont) { if (cont == NULL) { return APR_ENOCONT; } if ((*key) == NULL) { - (*key) = (struct threadkey_t *)ap_palloc(cont, sizeof(struct threadkey_t)); + (*key) = (struct ap_threadkey_t *)ap_palloc(cont, sizeof(struct ap_threadkey_t)); (*key)->cntxt = cont; } (*key)->key = *thekey; diff --git a/threadproc/win32/threadproc.h b/threadproc/win32/threadproc.h index e9d3bcf72..2388bd7e2 100644 --- a/threadproc/win32/threadproc.h +++ b/threadproc/win32/threadproc.h @@ -62,24 +62,24 @@ #define SHELL_PATH "cmd.exe" -struct thread_t { +struct ap_thread_t { ap_context_t *cntxt; HANDLE td; ap_int32_t cancel; ap_int32_t cancel_how; }; -struct threadattr_t { +struct ap_threadattr_t { ap_context_t *cntxt; ap_int32_t detach; }; -struct threadkey_t { +struct ap_threadkey_t { ap_context_t *cntxt; DWORD key; }; -struct procattr_t { +struct ap_procattr_t { ap_context_t *cntxt; STARTUPINFO si; ap_file_t *parent_in; @@ -93,10 +93,10 @@ struct procattr_t { ap_int32_t detached; }; -struct proc_t { +struct ap_proc_t { ap_context_t *cntxt; PROCESS_INFORMATION pi; - struct procattr_t *attr; + struct ap_procattr_t *attr; }; #endif /* ! THREAD_PROC_H */ |