diff options
120 files changed, 1408 insertions, 1408 deletions
diff --git a/dso/aix/dso.c b/dso/aix/dso.c index 1926180bb..4863107df 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -155,14 +155,14 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, (*res_handle)->handle = (void*)os_handle; (*res_handle)->cont = ctx; - apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { - return apr_run_cleanup(handle->cont, handle, dso_cleanup); + return apr_pool_cleanup_run(handle->cont, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, diff --git a/dso/beos/dso.c b/dso/beos/dso.c index 6fdc4cd75..b41d97b75 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -79,14 +79,14 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char (*res_handle)->handle = newid; (*res_handle)->cont = ctx; - apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { - return apr_run_cleanup(handle->cont, handle, dso_cleanup); + return apr_pool_cleanup_run(handle->cont, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, diff --git a/dso/os2/dso.c b/dso/os2/dso.c index bceef2e06..50ed0d282 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -94,7 +94,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char } (*res_handle)->handle = handle; - apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -102,7 +102,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { - return apr_run_cleanup(handle->cont, handle, dso_cleanup); + return apr_pool_cleanup_run(handle->cont, handle, dso_cleanup); } diff --git a/dso/os390/dso.c b/dso/os390/dso.c index 631d941bf..24d42844b 100644 --- a/dso/os390/dso.c +++ b/dso/os390/dso.c @@ -87,7 +87,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, if ((handle = dllload(path)) != NULL) { (*res_handle)->handle = handle; - apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -97,7 +97,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { - return apr_run_cleanup(handle->pool, handle, dso_cleanup); + return apr_pool_cleanup_run(handle->pool, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 25871f7ed..9ee57d939 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -107,14 +107,14 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, (*res_handle)->cont = ctx; (*res_handle)->errormsg = NULL; - apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { - return apr_run_cleanup(handle->cont, handle, dso_cleanup); + return apr_pool_cleanup_run(handle->cont, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 068f7b7d3..b77f0bfa4 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -126,14 +126,14 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, (*res_handle)->cont = ctx; (*res_handle)->load_error = APR_SUCCESS; - apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dso_unload(struct apr_dso_handle_t *handle) { - return apr_run_cleanup(handle->cont, handle, dso_cleanup); + return apr_pool_cleanup_run(handle->cont, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 61a21269c..425938cfd 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -82,7 +82,7 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cntx thedir->handle = 0; thedir->validentry = FALSE; *new = thedir; - apr_register_cleanup(cntxt, thedir, dir_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(cntxt, thedir, dir_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -167,14 +167,14 @@ apr_status_t apr_dir_rewind(apr_dir_t *thedir) -apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) +apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont) { return APR_OS2_STATUS(DosCreateDir(path, NULL)); } -apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) +apr_status_t apr_dir_remove(const char *path, apr_pool_t *cont) { return APR_OS2_STATUS(DosDeleteDir(path)); } diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index 8bece3dce..7e7f9181e 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -58,7 +58,7 @@ #include "apr_strings.h" #include <string.h> -apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) +apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { int rv; apr_file_t *dup_file; @@ -90,8 +90,8 @@ apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t dup_file->pipe = old_file->pipe; if (*new_file == NULL) { - apr_register_cleanup(dup_file->cntxt, dup_file, apr_file_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register(dup_file->cntxt, dup_file, apr_file_cleanup, + apr_pool_cleanup_null); *new_file = dup_file; } diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index ec055908a..ff71b3c1e 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -115,7 +115,7 @@ static apr_status_t handle_type(apr_filetype_e *ftype, HFILE file) -apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, +apr_status_t apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) { ULONG rc; @@ -145,7 +145,7 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, return APR_OS2_STATUS(rc); } -apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) +apr_status_t apr_file_perms_set(const char *fname, apr_fileperms_t perms) { return APR_ENOTIMPL; } diff --git a/file_io/os2/flock.c b/file_io/os2/flock.c index 62e3714d5..9fd7e182f 100644 --- a/file_io/os2/flock.c +++ b/file_io/os2/flock.c @@ -54,7 +54,7 @@ #include "fileio.h" -apr_status_t apr_lock_file(apr_file_t *thefile, int type) +apr_status_t apr_file_lock(apr_file_t *thefile, int type) { FILELOCK lockrange = { 0, 0x7fffffff }; ULONG rc; @@ -65,7 +65,7 @@ apr_status_t apr_lock_file(apr_file_t *thefile, int type) return APR_FROM_OS_ERROR(rc); } -apr_status_t apr_unlock_file(apr_file_t *thefile) +apr_status_t apr_file_unlock(apr_file_t *thefile) { FILELOCK unlockrange = { 0, 0x7fffffff }; ULONG rc; diff --git a/file_io/os2/open.c b/file_io/os2/open.c index c7c28e21f..16ccb00be 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -62,12 +62,12 @@ apr_status_t apr_file_cleanup(void *thefile) { apr_file_t *file = thefile; - return apr_close(file); + return apr_file_close(file); } -apr_status_t apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cntxt) +apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cntxt) { int oflags = 0; int mflags = OPEN_FLAGS_FAIL_ON_ERROR|OPEN_SHARE_DENYNONE; @@ -98,7 +98,7 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, ap if (dafile->buffered) { dafile->buffer = apr_palloc(cntxt, APR_FILE_BUFSIZE); - rv = apr_create_lock(&dafile->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cntxt); + rv = apr_lock_create(&dafile->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cntxt); if (rv) return rv; @@ -144,19 +144,19 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, ap dafile->direction = 0; dafile->pipe = FALSE; - apr_register_cleanup(dafile->cntxt, dafile, apr_file_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(dafile->cntxt, dafile, apr_file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } -apr_status_t apr_close(apr_file_t *file) +apr_status_t apr_file_close(apr_file_t *file) { ULONG rc; apr_status_t status; if (file && file->isopen) { - apr_flush(file); + apr_file_flush(file); rc = DosClose(file->filedes); if (rc == 0) { @@ -172,14 +172,14 @@ apr_status_t apr_close(apr_file_t *file) } if (file->buffered) - apr_destroy_lock(file->mutex); + apr_lock_destroy(file->mutex); return APR_SUCCESS; } -apr_status_t apr_remove_file(const char *path, apr_pool_t *cntxt) +apr_status_t apr_file_remove(const char *path, apr_pool_t *cntxt) { ULONG rc = DosDelete(path); return APR_OS2_STATUS(rc); @@ -187,7 +187,7 @@ apr_status_t apr_remove_file(const char *path, apr_pool_t *cntxt) -apr_status_t apr_rename_file(const char *from_path, const char *to_path, +apr_status_t apr_file_rename(const char *from_path, const char *to_path, apr_pool_t *p) { ULONG rc = DosMove(from_path, to_path); @@ -205,7 +205,7 @@ apr_status_t apr_rename_file(const char *from_path, const char *to_path, -apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) +apr_status_t apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file) { if (file == NULL) { return APR_ENOFILE; @@ -217,7 +217,7 @@ apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) -apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) +apr_status_t apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) { apr_os_file_t *dafile = thefile; @@ -234,7 +234,7 @@ apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, apr_pool -apr_status_t apr_eof(apr_file_t *fptr) +apr_status_t apr_file_eof(apr_file_t *fptr) { if (!fptr->isopen || fptr->eof_hit == 1) { return APR_EOF; @@ -244,20 +244,20 @@ apr_status_t apr_eof(apr_file_t *fptr) -apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) +apr_status_t apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { apr_os_file_t fd = 2; - return apr_put_os_file(thefile, &fd, cont); + return apr_os_file_put(thefile, &fd, cont); } -apr_status_t apr_open_stdout(apr_file_t **thefile, apr_pool_t *cont) +apr_status_t apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) { apr_os_file_t fd = 1; - return apr_put_os_file(thefile, &fd, cont); + return apr_os_file_put(thefile, &fd, cont); } diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 2098519cc..5dd8cab29 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -61,7 +61,7 @@ #include <string.h> #include <process.h> -apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) +apr_status_t apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) { ULONG filedes[2]; ULONG rc, action; @@ -122,7 +122,7 @@ apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont (*in)->pipe = 1; (*in)->timeout = -1; (*in)->blocking = BLK_ON; - apr_register_cleanup(cont, *in, apr_file_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(cont, *in, apr_file_cleanup, apr_pool_cleanup_null); (*out) = (apr_file_t *)apr_palloc(cont, sizeof(apr_file_t)); (*out)->cntxt = cont; @@ -134,14 +134,14 @@ apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont (*out)->pipe = 1; (*out)->timeout = -1; (*out)->blocking = BLK_ON; - apr_register_cleanup(cont, *out, apr_file_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(cont, *out, apr_file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } -apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) +apr_status_t apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) { /* Not yet implemented, interface not suitable */ return APR_ENOTIMPL; @@ -149,7 +149,7 @@ apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm, ap -apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) +apr_status_t apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) { if (thepipe->pipe == 1) { thepipe->timeout = timeout; @@ -172,7 +172,7 @@ apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeo -apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout) +apr_status_t apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) { if (thepipe->pipe == 1) { *timeout = thepipe->timeout; diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index f6dbd0255..37bc1da19 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -61,7 +61,7 @@ #include <malloc.h> -apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) +apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) { ULONG rc = 0; ULONG bytesread; @@ -76,10 +76,10 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) ULONG blocksize; ULONG size = *nbytes; - apr_lock(thefile->mutex); + apr_lock_aquire(thefile->mutex); if (thefile->direction == 1) { - apr_flush(thefile); + apr_file_flush(thefile); thefile->bufpos = 0; thefile->direction = 0; thefile->dataRead = 0; @@ -105,7 +105,7 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) } *nbytes = rc == 0 ? pos - (char *)buf : 0; - apr_unlock(thefile->mutex); + apr_lock_release(thefile->mutex); return APR_OS2_STATUS(rc); } else { if (thefile->pipe) @@ -137,7 +137,7 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) -apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) +apr_status_t apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) { ULONG rc = 0; ULONG byteswritten; @@ -152,7 +152,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) int blocksize; int size = *nbytes; - apr_lock(thefile->mutex); + apr_lock_aquire(thefile->mutex); if ( thefile->direction == 0 ) { // Position file pointer for writing at the offset we are logically reading from @@ -165,7 +165,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) while (rc == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) // write buffer is full - rc = apr_flush(thefile); + rc = apr_file_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); @@ -174,7 +174,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) size -= blocksize; } - apr_unlock(thefile->mutex); + apr_lock_release(thefile->mutex); return APR_OS2_STATUS(rc); } else { rc = DosWrite(thefile->filedes, buf, *nbytes, &byteswritten); @@ -193,7 +193,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) #ifdef HAVE_WRITEV -apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) +apr_status_t apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) { int bytes; if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { @@ -209,7 +209,7 @@ apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t -apr_status_t apr_putc(char ch, apr_file_t *thefile) +apr_status_t apr_file_putc(char ch, apr_file_t *thefile) { ULONG rc; ULONG byteswritten; @@ -229,15 +229,15 @@ apr_status_t apr_putc(char ch, apr_file_t *thefile) -apr_status_t apr_ungetc(char ch, apr_file_t *thefile) +apr_status_t apr_file_ungetc(char ch, apr_file_t *thefile) { apr_off_t offset = -1; - return apr_seek(thefile, APR_CUR, &offset); + return apr_file_seek(thefile, APR_CUR, &offset); } -apr_status_t apr_getc(char *ch, apr_file_t *thefile) +apr_status_t apr_file_getc(char *ch, apr_file_t *thefile) { ULONG rc; apr_size_t bytesread; @@ -247,7 +247,7 @@ apr_status_t apr_getc(char *ch, apr_file_t *thefile) } bytesread = 1; - rc = apr_read(thefile, ch, &bytesread); + rc = apr_file_read(thefile, ch, &bytesread); if (rc) { return rc; @@ -263,17 +263,17 @@ apr_status_t apr_getc(char *ch, apr_file_t *thefile) -apr_status_t apr_puts(const char *str, apr_file_t *thefile) +apr_status_t apr_file_puts(const char *str, apr_file_t *thefile) { apr_size_t len; len = strlen(str); - return apr_write(thefile, str, &len); + return apr_file_write(thefile, str, &len); } -apr_status_t apr_flush(apr_file_t *thefile) +apr_status_t apr_file_flush(apr_file_t *thefile) { if (thefile->buffered) { ULONG written = 0; @@ -298,7 +298,7 @@ apr_status_t apr_flush(apr_file_t *thefile) -apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) +apr_status_t apr_file_gets(char *str, int len, apr_file_t *thefile) { size_t readlen; apr_status_t rv = APR_SUCCESS; @@ -306,7 +306,7 @@ apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) for (i = 0; i < len-1; i++) { readlen = 1; - rv = apr_read(thefile, str+i, &readlen); + rv = apr_file_read(thefile, str+i, &readlen); if (readlen != 1) { rv = APR_EOF; @@ -324,7 +324,7 @@ apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) -APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) +APR_DECLARE(int) apr_file_printf(apr_file_t *fptr, const char *format, ...) { int cc; va_list ap; @@ -337,7 +337,7 @@ APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) } va_start(ap, format); len = apr_vsnprintf(buf, HUGE_STRING_LEN, format, ap); - cc = apr_puts(buf, fptr); + cc = apr_file_puts(buf, fptr); va_end(ap); free(buf); return (cc == APR_SUCCESS) ? len : -1; diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index 076fe93bc..f2027f204 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -65,7 +65,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) ULONG rc; if (thefile->direction == 1) { - apr_flush(thefile); + apr_file_flush(thefile); thefile->bufpos = thefile->direction = thefile->dataRead = 0; } @@ -85,7 +85,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) -apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) +apr_status_t apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) { if (!thefile->isopen) { return APR_EBADF; @@ -105,7 +105,7 @@ apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *of break; case APR_END: - rc = apr_getfileinfo(&finfo, APR_FINFO_NORM, thefile); + rc = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); if (rc == APR_SUCCESS) rc = setptr(thefile, finfo.size - *offset); break; diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 2e0f15015..93bcc6165 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -95,8 +95,8 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont return errno; } else { - apr_register_cleanup((*new)->cntxt, (void *)(*new), dir_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), dir_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } } @@ -106,7 +106,7 @@ apr_status_t apr_dir_close(apr_dir_t *thedir) apr_status_t rv; if ((rv = dir_cleanup(thedir)) == APR_SUCCESS) { - apr_kill_cleanup(thedir->cntxt, thedir, dir_cleanup); + apr_pool_cleanup_kill(thedir->cntxt, thedir, dir_cleanup); return APR_SUCCESS; } return rv; @@ -195,7 +195,7 @@ apr_status_t apr_dir_rewind(apr_dir_t *thedir) return APR_SUCCESS; } -apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) +apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont) { mode_t mode = apr_unix_perms2mode(perm); @@ -207,7 +207,7 @@ apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *co } } -apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) +apr_status_t apr_dir_remove(const char *path, apr_pool_t *cont) { if (rmdir(path) == 0) { return APR_SUCCESS; @@ -217,7 +217,7 @@ apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) } } -apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir) +apr_status_t apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir) { if (dir == NULL) { return APR_ENODIR; @@ -226,7 +226,7 @@ apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir) return APR_SUCCESS; } -apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, +apr_status_t apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont) { if ((*dir) == NULL) { diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 50496c425..1303beb3d 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -57,7 +57,7 @@ /* A file to put ALL of the accessor functions for apr_file_t types. */ -APR_DECLARE(apr_status_t) apr_get_filename(const char **fname, +APR_DECLARE(apr_status_t) apr_file_name_get(const char **fname, apr_file_t *thefile) { *fname = thefile->fname; @@ -122,15 +122,15 @@ apr_fileperms_t apr_unix_mode2perms(mode_t mode) } #endif -APR_DECLARE(apr_status_t) apr_get_filedata(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key, apr_file_t *file) { - return apr_get_userdata(data, key, file->cntxt); + return apr_pool_userdata_get(data, key, file->cntxt); } -APR_DECLARE(apr_status_t) apr_set_filedata(apr_file_t *file, void *data, +APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, void *data, const char *key, apr_status_t (*cleanup)(void *)) { - return apr_set_userdata(data, key, cleanup, file->cntxt); + return apr_pool_userdata_set(data, key, cleanup, file->cntxt); } diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 06956fac5..7f0e94f26 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -56,7 +56,7 @@ #include "apr_strings.h" #include "apr_portable.h" -apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) +apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { int have_file = 0; @@ -80,14 +80,14 @@ apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t (*new_file)->buffered = old_file->buffered; if ((*new_file)->buffered) { #if APR_HAS_THREADS - apr_create_lock(&((*new_file)->thlock), APR_MUTEX, APR_INTRAPROCESS, NULL, + apr_lock_create(&((*new_file)->thlock), APR_MUTEX, APR_INTRAPROCESS, NULL, p); #endif (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); } (*new_file)->blocking = old_file->blocking; /* this is the way dup() works */ - apr_register_cleanup((*new_file)->cntxt, (void *)(*new_file), apr_unix_file_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), apr_unix_file_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 0642d22ee..5c376b50f 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -105,7 +105,7 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, */ } -apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, +apr_status_t apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) { struct stat info; @@ -121,7 +121,7 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, } } -apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) +apr_status_t apr_file_perms_set(const char *fname, apr_fileperms_t perms) { mode_t mode = apr_unix_perms2mode(perms); diff --git a/file_io/unix/flock.c b/file_io/unix/flock.c index ecd7f7ae4..fe2892fa0 100644 --- a/file_io/unix/flock.c +++ b/file_io/unix/flock.c @@ -61,7 +61,7 @@ #include <sys/file.h> #endif -apr_status_t apr_lock_file(apr_file_t *thefile, int type) +apr_status_t apr_file_lock(apr_file_t *thefile, int type) { int rc; @@ -112,7 +112,7 @@ apr_status_t apr_lock_file(apr_file_t *thefile, int type) return APR_SUCCESS; } -apr_status_t apr_unlock_file(apr_file_t *thefile) +apr_status_t apr_file_unlock(apr_file_t *thefile) { int rc; diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index 3d749ee92..d15ea150b 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -55,7 +55,7 @@ #include "apr_file_io.h" -APR_DECLARE(apr_status_t) apr_full_read(apr_file_t *thefile, void *buf, +APR_DECLARE(apr_status_t) apr_file_read_file(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read) { @@ -65,7 +65,7 @@ APR_DECLARE(apr_status_t) apr_full_read(apr_file_t *thefile, void *buf, do { apr_size_t amt = nbytes; - status = apr_read(thefile, buf, &amt); + status = apr_file_read(thefile, buf, &amt); buf = (char *)buf + amt; nbytes -= amt; total_read += amt; @@ -77,7 +77,7 @@ APR_DECLARE(apr_status_t) apr_full_read(apr_file_t *thefile, void *buf, return status; } -APR_DECLARE(apr_status_t) apr_full_write(apr_file_t *thefile, const void *buf, +APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, const void *buf, apr_size_t nbytes, apr_size_t *bytes_written) { @@ -87,7 +87,7 @@ APR_DECLARE(apr_status_t) apr_full_write(apr_file_t *thefile, const void *buf, do { apr_size_t amt = nbytes; - status = apr_write(thefile, buf, &amt); + status = apr_file_write(thefile, buf, &amt); buf = (char *)buf + amt; nbytes -= amt; total_written += amt; diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 99de8a372..4082e59d9 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -67,7 +67,7 @@ apr_status_t apr_unix_file_cleanup(void *thefile) file->filedes = -1; #if APR_HAS_THREADS if (file->thlock) { - return apr_destroy_lock(file->thlock); + return apr_lock_destroy(file->thlock); } #endif return APR_SUCCESS; @@ -78,7 +78,7 @@ apr_status_t apr_unix_file_cleanup(void *thefile) } } -apr_status_t apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) +apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) { int oflags = 0; #if APR_HAS_THREADS @@ -111,7 +111,7 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, ap if ((*new)->buffered) { (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); #if APR_HAS_THREADS - rv = apr_create_lock(&((*new)->thlock), APR_MUTEX, APR_INTRAPROCESS, + rv = apr_lock_create(&((*new)->thlock), APR_MUTEX, APR_INTRAPROCESS, NULL, cont); if (rv) { return rv; @@ -163,27 +163,27 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, ap (*new)->bufpos = 0; (*new)->dataRead = 0; (*new)->direction = 0; - apr_register_cleanup((*new)->cntxt, (void *)(*new), apr_unix_file_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), apr_unix_file_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } -apr_status_t apr_close(apr_file_t *file) +apr_status_t apr_file_close(apr_file_t *file) { apr_status_t flush_rv = APR_SUCCESS, rv; if (file->buffered) { - flush_rv = apr_flush(file); + flush_rv = apr_file_flush(file); } if ((rv = apr_unix_file_cleanup(file)) == APR_SUCCESS) { - apr_kill_cleanup(file->cntxt, file, apr_unix_file_cleanup); + apr_pool_cleanup_kill(file->cntxt, file, apr_unix_file_cleanup); return APR_SUCCESS; } return rv ? rv : flush_rv; } -apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) +apr_status_t apr_file_remove(const char *path, apr_pool_t *cont) { if (unlink(path) == 0) { return APR_SUCCESS; @@ -193,7 +193,7 @@ apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) } } -apr_status_t apr_rename_file(const char *from_path, const char *to_path, +apr_status_t apr_file_rename(const char *from_path, const char *to_path, apr_pool_t *p) { if (rename(from_path, to_path) != 0) { @@ -202,7 +202,7 @@ apr_status_t apr_rename_file(const char *from_path, const char *to_path, return APR_SUCCESS; } -apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) +apr_status_t apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file) { if (file == NULL) { return APR_ENOFILE; @@ -212,7 +212,7 @@ apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) return APR_SUCCESS; } -apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, +apr_status_t apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) { int *dafile = thefile; @@ -231,7 +231,7 @@ apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, return APR_SUCCESS; } -apr_status_t apr_eof(apr_file_t *fptr) +apr_status_t apr_file_eof(apr_file_t *fptr) { if (fptr->eof_hit == 1) { return APR_EOF; @@ -239,7 +239,7 @@ apr_status_t apr_eof(apr_file_t *fptr) return APR_SUCCESS; } -apr_status_t apr_ferror(apr_file_t *fptr) +apr_status_t apr_file_error(apr_file_t *fptr) { /* This function should be removed ASAP. It is next on my list once * I am sure nobody is using it. @@ -247,18 +247,18 @@ apr_status_t apr_ferror(apr_file_t *fptr) return APR_SUCCESS; } -apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) +apr_status_t apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { int fd = STDERR_FILENO; - return apr_put_os_file(thefile, &fd, cont); + return apr_os_file_put(thefile, &fd, cont); } -apr_status_t apr_open_stdout(apr_file_t **thefile, apr_pool_t *cont) +apr_status_t apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) { int fd = STDOUT_FILENO; - return apr_put_os_file(thefile, &fd, cont); + return apr_os_file_put(thefile, &fd, cont); } APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index f5bf550fd..c9405abea 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -126,7 +126,7 @@ static apr_status_t pipenonblock(apr_file_t *thepipe) return APR_SUCCESS; } -apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) +apr_status_t apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) { if (thepipe->pipe == 1) { thepipe->timeout = timeout; @@ -145,7 +145,7 @@ apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeo return APR_EINVAL; } -apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout) +apr_status_t apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) { if (thepipe->pipe == 1) { *timeout = thepipe->timeout; @@ -154,7 +154,7 @@ apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *time return APR_EINVAL; } -apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) +apr_status_t apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) { int filedes[2]; @@ -187,14 +187,14 @@ apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont (*in)->thlock = NULL; #endif - apr_register_cleanup((*in)->cntxt, (void *)(*in), apr_unix_file_cleanup, - apr_null_cleanup); - apr_register_cleanup((*out)->cntxt, (void *)(*out), apr_unix_file_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*in)->cntxt, (void *)(*in), apr_unix_file_cleanup, + apr_pool_cleanup_null); + apr_pool_cleanup_register((*out)->cntxt, (void *)(*out), apr_unix_file_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } -apr_status_t apr_create_namedpipe(const char *filename, +apr_status_t apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) { mode_t mode = apr_unix_perms2mode(perm); diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 57a950d25..0f32e7044 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -101,7 +101,7 @@ static apr_status_t wait_for_io_or_timeout(apr_file_t *file, int for_read) /* problems: * 1) ungetchar not used for buffered files */ -apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) +apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) { apr_ssize_t rv; apr_size_t bytes_read; @@ -117,11 +117,11 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) apr_uint64_t size = *nbytes; #if APR_HAS_THREADS - apr_lock(thefile->thlock); + apr_lock_aquire(thefile->thlock); #endif if (thefile->direction == 1) { - apr_flush(thefile); + apr_file_flush(thefile); thefile->bufpos = 0; thefile->direction = 0; thefile->dataRead = 0; @@ -156,7 +156,7 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) rv = 0; } #if APR_HAS_THREADS - apr_unlock(thefile->thlock); + apr_lock_release(thefile->thlock); #endif return rv; } @@ -205,7 +205,7 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) } } -apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) +apr_status_t apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) { apr_size_t rv; @@ -215,7 +215,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) int size = *nbytes; #if APR_HAS_THREADS - apr_lock(thefile->thlock); + apr_lock_aquire(thefile->thlock); #endif if ( thefile->direction == 0 ) { @@ -232,7 +232,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) rv = 0; while (rv == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) /* write buffer is full*/ - apr_flush(thefile); + apr_file_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; @@ -243,7 +243,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) } #if APR_HAS_THREADS - apr_unlock(thefile->thlock); + apr_lock_release(thefile->thlock); #endif return rv; } @@ -276,7 +276,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) } } -apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, +apr_status_t apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) { #ifdef HAVE_WRITEV @@ -292,38 +292,38 @@ apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, } #else *nbytes = vec[0].iov_len; - return apr_write(thefile, vec[0].iov_base, nbytes); + return apr_file_write(thefile, vec[0].iov_base, nbytes); #endif } -apr_status_t apr_putc(char ch, apr_file_t *thefile) +apr_status_t apr_file_putc(char ch, apr_file_t *thefile) { apr_size_t nbytes = 1; - return apr_write(thefile, &ch, &nbytes); + return apr_file_write(thefile, &ch, &nbytes); } -apr_status_t apr_ungetc(char ch, apr_file_t *thefile) +apr_status_t apr_file_ungetc(char ch, apr_file_t *thefile) { thefile->ungetchar = (unsigned char)ch; return APR_SUCCESS; } -apr_status_t apr_getc(char *ch, apr_file_t *thefile) +apr_status_t apr_file_getc(char *ch, apr_file_t *thefile) { apr_size_t nbytes = 1; - return apr_read(thefile, ch, &nbytes); + return apr_file_read(thefile, ch, &nbytes); } -apr_status_t apr_puts(const char *str, apr_file_t *thefile) +apr_status_t apr_file_puts(const char *str, apr_file_t *thefile) { apr_size_t nbytes = strlen(str); - return apr_write(thefile, str, &nbytes); + return apr_file_write(thefile, str, &nbytes); } -apr_status_t apr_flush(apr_file_t *thefile) +apr_status_t apr_file_flush(apr_file_t *thefile) { if (thefile->buffered) { apr_int64_t written = 0; @@ -345,7 +345,7 @@ apr_status_t apr_flush(apr_file_t *thefile) return APR_SUCCESS; } -apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) +apr_status_t apr_file_gets(char *str, int len, apr_file_t *thefile) { apr_status_t rv = APR_SUCCESS; /* get rid of gcc warning */ apr_size_t nbytes; @@ -359,7 +359,7 @@ apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) while (str < final) { /* leave room for trailing '\0' */ nbytes = 1; - rv = apr_read(thefile, str, &nbytes); + rv = apr_file_read(thefile, str, &nbytes); if (rv != APR_SUCCESS) { break; } @@ -376,7 +376,7 @@ apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) return rv; } -APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) +APR_DECLARE(int) apr_file_printf(apr_file_t *fptr, const char *format, ...) { apr_status_t cc; va_list ap; @@ -389,7 +389,7 @@ APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) } va_start(ap, format); len = apr_vsnprintf(buf, HUGE_STRING_LEN, format, ap); - cc = apr_puts(buf, fptr); + cc = apr_file_puts(buf, fptr); va_end(ap); free(buf); return (cc == APR_SUCCESS) ? len : -1; diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index f89284358..459704279 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -60,7 +60,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) int rc; if (thefile->direction == 1) { - apr_flush(thefile); + apr_file_flush(thefile); thefile->bufpos = thefile->direction = thefile->dataRead = 0; } @@ -85,7 +85,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) } -apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) +apr_status_t apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) { apr_off_t rv; @@ -104,7 +104,7 @@ apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *of break; case APR_END: - rc = apr_getfileinfo(&finfo, APR_FINFO_SIZE, thefile); + rc = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); if (rc == APR_SUCCESS) rc = setptr(thefile, finfo.size - *offset); break; diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 64124121a..902a2659e 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -128,8 +128,8 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, (*new)->rootlen = len - 1; (*new)->cntxt = cont; (*new)->dirhand = INVALID_HANDLE_VALUE; - apr_register_cleanup((*new)->cntxt, (void *)(*new), dir_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), dir_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } @@ -261,7 +261,7 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *dir) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_make_dir(const char *path, apr_fileperms_t perm, +APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont) { #if APR_HAS_UNICODE_FS @@ -286,7 +286,7 @@ APR_DECLARE(apr_status_t) apr_make_dir(const char *path, apr_fileperms_t perm, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_remove_dir(const char *path, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *cont) { #if APR_HAS_UNICODE_FS apr_oslevel_e os_level; @@ -310,7 +310,7 @@ APR_DECLARE(apr_status_t) apr_remove_dir(const char *path, apr_pool_t *cont) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_os_dir(apr_os_dir_t **thedir, +APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir) { if (dir == NULL) { @@ -320,7 +320,7 @@ APR_DECLARE(apr_status_t) apr_get_os_dir(apr_os_dir_t **thedir, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_put_os_dir(apr_dir_t **dir, +APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont) { diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 495b58548..b4a865dbf 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -58,7 +58,7 @@ #include "apr_strings.h" #include <string.h> -APR_DECLARE(apr_status_t) apr_dupfile(apr_file_t **new_file, +APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { BOOLEAN isStdHandle = FALSE; @@ -109,8 +109,8 @@ APR_DECLARE(apr_status_t) apr_dupfile(apr_file_t **new_file, (*new_file)->buffered = FALSE; if (!isStdHandle) { - apr_register_cleanup((*new_file)->cntxt, (void *)(*new_file), file_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), file_cleanup, + apr_pool_cleanup_null); } return APR_SUCCESS; diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 335c56c5f..f784db652 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -154,28 +154,28 @@ static int resolve_ident(apr_finfo_t *finfo, const char *fname, * user, group or permissions. */ - if ((rv = apr_open(&thefile, fname, + if ((rv = apr_file_open(&thefile, fname, ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0) | ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) ? APR_READCONTROL : 0), APR_OS_DEFAULT, cont)) == APR_SUCCESS) { - rv = apr_getfileinfo(finfo, wanted, thefile); + rv = apr_file_info_get(finfo, wanted, thefile); finfo->filehand = NULL; - apr_close(thefile); + apr_file_close(thefile); } else if (APR_STATUS_IS_EACCES(rv) && (wanted & (APR_FINFO_PROT | APR_FINFO_OWNER))) { /* We have a backup plan. Perhaps we couldn't grab READ_CONTROL? * proceed without asking for that permission... */ - if ((rv = apr_open(&thefile, fname, + if ((rv = apr_file_open(&thefile, fname, ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0), APR_OS_DEFAULT, cont)) == APR_SUCCESS) { - rv = apr_getfileinfo(finfo, wanted & ~(APR_FINFO_PROT + rv = apr_file_info_get(finfo, wanted & ~(APR_FINFO_PROT | APR_FINFO_OWNER), thefile); finfo->filehand = NULL; - apr_close(thefile); + apr_file_close(thefile); } } if (rv != APR_SUCCESS && rv != APR_INCOMPLETE) @@ -246,8 +246,8 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, apr_int32_t wante ((wanted & APR_FINFO_PROT) ? &dacl : NULL), NULL, &pdesc); if (rv == ERROR_SUCCESS) - apr_register_cleanup(finfo->cntxt, pdesc, free_localheap, - apr_null_cleanup); + apr_pool_cleanup_register(finfo->cntxt, pdesc, free_localheap, + apr_pool_cleanup_null); else user = grp = dacl = NULL; @@ -322,7 +322,7 @@ void fillin_fileinfo(apr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo, } -APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, +APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) { BY_HANDLE_FILE_INFORMATION FileInfo; @@ -374,7 +374,7 @@ APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_setfileperms(const char *fname, +APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, apr_fileperms_t perms) { return APR_ENOTIMPL; diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c index 18d00b322..6a54fcb07 100644 --- a/file_io/win32/flock.c +++ b/file_io/win32/flock.c @@ -54,7 +54,7 @@ #include "fileio.h" -APR_DECLARE(apr_status_t) apr_lock_file(apr_file_t *thefile, int type) +APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) { OVERLAPPED offset; DWORD flags, len = 0xffffffff; @@ -70,7 +70,7 @@ APR_DECLARE(apr_status_t) apr_lock_file(apr_file_t *thefile, int type) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_unlock_file(apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile) { OVERLAPPED offset; DWORD len = 0xffffffff; diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 33a4873e2..03a9e0167 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -164,7 +164,7 @@ apr_status_t file_cleanup(void *thefile) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_open(apr_file_t **new, const char *fname, +APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) { @@ -266,11 +266,11 @@ APR_DECLARE(apr_status_t) apr_open(apr_file_t **new, const char *fname, if (flag & APR_BUFFERED) { (*new)->buffered = 1; (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); - rv = apr_create_lock(&(*new)->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cont); + rv = apr_lock_create(&(*new)->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cont); if (rv) { if (file_cleanup(*new) == APR_SUCCESS) { - apr_kill_cleanup(cont, *new, file_cleanup); + apr_pool_cleanup_kill(cont, *new, file_cleanup); } return rv; } @@ -292,26 +292,26 @@ APR_DECLARE(apr_status_t) apr_open(apr_file_t **new, const char *fname, (*new)->direction = 0; (*new)->filePtr = 0; - apr_register_cleanup((*new)->cntxt, (void *)(*new), file_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), file_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_close(apr_file_t *file) +APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) { apr_status_t stat; if ((stat = file_cleanup(file)) == APR_SUCCESS) { - apr_kill_cleanup(file->cntxt, file, file_cleanup); + apr_pool_cleanup_kill(file->cntxt, file, file_cleanup); if (file->buffered) - apr_destroy_lock(file->mutex); + apr_lock_destroy(file->mutex); return APR_SUCCESS; } return stat; } -APR_DECLARE(apr_status_t) apr_remove_file(const char *path, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont) { #if APR_HAS_UNICODE_FS apr_oslevel_e os_level; @@ -333,7 +333,7 @@ APR_DECLARE(apr_status_t) apr_remove_file(const char *path, apr_pool_t *cont) return apr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_rename_file(const char *frompath, +APR_DECLARE(apr_status_t) apr_file_rename(const char *frompath, const char *topath, apr_pool_t *cont) { @@ -383,7 +383,7 @@ APR_DECLARE(apr_status_t) apr_rename_file(const char *frompath, return apr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_get_os_file(apr_os_file_t *thefile, +APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file) { if (file == NULL) { @@ -393,7 +393,7 @@ APR_DECLARE(apr_status_t) apr_get_os_file(apr_os_file_t *thefile, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_put_os_file(apr_file_t **file, +APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) { @@ -404,7 +404,7 @@ APR_DECLARE(apr_status_t) apr_put_os_file(apr_file_t **file, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_eof(apr_file_t *fptr) +APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) { if (fptr->eof_hit == 1) { return APR_EOF; @@ -412,7 +412,7 @@ APR_DECLARE(apr_status_t) apr_eof(apr_file_t *fptr) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { apr_os_file_t file_handle; @@ -420,10 +420,10 @@ APR_DECLARE(apr_status_t) apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont if (file_handle == INVALID_HANDLE_VALUE) return apr_get_os_error(); - return apr_put_os_file(thefile, &file_handle, cont); + return apr_os_file_put(thefile, &file_handle, cont); } -APR_DECLARE(apr_status_t) apr_open_stdout(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) { apr_os_file_t file_handle; @@ -431,7 +431,7 @@ APR_DECLARE(apr_status_t) apr_open_stdout(apr_file_t **thefile, apr_pool_t *cont if (file_handle == INVALID_HANDLE_VALUE) return apr_get_os_error(); - return apr_put_os_file(thefile, &file_handle, cont); + return apr_os_file_put(thefile, &file_handle, cont); } APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 40a8c6c3e..4f4732d62 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -63,7 +63,7 @@ #include <sys/stat.h> #include "misc.h" -APR_DECLARE(apr_status_t) apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) +APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) { if (thepipe->pipe == 1) { thepipe->timeout = timeout; @@ -72,7 +72,7 @@ APR_DECLARE(apr_status_t) apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval return APR_EINVAL; } -APR_DECLARE(apr_status_t) apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout) +APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) { if (thepipe->pipe == 1) { *timeout = thepipe->timeout; @@ -81,7 +81,7 @@ APR_DECLARE(apr_status_t) apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval return APR_EINVAL; } -APR_DECLARE(apr_status_t) apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *p) { SECURITY_ATTRIBUTES sa; @@ -117,15 +117,15 @@ APR_DECLARE(apr_status_t) apr_create_pipe(apr_file_t **in, apr_file_t **out, apr return apr_get_os_error(); } - apr_register_cleanup((*in)->cntxt, (void *)(*in), file_cleanup, - apr_null_cleanup); - apr_register_cleanup((*out)->cntxt, (void *)(*out), file_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*in)->cntxt, (void *)(*in), file_cleanup, + apr_pool_cleanup_null); + apr_pool_cleanup_register((*out)->cntxt, (void *)(*out), file_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } /* apr_create_nt_pipe() - * An internal (for now) APR function created for use by apr_create_process() + * An internal (for now) APR function created for use by apr_proc_create() * when setting up pipes to communicate with the child process. * apr_create_nt_pipe() allows setting the blocking mode of each end of * the pipe when the pipe is created (rather than after the pipe is created). @@ -134,7 +134,7 @@ APR_DECLARE(apr_status_t) apr_create_pipe(apr_file_t **in, apr_file_t **out, apr * * In general, we don't want to enable child side pipe handles for async i/o. * This prevents us from enabling both ends of the pipe for async i/o in - * apr_create_pipe. + * apr_file_pipe_create. * * Why not use NamedPipes on NT which support setting pipe state to * non-blocking? On NT, even though you can set a pipe non-blocking, diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 48429bd55..bd8739b49 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -148,7 +148,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le return rv; } -APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *len) { apr_size_t rv; DWORD bytes_read = 0; @@ -175,10 +175,10 @@ APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf, apr_size_t *l apr_size_t blocksize; apr_size_t size = *len; - apr_lock(thefile->mutex); + apr_lock_aquire(thefile->mutex); if (thefile->direction == 1) { - apr_flush(thefile); + apr_file_flush(thefile); thefile->bufpos = 0; thefile->direction = 0; thefile->dataRead = 0; @@ -210,7 +210,7 @@ APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf, apr_size_t *l if (*len) { rv = 0; } - apr_unlock(thefile->mutex); + apr_lock_release(thefile->mutex); } else { /* Unbuffered i/o */ apr_size_t nbytes; @@ -221,7 +221,7 @@ APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf, apr_size_t *l return rv; } -APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) +APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) { apr_status_t rv; DWORD bwrote; @@ -231,7 +231,7 @@ APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf, apr_si int blocksize; int size = *nbytes; - apr_lock(thefile->mutex); + apr_lock_aquire(thefile->mutex); if (thefile->direction == 0) { // Position file pointer for writing at the offset we are logically reading from @@ -245,7 +245,7 @@ APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf, apr_si rv = 0; while (rv == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) // write buffer is full - rv = apr_flush(thefile); + rv = apr_file_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); @@ -254,7 +254,7 @@ APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf, apr_si size -= blocksize; } - apr_unlock(thefile->mutex); + apr_lock_release(thefile->mutex); return rv; } else { if (!thefile->pipe && thefile->append) { @@ -275,7 +275,7 @@ APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf, apr_si /* * Too bad WriteFileGather() is not supported on 95&98 (or NT prior to SP2) */ -APR_DECLARE(apr_status_t) apr_writev(apr_file_t *thefile, +APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) @@ -289,7 +289,7 @@ APR_DECLARE(apr_status_t) apr_writev(apr_file_t *thefile, for (i = 0; i < nvec; i++) { buf = vec[i].iov_base; bwrote = vec[i].iov_len; - rv = apr_write(thefile, buf, &bwrote); + rv = apr_file_write(thefile, buf, &bwrote); *nbytes += bwrote; if (rv != APR_SUCCESS) { break; @@ -298,26 +298,26 @@ APR_DECLARE(apr_status_t) apr_writev(apr_file_t *thefile, return rv; } -APR_DECLARE(apr_status_t) apr_putc(char ch, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile) { DWORD len = 1; - return apr_write(thefile, &ch, &len); + return apr_file_write(thefile, &ch, &len); } -APR_DECLARE(apr_status_t) apr_ungetc(char ch, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile) { thefile->ungetchar = (unsigned char) ch; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_getc(char *ch, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile) { apr_status_t rc; int bread; bread = 1; - rc = apr_read(thefile, ch, &bread); + rc = apr_file_read(thefile, ch, &bread); if (rc) { return rc; @@ -330,14 +330,14 @@ APR_DECLARE(apr_status_t) apr_getc(char *ch, apr_file_t *thefile) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_puts(const char *str, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile) { DWORD len = strlen(str); - return apr_write(thefile, str, &len); + return apr_file_write(thefile, str, &len); } -APR_DECLARE(apr_status_t) apr_fgets(char *str, int len, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) { apr_size_t readlen; apr_status_t rv = APR_SUCCESS; @@ -345,7 +345,7 @@ APR_DECLARE(apr_status_t) apr_fgets(char *str, int len, apr_file_t *thefile) for (i = 0; i < len-1; i++) { readlen = 1; - rv = apr_read(thefile, str+i, &readlen); + rv = apr_file_read(thefile, str+i, &readlen); if (readlen != 1) { rv = APR_EOF; @@ -363,7 +363,7 @@ APR_DECLARE(apr_status_t) apr_fgets(char *str, int len, apr_file_t *thefile) return rv; } -APR_DECLARE(apr_status_t) apr_flush(apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) { if (thefile->buffered) { DWORD written = 0; @@ -393,7 +393,7 @@ static int printf_flush(apr_vformatter_buff_t *vbuff) return -1; } -APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) +APR_DECLARE(int) apr_file_printf(apr_file_t *fptr, const char *format, ...) { int cc; va_list ap; @@ -406,7 +406,7 @@ APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) } va_start(ap, format); len = apr_vsnprintf(buf, HUGE_STRING_LEN, format, ap); - cc = apr_puts(buf, fptr); + cc = apr_file_puts(buf, fptr); va_end(ap); free(buf); return (cc == APR_SUCCESS) ? len : -1; diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 1e102739c..69e0ff031 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -63,7 +63,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) DWORD rc; if (thefile->direction == 1) { - apr_flush(thefile); + apr_file_flush(thefile); thefile->bufpos = thefile->direction = thefile->dataRead = 0; } @@ -86,7 +86,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) -APR_DECLARE(apr_status_t) apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) +APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) { DWORD howmove; DWORD rv; @@ -105,7 +105,7 @@ APR_DECLARE(apr_status_t) apr_seek(apr_file_t *thefile, apr_seek_where_t where, break; case APR_END: - rc = apr_getfileinfo(&finfo, APR_FINFO_SIZE, thefile); + rc = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); if (rc == APR_SUCCESS && (finfo.valid & APR_FINFO_SIZE)) rc = setptr(thefile, finfo.size - *offset); break; diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index 3ae49c59e..f9c703430 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -264,8 +264,8 @@ apr_status_t apr_xlate_open(apr_xlate_t **convset, const char *topage, if (found) { *convset = new; - apr_register_cleanup(pool, (void *)new, apr_xlate_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register(pool, (void *)new, apr_xlate_cleanup, + apr_pool_cleanup_null); status = APR_SUCCESS; } else { @@ -360,7 +360,7 @@ apr_status_t apr_xlate_close(apr_xlate_t *convset) apr_status_t status; if ((status = apr_xlate_cleanup(convset)) == APR_SUCCESS) { - apr_kill_cleanup(convset->pool, convset, apr_xlate_cleanup); + apr_pool_cleanup_kill(convset->pool, convset, apr_xlate_cleanup); } return status; diff --git a/include/apr_compat.h b/include/apr_compat.h index c9d1dd76b..d33d50a53 100644 --- a/include/apr_compat.h +++ b/include/apr_compat.h @@ -6,48 +6,48 @@ #define ap_inline apr_inline #define ap_md5_ctx_t apr_md5_ctx_t -#define ap_MD5Encode apr_MD5Encode -#define ap_MD5Final apr_MD5Final -#define ap_MD5Init apr_MD5Init -#define ap_MD5Update apr_MD5Update -#define ap_append_arrays apr_append_arrays +#define ap_MD5Encode apr_md5_encode +#define ap_MD5Final apr_md5_final +#define ap_MD5Init apr_md5_init +#define ap_MD5Update apr_md5_update +#define ap_append_arrays apr_array_append #define ap_array_cat apr_array_cat #define ap_array_header_t apr_array_header_t #define ap_array_pstrcat apr_array_pstrcat -#define ap_bytes_in_free_blocks apr_bytes_in_free_blocks -#define ap_bytes_in_pool apr_bytes_in_pool +#define ap_bytes_in_free_blocks apr_pool_free_blocks_num_bytes +#define ap_bytes_in_pool apr_pool_num_bytes #define ap_check_file_time apr_check_file_time #define ap_filetype_e apr_filetype_e -#define ap_cleanup_for_exec apr_cleanup_for_exec +#define ap_cleanup_for_exec apr_pool_cleanup_for_exec #define ap_clear_pool apr_clear_pool -#define ap_clear_table apr_clear_table -#define ap_copy_array apr_copy_array -#define ap_copy_array_hdr apr_copy_array_hdr -#define ap_copy_table apr_copy_table +#define ap_clear_table apr_table_clear +#define ap_copy_array apr_array_copy +#define ap_copy_array_hdr apr_array_copy_hdr +#define ap_copy_table apr_table_copy #define ap_cpystrn apr_cpystrn #define ap_day_snames apr_day_snames -#define ap_destroy_pool apr_destroy_pool +#define ap_destroy_pool apr_pool_destroy #define ap_exploded_time_t apr_exploded_time_t #define ap_fnmatch apr_fnmatch #define ap_getopt apr_getopt #define ap_inet_addr apr_inet_addr -#define ap_init_alloc apr_init_alloc +#define ap_init_alloc apr_pool_alloc_init #define ap_is_empty_table apr_is_empty_table #define ap_is_fnmatch apr_is_fnmatch -#define ap_kill_cleanup apr_kill_cleanup -#define ap_make_array apr_make_array -#define ap_make_sub_pool apr_make_sub_pool -#define ap_make_table apr_make_table +#define ap_kill_cleanup apr_pool_cleanup_kill +#define ap_make_array apr_array_make +#define ap_make_sub_pool apr_pool_sub_make +#define ap_make_table apr_table_make #define ap_month_snames apr_month_snames -#define ap_note_subprocess apr_note_subprocess -#define ap_null_cleanup apr_null_cleanup +#define ap_note_subprocess apr_pool_note_subprocess +#define ap_null_cleanup apr_pool_cleanup_null #define ap_os_dso_load apr_dso_load #define ap_os_dso_unload apr_dso_unload #define ap_os_dso_sym apr_dso_sym #define ap_os_dso_error apr_dso_error -#define ap_os_kill apr_kill -#define ap_overlap_tables apr_overlap_tables -#define ap_overlay_tables apr_overlay_tables +#define ap_os_kill apr_proc_kill +#define ap_overlap_tables apr_table_overlap +#define ap_overlay_tables apr_table_overlay #define ap_palloc apr_palloc #define ap_pcalloc apr_pcalloc #define ap_pool_join apr_pool_join @@ -55,11 +55,11 @@ #define ap_pstrcat apr_pstrcat #define ap_pstrdup apr_pstrdup #define ap_pstrndup apr_pstrndup -#define ap_push_array apr_push_array +#define ap_push_array apr_array_push #define ap_pvsprintf apr_pvsprintf -#define ap_register_cleanup apr_register_cleanup -#define ap_register_other_child apr_register_other_child -#define ap_run_cleanup apr_run_cleanup +#define ap_register_cleanup apr_pool_cleanup_register +#define ap_register_other_child apr_proc_other_child_register +#define ap_run_cleanup apr_pool_cleanup_run #define ap_signal apr_signal #define ap_snprintf apr_snprintf #define ap_table_add apr_table_add @@ -72,8 +72,8 @@ #define ap_table_set apr_table_set #define ap_table_setn apr_table_setn #define ap_table_unset apr_table_unset -#define ap_unregister_other_child apr_unregister_other_child -#define ap_validate_password apr_validate_password +#define ap_unregister_other_child apr_proc_other_child_unregister +#define ap_validate_password apr_password_validate #define ap_vformatter apr_vformatter #define ap_vsnprintf apr_vsnprintf #define ap_wait_t apr_wait_t diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 4cc02140d..5d864ca9b 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -73,7 +73,7 @@ extern "C" { * @package APR File handling */ -/* Flags for apr_open */ +/* Flags for apr_file_open */ #define APR_READ 1 /* Open the file for reading */ #define APR_WRITE 2 /* Open the file for writing */ #define APR_CREATE 4 /* Create the file if not there */ @@ -87,7 +87,7 @@ extern "C" { #define APR_XTHREAD 512 /* Platform dependent tag to open the file for use across multiple threads */ -/* flags for apr_seek */ +/* flags for apr_file_seek */ #define APR_SET SEEK_SET #define APR_CUR SEEK_CUR #define APR_END SEEK_END @@ -136,30 +136,30 @@ typedef struct apr_file_t apr_file_t; * </PRE> * @param perm Access permissions for file. * @param cont The pool to use. - * @deffunc apr_status_t apr_open(apr_file_t **new_file, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) + * @deffunc apr_status_t apr_file_open(apr_file_t **new_file, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) * @tip If perm is APR_OS_DEFAULT and the file is being created, appropriate * default permissions will be used. *arg1 must point to a valid file_t, * or NULL (in which case it will be allocated) */ -APR_DECLARE(apr_status_t) apr_open(apr_file_t **new_file, const char *fname, +APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new_file, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont); /** * Close the specified file. * @param file The file descriptor to close. - * @deffunc apr_status_t apr_close(apr_file_t *file) + * @deffunc apr_status_t apr_file_close(apr_file_t *file) */ -APR_DECLARE(apr_status_t) apr_close(apr_file_t *file); +APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file); /** * delete the specified file. * @param path The full path to the file (using / on all systems) * @param cont The pool to use. - * @deffunc apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) + * @deffunc apr_status_t apr_file_remove(const char *path, apr_pool_t *cont) * @tip If the file is open, it won't be removed until all instances are closed. */ -APR_DECLARE(apr_status_t) apr_remove_file(const char *path, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont); /** * rename the specified file. @@ -168,9 +168,9 @@ APR_DECLARE(apr_status_t) apr_remove_file(const char *path, apr_pool_t *cont); * @param pool The pool to use. * @tip If a file exists at the new location, then it will be overwritten. * Moving files or directories across devices may not be possible. - * @deffunc apr_status_t apr_rename_file(const char *from_path, const char *to_path, apr_pool_t *pool) + * @deffunc apr_status_t apr_file_rename(const char *from_path, const char *to_path, apr_pool_t *pool) */ -APR_DECLARE(apr_status_t) apr_rename_file(const char *from_path, +APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, const char *to_path, apr_pool_t *pool); @@ -178,34 +178,34 @@ APR_DECLARE(apr_status_t) apr_rename_file(const char *from_path, * Are we at the end of the file * @param fptr The apr file we are testing. * @tip Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise. - * @deffunc apr_status_t apr_eof(apr_file_t *fptr) + * @deffunc apr_status_t apr_file_eof(apr_file_t *fptr) */ -APR_DECLARE(apr_status_t) apr_eof(apr_file_t *fptr); +APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr); /** * Is there an error on the stream? * @param fptr The apr file we are testing. * @tip Returns -1 if the error indicator is set, APR_SUCCESS otherwise. - * @deffunc apr_status_t apr_ferror(apr_file_t *fptr) + * @deffunc apr_status_t apr_file_error(apr_file_t *fptr) */ -APR_DECLARE(apr_status_t) apr_ferror(apr_file_t *fptr); +APR_DECLARE(apr_status_t) apr_file_error(apr_file_t *fptr); /** * open standard error as an apr file pointer. * @param thefile The apr file to use as stderr. * @param cont The pool to allocate the file out of. - * @deffunc apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) + * @deffunc apr_status_t apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_open_stderr(apr_file_t **thefile, +APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont); /** * open standard output as an apr file pointer. * @param thefile The apr file to use as stdout. * @param cont The pool to allocate the file out of. - * @deffunc apr_status_t apr_open_stdout(apr_file_t **thefile, apr_pool_t *cont) + * @deffunc apr_status_t apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_open_stdout(apr_file_t **thefile, +APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont); /** @@ -213,7 +213,7 @@ APR_DECLARE(apr_status_t) apr_open_stdout(apr_file_t **thefile, * @param thefile The file descriptor to read from. * @param buf The buffer to store the data to. * @param nbytes On entry, the number of bytes to read; on exit, the number of bytes read. - * @tip apr_read will read up to the specified number of bytes, but never + * @tip apr_file_read will read up to the specified number of bytes, but never * more. If there isn't enough data to fill that number of bytes, all * of the available data is read. The third argument is modified to * reflect the number of bytes read. If a char was put back into the @@ -223,9 +223,9 @@ APR_DECLARE(apr_status_t) apr_open_stdout(apr_file_t **thefile, * error to be returned. * * APR_EINTR is never returned. - * @deffunc apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) + * @deffunc apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) */ -APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf, +APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes); /** @@ -234,7 +234,7 @@ APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf, * @param buf The buffer which contains the data. * @param nbytes On entry, the number of bytes to write; on exit, the number * of bytes written. - * @tip apr_write will write up to the specified number of bytes, but never + * @tip apr_file_write will write up to the specified number of bytes, but never * more. If the OS cannot write that many bytes, it will write as many * as it can. The third argument is modified to reflect the * number * of bytes written. @@ -242,9 +242,9 @@ APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf, * It is possible for both bytes to be written and an error to be returned. * * APR_EINTR is never returned. - * @deffunc apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) + * @deffunc apr_status_t apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) */ -APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf, +APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes); /** @@ -258,12 +258,12 @@ APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf, * @tip It is possible for both bytes to be written and an error to be returned. * APR_EINTR is never returned. * - * apr_writev is available even if the underlying operating system + * apr_file_writev is available even if the underlying operating system * * doesn't provide writev(). - * @deffunc apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) + * @deffunc apr_status_t apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) */ -APR_DECLARE(apr_status_t) apr_writev(apr_file_t *thefile, +APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes); @@ -274,7 +274,7 @@ APR_DECLARE(apr_status_t) apr_writev(apr_file_t *thefile, * @param buf The buffer to store the data to. * @param nbytes The number of bytes to read. * @param bytes_read If non-NULL, this will contain the number of bytes read. - * @tip apr_read will read up to the specified number of bytes, but never + * @tip apr_file_read will read up to the specified number of bytes, but never * more. If there isn't enough data to fill that number of bytes, * then the process/thread will block until it is available or EOF * is reached. If a char was put back into the stream via ungetc, @@ -284,9 +284,9 @@ APR_DECLARE(apr_status_t) apr_writev(apr_file_t *thefile, * error to be returned. * * APR_EINTR is never returned. - * @deffunc apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read) + * @deffunc apr_status_t apr_file_read_file(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read) */ -APR_DECLARE(apr_status_t) apr_full_read(apr_file_t *thefile, void *buf, +APR_DECLARE(apr_status_t) apr_file_read_file(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read); @@ -297,7 +297,7 @@ APR_DECLARE(apr_status_t) apr_full_read(apr_file_t *thefile, void *buf, * @param buf The buffer which contains the data. * @param nbytes The number of bytes to write. * @param bytes_written If non-NULL, this will contain the number of bytes written. - * @tip apr_write will write up to the specified number of bytes, but never + * @tip apr_file_write will write up to the specified number of bytes, but never * more. If the OS cannot write that many bytes, the process/thread * will block until they can be written. Exceptional error such as * "out of space" or "pipe closed" will terminate with an error. @@ -305,9 +305,9 @@ APR_DECLARE(apr_status_t) apr_full_read(apr_file_t *thefile, void *buf, * It is possible for both bytes to be written and an error to be returned. * * APR_EINTR is never returned. - * @deffunc apr_status_t apr_full_write(apr_file_t *thefile, const void *buf, apr_size_t nbytes, apr_size_t *bytes_written) + * @deffunc apr_status_t apr_file_write_full(apr_file_t *thefile, const void *buf, apr_size_t nbytes, apr_size_t *bytes_written) */ -APR_DECLARE(apr_status_t) apr_full_write(apr_file_t *thefile, const void *buf, +APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, const void *buf, apr_size_t nbytes, apr_size_t *bytes_written); @@ -315,49 +315,49 @@ APR_DECLARE(apr_status_t) apr_full_write(apr_file_t *thefile, const void *buf, * put a character into the specified file. * @param ch The character to write. * @param thefile The file descriptor to write to - * @deffunc apr_status_t apr_putc(char ch, apr_file_t *thefile) + * @deffunc apr_status_t apr_file_putc(char ch, apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_putc(char ch, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile); /** * get a character from the specified file. * @param ch The character to write. * @param thefile The file descriptor to write to - * @deffunc apr_status_t apr_getc(char *ch, apr_file_t *thefile) + * @deffunc apr_status_t apr_file_getc(char *ch, apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_getc(char *ch, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile); /** * put a character back onto a specified stream. * @param ch The character to write. * @param thefile The file descriptor to write to - * @deffunc apr_status_t apr_ungetc(char ch, apr_file_t *thefile) + * @deffunc apr_status_t apr_file_ungetc(char ch, apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_ungetc(char ch, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile); /** * Get a string from a specified file. * @param str The buffer to store the string in. * @param len The length of the string * @param thefile The file descriptor to read from - * @deffunc apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) + * @deffunc apr_status_t apr_file_gets(char *str, int len, apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_fgets(char *str, int len, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile); /** * Put the string into a specified file. * @param str The string to write. * @param thefile The file descriptor to write to - * @deffunc apr_status_t apr_puts(const char *str, apr_file_t *thefile) + * @deffunc apr_status_t apr_file_puts(const char *str, apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_puts(const char *str, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile); /** * Flush the file's buffer. * @param thefile The file descriptor to flush - * @deffunc apr_status_t apr_flush(apr_file_t *thefile) + * @deffunc apr_status_t apr_file_flush(apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_flush(apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile); /** * duplicate the specified file descriptor. @@ -365,9 +365,9 @@ APR_DECLARE(apr_status_t) apr_flush(apr_file_t *thefile); * @param old_file The file to duplicate. * @param p The pool to use for the new file. * @tip *arg1 must point to a valid apr_file_t, or point to NULL - * @deffunc apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) + * @deffunc apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) */ -APR_DECLARE(apr_status_t) apr_dupfile(apr_file_t **new_file, +APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p); @@ -382,9 +382,9 @@ APR_DECLARE(apr_status_t) apr_dupfile(apr_file_t **new_file, * @param offset The offset to move the pointer to. * @tip The third argument is modified to be the offset the pointer was actually moved to. - * @deffunc apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) + * @deffunc apr_status_t apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) */ -APR_DECLARE(apr_status_t) apr_seek(apr_file_t *thefile, +APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset); @@ -393,9 +393,9 @@ APR_DECLARE(apr_status_t) apr_seek(apr_file_t *thefile, * @param in The file descriptor to use as input to the pipe. * @param out The file descriptor to use as output from the pipe. * @param cont The pool to operate on. - * @deffunc apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) + * @deffunc apr_status_t apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_pipe(apr_file_t **in, apr_file_t **out, +APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont); /** @@ -403,9 +403,9 @@ APR_DECLARE(apr_status_t) apr_create_pipe(apr_file_t **in, apr_file_t **out, * @param filename The filename of the named pipe * @param perm The permissions for the newly created pipe. * @param cont The pool to operate on. - * @deffunc apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) + * @deffunc apr_status_t apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_namedpipe(const char *filename, +APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *cont); @@ -413,9 +413,9 @@ APR_DECLARE(apr_status_t) apr_create_namedpipe(const char *filename, * Get the timeout value for a pipe or manipulate the blocking state. * @param thepipe The pipe we are getting a timeout for. * @param timeout The current timeout value in microseconds. - * @deffunc apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout) + * @deffunc apr_status_t apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) */ -APR_DECLARE(apr_status_t) apr_get_pipe_timeout(apr_file_t *thepipe, +APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout); /** @@ -423,9 +423,9 @@ APR_DECLARE(apr_status_t) apr_get_pipe_timeout(apr_file_t *thepipe, * @param thepipe The pipe we are setting a timeout on. * @param timeout The timeout value in microseconds. Values < 0 mean wait * forever, 0 means do not wait at all. - * @deffunc apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) + * @deffunc apr_status_t apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) */ -APR_DECLARE(apr_status_t) apr_set_pipe_timeout(apr_file_t *thepipe, +APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout); /** file (un)locking functions. */ @@ -438,16 +438,16 @@ APR_DECLARE(apr_status_t) apr_set_pipe_timeout(apr_file_t *thepipe, * block. * @param thefile The file to lock. * @param type The type of lock to establish on the file. - * @deffunc apr_status_t apr_lock_file(apr_file_t *thefile, int type) + * @deffunc apr_status_t apr_file_lock(apr_file_t *thefile, int type) */ -APR_DECLARE(apr_status_t) apr_lock_file(apr_file_t *thefile, int type); +APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type); /** * Remove any outstanding locks on the file. * @param thefile The file to unlock. - * @deffunc apr_status_t apr_unlock_file(apr_file_t *thefile) + * @deffunc apr_status_t apr_file_unlock(apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_unlock_file(apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile); /**accessor and general file_io functions. */ @@ -455,9 +455,9 @@ APR_DECLARE(apr_status_t) apr_unlock_file(apr_file_t *thefile); * return the file name of the current file. * @param new_path The path of the file. * @param thefile The currently open file. - * @deffunc apr_status_t apr_get_filename(const char **new_path, apr_file_t *thefile) + * @deffunc apr_status_t apr_file_name_get(const char **new_path, apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_get_filename(const char **new_path, +APR_DECLARE(apr_status_t) apr_file_name_get(const char **new_path, apr_file_t *thefile); /** @@ -465,9 +465,9 @@ APR_DECLARE(apr_status_t) apr_get_filename(const char **new_path, * @param data The user data associated with the file. * @param key The key to use for retreiving data associated with this file. * @param file The currently open file. - * @deffunc apr_status_t apr_get_filedata(void **data, const char *key, apr_file_t *file) + * @deffunc apr_status_t apr_file_data_get(void **data, const char *key, apr_file_t *file) */ -APR_DECLARE(apr_status_t) apr_get_filedata(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key, apr_file_t *file); /** @@ -476,9 +476,9 @@ APR_DECLARE(apr_status_t) apr_get_filedata(void **data, const char *key, * @param data The user data to associate with the file. * @param key The key to use for assocaiteing data with the file. * @param cleanup The cleanup routine to use when the file is destroyed. - * @deffunc apr_status_t apr_set_filedata(apr_file_t *file, void *data, const char *key, apr_status_t (*cleanup)(void *)) + * @deffunc apr_status_t apr_file_data_set(apr_file_t *file, void *data, const char *key, apr_status_t (*cleanup)(void *)) */ -APR_DECLARE(apr_status_t) apr_set_filedata(apr_file_t *file, void *data, +APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, void *data, const char *key, apr_status_t (*cleanup)(void *)); @@ -488,9 +488,9 @@ APR_DECLARE(apr_status_t) apr_set_filedata(apr_file_t *file, void *data, * @param format The format string * @param ... The values to substitute in the format string * @return The number of bytes written - * @deffunc int apr_fprintf(apr_file_t *fptr, const char *format, ...) + * @deffunc int apr_file_printf(apr_file_t *fptr, const char *format, ...) */ -APR_DECLARE_NONSTD(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) +APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, const char *format, ...) __attribute__((format(printf,2,3))); /** @@ -502,9 +502,9 @@ APR_DECLARE_NONSTD(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) * are specified which could not be set. * * Platforms which do not implement this feature will return APR_ENOTIMPL. - * @deffunc apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) + * @deffunc apr_status_t apr_file_perms_set(const char *fname, apr_fileperms_t perms) */ -APR_DECLARE(apr_status_t) apr_setfileperms(const char *fname, +APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, apr_fileperms_t perms); /** @@ -512,34 +512,34 @@ APR_DECLARE(apr_status_t) apr_setfileperms(const char *fname, * @param path the path for the directory to be created. (use / on all systems) * @param perm Permissions for the new direcoty. * @param cont the pool to use. - * @deffunc apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) + * @deffunc apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_make_dir(const char *path, apr_fileperms_t perm, +APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont); /** * Remove directory from the file system. * @param path the path for the directory to be removed. (use / on all systems) * @param cont the pool to use. - * @deffunc apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) + * @deffunc apr_status_t apr_dir_remove(const char *path, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_remove_dir(const char *path, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *cont); /** * get the specified file's stats. * @param finfo Where to store the information about the file. * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values * @param thefile The file to get information about. - * @deffunc apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) + * @deffunc apr_status_t apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, +APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile); /** * Get the pool used by the file. * @return apr_pool_t the pool - * @deffunc apr_pool_t apr_get_file_pool(apr_file_t *f) + * @deffunc apr_pool_t apr_file_pool_get(apr_file_t *f) */ APR_POOL_DECLARE_ACCESSOR(file); diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 404b7e77a..f05a1e1e6 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -115,14 +115,14 @@ struct apr_getopt_option_t { * @param argc The number of arguments to parse * @param argv The array of arguments to parse * @tip Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) - * @deffunc apr_status_t apr_initopt(apr_getopt_t **os, apr_pool_t *cont,int argc, char *const *argv) + * @deffunc apr_status_t apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont,int argc, char *const *argv) */ -APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, +APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont, int argc, const char * const *argv); /** - * Parse the options initialized by apr_initopt(). - * @param os The apr_opt_t structure returned by apr_initopt() + * Parse the options initialized by apr_getopt_init(). + * @param os The apr_opt_t structure returned by apr_getopt_init() * @param opts A string of characters that are acceptable options to the * program. Characters followed by ":" are required to have an * option associated @@ -141,10 +141,10 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, char *optch, const char **optarg); /** - * Parse the options initialized by apr_initopt(), accepting long + * Parse the options initialized by apr_getopt_init(), accepting long * options beginning with "--" in addition to single-character * options beginning with "-". - * @param os The apr_getopt_t structure created by apr_initopt() + * @param os The apr_getopt_t structure created by apr_getopt_init() * @param opts A pointer to a list of apr_getopt_option_t structures, which * can be initialized with { "name", optch, has_args }. has_args * is nonzero if the option requires an argument. A structure diff --git a/include/apr_hash.h b/include/apr_hash.h index 77a2ce01e..8cb109606 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -97,9 +97,9 @@ typedef struct apr_hash_index_t apr_hash_index_t; * Create a hash table. * @param pool The pool to allocate the hash table out of * @return The hash table just created - * @deffunc apr_hash_t *apr_make_hash(apr_pool_t *pool) + * @deffunc apr_hash_t *apr_hash_make(apr_pool_t *pool) */ -APR_DECLARE(apr_hash_t *) apr_make_hash(apr_pool_t *pool); +APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool); /** * Associate a value with a key in a hash table. diff --git a/include/apr_lib.h b/include/apr_lib.h index fbaeac5c3..50bf956d9 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -212,9 +212,9 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), * Validate any password encypted with any algorithm that APR understands * @param passwd The password to validate * @param hash The password to validate against - * @deffunc apr_status_t apr_validate_password(const char *passwd, const char *hash) + * @deffunc apr_status_t apr_password_validate(const char *passwd, const char *hash) */ -APR_DECLARE(apr_status_t) apr_validate_password(const char *passwd, +APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, const char *hash); /* @@ -264,9 +264,9 @@ APR_DECLARE(int) apr_vsnprintf(char *buf, size_t len, const char *format, * @param prompt The prompt to display * @param pwbuf Where to store the password * @param bufsize The length of the password string. - * @deffunc apr_status_t apr_getpass(const char *prompt, char *pwbuf, size_t *bufsize) + * @deffunc apr_status_t apr_password_get(const char *prompt, char *pwbuf, size_t *bufsize) */ -APR_DECLARE(apr_status_t) apr_getpass(const char *prompt, char *pwbuf, +APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, size_t *bufsize); #ifdef __cplusplus diff --git a/include/apr_lock.h b/include/apr_lock.h index eaeaff977..aec0bce6e 100644 --- a/include/apr_lock.h +++ b/include/apr_lock.h @@ -96,9 +96,9 @@ typedef struct apr_lock_t apr_lock_t; * @param cont The pool to operate on. * @tip APR_CROSS_PROCESS may lock both processes and threads, but it is * only guaranteed to lock processes. - * @deffunc apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, apr_pool_t *cont) + * @deffunc apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_lock(apr_lock_t **lock, +APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, @@ -107,25 +107,25 @@ APR_DECLARE(apr_status_t) apr_create_lock(apr_lock_t **lock, /** * Lock a protected region. * @param lock The lock to set. - * @deffunc apr_status_t apr_lock(apr_lock_t *lock) + * @deffunc apr_status_t apr_lock_aquire(apr_lock_t *lock) */ -APR_DECLARE(apr_status_t) apr_lock(apr_lock_t *lock); +APR_DECLARE(apr_status_t) apr_lock_aquire(apr_lock_t *lock); /** * Unlock a protected region. * @param lock The lock to reset. - * @deffunc apr_status_t apr_unlock(apr_lock_t *lock) + * @deffunc apr_status_t apr_lock_release(apr_lock_t *lock) */ -APR_DECLARE(apr_status_t) apr_unlock(apr_lock_t *lock); +APR_DECLARE(apr_status_t) apr_lock_release(apr_lock_t *lock); /** * Free the memory associated with a lock. * @param lock The lock to free. - * @deffunc apr_status_t apr_destroy_lock(apr_lock_t *lock) + * @deffunc apr_status_t apr_lock_destroy(apr_lock_t *lock) * @tip If the lock is currently active when it is destroyed, it * will be unlocked first. */ -APR_DECLARE(apr_status_t) apr_destroy_lock(apr_lock_t *lock); +APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock); /** * Re-open a lock in a child process. @@ -133,15 +133,15 @@ APR_DECLARE(apr_status_t) apr_destroy_lock(apr_lock_t *lock); * @param fname A file name to use if the lock mechanism requires one. This * argument should always be provided. The lock code itself will * determine if it should be used. This filename should be the - * same one that was passed to apr_create_lock + * same one that was passed to apr_lock_create * @param cont The pool to operate on. * @tip This function doesn't always do something, it depends on the * locking mechanism chosen for the platform, but it is a good * idea to call it regardless, because it makes the code more * portable. - * @deffunc apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, apr_pool_t *cont) + * @deffunc apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_child_init_lock(apr_lock_t **lock, +APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, const char *fname, apr_pool_t *cont); @@ -150,9 +150,9 @@ APR_DECLARE(apr_status_t) apr_child_init_lock(apr_lock_t **lock, * @param lock The currently open lock. * @param key The key to use when retreiving data associated with this lock * @param data The user data associated with the lock. - * @deffunc apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data) + * @deffunc apr_status_t apr_lock_data_get(apr_lock_t *lock, const char *key, void *data) */ -APR_DECLARE(apr_status_t) apr_get_lockdata(apr_lock_t *lock, const char *key, +APR_DECLARE(apr_status_t) apr_lock_data_get(apr_lock_t *lock, const char *key, void *data); /** @@ -161,9 +161,9 @@ APR_DECLARE(apr_status_t) apr_get_lockdata(apr_lock_t *lock, const char *key, * @param data The user data to associate with the lock. * @param key The key to use when associating data with this lock * @param cleanup The cleanup to use when the lock is destroyed. - * @deffunc apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, apr_status_t (*cleanup)(void *)) + * @deffunc apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, apr_status_t (*cleanup)(void *)) */ -APR_DECLARE(apr_status_t) apr_set_lockdata(apr_lock_t *lock, void *data, +APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, apr_status_t (*cleanup)(void *)); diff --git a/include/apr_md5.h b/include/apr_md5.h index b38fc2584..ebf013d45 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -119,22 +119,22 @@ struct apr_md5_ctx_t { /** * MD5 Initialize. Begins an MD5 operation, writing a new context. * @param context The MD5 context to initialize. - * @deffunc apr_status_t apr_MD5Init(apr_md5_ctx_t *context) + * @deffunc apr_status_t apr_md5_init(apr_md5_ctx_t *context) */ -APR_DECLARE(apr_status_t) apr_MD5Init(apr_md5_ctx_t *context); +APR_DECLARE(apr_status_t) apr_md5_init(apr_md5_ctx_t *context); /** * MD5 translation setup. Provides the APR translation handle to be used * for translating the content before calculating the digest. * @param context The MD5 content to set the translation for. * @param xlate The translation handle to use for this MD5 context - * @deffunc apr_status_t apr_MD5SetXlate(apr_md5_ctx_t *context, apr_xlate_t *xlate) + * @deffunc apr_status_t apr_md5_set_xlate(apr_md5_ctx_t *context, apr_xlate_t *xlate) */ #if APR_HAS_XLATE -APR_DECLARE(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, +APR_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context, apr_xlate_t *xlate); #else -#define apr_MD5SetXlate(context, xlate) APR_ENOTIMPL +#define apr_md5_set_xlate(context, xlate) APR_ENOTIMPL #endif /** @@ -143,9 +143,9 @@ APR_DECLARE(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, * @param context The MD5 content to update. * @param input next message block to update * @param inputLen The length of the next message block - * @deffunc apr_status_t apr_MD5Update(apr_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) + * @deffunc apr_status_t apr_md5_update(apr_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) */ -APR_DECLARE(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, +APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen); @@ -154,9 +154,9 @@ APR_DECLARE(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, * message digest and zeroing the context * @param digest The final MD5 digest * @param context The MD5 content we are finalizing. - * @deffunc apr_status_t apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], apr_md5_ctx_t *context) + * @deffunc apr_status_t apr_md5_final(unsigned char digest[MD5_DIGESTSIZE], apr_md5_ctx_t *context) */ -APR_DECLARE(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], +APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE], apr_md5_ctx_t *context); /** @@ -165,9 +165,9 @@ APR_DECLARE(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], * @param salt The salt to use for the encoding * @param result The string to store the encoded password in * @param nbytes The length of the string - * @deffunc apr_status_t apr_MD5Encode(const char *password, const char *salt, char *result, size_t nbytes) + * @deffunc apr_status_t apr_md5_encode(const char *password, const char *salt, char *result, size_t nbytes) */ -APR_DECLARE(apr_status_t) apr_MD5Encode(const char *password, const char *salt, +APR_DECLARE(apr_status_t) apr_md5_encode(const char *password, const char *salt, char *result, size_t nbytes); #ifdef __cplusplus diff --git a/include/apr_network_io.h b/include/apr_network_io.h index a647bb289..b267a287b 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -194,7 +194,7 @@ struct apr_sockaddr_t { /** This points to the IP address structure within the appropriate * sockaddr structure. */ void *ipaddr_ptr; - /** If multiple addresses were found by apr_getaddrinfo(), this + /** If multiple addresses were found by apr_sockaddr_info_get(), this * points to a representation of the next address. */ apr_sockaddr_t *next; }; @@ -226,9 +226,9 @@ struct apr_hdtr_t { * @param family The address family of the socket (e.g., APR_INET). * @param type The type of the socket (e.g., SOCK_STREAM). * @param cont The pool to use - * @deffunc apr_status_t apr_create_socket(apr_socket_t **new_sock, int family, int type, apr_pool_t *cont) + * @deffunc apr_status_t apr_socket_create(apr_socket_t **new_sock, int family, int type, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_socket(apr_socket_t **new_sock, +APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock, int family, int type, apr_pool_t *cont); @@ -251,9 +251,9 @@ APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, /** * Close a tcp socket. * @param thesocket The socket to close - * @deffunc apr_status_t apr_close_socket(apr_socket_t *thesocket) + * @deffunc apr_status_t apr_socket_close(apr_socket_t *thesocket) */ -APR_DECLARE(apr_status_t) apr_close_socket(apr_socket_t *thesocket); +APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket); /** * Bind the socket to its associated port @@ -308,9 +308,9 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa); * @param port The port number. * @param flags Special processing flags. * @param p The pool for the apr_sockaddr_t and associated storage. - * @deffunc apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t *p) + * @deffunc apr_status_t apr_sockaddr_info_get(apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t *p) */ -APR_DECLARE(apr_status_t) apr_getaddrinfo(apr_sockaddr_t **sa, +APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, @@ -377,9 +377,9 @@ APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont); * @param data The user data associated with the socket. * @param key The key to associate with the user data. * @param sock The currently open socket. - * @deffunc apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *sock) + * @deffunc apr_status_t apr_socket_data_get(void **data, const char *key, apr_socket_t *sock) */ -APR_DECLARE(apr_status_t) apr_get_socketdata(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, apr_socket_t *sock); /** @@ -388,9 +388,9 @@ APR_DECLARE(apr_status_t) apr_get_socketdata(void **data, const char *key, * @param data The user data to associate with the socket. * @param key The key to associate with the data. * @param cleanup The cleanup to call when the socket is destroyed. - * @deffunc apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup)(void*)) + * @deffunc apr_status_t apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup)(void*)) */ -APR_DECLARE(apr_status_t) apr_set_socketdata(apr_socket_t *sock, void *data, +APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup)(void*)); @@ -537,9 +537,9 @@ APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, * @param sa The returned apr_sockaddr_t. * @param which Which interface do we want the apr_sockaddr_t for? * @param sock The socket to use - * @deffunc apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock) + * @deffunc apr_status_t apr_socket_addr_get(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock) */ -APR_DECLARE(apr_status_t) apr_get_sockaddr(apr_sockaddr_t **sa, +APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock); @@ -547,18 +547,18 @@ APR_DECLARE(apr_status_t) apr_get_sockaddr(apr_sockaddr_t **sa, * Set the port in an APR socket address. * @param sockaddr The socket address to set. * @param port The port to be stored in the socket address. - * @deffunc apr_status_t apr_set_port(apr_sockaddr_t *sockaddr, apr_port_t port) + * @deffunc apr_status_t apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, apr_port_t port) */ -APR_DECLARE(apr_status_t) apr_set_port(apr_sockaddr_t *sockaddr, +APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, apr_port_t port); /** * Return the port in an APR socket address. * @param port The port from the socket address. * @param sockaddr The socket address to reference. - * @deffunc apr_status_t apr_get_port(apr_port_t *port, apr_sockaddr_t *sockaddr) + * @deffunc apr_status_t apr_sockaddr_port_get(apr_port_t *port, apr_sockaddr_t *sockaddr) */ -APR_DECLARE(apr_status_t) apr_get_port(apr_port_t *port, +APR_DECLARE(apr_status_t) apr_sockaddr_port_get(apr_port_t *port, apr_sockaddr_t *sockaddr); /** @@ -566,9 +566,9 @@ APR_DECLARE(apr_status_t) apr_get_port(apr_port_t *port, * @param sockaddr The socket address to use * @param addr The IP address to attach to the socket. * Use APR_ANYADDR to use any IP addr on the machine. - * @deffunc apr_status_t apr_set_ipaddr(apr_sockaddr_t *sockaddr, const char *addr) + * @deffunc apr_status_t apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, const char *addr) */ -APR_DECLARE(apr_status_t) apr_set_ipaddr(apr_sockaddr_t *sockaddr, +APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, const char *addr); /** @@ -576,9 +576,9 @@ APR_DECLARE(apr_status_t) apr_set_ipaddr(apr_sockaddr_t *sockaddr, * an APR socket address. * @param addr The IP address. * @param sockaddr The socket address to reference. - * @deffunc apr_status_t apr_get_ipaddr(char **addr, apr_sockaddr_t *sockaddr) + * @deffunc apr_status_t apr_sockaddr_ip_get(char **addr, apr_sockaddr_t *sockaddr) */ -APR_DECLARE(apr_status_t) apr_get_ipaddr(char **addr, +APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, apr_sockaddr_t *sockaddr); /** @@ -586,9 +586,9 @@ APR_DECLARE(apr_status_t) apr_get_ipaddr(char **addr, * @param new_poll The poll structure to be used. * @param num The number of socket descriptors to be polled. * @param cont The pool to operate on. - * @deffunc apr_status_t apr_setup_poll(apr_pollfd_t **new_poll, apr_int32_t num, apr_pool_t *cont) + * @deffunc apr_status_t apr_poll_setup(apr_pollfd_t **new_poll, apr_int32_t num, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_setup_poll(apr_pollfd_t **new_poll, +APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new_poll, apr_int32_t num, apr_pool_t *cont); @@ -622,9 +622,9 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, * APR_POLLPRI signal if prioirty data is availble to be read * APR_POLLOUT signal if write will not block * </PRE> - * @deffunc apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event) + * @deffunc apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event) */ -APR_DECLARE(apr_status_t) apr_add_poll_socket(apr_pollfd_t *aprset, +APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event); @@ -638,18 +638,18 @@ APR_DECLARE(apr_status_t) apr_add_poll_socket(apr_pollfd_t *aprset, * APR_POLLPRI signal if prioirty data is availble to be read * APR_POLLOUT signal if write will not block * </PRE> - * @deffunc apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) + * @deffunc apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) */ -APR_DECLARE(apr_status_t) apr_mask_poll_socket(apr_pollfd_t *aprset, +APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events); /** * Remove a socket from the poll structure. * @param aprset The poll structure we will be using. * @param sock The socket to remove from the current poll structure. - * @deffunc apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) + * @deffunc apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) */ -APR_DECLARE(apr_status_t) apr_remove_poll_socket(apr_pollfd_t *aprset, +APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock); /** @@ -661,9 +661,9 @@ APR_DECLARE(apr_status_t) apr_remove_poll_socket(apr_pollfd_t *aprset, * APR_POLLPRI signal if prioirty data is availble to be read * APR_POLLOUT signal if write will not block * </PRE> - * @deffunc apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events) + * @deffunc apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) */ -APR_DECLARE(apr_status_t) apr_clear_poll_sockets(apr_pollfd_t *aprset, +APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events); /** @@ -680,9 +680,9 @@ APR_DECLARE(apr_status_t) apr_clear_poll_sockets(apr_pollfd_t *aprset, * </PRE> * @param sock The socket we wish to get information about. * @param aprset The poll structure we will be using. - * @deffunc apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) + * @deffunc apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) */ -APR_DECLARE(apr_status_t) apr_get_revents(apr_int16_t *event, +APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset); @@ -691,9 +691,9 @@ APR_DECLARE(apr_status_t) apr_get_revents(apr_int16_t *event, * @param pollfd The currently open pollfd. * @param key The key to use for retreiving data associated with a poll struct. * @param data The user data associated with the pollfd. - * @deffunc apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data) + * @deffunc apr_status_t apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data) */ -APR_DECLARE(apr_status_t) apr_get_polldata(apr_pollfd_t *pollfd, +APR_DECLARE(apr_status_t) apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data); /** @@ -702,9 +702,9 @@ APR_DECLARE(apr_status_t) apr_get_polldata(apr_pollfd_t *pollfd, * @param data The key to associate with the data. * @param key The user data to associate with the pollfd. * @param cleanup The cleanup function - * @deffunc apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, apr_status_t (*cleanup)(void *)) + * @deffunc apr_status_t apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, apr_status_t (*cleanup)(void *)) */ -APR_DECLARE(apr_status_t) apr_set_polldata(apr_pollfd_t *pollfd, void *data, +APR_DECLARE(apr_status_t) apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, apr_status_t (*cleanup)(void *)); diff --git a/include/apr_pools.h b/include/apr_pools.h index 0315d29e5..10fc9935f 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -215,9 +215,9 @@ APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); * ever be used outside of APR. * @tip Programs do NOT need to call this directly. APR will call this * automatically from apr_initialize. - * @deffunc apr_status_t apr_init_alloc(apr_pool_t *globalp) + * @deffunc apr_status_t apr_pool_alloc_init(apr_pool_t *globalp) */ -APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp); +APR_DECLARE(apr_status_t) apr_pool_alloc_init(apr_pool_t *globalp); /** * Tear down all of the internal structures required to use pools @@ -226,9 +226,9 @@ APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp); * ever be used outside of APR. * @tip Programs do NOT need to call this directly. APR will call this * automatically from apr_terminate. - * @deffunc void apr_term_alloc(apr_pool_t *globalp) + * @deffunc void apr_pool_alloc_term(apr_pool_t *globalp) */ -APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp); +APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp); /* pool functions */ @@ -239,9 +239,9 @@ APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp); * pool. If it is non-NULL, the new pool will inherit all * of it's parent pool's attributes, except the apr_pool_t will * be a sub-pool. - * @deffunc apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) + * @deffunc apr_status_t apr_pool_create(apr_pool_t **newcont, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont, +APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont, apr_pool_t *cont); /** @@ -258,9 +258,9 @@ APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont, * data by choosing a key that another part of the program is using * It is advised that steps are taken to ensure that a unique * key is used at all times. - * @deffunc apr_status_t apr_set_userdata(const void *data, const char *key, apr_status_t (*cleanup)(void *), apr_pool_t *cont) + * @deffunc apr_status_t apr_pool_userdata_set(const void *data, const char *key, apr_status_t (*cleanup)(void *), apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, +APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, const char *key, apr_status_t (*cleanup)(void *), apr_pool_t *cont); @@ -269,9 +269,9 @@ APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, * @param data The key for the data to retrieve * @param key The user data associated with the pool. * @param cont The current pool. - * @deffunc apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont) + * @deffunc apr_status_t apr_pool_userdata_get(void **data, const char *key, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *cont); /** @@ -281,9 +281,9 @@ APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key, * @return The new sub-pool * @tip The apr_abort function provides a way to quit the program if the * machine is out of memory. By default, APR will return on error. - * @deffunc apr_pool_t *apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) + * @deffunc apr_pool_t *apr_pool_sub_make(apr_pool_t *p, int (*apr_abort)(int retcode)) */ -APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, +APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, int (*apr_abort)(int retcode)); /** @@ -299,24 +299,24 @@ APR_DECLARE(void) apr_clear_pool(apr_pool_t *p); * destroy the pool * @param p The pool to destroy * @tip This will actually free the memory - * @deffunc void apr_destroy_pool(apr_pool_t *p) + * @deffunc void apr_pool_destroy(apr_pool_t *p) */ -APR_DECLARE(void) apr_destroy_pool(apr_pool_t *p); +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); /** * report the number of bytes currently in the pool * @param p The pool to inspect * @return The number of bytes - * @deffunc apr_size_t apr_bytes_in_pool(apr_pool_t *p) + * @deffunc apr_size_t apr_pool_num_bytes(apr_pool_t *p) */ -APR_DECLARE(apr_size_t) apr_bytes_in_pool(apr_pool_t *p); +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p); /** * report the number of bytes currently in the list of free blocks * @return The number of bytes - * @deffunc apr_size_t apr_bytes_in_free_blocks(void) + * @deffunc apr_size_t apr_pool_free_blocks_num_bytes(void) */ -APR_DECLARE(apr_size_t) apr_bytes_in_free_blocks(void); +APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void); /** * Allocate a block of memory from a pool @@ -343,9 +343,9 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); * @param plain_cleanup The function to call when the pool is cleared * or destroyed * @param child_cleanup The function to call when a child process is created - * @deffunc void apr_register_cleanup(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup)(void *), apr_status_t (*child_cleanup)(void *)) + * @deffunc void apr_pool_cleanup_register(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup)(void *), apr_status_t (*child_cleanup)(void *)) */ -APR_DECLARE(void) apr_register_cleanup(apr_pool_t *p, const void *data, +APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup)(void *), apr_status_t (*child_cleanup)(void *)); @@ -354,9 +354,9 @@ APR_DECLARE(void) apr_register_cleanup(apr_pool_t *p, const void *data, * @param p The pool remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup - * @deffunc void apr_kill_cleanup(apr_pool_t *p, const void *data, apr_status_t (*cleanup)(void *)) + * @deffunc void apr_pool_cleanup_kill(apr_pool_t *p, const void *data, apr_status_t (*cleanup)(void *)) */ -APR_DECLARE(void) apr_kill_cleanup(apr_pool_t *p, const void *data, +APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, apr_status_t (*cleanup)(void *)); /** @@ -364,9 +364,9 @@ APR_DECLARE(void) apr_kill_cleanup(apr_pool_t *p, const void *data, * @param p The pool remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup - * @deffunc apr_status_t apr_run_cleanup(apr_pool_t *p, void *data, apr_status_t (*cleanup)(void *)) + * @deffunc apr_status_t apr_pool_cleanup_run(apr_pool_t *p, void *data, apr_status_t (*cleanup)(void *)) */ -APR_DECLARE(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, +APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, apr_status_t (*cleanup)(void *)); /* Preparing for exec() --- close files, etc., but *don't* flush I/O @@ -375,16 +375,16 @@ APR_DECLARE(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, /** * Run all of the child_cleanups, so that any unnecessary files are * closed because we are about to exec a new program - * @deffunc void apr_cleanup_for_exec(void) + * @deffunc void apr_pool_cleanup_for_exec(void) */ -APR_DECLARE(void) apr_cleanup_for_exec(void); +APR_DECLARE(void) apr_pool_cleanup_for_exec(void); /** * An empty cleanup function * @param data The data to cleanup - * @deffunc apr_status_t apr_null_cleanup(void *data) + * @deffunc apr_status_t apr_pool_cleanup_null(void *data) */ -APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data); +APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data); /* * Pool accessor functions. @@ -397,7 +397,7 @@ APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data); * * APR_POOL_DECLARE_ACCESSOR(file); * becomes: - * APR_DECLARE(apr_pool_t *) apr_get_file_pool(apr_file_t *ob); + * APR_DECLARE(apr_pool_t *) apr_file_pool_get(apr_file_t *ob); * * In the implementation, the APR_POOL_IMPLEMENT_ACCESSOR() is used to * actually define the function. It assumes the field is named "pool". For @@ -408,13 +408,13 @@ APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data); * the macros to support other linkages. */ #define APR_POOL_DECLARE_ACCESSOR(typename) \ - APR_DECLARE(apr_pool_t *) apr_get_##typename##_pool \ + APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ (apr_##typename##_t *ob) #define APR_POOL_IMPLEMENT_ACCESSOR(typename) \ APR_POOL_IMPLEMENT_ACCESSOR_X(typename, pool) #define APR_POOL_IMPLEMENT_ACCESSOR_X(typename, fieldname) \ - APR_DECLARE(apr_pool_t *) apr_get_##typename##_pool \ + APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ (apr_##typename##_t *ob) { return ob->fieldname; } /* used to guarantee to the apr_pool_t debugging code that the sub apr_pool_t diff --git a/include/apr_portable.h b/include/apr_portable.h index 5eec7971d..00d307707 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -200,56 +200,56 @@ typedef struct apr_os_sock_info_t apr_os_sock_info_t; * convert the file from apr type to os specific type. * @param thefile The os specific file we are converting to * @param file The apr file to convert. - * @deffunc apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) + * @deffunc apr_status_t apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file) * @tip On Unix, it is only possible to get a file descriptor from * an apr file type. */ -APR_DECLARE(apr_status_t) apr_get_os_file(apr_os_file_t *thefile, +APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file); /** * convert the dir from apr type to os specific type. * @param thedir The os specific dir we are converting to * @param dir The apr dir to convert. - * @deffunc apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir) + * @deffunc apr_status_t apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir) */ -APR_DECLARE(apr_status_t) apr_get_os_dir(apr_os_dir_t **thedir, +APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir); /** * Convert the socket from an apr type to an OS specific socket * @param thesock The socket to convert. * @param sock The os specifc equivelant of the apr socket.. - * @deffunc apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) + * @deffunc apr_status_t apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) */ -APR_DECLARE(apr_status_t) apr_get_os_sock(apr_os_sock_t *thesock, +APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock); /** * Convert the lock from os specific type to apr type * @param oslock The os specific lock we are converting to. * @param lock The apr lock to convert. - * @deffunc apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock) + * @deffunc apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) */ -APR_DECLARE(apr_status_t) apr_get_os_lock(apr_os_lock_t *oslock, +APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock); /** * Get the exploded time in the platforms native format. * @param ostime the native time format * @param aprtime the time to convert - * @deffunc apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, apr_exploded_time_t *aprtime) + * @deffunc apr_status_t apr_os_exp_time_get(apr_os_exp_time_t **ostime, apr_exploded_time_t *aprtime) */ -APR_DECLARE(apr_status_t) apr_get_os_exp_time(apr_os_exp_time_t **ostime, +APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, apr_exploded_time_t *aprtime); /** * Get the imploded time in the platforms native format. * @param ostime the native time format * @param aprtimethe time to convert - * @deffunc apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime) + * @deffunc apr_status_t apr_os_imp_time_get(apr_os_imp_time_t **ostime, apr_time_t *aprtime) */ -APR_DECLARE(apr_status_t) apr_get_os_imp_time(apr_os_imp_time_t **ostime, +APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime, apr_time_t *aprtime); #if APR_HAS_THREADS @@ -258,18 +258,18 @@ APR_DECLARE(apr_status_t) apr_get_os_imp_time(apr_os_imp_time_t **ostime, * convert the thread to os specific type from apr type. * @param thethd The apr thread to convert * @param thd The os specific thread we are converting to - * @deffunc apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd) + * @deffunc apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) */ -APR_DECLARE(apr_status_t) apr_get_os_thread(apr_os_thread_t **thethd, +APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd); /** * convert the thread private memory key to os specific type from an apr type. * @param thekey The apr handle we are converting from. * @param key The os specific handle we are converting to. - * @deffunc apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key) + * @deffunc apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) */ -APR_DECLARE(apr_status_t) apr_get_os_threadkey(apr_os_threadkey_t *thekey, +APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key); #endif /* APR_HAS_THREADS */ @@ -279,11 +279,11 @@ APR_DECLARE(apr_status_t) apr_get_os_threadkey(apr_os_threadkey_t *thekey, * @param file The apr file we are converting to. * @param thefile The os specific file to convert * @param cont The pool to use if it is needed. - * @deffunc apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) + * @deffunc apr_status_t apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) * @tip On Unix, it is only possible to put a file descriptor into * an apr file type. */ -APR_DECLARE(apr_status_t) apr_put_os_file(apr_file_t **file, +APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont); @@ -292,9 +292,9 @@ APR_DECLARE(apr_status_t) apr_put_os_file(apr_file_t **file, * @param dir The apr dir we are converting to. * @param thedir The os specific dir to convert * @param cont The pool to use when creating to apr directory. - * @deffunc apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont) + * @deffunc apr_status_t apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_put_os_dir(apr_dir_t **dir, +APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont); @@ -303,9 +303,9 @@ APR_DECLARE(apr_status_t) apr_put_os_dir(apr_dir_t **dir, * @param sock The pool to use. * @param thesock The socket to convert to. * @param cont The socket we are converting to an apr type. - * @deffunc apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) + * @deffunc apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_put_os_sock(apr_socket_t **sock, +APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont); @@ -316,11 +316,11 @@ APR_DECLARE(apr_status_t) apr_put_os_sock(apr_socket_t **sock, * @param os_sock_info The os representation of the socket handle and * other characteristics of the socket * @param cont The pool to use - * @deffunc apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont) + * @deffunc apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont) * @tip If you only know the descriptor/handle or if it isn't really - * a true socket, use apr_put_os_sock() instead. + * a true socket, use apr_os_sock_put() instead. */ -APR_DECLARE(apr_status_t) apr_make_os_sock(apr_socket_t **apr_sock, +APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont); @@ -329,9 +329,9 @@ APR_DECLARE(apr_status_t) apr_make_os_sock(apr_socket_t **apr_sock, * @param lock The apr lock we are converting to. * @param thelock The os specific lock to convert. * @param cont The pool to use if it is needed. - * @deffunc apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, apr_pool_t *cont) + * @deffunc apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_put_os_lock(apr_lock_t **lock, +APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, apr_pool_t *cont); @@ -340,9 +340,9 @@ APR_DECLARE(apr_status_t) apr_put_os_lock(apr_lock_t **lock, * @param aprtime the APR time format * @param ostime the time to convert * @param cont the pool to use if necessary - * @deffunc apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont) + * @deffunc apr_status_t apr_os_imp_time_put(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_put_os_imp_time(apr_time_t *aprtime, +APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont); @@ -351,9 +351,9 @@ APR_DECLARE(apr_status_t) apr_put_os_imp_time(apr_time_t *aprtime, * @param aprtime the APR time format * @param ostime the time to convert * @param cont the pool to use if necessary - * @deffunc apr_status_t apr_put_os_exp_time(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont) + * @deffunc apr_status_t apr_os_exp_time_pupt(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_put_os_exp_time(apr_exploded_time_t *aprtime, +APR_DECLARE(apr_status_t) apr_os_exp_time_pupt(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont); @@ -364,9 +364,9 @@ APR_DECLARE(apr_status_t) apr_put_os_exp_time(apr_exploded_time_t *aprtime, * @param thd The apr thread we are converting to. * @param thethd The os specific thread to convert * @param cont The pool to use if it is needed. - * @deffunc apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, + * @deffunc apr_status_t apr_os_thread_pupt(apr_thread_t **thd, apr_os_thread_t *thethd, */ -APR_DECLARE(apr_status_t) apr_put_os_thread(apr_thread_t **thd, +APR_DECLARE(apr_status_t) apr_os_thread_pupt(apr_thread_t **thd, apr_os_thread_t *thethd, apr_pool_t *cont); @@ -375,9 +375,9 @@ APR_DECLARE(apr_status_t) apr_put_os_thread(apr_thread_t **thd, * @param key The apr handle we are converting to. * @param thekey The os specific handle to convert * @param cont The pool to use if it is needed. - * @deffunc apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, apr_os_threadkey_t *thekey, apr_pool_t *cont) + * @deffunc apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, apr_os_threadkey_t *thekey, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_put_os_threadkey(apr_threadkey_t **key, +APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, apr_os_threadkey_t *thekey, apr_pool_t *cont); diff --git a/include/apr_shmem.h b/include/apr_shmem.h index 908b10a2a..64e0604db 100644 --- a/include/apr_shmem.h +++ b/include/apr_shmem.h @@ -134,9 +134,9 @@ APR_DECLARE(apr_status_t) apr_shm_free(apr_shmem_t *shared, void *entity); * based on file access. APR_USES_KEYBASED_SHM if shared * memory is based on a key value such as shmctl. If the * shared memory is anonymous, the name is NULL. - * @deffunc apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name) + * @deffunc apr_status_t apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) */ -APR_DECLARE(apr_status_t) apr_get_shm_name(apr_shmem_t *c, +APR_DECLARE(apr_status_t) apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name); /** @@ -149,17 +149,17 @@ APR_DECLARE(apr_status_t) apr_get_shm_name(apr_shmem_t *c, * @return APR_USES_ANONYMOUS_SHM if we are using anonymous shared * memory. APR_SUCCESS if we are using named shared memory * and we were able to assign the name correctly. - * @deffunc apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name) + * @deffunc apr_status_t apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) */ -APR_DECLARE(apr_status_t) apr_set_shm_name(apr_shmem_t *c, +APR_DECLARE(apr_status_t) apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name); /** * Open the shared memory block in a child process. * @param The shared memory block to open in the child. - * @deffunc apr_status_t apr_open_shmem(apr_shmem_t *c) + * @deffunc apr_status_t apr_shm_open(apr_shmem_t *c) */ -APR_DECLARE(apr_status_t) apr_open_shmem(apr_shmem_t *c); +APR_DECLARE(apr_status_t) apr_shm_open(apr_shmem_t *c); /** * Determine how much memory is available in the specified shared memory block diff --git a/include/apr_tables.h b/include/apr_tables.h index 769704785..00c441ba5 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -149,9 +149,9 @@ struct apr_table_entry_t { * @param nelts the number of elements in the initial array * @param elt_size The size of each element in the array. * @return The new array - * @deffunc apr_array_header_t *apr_make_array(struct apr_pool_t *p, int nelts, int elt_size) + * @deffunc apr_array_header_t *apr_array_make(struct apr_pool_t *p, int nelts, int elt_size) */ -APR_DECLARE(apr_array_header_t *) apr_make_array(struct apr_pool_t *p, +APR_DECLARE(apr_array_header_t *) apr_array_make(struct apr_pool_t *p, int nelts, int elt_size); /** @@ -160,9 +160,9 @@ APR_DECLARE(apr_array_header_t *) apr_make_array(struct apr_pool_t *p, * @return Location for the new element in the array. * @tip If there are no free spots in the array, then this function will * allocate new space for the new element. - * @deffunc void *apr_push_array(apr_array_header_t *arr) + * @deffunc void *apr_array_push(apr_array_header_t *arr) */ -APR_DECLARE(void *) apr_push_array(apr_array_header_t *arr); +APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr); /** * Concatenate two arrays together @@ -179,13 +179,13 @@ APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, * @param p The pool to allocate the copy of the array out of * @param arr The array to copy * @return An exact copy of the array passed in - * @deffunc apr_array_header_t *apr_copy_array(apr_pool_t *p, const apr_array_header_t *arr) - * @tip The alternate apr_copy_array_hdr copies only the header, and arranges + * @deffunc apr_array_header_t *apr_array_copy(apr_pool_t *p, const apr_array_header_t *arr) + * @tip The alternate apr_array_copy_hdr copies only the header, and arranges * for the elements to be copied if (and only if) the code subsequently does * a push or arraycat. */ APR_DECLARE(apr_array_header_t *) - apr_copy_array(struct apr_pool_t *p, + apr_array_copy(struct apr_pool_t *p, const apr_array_header_t *arr); /** * Copy the headers of the array, and arrange for the elements to be copied if @@ -193,11 +193,11 @@ APR_DECLARE(apr_array_header_t *) * @param p The pool to allocate the copy of the array out of * @param arr The array to copy * @return An exact copy of the array passed in - * @deffunc apr_array_header_t *apr_copy_array_hdr(apr_pool_t *p, const apr_array_header_t *arr) - * @tip The alternate apr_copy_array copies the *entire* array. + * @deffunc apr_array_header_t *apr_array_copy_hdr(apr_pool_t *p, const apr_array_header_t *arr) + * @tip The alternate apr_array_copy copies the *entire* array. */ APR_DECLARE(apr_array_header_t *) - apr_copy_array_hdr(struct apr_pool_t *p, + apr_array_copy_hdr(struct apr_pool_t *p, const apr_array_header_t *arr); /** @@ -206,10 +206,10 @@ APR_DECLARE(apr_array_header_t *) * @param first The array to put first in the new array. * @param second The array to put second in the new array. * @param return A new array containing the data from the two arrays passed in. - * @deffunc apr_array_header_t *apr_append_arrays(apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second) + * @deffunc apr_array_header_t *apr_array_append(apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second) */ APR_DECLARE(apr_array_header_t *) - apr_append_arrays(struct apr_pool_t *p, + apr_array_append(struct apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second); @@ -235,26 +235,26 @@ APR_DECLARE(char *) apr_array_pstrcat(struct apr_pool_t *p, * @param nelts The number of elements in the initial table. * @return The new table. * @warning This table can only store text data - * @deffunc apr_table_t *apr_make_table(apr_pool_t *p, int nelts) + * @deffunc apr_table_t *apr_table_make(apr_pool_t *p, int nelts) */ -APR_DECLARE(apr_table_t *) apr_make_table(struct apr_pool_t *p, int nelts); +APR_DECLARE(apr_table_t *) apr_table_make(struct apr_pool_t *p, int nelts); /** * Create a new table and copy another table into it * @param p The pool to allocate the new table out of * @param t The table to copy * @return A copy of the table passed in - * @deffunc apr_table_t *apr_copy_table(apr_pool_t *p, const apr_table_t *t) + * @deffunc apr_table_t *apr_table_copy(apr_pool_t *p, const apr_table_t *t) */ -APR_DECLARE(apr_table_t *) apr_copy_table(struct apr_pool_t *p, +APR_DECLARE(apr_table_t *) apr_table_copy(struct apr_pool_t *p, const apr_table_t *t); /** * Delete all of the elements from a table * @param t The table to clear - * @deffunc void apr_clear_table(apr_table_t *t) + * @deffunc void apr_table_clear(apr_table_t *t) */ -APR_DECLARE(void) apr_clear_table(apr_table_t *t); +APR_DECLARE(void) apr_table_clear(apr_table_t *t); /** * Get the value associated with a given key from the table. After this call, @@ -358,9 +358,9 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, * @param overlay The first table to put in the new table * @param base The table to add at the end of the new table * @return A new table containing all of the data from the two passed in - * @deffunc apr_table_t *apr_overlay_tables(apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base); + * @deffunc apr_table_t *apr_table_overlay(apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base); */ -APR_DECLARE(apr_table_t *) apr_overlay_tables(struct apr_pool_t *p, +APR_DECLARE(apr_table_t *) apr_table_overlay(struct apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base); @@ -400,7 +400,7 @@ APR_DECLARE(void) apr_table_vdo(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, va_list); -/* Conceptually, apr_overlap_tables does this: +/* Conceptually, apr_table_overlap does this: * * apr_array_header_t *barr = apr_table_elts(b); * apr_table_entry_t *belt = (apr_table_entry_t *)barr->elts; @@ -434,9 +434,9 @@ APR_DECLARE(void) * APR_OVERLAP_TABLES_MERGE Use apr_table_mergen * @tip This function is highly optimized, and uses less memory and CPU cycles * than a function that just loops through table b calling other functions. - * @deffunc void apr_overlap_tables(apr_table_t *a, const apr_table_t *b, unsigned flags) + * @deffunc void apr_table_overlap(apr_table_t *a, const apr_table_t *b, unsigned flags) */ -APR_DECLARE(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, +APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, unsigned flags); #ifdef __cplusplus diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index f77bd22e6..fc0a89d08 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -157,26 +157,26 @@ struct process_chain { * Create and initialize a new threadattr variable * @param new_attr The newly created threadattr. * @param cont The pool to use - * @deffunc apr_status_t apr_create_threadattr(apr_threadattr_t **new_attr, apr_pool_t *cont) + * @deffunc apr_status_t apr_threadattr_create(apr_threadattr_t **new_attr, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_threadattr(apr_threadattr_t **new_attr, +APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new_attr, apr_pool_t *cont); /** * Set if newly created threads should be created in detach mode. * @param attr The threadattr to affect * @param on Thread detach state on or off - * @deffunc apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) + * @deffunc apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) */ -APR_DECLARE(apr_status_t) apr_setthreadattr_detach(apr_threadattr_t *attr, +APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on); /** * Get the detach mode for this threadattr. * @param attr The threadattr to reference - * @deffunc apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) + * @deffunc apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr) */ -APR_DECLARE(apr_status_t) apr_getthreadattr_detach(apr_threadattr_t *attr); +APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr); /** * Create a new thread of execution @@ -185,9 +185,9 @@ APR_DECLARE(apr_status_t) apr_getthreadattr_detach(apr_threadattr_t *attr); * @param func The function to start the new thread in * @param data Any data to be passed to the starting function * @param cont The pool to use - * @deffunc apr_status_t apr_create_thread(apr_thread_t **new_thread, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont) + * @deffunc apr_status_t apr_thread_create(apr_thread_t **new_thread, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_thread(apr_thread_t **new_thread, +APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new_thread, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont); @@ -222,9 +222,9 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd); * @param data The user data associated with the thread. * @param key The key to associate with the data * @param thread The currently open thread. - * @deffunc apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread) + * @deffunc apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) */ -APR_DECLARE(apr_status_t) apr_get_threaddata(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread); /** @@ -233,9 +233,9 @@ APR_DECLARE(apr_status_t) apr_get_threaddata(void **data, const char *key, * @param key The key to use for associating the data with the tread * @param cleanup The cleanup routine to use when the thread is destroyed. * @param thread The currently open thread. - * @deffunc apr_status_t apr_set_threaddata(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread) + * @deffunc apr_status_t apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread) */ -APR_DECLARE(apr_status_t) apr_set_threaddata(void *data, const char *key, +APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread); @@ -244,9 +244,9 @@ APR_DECLARE(apr_status_t) apr_set_threaddata(void *data, const char *key, * @param key The thread private handle. * @param dest The destructor to use when freeing the private memory. * @param cont The pool to use - * @deffunc apr_status_t apr_create_thread_private(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) + * @deffunc apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_thread_private(apr_threadkey_t **key, +APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont); @@ -254,35 +254,35 @@ APR_DECLARE(apr_status_t) apr_create_thread_private(apr_threadkey_t **key, * Get a pointer to the thread private memory * @param new_mem The data stored in private memory * @param key The handle for the desired thread private memory - * @deffunc apr_status_t apr_get_thread_private(void **new_mem, apr_threadkey_t *key) + * @deffunc apr_status_t apr_threadkey_private_get(void **new_mem, apr_threadkey_t *key) */ -APR_DECLARE(apr_status_t) apr_get_thread_private(void **new_mem, +APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new_mem, apr_threadkey_t *key); /** * Set the data to be stored in thread private memory * @param priv The data to be stored in private memory * @param key The handle for the desired thread private memory - * @deffunc apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) + * @deffunc apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) */ -APR_DECLARE(apr_status_t) apr_set_thread_private(void *priv, +APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t *key); /** * Free the thread private memory * @param key The handle for the desired thread private memory - * @deffunc apr_status_t apr_delete_thread_private(apr_threadkey_t *key) + * @deffunc apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) */ -APR_DECLARE(apr_status_t) apr_delete_thread_private(apr_threadkey_t *key); +APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key); /** * Return the pool associated with the current threadkey. * @param data The user data associated with the threadkey. * @param key The key associated with the data * @param threadkey The currently open threadkey. - * @deffunc apr_status_t apr_get_threadkeydata(void **data, const char *key, apr_threadkey_t *threadkey) + * @deffunc apr_status_t apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) */ -APR_DECLARE(apr_status_t) apr_get_threadkeydata(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey); /** @@ -291,9 +291,9 @@ APR_DECLARE(apr_status_t) apr_get_threadkeydata(void **data, const char *key, * @param key The key to associate with the data. * @param cleanup The cleanup routine to use when the file is destroyed. * @param threadkey The currently open threadkey. - * @deffunc apr_status_t apr_set_threadkeydata(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey) + * @deffunc apr_status_t apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey) */ -APR_DECLARE(apr_status_t) apr_set_threadkeydata(void *data, const char *key, +APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey); @@ -307,9 +307,9 @@ APR_DECLARE(apr_status_t) apr_set_threadkeydata(void *data, const char *key, * Create and initialize a new procattr variable * @param new_attr The newly created procattr. * @param cont The pool to use - * @deffunc apr_status_t apr_createprocattr_init(apr_procattr_t **new_attr, apr_pool_t *cont) + * @deffunc apr_status_t apr_procattr_create(apr_procattr_t **new_attr, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_createprocattr_init(apr_procattr_t **new_attr, +APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new_attr, apr_pool_t *cont); /** @@ -319,9 +319,9 @@ APR_DECLARE(apr_status_t) apr_createprocattr_init(apr_procattr_t **new_attr, * @param in Should stdin be a pipe back to the parent? * @param out Should stdout be a pipe back to the parent? * @param err Should stderr be a pipe back to the parent? - * @deffunc apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) + * @deffunc apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) */ -APR_DECLARE(apr_status_t) apr_setprocattr_io(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err); @@ -330,7 +330,7 @@ APR_DECLARE(apr_status_t) apr_setprocattr_io(apr_procattr_t *attr, * @param attr The procattr we care about. * @param child_in apr_file_t value to use as child_in. Must be a valid file. * @param parent_in apr_file_t value to use as parent_in. Must be a valid file. - * @deffunc apr_status_t apr_setprocattr_childin(struct apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) + * @deffunc apr_status_t apr_procattr_child_in_set(struct apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) * @tip This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) * that you wish to use, perhaps persistently across multiple @@ -338,7 +338,7 @@ APR_DECLARE(apr_status_t) apr_setprocattr_io(apr_procattr_t *attr, * extra function calls by not creating your own pipe since this * creates one in the process space for you. */ -APR_DECLARE(apr_status_t) apr_setprocattr_childin(struct apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_child_in_set(struct apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in); @@ -347,13 +347,13 @@ APR_DECLARE(apr_status_t) apr_setprocattr_childin(struct apr_procattr_t *attr, * @param attr The procattr we care about. * @param child_out apr_file_t value to use as child_out. Must be a valid file. * @param parent_out apr_file_t value to use as parent_out. Must be a valid file. - * @deffunc apr_status_t apr_setprocattr_childout(struct apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) + * @deffunc apr_status_t apr_procattr_child_out_set(struct apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) * @tip This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) * that you wish to use, perhaps persistently across multiple * process invocations - such as a log file. */ -APR_DECLARE(apr_status_t) apr_setprocattr_childout(struct apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_child_out_set(struct apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out); @@ -362,13 +362,13 @@ APR_DECLARE(apr_status_t) apr_setprocattr_childout(struct apr_procattr_t *attr, * @param attr The procattr we care about. * @param child_err apr_file_t value to use as child_err. Must be a valid file. * @param parent_err apr_file_t value to use as parent_err. Must be a valid file. - * @deffunc apr_status_t apr_setprocattr_childerr(struct apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) + * @deffunc apr_status_t apr_procattr_child_err_set(struct apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) * @tip This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) * that you wish to use, perhaps persistently across multiple * process invocations - such as a log file. */ -APR_DECLARE(apr_status_t) apr_setprocattr_childerr(struct apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_child_err_set(struct apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err); @@ -378,9 +378,9 @@ APR_DECLARE(apr_status_t) apr_setprocattr_childerr(struct apr_procattr_t *attr, * @param dir Which dir to start in. By default, this is the same dir as * the parent currently resides in, when the createprocess call * is made. - * @deffunc apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir) + * @deffunc apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) */ -APR_DECLARE(apr_status_t) apr_setprocattr_dir(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, const char *dir); /** @@ -391,18 +391,18 @@ APR_DECLARE(apr_status_t) apr_setprocattr_dir(apr_procattr_t *attr, * APR_SHELLCMD -- Shell script * APR_PROGRAM -- Executable program (default) * </PRE> - * @deffunc apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, apr_cmdtype_e cmd) + * @deffunc apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd) */ -APR_DECLARE(apr_status_t) apr_setprocattr_cmdtype(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd); /** * Determine if the chlid should start in detached state. * @param attr The procattr we care about. * @param detach Should the child start in detached state? Default is no. - * @deffunc apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach) + * @deffunc apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) */ -APR_DECLARE(apr_status_t) apr_setprocattr_detach(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach); #if APR_HAVE_STRUCT_RLIMIT @@ -416,9 +416,9 @@ APR_DECLARE(apr_status_t) apr_setprocattr_detach(apr_procattr_t *attr, * APR_LIMIT_NPROC * </PRE> * @param limit Value to set the limit to. - * @deffunc apr_status_t apr_setprocattr_limit(apr_procattr_t *attr, apr_int32_t what, apr_int32_t what, struct rlimit *limit) + * @deffunc apr_status_t apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, apr_int32_t what, struct rlimit *limit) */ -APR_DECLARE(apr_status_t) apr_setprocattr_limit(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, struct rlimit *limit); #endif @@ -429,9 +429,9 @@ APR_DECLARE(apr_status_t) apr_setprocattr_limit(apr_procattr_t *attr, * a standard unix fork. * @param proc The resulting process handle. * @param cont The pool to use. - * @deffunc apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) + * @deffunc apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_fork(apr_proc_t *proc, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont); #endif /** @@ -445,9 +445,9 @@ APR_DECLARE(apr_status_t) apr_fork(apr_proc_t *proc, apr_pool_t *cont); * @param attr the procattr we should use to determine how to create the new * process * @param cont The pool to use. - * @deffunc apr_status_t apr_create_process(apr_proc_t *new_proc, const char *progname, const char * const *args, const char * const *env, apr_procattr_t *attr, apr_pool_t *cont) + * @deffunc apr_status_t apr_proc_create(apr_proc_t *new_proc, const char *progname, const char * const *args, const char * const *env, apr_procattr_t *attr, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_process(apr_proc_t *new_proc, +APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new_proc, const char *progname, const char * const *args, const char * const *env, @@ -463,14 +463,14 @@ APR_DECLARE(apr_status_t) apr_create_process(apr_proc_t *new_proc, * APR_NOWAIT -- return immediately regardless of if the * child is dead or not. * </PRE> - * @deffunc apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e waithow) + * @deffunc apr_status_t apr_proc_wait(apr_proc_t *proc, apr_wait_how_e waithow) * @tip The childs status is in the return code to this process. It is one of: * <PRE> * APR_CHILD_DONE -- child is no longer running. * APR_CHILD_NOTDONE -- child is still running. * </PRE> */ -APR_DECLARE(apr_status_t) apr_wait_proc(apr_proc_t *proc, +APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, apr_wait_how_e waithow); /** @@ -488,9 +488,9 @@ APR_DECLARE(apr_status_t) apr_wait_proc(apr_proc_t *proc, * child is dead or not. * </PRE> * @param p Pool to allocate child information out of. - * @deffunc apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p) + * @deffunc apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p) */ -APR_DECLARE(apr_status_t) apr_wait_all_procs(apr_proc_t *proc, +APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p); @@ -498,7 +498,7 @@ APR_DECLARE(apr_status_t) apr_wait_all_procs(apr_proc_t *proc, /** * Detach the process from the controlling terminal. */ -apr_status_t apr_detach(void); +apr_status_t apr_proc_detach(void); #if APR_HAS_OTHER_CHILD @@ -513,9 +513,9 @@ apr_status_t apr_detach(void); * then the maintenance is invoked with reason * OC_REASON_UNWRITABLE. * @param p The pool to use for allocating memory. - * @deffunc void apr_register_other_child(apr_proc_t *pid, void (*maintenance) (int reason, void *, int status), void *data, apr_file_t *write_fd, apr_pool_t *p) + * @deffunc void apr_proc_other_child_register(apr_proc_t *pid, void (*maintenance) (int reason, void *, int status), void *data, apr_file_t *write_fd, apr_pool_t *p) */ -APR_DECLARE(void) apr_register_other_child(apr_proc_t *pid, +APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *pid, void (*maintenance) (int reason, void *, int status), @@ -526,36 +526,36 @@ APR_DECLARE(void) apr_register_other_child(apr_proc_t *pid, * Stop watching the specified process. * @param data The data to pass to the maintenance function. This is * used to find the process to unregister. - * @deffunc void apr_unregister_other_child(void *data) + * @deffunc void apr_proc_other_child_unregister(void *data) * @tip Since this can be called by a maintenance function while we're * scanning the other_children list, all scanners should protect * themself by loading ocr->next before calling any maintenance * function. */ -APR_DECLARE(void) apr_unregister_other_child(void *data); +APR_DECLARE(void) apr_proc_other_child_unregister(void *data); /** * Check on the specified process. If it is gone, call the maintenance * function. * @param pid The process to check. * @param status The status to pass to the maintenance function. - * @deffunc apr_status_t apr_reap_other_child(apr_proc_t *pid, int status); + * @deffunc apr_status_t apr_proc_other_child_read(apr_proc_t *pid, int status); */ -APR_DECLARE(apr_status_t) apr_reap_other_child(apr_proc_t *pid, int status); +APR_DECLARE(apr_status_t) apr_proc_other_child_read(apr_proc_t *pid, int status); /** * Loop through all registered other_children and call the appropriate * maintenance function when necessary. - * @deffunc void apr_check_other_child(); + * @deffunc void apr_proc_other_child_check(); */ -APR_DECLARE(void) apr_check_other_child(void); +APR_DECLARE(void) apr_proc_other_child_check(void); /** * Ensure all the registered write_fds are still writable, otherwise * invoke the maintenance functions as appropriate. - * @deffunc void apr_probe_writable_fds() + * @deffunc void apr_proc_probe_writable_fds() */ -APR_DECLARE(void) apr_probe_writable_fds(void); +APR_DECLARE(void) apr_proc_probe_writable_fds(void); #endif /* APR_HAS_OTHER_CHILD */ @@ -563,9 +563,9 @@ APR_DECLARE(void) apr_probe_writable_fds(void); * Terminate a process. * @param proc The process to terminate. * @param sig How to kill the process. - * @deffunc apr_status_t apr_kill(apr_proc_t *proc, int sig) + * @deffunc apr_status_t apr_proc_kill(apr_proc_t *proc, int sig) */ -APR_DECLARE(apr_status_t) apr_kill(apr_proc_t *proc, int sig); +APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig); /** * Register a process to be killed when a pool dies. @@ -579,9 +579,9 @@ APR_DECLARE(apr_status_t) apr_kill(apr_proc_t *proc, int sig); * just_wait -- wait forever for the process to complete * kill_only_once -- send SIGTERM and then wait * </PRE> - * @deffunc void apr_note_subprocess(struct apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) + * @deffunc void apr_pool_note_subprocess(struct apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) */ -APR_DECLARE(void) apr_note_subprocess(apr_pool_t *a, apr_proc_t *pid, +APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how); #ifdef __cplusplus diff --git a/include/apr_time.h b/include/apr_time.h index 0f520aa8f..2aeac26c5 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -90,9 +90,9 @@ typedef apr_int32_t apr_interval_time_t; /** * return the current time - * @deffunc apr_time_t apr_now(void) + * @deffunc apr_time_t apr_time_now(void) */ -APR_DECLARE(apr_time_t) apr_now(void); +APR_DECLARE(apr_time_t) apr_time_now(void); typedef struct apr_exploded_time_t apr_exploded_time_t; /** diff --git a/include/apr_uuid.h b/include/apr_uuid.h index c33b70351..3b3e2e156 100644 --- a/include/apr_uuid.h +++ b/include/apr_uuid.h @@ -78,9 +78,9 @@ typedef struct { /** * Generate and return a (new) UUID * @param uuid The resulting UUID - * @deffunc void apr_get_uuid(apr_uuid_t *uuid) + * @deffunc void apr_uuid_get(apr_uuid_t *uuid) */ -APR_DECLARE(void) apr_get_uuid(apr_uuid_t *uuid); +APR_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid); /** * Format a UUID into a string, following the standard format @@ -88,17 +88,17 @@ APR_DECLARE(void) apr_get_uuid(apr_uuid_t *uuid); * be at least APR_UUID_FORMATTED_LENGTH + 1 bytes long to hold * the formatted UUID and a null terminator * @param uuid The UUID to format - * @deffunc void apr_format_uuid(char *buffer, const apr_uuid_t *uuid) + * @deffunc void apr_uuid_format(char *buffer, const apr_uuid_t *uuid) */ -APR_DECLARE(void) apr_format_uuid(char *buffer, const apr_uuid_t *uuid); +APR_DECLARE(void) apr_uuid_format(char *buffer, const apr_uuid_t *uuid); /** * Parse a standard-format string into a UUID * @param uuid The resulting UUID * @param uuid_str The formatted UUID - * @deffunc apr_status_t apr_parse_uuid(apr_uuid_t *uuid, const char *uuid_str) + * @deffunc apr_status_t apr_uuid_parse(apr_uuid_t *uuid, const char *uuid_str) */ -APR_DECLARE(apr_status_t) apr_parse_uuid(apr_uuid_t *uuid, const char *uuid_str); +APR_DECLARE(apr_status_t) apr_uuid_parse(apr_uuid_t *uuid, const char *uuid_str); #ifdef __cplusplus } diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index c351de971..d620efb01 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -118,7 +118,7 @@ apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars, #define S_IFWHT 0160000 /* Whiteout */ #endif -/* Internal Flags for apr_open */ +/* Internal Flags for apr_file_open */ #define APR_OPENLINK 8192 /* Open a link itself, if supported */ #define APR_READCONTROL 4096 /* Read the file's owner/perms */ #define APR_WRITECONTROL 2048 /* Modifythe file's owner/perms */ diff --git a/lib/apr_pools.c b/lib/apr_pools.c index b23620621..cbf92d001 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -329,7 +329,7 @@ static void free_blocks(union block_hdr *blok) #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); } #endif old_free_list = block_freelist; @@ -381,7 +381,7 @@ static void free_blocks(union block_hdr *blok) #if APR_HAS_THREADS if (alloc_mutex) { - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); } #endif /* APR_HAS_THREADS */ #endif /* ALLOC_USE_MALLOC */ @@ -466,7 +466,7 @@ static apr_pool_t *permanent_pool; #define POOL_HDR_CLICKS (1 + ((sizeof(struct apr_pool_t) - 1) / CLICK_SZ)) #define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) -APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) +APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, int (*apr_abort)(int retcode)) { union block_hdr *blok; apr_pool_t *new_pool; @@ -474,7 +474,7 @@ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); } #endif @@ -500,7 +500,7 @@ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int #if APR_HAS_THREADS if (alloc_mutex) { - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); } #endif @@ -536,16 +536,16 @@ static void dump_stats(void) } #endif -/* ### why do we have this, in addition to apr_make_sub_pool? */ -APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) +/* ### why do we have this, in addition to apr_pool_sub_make? */ +APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont, apr_pool_t *cont) { apr_pool_t *newpool; if (cont) { - newpool = apr_make_sub_pool(cont, cont->apr_abort); + newpool = apr_pool_sub_make(cont, cont->apr_abort); } else { - newpool = apr_make_sub_pool(NULL, NULL); + newpool = apr_pool_sub_make(NULL, NULL); } if (newpool == NULL) { @@ -575,7 +575,7 @@ struct cleanup { struct cleanup *next; }; -APR_DECLARE(void) apr_register_cleanup(apr_pool_t *p, const void *data, +APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup) (void *), apr_status_t (*child_cleanup) (void *)) { @@ -591,7 +591,7 @@ APR_DECLARE(void) apr_register_cleanup(apr_pool_t *p, const void *data, } } -APR_DECLARE(void) apr_kill_cleanup(apr_pool_t *p, const void *data, +APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, apr_status_t (*cleanup) (void *)) { struct cleanup *c; @@ -612,10 +612,10 @@ APR_DECLARE(void) apr_kill_cleanup(apr_pool_t *p, const void *data, } } -APR_DECLARE(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, +APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, apr_status_t (*cleanup) (void *)) { - apr_kill_cleanup(p, data, cleanup); + apr_pool_cleanup_kill(p, data, cleanup); return (*cleanup) (data); } @@ -645,7 +645,7 @@ static void cleanup_pool_for_exec(apr_pool_t *p) } } -APR_DECLARE(void) apr_cleanup_for_exec(void) +APR_DECLARE(void) apr_pool_cleanup_for_exec(void) { #if !defined(WIN32) && !defined(OS2) /* @@ -661,13 +661,13 @@ APR_DECLARE(void) apr_cleanup_for_exec(void) #endif /* ndef WIN32 */ } -APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data) +APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data) { /* do nothing cleanup routine */ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp) +APR_DECLARE(apr_status_t) apr_pool_alloc_init(apr_pool_t *globalp) { #if APR_HAS_THREADS apr_status_t status; @@ -679,20 +679,20 @@ APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp) stack_var_init(&s); #endif #if APR_HAS_THREADS - status = apr_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, + status = apr_lock_create(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, globalp); if (status != APR_SUCCESS) { - apr_destroy_lock(alloc_mutex); + apr_lock_destroy(alloc_mutex); return status; } - status = apr_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, + status = apr_lock_create(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, globalp); if (status != APR_SUCCESS) { - apr_destroy_lock(spawn_mutex); + apr_lock_destroy(spawn_mutex); return status; } #endif - permanent_pool = apr_make_sub_pool(globalp, NULL); + permanent_pool = apr_pool_sub_make(globalp, NULL); #ifdef ALLOC_STATS atexit(dump_stats); @@ -701,15 +701,15 @@ APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp) return APR_SUCCESS; } -APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp) +APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp) { #if APR_HAS_THREADS - apr_destroy_lock(alloc_mutex); - apr_destroy_lock(spawn_mutex); + apr_lock_destroy(alloc_mutex); + apr_lock_destroy(spawn_mutex); alloc_mutex = NULL; spawn_mutex = NULL; #endif - apr_destroy_pool(globalp); + apr_pool_destroy(globalp); } /* We only want to lock the mutex if we are being called from apr_clear_pool. @@ -721,7 +721,7 @@ APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp) APR_DECLARE(void) apr_clear_pool(apr_pool_t *a) { while (a->sub_pools) { - apr_destroy_pool(a->sub_pools); + apr_pool_destroy(a->sub_pools); } /* * Don't hold the mutex during cleanups. @@ -753,12 +753,12 @@ APR_DECLARE(void) apr_clear_pool(apr_pool_t *a) #endif } -APR_DECLARE(void) apr_destroy_pool(apr_pool_t *a) +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *a) { apr_clear_pool(a); #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); } #endif @@ -775,17 +775,17 @@ APR_DECLARE(void) apr_destroy_pool(apr_pool_t *a) } #if APR_HAS_THREADS if (alloc_mutex) { - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); } #endif free_blocks(a->first); } -APR_DECLARE(apr_size_t) apr_bytes_in_pool(apr_pool_t *p) +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p) { return bytes_in_block_list(p->first); } -APR_DECLARE(apr_size_t) apr_bytes_in_free_blocks(void) +APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void) { return bytes_in_block_list(block_freelist); } @@ -963,7 +963,7 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); } #endif @@ -976,7 +976,7 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) #if APR_HAS_THREADS if (alloc_mutex) { - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); } #endif @@ -999,14 +999,14 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *a, apr_size_t size) * User data management functions */ -APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, +APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, const char *key, apr_status_t (*cleanup) (void *), apr_pool_t *cont) { int keylen = strlen(key); if (cont->prog_data == NULL) - cont->prog_data = apr_make_hash(cont); + cont->prog_data = apr_hash_make(cont); if (apr_hash_get(cont->prog_data, key, keylen) == NULL){ char *new_key = apr_pstrdup(cont, key); @@ -1016,11 +1016,11 @@ APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, apr_hash_set(cont->prog_data, key, keylen, data); } - apr_register_cleanup(cont, data, cleanup, cleanup); + apr_pool_cleanup_register(cont, data, cleanup, cleanup); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *cont) { if (cont->prog_data == NULL) *data = NULL; @@ -1087,11 +1087,11 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) /* must try another blok */ #if APR_HAS_THREADS - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); #endif nblok = new_block(2 * cur_len, NULL); #if APR_HAS_THREADS - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); #endif memcpy(nblok->h.first_avail, blok->h.first_avail, cur_len); ps->vbuff.curpos = nblok->h.first_avail + cur_len; @@ -1102,12 +1102,12 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) if (ps->got_a_new_block) { debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); #if APR_HAS_THREADS - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); #endif blok->h.next = block_freelist; block_freelist = blok; #if APR_HAS_THREADS - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); #endif } ps->blok = nblok; @@ -1202,7 +1202,7 @@ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) * generic interface, but for now, it's a special case */ -APR_DECLARE(void) apr_note_subprocess(apr_pool_t *a, apr_proc_t *pid, +APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) { struct process_chain *new = @@ -1237,7 +1237,7 @@ static void free_proc_chain(struct process_chain *procs) #ifndef NEED_WAITPID /* Pick up all defunct processes */ for (p = procs; p; p = p->next) { - if (apr_wait_proc(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { + if (apr_proc_wait(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { p->kill_how = kill_never; } } @@ -1248,20 +1248,20 @@ static void free_proc_chain(struct process_chain *procs) || (p->kill_how == kill_only_once)) { /* * Subprocess may be dead already. Only need the timeout if not. - * Note: apr_kill on Windows is TerminateProcess(), which is + * Note: apr_proc_kill on Windows is TerminateProcess(), which is * similar to a SIGKILL, so always give the process a timeout * under Windows before killing it. */ #ifdef WIN32 need_timeout = 1; #else - if (apr_kill(p->pid, SIGTERM) == APR_SUCCESS) { + if (apr_proc_kill(p->pid, SIGTERM) == APR_SUCCESS) { need_timeout = 1; } #endif } else if (p->kill_how == kill_always) { - apr_kill(p->pid, SIGKILL); + apr_proc_kill(p->pid, SIGKILL); } } @@ -1276,7 +1276,7 @@ static void free_proc_chain(struct process_chain *procs) */ for (p = procs; p; p = p->next) { if (p->kill_how == kill_after_timeout) { - apr_kill(p->pid, SIGKILL); + apr_proc_kill(p->pid, SIGKILL); } } #ifdef WIN32 @@ -1293,7 +1293,7 @@ static void free_proc_chain(struct process_chain *procs) /* Now wait for all the signaled processes to die */ for (p = procs; p; p = p->next) { if (p->kill_how != kill_never) { - (void) apr_wait_proc(p->pid, APR_WAIT); + (void) apr_proc_wait(p->pid, APR_WAIT); } } } diff --git a/locks/beos/crossproc.c b/locks/beos/crossproc.c index b17aa28f3..a2052891b 100644 --- a/locks/beos/crossproc.c +++ b/locks/beos/crossproc.c @@ -81,8 +81,8 @@ apr_status_t create_inter_lock(apr_lock_t *new) } new->ben_interproc = 0; new->sem_interproc = stat; - apr_register_cleanup(new->cntxt, (void *)new, lock_inter_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register(new->cntxt, (void *)new, lock_inter_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } @@ -116,7 +116,7 @@ apr_status_t destroy_inter_lock(apr_lock_t *lock) { apr_status_t stat; if ((stat = lock_inter_cleanup(lock)) == APR_SUCCESS) { - apr_kill_cleanup(lock->cntxt, lock, lock_inter_cleanup); + apr_pool_cleanup_kill(lock->cntxt, lock, lock_inter_cleanup); return APR_SUCCESS; } return stat; diff --git a/locks/beos/intraproc.c b/locks/beos/intraproc.c index 65cb5a3e5..57f1c9b67 100644 --- a/locks/beos/intraproc.c +++ b/locks/beos/intraproc.c @@ -76,8 +76,8 @@ apr_status_t create_intra_lock(apr_lock_t *new) } new->ben_intraproc = 0; new->sem_intraproc = stat; - apr_register_cleanup(new->cntxt, (void *)new, lock_intra_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register(new->cntxt, (void *)new, lock_intra_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } @@ -111,7 +111,7 @@ apr_status_t destroy_intra_lock(apr_lock_t *lock) { apr_status_t stat; if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) { - apr_kill_cleanup(lock->cntxt, lock, lock_intra_cleanup); + apr_pool_cleanup_kill(lock->cntxt, lock, lock_intra_cleanup); return APR_SUCCESS; } return stat; diff --git a/locks/beos/locks.c b/locks/beos/locks.c index 5302a1b59..43d921465 100644 --- a/locks/beos/locks.c +++ b/locks/beos/locks.c @@ -56,7 +56,7 @@ #include "apr_strings.h" #include "apr_portable.h" -apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, +apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, apr_pool_t *cont) { @@ -86,7 +86,7 @@ apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, return APR_SUCCESS; } -apr_status_t apr_lock(apr_lock_t *lock) +apr_status_t apr_lock_aquire(apr_lock_t *lock) { apr_status_t stat; @@ -103,7 +103,7 @@ apr_status_t apr_lock(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_unlock(apr_lock_t *lock) +apr_status_t apr_lock_release(apr_lock_t *lock) { apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { @@ -119,7 +119,7 @@ apr_status_t apr_unlock(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_destroy_lock(apr_lock_t *lock) +apr_status_t apr_lock_destroy(apr_lock_t *lock) { apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { @@ -135,7 +135,7 @@ apr_status_t apr_destroy_lock(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, +apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, apr_pool_t *cont) { apr_status_t stat; @@ -147,18 +147,18 @@ apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, return APR_SUCCESS; } -apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data) +apr_status_t apr_lock_data_get(apr_lock_t *lock, const char *key, void *data) { - return apr_get_userdata(data, key, lock->cntxt); + return apr_pool_userdata_get(data, key, lock->cntxt); } -apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, +apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, apr_status_t (*cleanup) (void *)) { - return apr_set_userdata(data, key, cleanup, lock->cntxt); + return apr_pool_userdata_set(data, key, cleanup, lock->cntxt); } -apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock) +apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) { oslock->sem_interproc = lock->sem_interproc; oslock->sem_intraproc = lock->sem_intraproc; @@ -167,7 +167,7 @@ apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, +apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, apr_pool_t *cont) { if (cont == NULL) { diff --git a/locks/os2/locks.c b/locks/os2/locks.c index 45f769db1..55e48edf2 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -71,12 +71,12 @@ void setup_lock() static apr_status_t lock_cleanup(void *thelock) { apr_lock_t *lock = thelock; - return apr_destroy_lock(lock); + return apr_lock_destroy(lock); } -apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, +apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, apr_pool_t *cont) { apr_lock_t *new; @@ -102,14 +102,14 @@ apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, apr_locksco *lock = new; if (!rc) - apr_register_cleanup(cont, new, lock_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(cont, new, lock_cleanup, apr_pool_cleanup_null); return APR_OS2_STATUS(rc); } -apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, +apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, apr_pool_t *cont) { int rc; @@ -126,14 +126,14 @@ apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, rc = DosOpenMutexSem( (char *)fname, &(*lock)->hMutex ); if (!rc) - apr_register_cleanup(cont, *lock, lock_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(cont, *lock, lock_cleanup, apr_pool_cleanup_null); return APR_OS2_STATUS(rc); } -apr_status_t apr_lock(apr_lock_t *lock) +apr_status_t apr_lock_aquire(apr_lock_t *lock) { ULONG rc; @@ -149,7 +149,7 @@ apr_status_t apr_lock(apr_lock_t *lock) -apr_status_t apr_unlock(apr_lock_t *lock) +apr_status_t apr_lock_release(apr_lock_t *lock) { ULONG rc; @@ -164,14 +164,14 @@ apr_status_t apr_unlock(apr_lock_t *lock) -apr_status_t apr_destroy_lock(apr_lock_t *lock) +apr_status_t apr_lock_destroy(apr_lock_t *lock) { ULONG rc; apr_status_t stat = APR_SUCCESS; if (lock->owner == CurrentTid) { while (lock->lock_count > 0 && stat == APR_SUCCESS) - stat = apr_unlock(lock); + stat = apr_lock_release(lock); } if (stat != APR_SUCCESS) diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index f140183e1..050e9c4e5 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -99,7 +99,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) return errno; } new->curr_locked = 0; - apr_register_cleanup(new->cntxt, (void *)new, lock_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(new->cntxt, (void *)new, lock_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -136,7 +136,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_pool_cleanup_kill(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; @@ -222,7 +222,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) } new->curr_locked = 0; - apr_register_cleanup(new->cntxt, (void *)new, lock_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(new->cntxt, (void *)new, lock_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -258,7 +258,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) { apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_pool_cleanup_kill(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; @@ -315,7 +315,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) new->curr_locked=0; unlink(new->fname); - apr_register_cleanup(new->cntxt, new, lock_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(new->cntxt, new, lock_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -351,7 +351,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) { apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_pool_cleanup_kill(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; @@ -395,7 +395,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) return errno; } new->curr_locked = 0; - apr_register_cleanup(new->cntxt, (void *)new, lock_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(new->cntxt, (void *)new, lock_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -431,7 +431,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) { apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_pool_cleanup_kill(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c index 514d6a83e..cd9c0f666 100644 --- a/locks/unix/intraproc.c +++ b/locks/unix/intraproc.c @@ -108,8 +108,8 @@ apr_status_t apr_unix_create_intra_lock(apr_lock_t *new) } new->curr_locked = 0; - apr_register_cleanup(new->cntxt, (void *)new, lock_intra_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register(new->cntxt, (void *)new, lock_intra_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } @@ -143,7 +143,7 @@ apr_status_t apr_unix_destroy_intra_lock(apr_lock_t *lock) { apr_status_t stat; if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) { - apr_kill_cleanup(lock->cntxt, lock, lock_intra_cleanup); + apr_pool_cleanup_kill(lock->cntxt, lock, lock_intra_cleanup); return APR_SUCCESS; } return stat; diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 8104e22fe..841433022 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -56,7 +56,7 @@ #include "apr_strings.h" #include "apr_portable.h" -apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, +apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, apr_pool_t *cont) { @@ -101,7 +101,7 @@ apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, return APR_SUCCESS; } -apr_status_t apr_lock(apr_lock_t *lock) +apr_status_t apr_lock_aquire(apr_lock_t *lock) { apr_status_t stat; #if APR_PROCESS_LOCK_IS_GLOBAL /* don't need intra lock for APR_LOCKALL */ @@ -125,7 +125,7 @@ apr_status_t apr_lock(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_unlock(apr_lock_t *lock) +apr_status_t apr_lock_release(apr_lock_t *lock) { apr_status_t stat; @@ -150,7 +150,7 @@ apr_status_t apr_unlock(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_destroy_lock(apr_lock_t *lock) +apr_status_t apr_lock_destroy(apr_lock_t *lock) { apr_status_t stat; #if APR_PROCESS_LOCK_IS_GLOBAL /* don't need intra lock for APR_LOCKALL */ @@ -176,7 +176,7 @@ apr_status_t apr_destroy_lock(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, +apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, apr_pool_t *cont) { apr_status_t stat; @@ -188,18 +188,18 @@ apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, return APR_SUCCESS; } -apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data) +apr_status_t apr_lock_data_get(apr_lock_t *lock, const char *key, void *data) { - return apr_get_userdata(data, key, lock->cntxt); + return apr_pool_userdata_get(data, key, lock->cntxt); } -apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, +apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, apr_status_t (*cleanup) (void *)) { - return apr_set_userdata(data, key, cleanup, lock->cntxt); + return apr_pool_userdata_set(data, key, cleanup, lock->cntxt); } -apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock) +apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) { oslock->crossproc = lock->interproc; #if APR_HAS_THREADS @@ -211,7 +211,7 @@ apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, +apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, apr_pool_t *cont) { if (cont == NULL) { diff --git a/locks/win32/locks.c b/locks/win32/locks.c index 701e2c281..fa802ce66 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -57,7 +57,7 @@ #include "win32/locks.h" #include "apr_portable.h" -APR_DECLARE(apr_status_t) apr_create_lock(apr_lock_t **lock, +APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, @@ -94,7 +94,7 @@ APR_DECLARE(apr_status_t) apr_create_lock(apr_lock_t **lock, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_child_init_lock(apr_lock_t **lock, +APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, const char *fname, apr_pool_t *cont) { @@ -115,7 +115,7 @@ APR_DECLARE(apr_status_t) apr_child_init_lock(apr_lock_t **lock, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_lock(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_aquire(apr_lock_t *lock) { DWORD rv; if (lock->scope == APR_INTRAPROCESS) { @@ -131,7 +131,7 @@ APR_DECLARE(apr_status_t) apr_lock(apr_lock_t *lock) return apr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_unlock(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_release(apr_lock_t *lock) { if (lock->scope == APR_INTRAPROCESS) { LeaveCriticalSection(&lock->section); @@ -144,7 +144,7 @@ APR_DECLARE(apr_status_t) apr_unlock(apr_lock_t *lock) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_destroy_lock(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock) { if (lock->scope == APR_INTRAPROCESS) { DeleteCriticalSection(&lock->section); @@ -157,27 +157,27 @@ APR_DECLARE(apr_status_t) apr_destroy_lock(apr_lock_t *lock) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_lockdata(apr_lock_t *lock, const char *key, +APR_DECLARE(apr_status_t) apr_lock_data_get(apr_lock_t *lock, const char *key, void *data) { - return apr_get_userdata(data, key, lock->cntxt); + return apr_pool_userdata_get(data, key, lock->cntxt); } -APR_DECLARE(apr_status_t) apr_set_lockdata(apr_lock_t *lock, void *data, +APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, apr_status_t (*cleanup) (void *)) { - return apr_set_userdata(data, key, cleanup, lock->cntxt); + return apr_pool_userdata_set(data, key, cleanup, lock->cntxt); } -APR_DECLARE(apr_status_t) apr_get_os_lock(apr_os_lock_t *thelock, +APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *thelock, apr_lock_t *lock) { *thelock = lock->mutex; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_put_os_lock(apr_lock_t **lock, +APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, apr_pool_t *cont) { diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index b23620621..cbf92d001 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -329,7 +329,7 @@ static void free_blocks(union block_hdr *blok) #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); } #endif old_free_list = block_freelist; @@ -381,7 +381,7 @@ static void free_blocks(union block_hdr *blok) #if APR_HAS_THREADS if (alloc_mutex) { - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); } #endif /* APR_HAS_THREADS */ #endif /* ALLOC_USE_MALLOC */ @@ -466,7 +466,7 @@ static apr_pool_t *permanent_pool; #define POOL_HDR_CLICKS (1 + ((sizeof(struct apr_pool_t) - 1) / CLICK_SZ)) #define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) -APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) +APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, int (*apr_abort)(int retcode)) { union block_hdr *blok; apr_pool_t *new_pool; @@ -474,7 +474,7 @@ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); } #endif @@ -500,7 +500,7 @@ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int #if APR_HAS_THREADS if (alloc_mutex) { - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); } #endif @@ -536,16 +536,16 @@ static void dump_stats(void) } #endif -/* ### why do we have this, in addition to apr_make_sub_pool? */ -APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) +/* ### why do we have this, in addition to apr_pool_sub_make? */ +APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont, apr_pool_t *cont) { apr_pool_t *newpool; if (cont) { - newpool = apr_make_sub_pool(cont, cont->apr_abort); + newpool = apr_pool_sub_make(cont, cont->apr_abort); } else { - newpool = apr_make_sub_pool(NULL, NULL); + newpool = apr_pool_sub_make(NULL, NULL); } if (newpool == NULL) { @@ -575,7 +575,7 @@ struct cleanup { struct cleanup *next; }; -APR_DECLARE(void) apr_register_cleanup(apr_pool_t *p, const void *data, +APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup) (void *), apr_status_t (*child_cleanup) (void *)) { @@ -591,7 +591,7 @@ APR_DECLARE(void) apr_register_cleanup(apr_pool_t *p, const void *data, } } -APR_DECLARE(void) apr_kill_cleanup(apr_pool_t *p, const void *data, +APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, apr_status_t (*cleanup) (void *)) { struct cleanup *c; @@ -612,10 +612,10 @@ APR_DECLARE(void) apr_kill_cleanup(apr_pool_t *p, const void *data, } } -APR_DECLARE(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, +APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, apr_status_t (*cleanup) (void *)) { - apr_kill_cleanup(p, data, cleanup); + apr_pool_cleanup_kill(p, data, cleanup); return (*cleanup) (data); } @@ -645,7 +645,7 @@ static void cleanup_pool_for_exec(apr_pool_t *p) } } -APR_DECLARE(void) apr_cleanup_for_exec(void) +APR_DECLARE(void) apr_pool_cleanup_for_exec(void) { #if !defined(WIN32) && !defined(OS2) /* @@ -661,13 +661,13 @@ APR_DECLARE(void) apr_cleanup_for_exec(void) #endif /* ndef WIN32 */ } -APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data) +APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data) { /* do nothing cleanup routine */ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp) +APR_DECLARE(apr_status_t) apr_pool_alloc_init(apr_pool_t *globalp) { #if APR_HAS_THREADS apr_status_t status; @@ -679,20 +679,20 @@ APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp) stack_var_init(&s); #endif #if APR_HAS_THREADS - status = apr_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, + status = apr_lock_create(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, globalp); if (status != APR_SUCCESS) { - apr_destroy_lock(alloc_mutex); + apr_lock_destroy(alloc_mutex); return status; } - status = apr_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, + status = apr_lock_create(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, globalp); if (status != APR_SUCCESS) { - apr_destroy_lock(spawn_mutex); + apr_lock_destroy(spawn_mutex); return status; } #endif - permanent_pool = apr_make_sub_pool(globalp, NULL); + permanent_pool = apr_pool_sub_make(globalp, NULL); #ifdef ALLOC_STATS atexit(dump_stats); @@ -701,15 +701,15 @@ APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp) return APR_SUCCESS; } -APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp) +APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp) { #if APR_HAS_THREADS - apr_destroy_lock(alloc_mutex); - apr_destroy_lock(spawn_mutex); + apr_lock_destroy(alloc_mutex); + apr_lock_destroy(spawn_mutex); alloc_mutex = NULL; spawn_mutex = NULL; #endif - apr_destroy_pool(globalp); + apr_pool_destroy(globalp); } /* We only want to lock the mutex if we are being called from apr_clear_pool. @@ -721,7 +721,7 @@ APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp) APR_DECLARE(void) apr_clear_pool(apr_pool_t *a) { while (a->sub_pools) { - apr_destroy_pool(a->sub_pools); + apr_pool_destroy(a->sub_pools); } /* * Don't hold the mutex during cleanups. @@ -753,12 +753,12 @@ APR_DECLARE(void) apr_clear_pool(apr_pool_t *a) #endif } -APR_DECLARE(void) apr_destroy_pool(apr_pool_t *a) +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *a) { apr_clear_pool(a); #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); } #endif @@ -775,17 +775,17 @@ APR_DECLARE(void) apr_destroy_pool(apr_pool_t *a) } #if APR_HAS_THREADS if (alloc_mutex) { - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); } #endif free_blocks(a->first); } -APR_DECLARE(apr_size_t) apr_bytes_in_pool(apr_pool_t *p) +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p) { return bytes_in_block_list(p->first); } -APR_DECLARE(apr_size_t) apr_bytes_in_free_blocks(void) +APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void) { return bytes_in_block_list(block_freelist); } @@ -963,7 +963,7 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); } #endif @@ -976,7 +976,7 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) #if APR_HAS_THREADS if (alloc_mutex) { - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); } #endif @@ -999,14 +999,14 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *a, apr_size_t size) * User data management functions */ -APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, +APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, const char *key, apr_status_t (*cleanup) (void *), apr_pool_t *cont) { int keylen = strlen(key); if (cont->prog_data == NULL) - cont->prog_data = apr_make_hash(cont); + cont->prog_data = apr_hash_make(cont); if (apr_hash_get(cont->prog_data, key, keylen) == NULL){ char *new_key = apr_pstrdup(cont, key); @@ -1016,11 +1016,11 @@ APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, apr_hash_set(cont->prog_data, key, keylen, data); } - apr_register_cleanup(cont, data, cleanup, cleanup); + apr_pool_cleanup_register(cont, data, cleanup, cleanup); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *cont) { if (cont->prog_data == NULL) *data = NULL; @@ -1087,11 +1087,11 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) /* must try another blok */ #if APR_HAS_THREADS - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); #endif nblok = new_block(2 * cur_len, NULL); #if APR_HAS_THREADS - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); #endif memcpy(nblok->h.first_avail, blok->h.first_avail, cur_len); ps->vbuff.curpos = nblok->h.first_avail + cur_len; @@ -1102,12 +1102,12 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) if (ps->got_a_new_block) { debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); #if APR_HAS_THREADS - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); #endif blok->h.next = block_freelist; block_freelist = blok; #if APR_HAS_THREADS - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); #endif } ps->blok = nblok; @@ -1202,7 +1202,7 @@ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) * generic interface, but for now, it's a special case */ -APR_DECLARE(void) apr_note_subprocess(apr_pool_t *a, apr_proc_t *pid, +APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) { struct process_chain *new = @@ -1237,7 +1237,7 @@ static void free_proc_chain(struct process_chain *procs) #ifndef NEED_WAITPID /* Pick up all defunct processes */ for (p = procs; p; p = p->next) { - if (apr_wait_proc(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { + if (apr_proc_wait(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { p->kill_how = kill_never; } } @@ -1248,20 +1248,20 @@ static void free_proc_chain(struct process_chain *procs) || (p->kill_how == kill_only_once)) { /* * Subprocess may be dead already. Only need the timeout if not. - * Note: apr_kill on Windows is TerminateProcess(), which is + * Note: apr_proc_kill on Windows is TerminateProcess(), which is * similar to a SIGKILL, so always give the process a timeout * under Windows before killing it. */ #ifdef WIN32 need_timeout = 1; #else - if (apr_kill(p->pid, SIGTERM) == APR_SUCCESS) { + if (apr_proc_kill(p->pid, SIGTERM) == APR_SUCCESS) { need_timeout = 1; } #endif } else if (p->kill_how == kill_always) { - apr_kill(p->pid, SIGKILL); + apr_proc_kill(p->pid, SIGKILL); } } @@ -1276,7 +1276,7 @@ static void free_proc_chain(struct process_chain *procs) */ for (p = procs; p; p = p->next) { if (p->kill_how == kill_after_timeout) { - apr_kill(p->pid, SIGKILL); + apr_proc_kill(p->pid, SIGKILL); } } #ifdef WIN32 @@ -1293,7 +1293,7 @@ static void free_proc_chain(struct process_chain *procs) /* Now wait for all the signaled processes to die */ for (p = procs; p; p = p->next) { if (p->kill_how != kill_never) { - (void) apr_wait_proc(p->pid, APR_WAIT); + (void) apr_proc_wait(p->pid, APR_WAIT); } } } diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 7d8e11275..40378d20d 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -48,7 +48,7 @@ static const char *pretty_path (const char *name) return p + 1; } -APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, +APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont, int argc, const char *const *argv) { void *argv_buff; diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c index 4cd0d36db..547cc4e2a 100644 --- a/misc/unix/getuuid.c +++ b/misc/unix/getuuid.c @@ -105,12 +105,12 @@ static void get_random_info(unsigned char node[NODE_LENGTH]) } r; - apr_MD5Init(&c); + apr_md5_init(&c); r.pid = getpid(); gettimeofday(&r.t, (struct timezone *)0); gethostname(r.hostname, 256); - apr_MD5Update(&c, (const unsigned char *)&r, sizeof(r)); - apr_MD5Final(seed, &c); + apr_md5_update(&c, (const unsigned char *)&r, sizeof(r)); + apr_md5_final(seed, &c); memcpy(node, seed, NODE_LENGTH); /* use a subset of the seed bytes */ #endif @@ -196,7 +196,7 @@ static void get_current_time(apr_uint64_t *timestamp) *timestamp = time_now + fudge; } -void apr_get_uuid(apr_uuid_t *uuid) +void apr_uuid_get(apr_uuid_t *uuid) { apr_uint64_t timestamp; unsigned char *d = uuid->data; diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index 0bc8629a3..40b16b05f 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -71,7 +71,7 @@ static apr_other_child_rec_t *other_children = NULL; -APR_DECLARE(void) apr_register_other_child(apr_proc_t *pid, +APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *pid, void (*maintenance) (int reason, void *, int status), void *data, apr_file_t *write_fd, apr_pool_t *p) { @@ -91,7 +91,7 @@ APR_DECLARE(void) apr_register_other_child(apr_proc_t *pid, other_children = ocr; } -APR_DECLARE(void) apr_unregister_other_child(void *data) +APR_DECLARE(void) apr_proc_other_child_unregister(void *data) { apr_other_child_rec_t **pocr, *nocr; @@ -108,7 +108,7 @@ APR_DECLARE(void) apr_unregister_other_child(void *data) /* test to ensure that the write_fds are all still writable, otherwise * invoke the maintenance functions as appropriate */ -void apr_probe_writable_fds(void) +void apr_proc_probe_writable_fds(void) { fd_set writable_fds; int fd_max; @@ -156,7 +156,7 @@ void apr_probe_writable_fds(void) } } -APR_DECLARE(apr_status_t) apr_reap_other_child(apr_proc_t *pid, int status) +APR_DECLARE(apr_status_t) apr_proc_other_child_read(apr_proc_t *pid, int status) { apr_other_child_rec_t *ocr, *nocr; @@ -172,7 +172,7 @@ APR_DECLARE(apr_status_t) apr_reap_other_child(apr_proc_t *pid, int status) return APR_CHILD_NOTDONE; } -APR_DECLARE(void) apr_check_other_child(void) +APR_DECLARE(void) apr_proc_other_child_check(void) { apr_other_child_rec_t *ocr, *nocr; pid_t waitret; diff --git a/misc/unix/start.c b/misc/unix/start.c index f208c2019..41e9327b5 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -76,7 +76,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_SUCCESS; } - if (apr_create_pool(&global_apr_pool, NULL) != APR_SUCCESS) { + if (apr_pool_create(&global_apr_pool, NULL) != APR_SUCCESS) { return APR_ENOPOOL; } @@ -94,7 +94,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_EEXIST; } #endif - status = apr_init_alloc(global_apr_pool); + status = apr_pool_alloc_init(global_apr_pool); return status; } @@ -104,7 +104,7 @@ APR_DECLARE(void) apr_terminate(void) if (initialized) { return; } - apr_term_alloc(global_apr_pool); + apr_pool_alloc_term(global_apr_pool); } APR_DECLARE(apr_status_t) apr_set_abort(int (*apr_abort)(int retcode), apr_pool_t *cont) diff --git a/misc/unix/uuid.c b/misc/unix/uuid.c index dc3580818..00a533fc5 100644 --- a/misc/unix/uuid.c +++ b/misc/unix/uuid.c @@ -60,7 +60,7 @@ #include "apr_lib.h" -APR_DECLARE(void) apr_format_uuid(char *buffer, const apr_uuid_t *uuid) +APR_DECLARE(void) apr_uuid_format(char *buffer, const apr_uuid_t *uuid) { const unsigned char *d = uuid->data; @@ -95,7 +95,7 @@ static unsigned char parse_hexpair(const char *s) return (unsigned char)result; } -APR_DECLARE(apr_status_t) apr_parse_uuid(apr_uuid_t *uuid, +APR_DECLARE(apr_status_t) apr_uuid_parse(apr_uuid_t *uuid, const char *uuid_str) { int i; diff --git a/misc/win32/getuuid.c b/misc/win32/getuuid.c index 465ef215c..e1b5b4b0e 100644 --- a/misc/win32/getuuid.c +++ b/misc/win32/getuuid.c @@ -62,7 +62,7 @@ #include "apr.h" #include "apr_uuid.h" -APR_DECLARE(void) apr_get_uuid(apr_uuid_t *uuid) +APR_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid) { GUID guid; diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 948fc680a..09ae1da01 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -120,7 +120,7 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, #ifdef BEOS /* XXX: mmap shouldn't really change the seek offset */ - apr_seek(file, APR_SET, &offset); + apr_file_seek(file, APR_SET, &offset); if (flag & APR_MMAP_WRITE) { native_flags |= B_WRITE_AREA; } @@ -166,8 +166,8 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, (*new)->cntxt = cont; /* register the cleanup... */ - apr_register_cleanup((*new)->cntxt, (void*)(*new), mmap_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void*)(*new), mmap_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } @@ -179,7 +179,7 @@ apr_status_t apr_mmap_delete(apr_mmap_t *mmap) return APR_ENOENT; if ((rv = mmap_cleanup(mmap)) == APR_SUCCESS) { - apr_kill_cleanup(mmap->cntxt, mmap, mmap_cleanup); + apr_pool_cleanup_kill(mmap->cntxt, mmap, mmap_cleanup); return APR_SUCCESS; } return rv; diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index 28c522469..b42ab98e8 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -147,8 +147,8 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, (*new)->cntxt = cont; /* register the cleanup... */ - apr_register_cleanup((*new)->cntxt, (void*)(*new), mmap_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void*)(*new), mmap_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } @@ -157,7 +157,7 @@ APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mmap) apr_status_t rv; if ((rv = mmap_cleanup(mmap)) == APR_SUCCESS) { - apr_kill_cleanup(mmap->cntxt, mmap, mmap_cleanup); + apr_pool_cleanup_kill(mmap->cntxt, mmap, mmap_cleanup); return APR_SUCCESS; } return rv; diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index 561e83d6d..6282877cb 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -67,7 +67,7 @@ * select for R4.5 of BeOS. So here we use code that uses the write * bits. */ -apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) +apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * num); if ((*new) == NULL) { @@ -84,7 +84,7 @@ apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *con return APR_SUCCESS; } -apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, +apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event) { if (event & APR_POLLIN) { @@ -102,7 +102,7 @@ apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, return APR_SUCCESS; } -apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, +apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) { @@ -146,7 +146,7 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, return APR_SUCCESS; } -apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) +apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { apr_int16_t revents = 0; char data[1]; @@ -190,7 +190,7 @@ apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_ return APR_SUCCESS; } -apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) +apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) { FD_CLR(sock->socketdes, aprset->read); FD_CLR(sock->socketdes, aprset->read); @@ -198,7 +198,7 @@ apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) return APR_SUCCESS; } -apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t event) +apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t event) { if (event & APR_POLLIN) { FD_ZERO(aprset->read); @@ -213,15 +213,15 @@ apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t event) return APR_SUCCESS; } -apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data) +apr_status_t apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data) { - return apr_get_userdata(data, key, pollfd->cntxt); + return apr_pool_userdata_get(data, key, pollfd->cntxt); } -apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, +apr_status_t apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, apr_status_t (*cleanup) (void *)) { - return apr_set_userdata(data, key, cleanup, pollfd->cntxt); + return apr_pool_userdata_set(data, key, cleanup, pollfd->cntxt); } #endif /* BEOS_BONE */ diff --git a/network_io/os2/poll.c b/network_io/os2/poll.c index 9fe63222d..5b6850d32 100644 --- a/network_io/os2/poll.c +++ b/network_io/os2/poll.c @@ -62,7 +62,7 @@ /* OS/2 doesn't have a poll function, implement using OS/2 style select */ -apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) +apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { *new = (apr_pollfd_t *)apr_palloc(cont, sizeof(apr_pollfd_t)); @@ -93,7 +93,7 @@ apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *con -apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, +apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) { int i; @@ -129,7 +129,7 @@ apr_status_t apr_poll(apr_pollfd_t *pollfdset, apr_int32_t *nsds, { int i; int rv = 0; - apr_time_t starttime = apr_now(); + apr_time_t starttime = apr_time_now(); do { for (i=0; i<pollfdset->num_total; i++) { @@ -143,7 +143,7 @@ apr_status_t apr_poll(apr_pollfd_t *pollfdset, apr_int32_t *nsds, timeout >= 0 ? timeout / 1000 : -1); if (rv < 0 && sock_errno() == SOCEINTR && timeout >= 0 ) { - apr_interval_time_t elapsed = apr_now() - starttime; + apr_interval_time_t elapsed = apr_time_now() - starttime; if (timeout <= elapsed) break; @@ -158,7 +158,7 @@ apr_status_t apr_poll(apr_pollfd_t *pollfdset, apr_int32_t *nsds, -apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) +apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { int i; @@ -180,7 +180,7 @@ apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_ -apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, +apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) { int start, *count, pos; @@ -218,7 +218,7 @@ apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, -apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) +apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) { - return apr_mask_poll_socket(aprset, sock, APR_POLLIN|APR_POLLOUT|APR_POLLPRI); + return apr_poll_socket_mask(aprset, sock, APR_POLLIN|APR_POLLOUT|APR_POLLPRI); } diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 7c264f6d3..e3833e418 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -126,7 +126,7 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->remote_addr->pool = p; } -apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, +apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, apr_pool_t *cont) { int family = ofamily; @@ -163,8 +163,8 @@ apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, (*new)->timeout = -1; (*new)->nonblock = FALSE; - apr_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -178,9 +178,9 @@ apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) } } -apr_status_t apr_close_socket(apr_socket_t *thesocket) +apr_status_t apr_socket_close(apr_socket_t *thesocket) { - apr_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); + apr_pool_cleanup_kill(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); } @@ -223,8 +223,8 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn return APR_OS2_STATUS(sock_errno()); } - apr_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -246,27 +246,27 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) -apr_status_t apr_get_socketdata(void **data, const char *key, +apr_status_t apr_socket_data_get(void **data, const char *key, apr_socket_t *socket) { - return apr_get_userdata(data, key, socket->cntxt); + return apr_pool_userdata_get(data, key, socket->cntxt); } -apr_status_t apr_set_socketdata(apr_socket_t *socket, void *data, const char *key, +apr_status_t apr_socket_data_set(apr_socket_t *socket, void *data, const char *key, apr_status_t (*cleanup) (void *)) { - return apr_set_userdata(data, key, cleanup, socket->cntxt); + return apr_pool_userdata_set(data, key, cleanup, socket->cntxt); } -apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) +apr_status_t apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) { *thesock = sock->socketdes; return APR_SUCCESS; } -apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, +apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont) { @@ -288,13 +288,13 @@ apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, (*apr_sock)->remote_addr->salen); } - apr_register_cleanup((*apr_sock)->cntxt, (void *)(*apr_sock), - socket_cleanup, apr_null_cleanup); + apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), + socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } -apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) +apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index c3305e8d8..d6ef1fb0a 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -57,7 +57,7 @@ #ifdef HAVE_POLL /* We can just use poll to do our socket polling. */ -apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) +apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t)); if ((*new) == NULL) { @@ -115,7 +115,7 @@ static apr_int16_t get_revent(apr_int16_t event) return rv; } -apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, +apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event) { int i = 0; @@ -153,7 +153,7 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, return APR_SUCCESS; } -apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) +apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { int i = 0; @@ -167,7 +167,7 @@ apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_ return APR_SUCCESS; } -apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, +apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) { apr_int16_t newevents; @@ -187,7 +187,7 @@ apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, return APR_SUCCESS; } -apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) +apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) { int i = 0; while(i < aprset->curpos && aprset->pollset[i].fd != sock->socketdes) { @@ -204,7 +204,7 @@ apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) return APR_SUCCESS; } -apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events) +apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) { int i = 0; apr_int16_t newevents; @@ -222,7 +222,7 @@ apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events) #else /* Use select to mimic poll */ -apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) +apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * num); if ((*new) == NULL) { @@ -239,7 +239,7 @@ apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *con return APR_SUCCESS; } -apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, +apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event) { if (event & APR_POLLIN) { @@ -257,7 +257,7 @@ apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, return APR_SUCCESS; } -apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, +apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) { @@ -301,7 +301,7 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, return APR_SUCCESS; } -apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) +apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { apr_int16_t revents = 0; char data[1]; @@ -348,7 +348,7 @@ apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_ return APR_SUCCESS; } -apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) +apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) { FD_CLR(sock->socketdes, aprset->read); FD_CLR(sock->socketdes, aprset->except); @@ -356,7 +356,7 @@ apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) return APR_SUCCESS; } -apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t event) +apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t event) { if (event & APR_POLLIN) { FD_ZERO(aprset->read); @@ -373,15 +373,15 @@ apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t event) #endif -apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data) +apr_status_t apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data) { - return apr_get_userdata(data, key, pollfd->cntxt); + return apr_pool_userdata_get(data, key, pollfd->cntxt); } -apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, +apr_status_t apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, apr_status_t (*cleanup) (void *)) { - return apr_set_userdata(data, key, cleanup, pollfd->cntxt); + return apr_pool_userdata_set(data, key, cleanup, pollfd->cntxt); } #if APR_FILES_AS_SOCKETS diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 5ebe4e9ee..c50e59392 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -70,7 +70,7 @@ #include <stdlib.h> #endif -APR_DECLARE(apr_status_t) apr_set_port(apr_sockaddr_t *sockaddr, +APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, apr_port_t port) { /* XXX IPv6: assumes sin_port and sin6_port at same offset */ @@ -79,10 +79,10 @@ APR_DECLARE(apr_status_t) apr_set_port(apr_sockaddr_t *sockaddr, } /* XXX assumes IPv4... I don't think this function is needed anyway - * since we have apr_getaddrinfo(), but we need to clean up Apache's + * since we have apr_sockaddr_info_get(), but we need to clean up Apache's * listen.c a bit more first. */ -APR_DECLARE(apr_status_t) apr_set_ipaddr(apr_sockaddr_t *sockaddr, +APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, const char *addr) { apr_uint32_t ipaddr; @@ -105,7 +105,7 @@ APR_DECLARE(apr_status_t) apr_set_ipaddr(apr_sockaddr_t *sockaddr, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_port(apr_port_t *port, +APR_DECLARE(apr_status_t) apr_sockaddr_port_get(apr_port_t *port, apr_sockaddr_t *sockaddr) { /* XXX IPv6 - assumes sin_port and sin6_port at same offset */ @@ -113,7 +113,7 @@ APR_DECLARE(apr_status_t) apr_get_port(apr_port_t *port, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_ipaddr(char **addr, +APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, apr_sockaddr_t *sockaddr) { *addr = apr_palloc(sockaddr->pool, sockaddr->addr_str_len); @@ -154,7 +154,7 @@ static void set_sockaddr_vars(apr_sockaddr_t *addr, int family) #endif } -APR_DECLARE(apr_status_t) apr_get_sockaddr(apr_sockaddr_t **sa, +APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock) { @@ -303,7 +303,7 @@ static void save_addrinfo(apr_pool_t *p, apr_sockaddr_t *sa, } #endif -APR_DECLARE(apr_status_t) apr_getaddrinfo(apr_sockaddr_t **sa, +APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t *p) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 77a39501b..b29f64294 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -121,7 +121,7 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->remote_addr->pool = p; } -apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, +apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, apr_pool_t *cont) { int family = ofamily; @@ -155,8 +155,8 @@ apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, set_socket_vars(*new, family); (*new)->timeout = -1; - apr_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -165,9 +165,9 @@ apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) return (shutdown(thesocket->socketdes, how) == -1) ? errno : APR_SUCCESS; } -apr_status_t apr_close_socket(apr_socket_t *thesocket) +apr_status_t apr_socket_close(apr_socket_t *thesocket) { - apr_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); + apr_pool_cleanup_kill(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); } @@ -241,8 +241,8 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn (*new)->local_interface_unknown = 1; } - apr_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -283,24 +283,24 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) } } -apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *sock) +apr_status_t apr_socket_data_get(void **data, const char *key, apr_socket_t *sock) { - return apr_get_userdata(data, key, sock->cntxt); + return apr_pool_userdata_get(data, key, sock->cntxt); } -apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, const char *key, +apr_status_t apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup) (void *)) { - return apr_set_userdata(data, key, cleanup, sock->cntxt); + return apr_pool_userdata_set(data, key, cleanup, sock->cntxt); } -apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) +apr_status_t apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) { *thesock = sock->socketdes; return APR_SUCCESS; } -apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, +apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont) { @@ -325,13 +325,13 @@ apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, (*apr_sock)->remote_addr->salen); } - apr_register_cleanup((*apr_sock)->cntxt, (void *)(*apr_sock), - socket_cleanup, apr_null_cleanup); + apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), + socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } -apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, +apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) { if ((*sock) == NULL) { diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index 5baa00768..5d01f313a 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -60,7 +60,7 @@ #include <time.h> -APR_DECLARE(apr_status_t) apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, +APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { (*new) = (apr_pollfd_t *)apr_palloc(cont, sizeof(apr_pollfd_t) * num); @@ -80,7 +80,7 @@ APR_DECLARE(apr_status_t) apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_add_poll_socket(apr_pollfd_t *aprset, +APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event) { @@ -142,7 +142,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_revents(apr_int16_t *event, +APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { @@ -198,20 +198,20 @@ APR_DECLARE(apr_status_t) apr_get_revents(apr_int16_t *event, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_polldata(apr_pollfd_t *pollfd, +APR_DECLARE(apr_status_t) apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data) { - return apr_get_userdata(data, key, pollfd->cntxt); + return apr_pool_userdata_get(data, key, pollfd->cntxt); } -APR_DECLARE(apr_status_t) apr_set_polldata(apr_pollfd_t *pollfd, void *data, +APR_DECLARE(apr_status_t) apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, apr_status_t (*cleanup)(void *)) { - return apr_set_userdata(data, key, cleanup, pollfd->cntxt); + return apr_pool_userdata_set(data, key, cleanup, pollfd->cntxt); } -APR_DECLARE(apr_status_t) apr_mask_poll_socket(apr_pollfd_t *aprset, +APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) { @@ -230,13 +230,13 @@ APR_DECLARE(apr_status_t) apr_mask_poll_socket(apr_pollfd_t *aprset, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_remove_poll_socket(apr_pollfd_t *aprset, +APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) { - return apr_mask_poll_socket(aprset, sock, ~0); + return apr_poll_socket_mask(aprset, sock, ~0); } -APR_DECLARE(apr_status_t) apr_clear_poll_sockets(apr_pollfd_t *aprset, +APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) { if (events & APR_POLLIN) { diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 9d792332c..21559692f 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -112,7 +112,7 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) sizeof(apr_sockaddr_t)); } -APR_DECLARE(apr_status_t) apr_create_socket(apr_socket_t **new, int ofamily, +APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily, int type, apr_pool_t *cont) { int family = ofamily; @@ -153,8 +153,8 @@ APR_DECLARE(apr_status_t) apr_create_socket(apr_socket_t **new, int ofamily, (*new)->timeout = -1; (*new)->disconnected = 0; - apr_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -186,9 +186,9 @@ APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, } } -APR_DECLARE(apr_status_t) apr_close_socket(apr_socket_t *thesocket) +APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket) { - apr_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); + apr_pool_cleanup_kill(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); } @@ -260,8 +260,8 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, (*new)->local_interface_unknown = 1; } - apr_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -299,27 +299,27 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_socketdata(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, apr_socket_t *socket) { - return apr_get_userdata(data, key, socket->cntxt); + return apr_pool_userdata_get(data, key, socket->cntxt); } -APR_DECLARE(apr_status_t) apr_set_socketdata(apr_socket_t *socket, void *data, +APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *socket, void *data, const char *key, apr_status_t (*cleanup)(void *)) { - return apr_set_userdata(data, key, cleanup, socket->cntxt); + return apr_pool_userdata_set(data, key, cleanup, socket->cntxt); } -APR_DECLARE(apr_status_t) apr_get_os_sock(apr_os_sock_t *thesock, +APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) { *thesock = sock->sock; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_make_os_sock(apr_socket_t **apr_sock, +APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont) { @@ -344,13 +344,13 @@ APR_DECLARE(apr_status_t) apr_make_os_sock(apr_socket_t **apr_sock, (*apr_sock)->remote_addr->pool = cont; } - apr_register_cleanup((*apr_sock)->cntxt, (void *)(*apr_sock), - socket_cleanup, apr_null_cleanup); + apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), + socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_put_os_sock(apr_socket_t **sock, +APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) { diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 92d849b17..6a9be850f 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -/* apr_getpass.c: abstraction to provide for obtaining a password from the +/* apr_password_get.c: abstraction to provide for obtaining a password from the * command line in whatever way the OS supports. In the best case, it's a * wrapper for the system library's getpass() routine; otherwise, we * use one we define ourselves. @@ -212,7 +212,7 @@ static char *getpass(const char *prompt) * but the caller is *not* made aware of it. */ -APR_DECLARE(apr_status_t) apr_getpass(const char *prompt, char *pwbuf, size_t *bufsiz) +APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, size_t *bufsiz) { char *pw_got = NULL; int result = 0; diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c index 81d90e26c..8387ff2a6 100644 --- a/passwd/apr_md5.c +++ b/passwd/apr_md5.c @@ -86,7 +86,7 @@ */ /* - * The apr_MD5Encode() routine uses much code obtained from the FreeBSD 3.0 + * The apr_md5_encode() routine uses much code obtained from the FreeBSD 3.0 * MD5 crypt() function, which is licenced as follows: * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): @@ -146,7 +146,7 @@ static unsigned char PADDING[64] = }; #if APR_CHARSET_EBCDIC -static apr_xlate_t *xlate_ebcdic_to_ascii; /* used in apr_MD5Encode() */ +static apr_xlate_t *xlate_ebcdic_to_ascii; /* used in apr_md5_encode() */ #endif /* F, G, H and I are basic MD5 functions. @@ -186,7 +186,7 @@ static apr_xlate_t *xlate_ebcdic_to_ascii; /* used in apr_MD5Encode() */ /* MD5 initialization. Begins an MD5 operation, writing a new context. */ -APR_DECLARE(apr_status_t) apr_MD5Init(apr_md5_ctx_t *context) +APR_DECLARE(apr_status_t) apr_md5_init(apr_md5_ctx_t *context) { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ @@ -205,7 +205,7 @@ APR_DECLARE(apr_status_t) apr_MD5Init(apr_md5_ctx_t *context) * to be used for translating the content before calculating the * digest. */ -APR_DECLARE(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, +APR_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context, apr_xlate_t *xlate) { apr_status_t rv; @@ -229,7 +229,7 @@ APR_DECLARE(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, operation, processing another message block, and updating the context. */ -APR_DECLARE(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, +APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) { @@ -311,7 +311,7 @@ APR_DECLARE(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, /* MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context. */ -APR_DECLARE(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], +APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE], apr_md5_ctx_t *context) { unsigned char bits[8]; @@ -321,17 +321,17 @@ APR_DECLARE(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], Encode(bits, context->count, 8); #if APR_HAS_XLATE - /* apr_MD5Update() should not translate for this final round. */ + /* apr_md5_update() should not translate for this final round. */ context->xlate = NULL; #endif /*APR_HAS_XLATE*/ /* Pad out to 56 mod 64. */ idx = (unsigned int) ((context->count[0] >> 3) & 0x3f); padLen = (idx < 56) ? (56 - idx) : (120 - idx); - apr_MD5Update(context, PADDING, padLen); + apr_md5_update(context, PADDING, padLen); /* Append length (before padding) */ - apr_MD5Update(context, bits, 8); + apr_md5_update(context, bits, 8); /* Store state in digest */ Encode(digest, context->state, MD5_DIGESTSIZE); @@ -491,7 +491,7 @@ static void to64(char *s, unsigned long v, int n) } } -APR_DECLARE(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, +APR_DECLARE(apr_status_t) apr_md5_encode(const char *pw, const char *salt, char *result, size_t nbytes) { /* @@ -536,36 +536,36 @@ APR_DECLARE(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, /* * 'Time to make the doughnuts..' */ - apr_MD5Init(&ctx); + apr_md5_init(&ctx); #if APR_CHARSET_EBCDIC - apr_MD5SetXlate(&ctx, xlate_ebcdic_to_ascii); + apr_md5_set_xlate(&ctx, xlate_ebcdic_to_ascii); #endif /* * The password first, since that is what is most unknown */ - apr_MD5Update(&ctx, (unsigned char *)pw, strlen(pw)); + apr_md5_update(&ctx, (unsigned char *)pw, strlen(pw)); /* * Then our magic string */ - apr_MD5Update(&ctx, (unsigned char *)apr1_id, strlen(apr1_id)); + apr_md5_update(&ctx, (unsigned char *)apr1_id, strlen(apr1_id)); /* * Then the raw salt */ - apr_MD5Update(&ctx, (unsigned char *)sp, sl); + apr_md5_update(&ctx, (unsigned char *)sp, sl); /* * Then just as many characters of the MD5(pw, salt, pw) */ - apr_MD5Init(&ctx1); - apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); - apr_MD5Update(&ctx1, (unsigned char *)sp, sl); - apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); - apr_MD5Final(final, &ctx1); + apr_md5_init(&ctx1); + apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_md5_update(&ctx1, (unsigned char *)sp, sl); + apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_md5_final(final, &ctx1); for (pl = strlen(pw); pl > 0; pl -= MD5_DIGESTSIZE) { - apr_MD5Update(&ctx, final, + apr_md5_update(&ctx, final, (pl > MD5_DIGESTSIZE) ? MD5_DIGESTSIZE : pl); } @@ -579,10 +579,10 @@ APR_DECLARE(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, */ for (i = strlen(pw); i != 0; i >>= 1) { if (i & 1) { - apr_MD5Update(&ctx, final, 1); + apr_md5_update(&ctx, final, 1); } else { - apr_MD5Update(&ctx, (unsigned char *)pw, 1); + apr_md5_update(&ctx, (unsigned char *)pw, 1); } } @@ -594,7 +594,7 @@ APR_DECLARE(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, strncat(passwd, sp, sl); strcat(passwd, "$"); - apr_MD5Final(final, &ctx); + apr_md5_final(final, &ctx); /* * And now, just to make sure things don't run too fast.. @@ -602,28 +602,28 @@ APR_DECLARE(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, * need 30 seconds to build a 1000 entry dictionary... */ for (i = 0; i < 1000; i++) { - apr_MD5Init(&ctx1); + apr_md5_init(&ctx1); if (i & 1) { - apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw)); } else { - apr_MD5Update(&ctx1, final, MD5_DIGESTSIZE); + apr_md5_update(&ctx1, final, MD5_DIGESTSIZE); } if (i % 3) { - apr_MD5Update(&ctx1, (unsigned char *)sp, sl); + apr_md5_update(&ctx1, (unsigned char *)sp, sl); } if (i % 7) { - apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw)); } if (i & 1) { - apr_MD5Update(&ctx1, final, MD5_DIGESTSIZE); + apr_md5_update(&ctx1, final, MD5_DIGESTSIZE); } else { - apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw)); } - apr_MD5Final(final,&ctx1); + apr_md5_final(final,&ctx1); } p = passwd + strlen(passwd); @@ -647,12 +647,12 @@ APR_DECLARE(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, /* * Validate a plaintext password against a smashed one. Use either - * crypt() (if available) or apr_MD5Encode(), depending upon the format + * crypt() (if available) or apr_md5_encode(), depending upon the format * of the smashed input password. Return APR_SUCCESS if they match, or * APR_EMISMATCH if they don't. */ -APR_DECLARE(apr_status_t) apr_validate_password(const char *passwd, +APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, const char *hash) { char sample[120]; @@ -663,7 +663,7 @@ APR_DECLARE(apr_status_t) apr_validate_password(const char *passwd, /* * The hash was created using our custom algorithm. */ - apr_MD5Encode(passwd, hash, sample, sizeof(sample)); + apr_md5_encode(passwd, hash, sample, sizeof(sample)); } else { /* diff --git a/shmem/os2/shmem.c b/shmem/os2/shmem.c index 6e4dcbebf..49713f406 100644 --- a/shmem/os2/shmem.c +++ b/shmem/os2/shmem.c @@ -121,7 +121,7 @@ apr_status_t apr_shm_free(struct shmem_t *m, void *entity) -apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name) +apr_status_t apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) { *name = NULL; return APR_ANONYMOUS; @@ -129,14 +129,14 @@ apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name) -apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name) +apr_status_t apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) { return APR_ANONYMOUS; } -apr_status_t apr_open_shmem(struct shmem_t *m) +apr_status_t apr_shm_open(struct shmem_t *m) { int rc; diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index f7c5c9929..1abcd7f1f 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -110,7 +110,7 @@ apr_status_t apr_shm_free(struct shmem_t *shared, void *entity) return APR_SUCCESS; } -apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name) +apr_status_t apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) { #if APR_USES_ANONYMOUS_SHM *name = NULL; @@ -125,7 +125,7 @@ apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name) #endif } -apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name) +apr_status_t apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) { #if APR_USES_ANONYMOUS_SHM return APR_ANONYMOUS; @@ -139,7 +139,7 @@ apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name) #endif } -apr_status_t apr_open_shmem(struct shmem_t *c) +apr_status_t apr_shm_open(struct shmem_t *c) { #if APR_USES_ANONYMOUS_SHM diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 0f21c6d6b..76dacc90c 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -499,7 +499,7 @@ static char *conv_apr_sockaddr(apr_sockaddr_t *sa, char *buf_end, int *len) /* XXX IPv6: this assumes sin_port and sin6_port are at same offset */ p = conv_10(ntohs(sa->sa.sin.sin_port), TRUE, &is_negative, p, &sub_len); *--p = ':'; - apr_get_ipaddr(&ipaddr_str, sa); + apr_sockaddr_ip_get(&ipaddr_str, sa); sub_len = strlen(ipaddr_str); #if APR_HAVE_IPV6 if (sa->sa.sin.sin_family == APR_INET6 && diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 78a06c743..142e93dd1 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -127,7 +127,7 @@ static apr_hash_entry_t **alloc_array(apr_hash_t *ht, apr_size_t max) return apr_pcalloc(ht->pool, sizeof(*ht->array) * (max + 1)); } -APR_DECLARE(apr_hash_t *) apr_make_hash(apr_pool_t *pool) +APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool) { apr_hash_t *ht; ht = apr_palloc(pool, sizeof(apr_hash_t)); diff --git a/tables/apr_tables.c b/tables/apr_tables.c index a3e5821f6..059f93635 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -107,7 +107,7 @@ static void make_array_core(apr_array_header_t *res, apr_pool_t *c, res->nalloc = nelts; /* ...but this many allocated */ } -APR_DECLARE(apr_array_header_t *) apr_make_array(apr_pool_t *p, +APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, int nelts, int elt_size) { apr_array_header_t *res; @@ -117,7 +117,7 @@ APR_DECLARE(apr_array_header_t *) apr_make_array(apr_pool_t *p, return res; } -APR_DECLARE(void *) apr_push_array(apr_array_header_t *arr) +APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr) { if (arr->nelts == arr->nalloc) { int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2; @@ -159,10 +159,10 @@ APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, dst->nelts += src->nelts; } -APR_DECLARE(apr_array_header_t *) apr_copy_array(apr_pool_t *p, +APR_DECLARE(apr_array_header_t *) apr_array_copy(apr_pool_t *p, const apr_array_header_t *arr) { - apr_array_header_t *res = apr_make_array(p, arr->nalloc, arr->elt_size); + apr_array_header_t *res = apr_array_make(p, arr->nalloc, arr->elt_size); memcpy(res->elts, arr->elts, arr->elt_size * arr->nelts); res->nelts = arr->nelts; @@ -186,7 +186,7 @@ static APR_INLINE void copy_array_hdr_core(apr_array_header_t *res, } APR_DECLARE(apr_array_header_t *) - apr_copy_array_hdr(apr_pool_t *p, + apr_array_copy_hdr(apr_pool_t *p, const apr_array_header_t *arr) { apr_array_header_t *res; @@ -200,11 +200,11 @@ APR_DECLARE(apr_array_header_t *) /* The above is used here to avoid consing multiple new array bodies... */ APR_DECLARE(apr_array_header_t *) - apr_append_arrays(apr_pool_t *p, + apr_array_append(apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second) { - apr_array_header_t *res = apr_copy_array_hdr(p, first); + apr_array_header_t *res = apr_array_copy_hdr(p, first); apr_array_cat(res, second); return res; @@ -286,14 +286,14 @@ static apr_table_entry_t *table_push(apr_table_t *t) if (t->a.nelts == t->a.nalloc) { return NULL; } - return (apr_table_entry_t *) apr_push_array(&t->a); + return (apr_table_entry_t *) apr_array_push(&t->a); } #else /* MAKE_TABLE_PROFILE */ -#define table_push(t) ((apr_table_entry_t *) apr_push_array(&(t)->a)) +#define table_push(t) ((apr_table_entry_t *) apr_array_push(&(t)->a)) #endif /* MAKE_TABLE_PROFILE */ -APR_DECLARE(apr_table_t *) apr_make_table(apr_pool_t *p, int nelts) +APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts) { apr_table_t *t = apr_palloc(p, sizeof(apr_table_t)); @@ -304,7 +304,7 @@ APR_DECLARE(apr_table_t *) apr_make_table(apr_pool_t *p, int nelts) return t; } -APR_DECLARE(apr_table_t *) apr_copy_table(apr_pool_t *p, const apr_table_t *t) +APR_DECLARE(apr_table_t *) apr_table_copy(apr_pool_t *p, const apr_table_t *t) { apr_table_t *new = apr_palloc(p, sizeof(apr_table_t)); @@ -323,7 +323,7 @@ APR_DECLARE(apr_table_t *) apr_copy_table(apr_pool_t *p, const apr_table_t *t) return new; } -APR_DECLARE(void) apr_clear_table(apr_table_t *t) +APR_DECLARE(void) apr_table_clear(apr_table_t *t) { t->a.nelts = 0; } @@ -534,7 +534,7 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, elts->val = (char *)val; } -APR_DECLARE(apr_table_t *) apr_overlay_tables(apr_pool_t *p, +APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base) { @@ -665,7 +665,7 @@ static int sort_overlap(const void *va, const void *vb) #define APR_OVERLAP_TABLES_ON_STACK (512) #endif -APR_DECLARE(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, +APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, unsigned flags) { overlap_key cat_keys_buf[APR_OVERLAP_TABLES_ON_STACK]; diff --git a/test/abc.c b/test/abc.c index 894228d85..d0cd82302 100644 --- a/test/abc.c +++ b/test/abc.c @@ -11,12 +11,12 @@ int main(int argc, char *argv[]) int status = 0; apr_pool_t *context; - apr_create_pool(&context, NULL); + apr_pool_create(&context, NULL); - apr_open(&fd, argv[1], APR_READ, -1, context); + apr_file_open(&fd, argv[1], APR_READ, -1, context); while (!status) { - status = apr_getc(&ch, fd); + status = apr_file_getc(&ch, fd); if (status == APR_EOF ) fprintf(stdout, "EOF, YEAH!!!!!!!!!\n"); else if (status == APR_SUCCESS) diff --git a/test/client.c b/test/client.c index 8ccc555ea..70f269c5e 100644 --- a/test/client.c +++ b/test/client.c @@ -98,14 +98,14 @@ int main(int argc, char *argv[]) atexit(closeapr); fprintf(stdout, "Creating context......."); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Something went wrong\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout,"\tClient: Making socket address..............."); - if ((stat = apr_getaddrinfo(&remote_sa, dest, APR_UNSPEC, 8021, 0, context)) + if ((stat = apr_sockaddr_info_get(&remote_sa, dest, APR_UNSPEC, 8021, 0, context)) != APR_SUCCESS) { fprintf(stdout, "Failed!\n"); fprintf(stdout, "Address resolution failed for %s: %s\n", @@ -115,7 +115,7 @@ int main(int argc, char *argv[]) fprintf(stdout,"OK\n"); fprintf(stdout, "\tClient: Creating new socket......."); - if (apr_create_socket(&sock, remote_sa->sa.sin.sin_family, SOCK_STREAM, + if (apr_socket_create(&sock, remote_sa->sa.sin.sin_family, SOCK_STREAM, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) stat = apr_connect(sock, remote_sa); if (stat != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Could not connect: %s (%d)\n", apr_strerror(stat, msgbuf, sizeof(msgbuf)), stat); fflush(stderr); @@ -138,25 +138,25 @@ int main(int argc, char *argv[]) if (read_timeout == -1) { fprintf(stdout, "\tClient: Setting socket option NONBLOCK......."); if (apr_setsocketopt(sock, APR_SO_NONBLOCK, 1) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Couldn't set socket option\n"); exit(-1); } fprintf(stdout, "OK\n"); } - apr_get_sockaddr(&remote_sa, APR_REMOTE, sock); - apr_get_ipaddr(&remote_ipaddr, remote_sa); - apr_get_port(&remote_port, remote_sa); - apr_get_sockaddr(&local_sa, APR_LOCAL, sock); - apr_get_ipaddr(&local_ipaddr, local_sa); - apr_get_port(&local_port, local_sa); + apr_socket_addr_get(&remote_sa, APR_REMOTE, sock); + apr_sockaddr_ip_get(&remote_ipaddr, remote_sa); + apr_sockaddr_port_get(&remote_port, remote_sa); + apr_socket_addr_get(&local_sa, APR_LOCAL, sock); + apr_sockaddr_ip_get(&local_ipaddr, local_sa); + apr_sockaddr_port_get(&local_port, local_sa); fprintf(stdout, "\tClient socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); fprintf(stdout, "\tClient: Trying to send data over socket......."); length = STRLEN; if (apr_send(sock, datasend, &length) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Problem sending data\n"); exit(-1); } @@ -176,13 +176,13 @@ int main(int argc, char *argv[]) fprintf(stdout, "\tClient: Trying to receive data over socket......."); if ((stat = apr_recv(sock, datarecv, &length)) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Problem receiving data: %s (%d)\n", apr_strerror(stat, msgbuf, sizeof(msgbuf)), stat); exit(-1); } if (strcmp(datarecv, "Recv data test")) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "I did not receive the correct data %s\n", datarecv); exit(-1); } @@ -190,14 +190,14 @@ int main(int argc, char *argv[]) fprintf(stdout, "\tClient: Shutting down socket......."); if (apr_shutdown(sock, APR_SHUTDOWN_WRITE) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Could not shutdown socket\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tClient: Closing down socket......."); - if (apr_close_socket(sock) != APR_SUCCESS) { + if (apr_socket_close(sock) != APR_SUCCESS) { fprintf(stderr, "Could not shutdown socket\n"); exit(-1); } diff --git a/test/sendfile.c b/test/sendfile.c index 425b55987..146a05b82 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -110,18 +110,18 @@ static void apr_setup(apr_pool_t **p, apr_socket_t **sock, int *family) atexit(closeapr); - rv = apr_create_pool(p, NULL); + rv = apr_pool_create(p, NULL); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_create_pool()->%d/%s\n", + fprintf(stderr, "apr_pool_create()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } *sock = NULL; - rv = apr_create_socket(sock, *family, SOCK_STREAM, *p); + rv = apr_socket_create(sock, *family, SOCK_STREAM, *p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_create_socket()->%d/%s\n", + fprintf(stderr, "apr_socket_create()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -130,9 +130,9 @@ static void apr_setup(apr_pool_t **p, apr_socket_t **sock, int *family) if (*family == APR_UNSPEC) { apr_sockaddr_t *localsa; - rv = apr_get_sockaddr(&localsa, APR_LOCAL, *sock); + rv = apr_socket_addr_get(&localsa, APR_LOCAL, *sock); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_get_sockaddr()->%d/%s\n", + fprintf(stderr, "apr_socket_addr_get()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -150,11 +150,11 @@ static void create_testfile(apr_pool_t *p, const char *fname) apr_finfo_t finfo; printf("Creating a test file...\n"); - rv = apr_open(&f, fname, + rv = apr_file_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE | APR_BUFFERED, APR_UREAD | APR_UWRITE, p); if (rv) { - fprintf(stderr, "apr_open()->%d/%s\n", + fprintf(stderr, "apr_file_open()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -162,35 +162,35 @@ static void create_testfile(apr_pool_t *p, const char *fname) buf[0] = FILE_DATA_CHAR; buf[1] = '\0'; for (i = 0; i < FILE_LENGTH; i++) { - /* exercise apr_putc() and apr_puts() on buffered files */ + /* exercise apr_file_putc() and apr_file_puts() on buffered files */ if ((i % 2) == 0) { - rv = apr_putc(buf[0], f); + rv = apr_file_putc(buf[0], f); if (rv) { - fprintf(stderr, "apr_putc()->%d/%s\n", + fprintf(stderr, "apr_file_putc()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } } else { - rv = apr_puts(buf, f); + rv = apr_file_puts(buf, f); if (rv) { - fprintf(stderr, "apr_puts()->%d/%s\n", + fprintf(stderr, "apr_file_puts()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } } } - rv = apr_close(f); + rv = apr_file_close(f); if (rv) { - fprintf(stderr, "apr_close()->%d/%s\n", + fprintf(stderr, "apr_file_close()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } rv = apr_stat(&finfo, fname, APR_FINFO_NORM, p); if (rv) { - fprintf(stderr, "apr_close()->%d/%s\n", + fprintf(stderr, "apr_file_close()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -230,17 +230,17 @@ static int client(client_socket_mode_t socket_mode) apr_setup(&p, &sock, &family); create_testfile(p, TESTFILE); - rv = apr_open(&f, TESTFILE, APR_READ, 0, p); + rv = apr_file_open(&f, TESTFILE, APR_READ, 0, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_open()->%d/%s\n", + fprintf(stderr, "apr_file_open()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = apr_getaddrinfo(&destsa, "127.0.0.1", family, TESTSF_PORT, 0, p); + rv = apr_sockaddr_info_get(&destsa, "127.0.0.1", family, TESTSF_PORT, 0, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_getaddrinfo()->%d/%s\n", + fprintf(stderr, "apr_sockaddr_info_get()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -343,9 +343,9 @@ static int client(client_socket_mode_t socket_mode) apr_size_t total_bytes_sent; pfd = NULL; - rv = apr_setup_poll(&pfd, 1, p); + rv = apr_poll_setup(&pfd, 1, p); assert(!rv); - rv = apr_add_poll_socket(pfd, sock, APR_POLLOUT); + rv = apr_poll_socket_add(pfd, sock, APR_POLLOUT); assert(!rv); total_bytes_sent = 0; @@ -456,9 +456,9 @@ static int client(client_socket_mode_t socket_mode) } current_file_offset = 0; - rv = apr_seek(f, APR_CUR, ¤t_file_offset); + rv = apr_file_seek(f, APR_CUR, ¤t_file_offset); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_seek()->%d/%s\n", + fprintf(stderr, "apr_file_seek()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -493,9 +493,9 @@ static int client(client_socket_mode_t socket_mode) printf("client: apr_sendfile() worked as expected!\n"); - rv = apr_remove_file(TESTFILE, p); + rv = apr_file_remove(TESTFILE, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_remove_file()->%d/%s\n", + fprintf(stderr, "apr_file_remove()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -527,9 +527,9 @@ static int server(void) exit(1); } - rv = apr_getaddrinfo(&localsa, NULL, family, TESTSF_PORT, 0, p); + rv = apr_sockaddr_info_get(&localsa, NULL, family, TESTSF_PORT, 0, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_getaddrinfo()->%d/%s\n", + fprintf(stderr, "apr_sockaddr_info_get()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); diff --git a/test/server.c b/test/server.c index 32871da19..c47366b28 100644 --- a/test/server.c +++ b/test/server.c @@ -95,13 +95,13 @@ int main(int argc, const char * const argv[]) atexit(closeapr); fprintf(stdout, "Creating context......."); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Could not create a context\n"); exit(-1); } fprintf(stdout, "OK\n"); - if (apr_initopt(&opt, context, argc, argv)) { + if (apr_getopt_init(&opt, context, argc, argv)) { fprintf(stderr, "failed to initialize opts\n"); exit(-1); } @@ -125,7 +125,7 @@ int main(int argc, const char * const argv[]) * socket we need. We'll use the returned sockaddr later when * we bind. */ - stat = apr_getaddrinfo(&localsa, bind_to_ipaddr, APR_UNSPEC, 8021, 0, + stat = apr_sockaddr_info_get(&localsa, bind_to_ipaddr, APR_UNSPEC, 8021, 0, context); if (stat != APR_SUCCESS) { fprintf(stderr, @@ -137,7 +137,7 @@ int main(int argc, const char * const argv[]) } fprintf(stdout, "\tServer: Creating new socket......."); - if (apr_create_socket(&sock, family, SOCK_STREAM, context) != APR_SUCCESS) { + if (apr_socket_create(&sock, family, SOCK_STREAM, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); } @@ -145,7 +145,7 @@ int main(int argc, const char * const argv[]) fprintf(stdout, "\tServer: Setting socket option NONBLOCK......."); if (apr_setsocketopt(sock, APR_SO_NONBLOCK, 1) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Couldn't set socket option\n"); exit(-1); } @@ -153,20 +153,20 @@ int main(int argc, const char * const argv[]) fprintf(stdout, "\tServer: Setting socket option REUSEADDR......."); if (apr_setsocketopt(sock, APR_SO_REUSEADDR, 1) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Couldn't set socket option\n"); exit(-1); } fprintf(stdout, "OK\n"); if (!localsa) { - apr_get_sockaddr(&localsa, APR_LOCAL, sock); - apr_set_port(localsa, 8021); + apr_socket_addr_get(&localsa, APR_LOCAL, sock); + apr_sockaddr_port_set(localsa, 8021); } fprintf(stdout, "\tServer: Binding socket to port......."); if ((stat = apr_bind(sock, localsa)) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Could not bind: %s\n", apr_strerror(stat, buf, sizeof buf)); exit(-1); @@ -175,26 +175,26 @@ int main(int argc, const char * const argv[]) fprintf(stdout, "\tServer: Listening to socket......."); if (apr_listen(sock, 5) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Could not listen\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Setting up socket for polling......."); - apr_setup_poll(&sdset, 1, context); - apr_add_poll_socket(sdset, sock, APR_POLLIN); + apr_poll_setup(&sdset, 1, context); + apr_poll_socket_add(sdset, sock, APR_POLLIN); fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Beginning to poll for socket......."); rv = 1; if (apr_poll(sdset, &rv, -1) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Select caused an error\n"); exit(-1); } else if (rv == 0) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "I should not return until rv == 1\n"); exit(-1); } @@ -202,31 +202,31 @@ int main(int argc, const char * const argv[]) fprintf(stdout, "\tServer: Accepting a connection......."); if (apr_accept(&sock2, sock, context) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Could not accept connection.\n"); exit(-1); } fprintf(stdout, "OK\n"); - apr_get_sockaddr(&remotesa, APR_REMOTE, sock2); - apr_get_ipaddr(&remote_ipaddr, remotesa); - apr_get_port(&remote_port, remotesa); - apr_get_sockaddr(&localsa, APR_LOCAL, sock2); - apr_get_ipaddr(&local_ipaddr, localsa); - apr_get_port(&local_port, localsa); + apr_socket_addr_get(&remotesa, APR_REMOTE, sock2); + apr_sockaddr_ip_get(&remote_ipaddr, remotesa); + apr_sockaddr_port_get(&remote_port, remotesa); + apr_socket_addr_get(&localsa, APR_LOCAL, sock2); + apr_sockaddr_ip_get(&local_ipaddr, localsa); + apr_sockaddr_port_get(&local_port, localsa); fprintf(stdout, "\tServer socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); length = STRLEN; fprintf(stdout, "\tServer: Trying to recv data from socket......."); if (apr_recv(sock2, datasend, &length) != APR_SUCCESS) { - apr_close_socket(sock); - apr_close_socket(sock2); + apr_socket_close(sock); + apr_socket_close(sock2); fprintf(stderr, "Problem recving data\n"); exit(-1); } if (strcmp(datasend, "Send data test")) { - apr_close_socket(sock); - apr_close_socket(sock2); + apr_socket_close(sock); + apr_socket_close(sock2); fprintf(stderr, "I did not receive the correct data %s\n", datarecv); exit(-1); } @@ -235,8 +235,8 @@ int main(int argc, const char * const argv[]) length = STRLEN; fprintf(stdout, "\tServer: Sending data over socket......."); if (apr_send(sock2, datarecv, &length) != APR_SUCCESS) { - apr_close_socket(sock); - apr_close_socket(sock2); + apr_socket_close(sock); + apr_socket_close(sock2); fprintf(stderr, "Problem sending data\n"); exit(-1); } @@ -244,23 +244,23 @@ int main(int argc, const char * const argv[]) fprintf(stdout, "\tServer: Shutting down accepted socket......."); if (apr_shutdown(sock2, APR_SHUTDOWN_READ) != APR_SUCCESS) { - apr_close_socket(sock); - apr_close_socket(sock2); + apr_socket_close(sock); + apr_socket_close(sock2); fprintf(stderr, "Problem shutting down\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: closing duplicate socket......."); - if (apr_close_socket(sock2) != APR_SUCCESS) { - apr_close_socket(sock); + if (apr_socket_close(sock2) != APR_SUCCESS) { + apr_socket_close(sock); fprintf(stderr, "Problem closing down\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: closing original socket......."); - if (apr_close_socket(sock) != APR_SUCCESS) { + if (apr_socket_close(sock) != APR_SUCCESS) { fprintf(stderr, "Problem closing down\n"); exit(-1); } diff --git a/test/testargs.c b/test/testargs.c index aa088e98a..803f3ecca 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -87,9 +87,9 @@ int main(int argc, const char * const argv[]) apr_initialize(); atexit(closeapr); - apr_create_pool(&context, NULL); + apr_pool_create(&context, NULL); - if (apr_initopt(&opt, context, argc, argv)) + if (apr_getopt_init(&opt, context, argc, argv)) { printf("failed to initialize opts"); exit(1); diff --git a/test/testcontext.c b/test/testcontext.c index 4755e183e..7267aac0a 100644 --- a/test/testcontext.c +++ b/test/testcontext.c @@ -85,16 +85,16 @@ int main(void) } atexit(closeapr); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } testdata = apr_pstrdup(context, "This is a test\n"); - apr_set_userdata(testdata, "TEST", string_cleanup, context); + apr_pool_userdata_set(testdata, "TEST", string_cleanup, context); - apr_get_userdata((void **)&retdata, "TEST", context); + apr_pool_userdata_get((void **)&retdata, "TEST", context); if (!strcmp(testdata, retdata)) { fprintf(stdout, "User data is working ok\n"); diff --git a/test/testdso.c b/test/testdso.c index d07148a35..160fad15d 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -35,7 +35,7 @@ int main (int argc, char ** argv) apr_initialize(); atexit(closeapr); - if (apr_create_pool(&cont, NULL) != APR_SUCCESS) { + if (apr_pool_create(&cont, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } diff --git a/test/testfile.c b/test/testfile.c index 2a7f4a042..af449742a 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -124,11 +124,11 @@ int main(void) exit(-1); } atexit(closeapr); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } - if (apr_create_pool(&cont2, context) != APR_SUCCESS) { + if (apr_pool_create(&cont2, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } @@ -136,7 +136,7 @@ int main(void) fprintf(stdout, "Testing file functions.\n"); fprintf(stdout, "\tOpening file......."); - status = apr_open(&thefile, filename, flag, APR_UREAD | APR_UWRITE | APR_GREAD, context); + status = apr_file_open(&thefile, filename, flag, APR_UREAD | APR_UWRITE | APR_GREAD, context); if (status != APR_SUCCESS) { fprintf(stderr, "Didn't open file: %d/%s\n", status, apr_strerror(status, errmsg, sizeof errmsg)); @@ -151,7 +151,7 @@ int main(void) fprintf(stderr, "Bad file des\n"); exit(-1); } - apr_get_filename(&str, thefile); + apr_file_name_get(&str, thefile); if (strcmp(str, filename) != 0) { fprintf(stderr, "wrong filename\n"); exit(-1); @@ -163,9 +163,9 @@ int main(void) fprintf(stdout, "\tWriting to file......."); nbytes = strlen("this is a test"); - status = apr_write(thefile, "this is a test", &nbytes); + status = apr_file_write(thefile, "this is a test", &nbytes); if (status != APR_SUCCESS) { - fprintf(stderr, "something's wrong; apr_write->%d/%s\n", + fprintf(stderr, "something's wrong; apr_file_write->%d/%s\n", status, apr_strerror(status, errmsg, sizeof errmsg)); exit(-1); } @@ -179,7 +179,7 @@ int main(void) fprintf(stdout, "\tMoving to start of file......."); zer = 0; - status = apr_seek(thefile, SEEK_SET, &zer); + status = apr_file_seek(thefile, SEEK_SET, &zer); if (status != APR_SUCCESS) { fprintf(stderr, "couldn't seek to beginning of file: %d/%s", status, apr_strerror(status, errmsg, sizeof errmsg)); @@ -201,8 +201,8 @@ int main(void) fprintf(stdout, "OK\n"); fprintf(stdout, "\t\tChecking for incoming data......."); - apr_setup_poll(&sdset, 1, context); - apr_add_poll_socket(sdset, testsock, APR_POLLIN); + apr_poll_setup(&sdset, 1, context); + apr_poll_socket_add(sdset, testsock, APR_POLLIN); num = 1; if (apr_poll(sdset, &num, -1) != APR_SUCCESS) { fprintf(stderr, "Select caused an error\n"); @@ -218,9 +218,9 @@ int main(void) fprintf(stdout, "\tReading from the file......."); nbytes = strlen("this is a test"); buf = (char *)apr_palloc(context, nbytes + 1); - status = apr_read(thefile, buf, &nbytes); + status = apr_file_read(thefile, buf, &nbytes); if (status != APR_SUCCESS) { - fprintf(stderr, "apr_read()->%d/%s\n", + fprintf(stderr, "apr_file_read()->%d/%s\n", status, apr_strerror(status, errmsg, sizeof errmsg)); exit(-1); } @@ -233,7 +233,7 @@ int main(void) } fprintf(stdout, "\tAdding user data to the file......."); - status = apr_set_filedata(thefile, "This is a test", "test", apr_null_cleanup); + status = apr_file_data_set(thefile, "This is a test", "test", apr_pool_cleanup_null); if (status != APR_SUCCESS) { fprintf(stderr, "Couldn't add the data\n"); exit(-1); @@ -243,7 +243,7 @@ int main(void) } fprintf(stdout, "\tGetting user data from the file......."); - status = apr_get_filedata((void **)&teststr, "test", thefile); + status = apr_file_data_get((void **)&teststr, "test", thefile); if (status != APR_SUCCESS || strcmp(teststr, "This is a test")) { fprintf(stderr, "Couldn't get the data\n"); exit(-1); @@ -253,7 +253,7 @@ int main(void) } fprintf(stdout, "\tGetting fileinfo......."); - status = apr_getfileinfo(&finfo, APR_FINFO_NORM, thefile); + status = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); if (status == APR_INCOMPLETE) { int i; fprintf(stdout, "INCOMPLETE\n"); @@ -272,7 +272,7 @@ int main(void) uid = finfo.user; fprintf(stdout, "\tClosing File......."); - status = apr_close(thefile); + status = apr_file_close(thefile); if (status != APR_SUCCESS) { fprintf(stderr, "Couldn't close the file\n"); exit(-1); @@ -329,7 +329,7 @@ int main(void) } fprintf(stdout, "\tDeleting file......."); - status = apr_remove_file(filename, context); + status = apr_file_remove(filename, context); if (status != APR_SUCCESS) { fprintf(stderr, "Couldn't delete the file\n"); exit(-1); @@ -339,7 +339,7 @@ int main(void) } fprintf(stdout, "\tMaking sure it's gone......."); - status = apr_open(&thefile, filename, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, context); + status = apr_file_open(&thefile, filename, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, context); if (status == APR_SUCCESS) { fprintf(stderr, "I could open the file for some reason?\n"); exit(-1); @@ -352,7 +352,7 @@ int main(void) test_filedel(context); test_read(context); - apr_destroy_pool(context); + apr_pool_destroy(context); return 1; } @@ -362,20 +362,20 @@ int test_filedel(apr_pool_t *context) apr_int32_t flag = APR_READ | APR_WRITE | APR_CREATE; apr_status_t stat; - stat = apr_open(&thefile, "testdel", flag, APR_UREAD | APR_UWRITE | APR_GREAD, context); + stat = apr_file_open(&thefile, "testdel", flag, APR_UREAD | APR_UWRITE | APR_GREAD, context); if (stat != APR_SUCCESS) { return stat; } - if ((stat = apr_close(thefile)) != APR_SUCCESS) { + if ((stat = apr_file_close(thefile)) != APR_SUCCESS) { return stat; } - if ((stat = apr_remove_file("testdel", context)) != APR_SUCCESS) { + if ((stat = apr_file_remove("testdel", context)) != APR_SUCCESS) { return stat; } - stat = apr_open(&thefile, "testdel", APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, context); + stat = apr_file_open(&thefile, "testdel", APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, context); if (stat == APR_SUCCESS) { return stat; } @@ -393,7 +393,7 @@ int testdirs(apr_pool_t *context) fprintf(stdout, "Testing Directory functions.\n"); fprintf(stdout, "\tMakeing Directory......."); - if (apr_make_dir("testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE | APR_GREAD | APR_GWRITE | APR_GEXECUTE | APR_WREAD | APR_WWRITE | APR_WEXECUTE, context) != APR_SUCCESS) { + if (apr_dir_make("testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE | APR_GREAD | APR_GWRITE | APR_GEXECUTE | APR_WREAD | APR_WWRITE | APR_WEXECUTE, context) != APR_SUCCESS) { fprintf(stderr, "Could not create directory\n"); return -1; } @@ -401,13 +401,13 @@ int testdirs(apr_pool_t *context) fprintf(stdout, "OK\n"); } - if (apr_open(&file, "testdir/testfile", APR_READ | APR_WRITE | APR_CREATE, APR_UREAD | APR_UWRITE | APR_UEXECUTE, context) != APR_SUCCESS) {; + if (apr_file_open(&file, "testdir/testfile", APR_READ | APR_WRITE | APR_CREATE, APR_UREAD | APR_UWRITE | APR_UEXECUTE, context) != APR_SUCCESS) {; return -1; } bytes = strlen("Another test!!!"); - apr_write(file, "Another test!!", &bytes); - apr_close(file); + apr_file_write(file, "Another test!!", &bytes); + apr_file_close(file); fprintf(stdout, "\tOpening Directory......."); if (apr_dir_open(&temp, "testdir", context) != APR_SUCCESS) { @@ -474,7 +474,7 @@ int testdirs(apr_pool_t *context) } fprintf(stdout, "\tRemoving file from directory......."); - if (apr_remove_file("testdir/testfile", context) != APR_SUCCESS) { + if (apr_file_remove("testdir/testfile", context) != APR_SUCCESS) { fprintf(stderr, "Could not remove file\n"); return -1; } @@ -483,7 +483,7 @@ int testdirs(apr_pool_t *context) } fprintf(stdout, "\tRemoving Directory......."); - if (apr_remove_dir("testdir", context) != APR_SUCCESS) { + if (apr_dir_remove("testdir", context) != APR_SUCCESS) { fprintf(stderr, "Could not remove directory\n"); return -1; } @@ -506,23 +506,23 @@ static void create_testread(apr_pool_t *p, const char *fname) /* Create a test file with known content. */ - rv = apr_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); + rv = apr_file_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); if (rv) { - fprintf(stderr, "apr_open()->%d/%s\n", + fprintf(stderr, "apr_file_open()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } nbytes = 4; - rv = apr_write(f, "abc\n", &nbytes); + rv = apr_file_write(f, "abc\n", &nbytes); assert(!rv && nbytes == 4); memset(buf, 'a', sizeof buf); nbytes = sizeof buf; - rv = apr_write(f, buf, &nbytes); + rv = apr_file_write(f, buf, &nbytes); assert(!rv && nbytes == sizeof buf); nbytes = 2; - rv = apr_write(f, "\n\n", &nbytes); + rv = apr_file_write(f, "\n\n", &nbytes); assert(!rv && nbytes == 2); - rv = apr_close(f); + rv = apr_file_close(f); assert(!rv); } @@ -537,11 +537,11 @@ static char read_one(apr_file_t *f, int expected) bytes[0] = bytes[2] = 0x01; if (counter % 2) { - rv = apr_getc(bytes + 1, f); + rv = apr_file_getc(bytes + 1, f); } else { nbytes = 1; - rv = apr_read(f, bytes + 1, &nbytes); + rv = apr_file_read(f, bytes + 1, &nbytes); assert(nbytes == 1); } assert(!rv); @@ -560,23 +560,23 @@ static void test_read_guts(apr_pool_t *p, const char *fname, apr_int32_t extra_f char buf[1024]; int i; - rv = apr_open(&f, fname, APR_READ | extra_flags, 0, p); + rv = apr_file_open(&f, fname, APR_READ | extra_flags, 0, p); assert(!rv); read_one(f, 'a'); read_one(f, 'b'); if (extra_flags & APR_BUFFERED) { fprintf(stdout, - "\n\t\tskipping apr_ungetc() for APR_BUFFERED... " + "\n\t\tskipping apr_file_ungetc() for APR_BUFFERED... " "doesn't work yet...\n\t\t\t\t "); } else { - rv = apr_ungetc('b', f); + rv = apr_file_ungetc('b', f); assert(!rv); /* Note: some implementations move the file ptr back; * others just save up to one char; it isn't * portable to unget more than once. */ - /* Don't do this: rv = apr_ungetc('a', f); */ + /* Don't do this: rv = apr_file_ungetc('a', f); */ read_one(f, 'b'); } read_one(f, 'c'); @@ -586,20 +586,20 @@ static void test_read_guts(apr_pool_t *p, const char *fname, apr_int32_t extra_f } read_one(f, '\n'); read_one(f, '\n'); - rv = apr_getc(buf, f); + rv = apr_file_getc(buf, f); assert(rv == APR_EOF); - rv = apr_close(f); + rv = apr_file_close(f); assert(!rv); f = NULL; - rv = apr_open(&f, fname, APR_READ | extra_flags, 0, p); + rv = apr_file_open(&f, fname, APR_READ | extra_flags, 0, p); assert(!rv); - rv = apr_fgets(buf, 10, f); + rv = apr_file_gets(buf, 10, f); assert(!rv); assert(!strcmp(buf, "abc\n")); /* read first 800 of TESTREAD_BLKSIZE 'a's */ - rv = apr_fgets(buf, 801, f); + rv = apr_file_gets(buf, 801, f); assert(!rv); assert(strlen(buf) == 800); for (i = 0; i < 800; i++) { @@ -607,7 +607,7 @@ static void test_read_guts(apr_pool_t *p, const char *fname, apr_int32_t extra_f } /* read rest of the 'a's and the first newline */ - rv = apr_fgets(buf, sizeof buf, f); + rv = apr_file_gets(buf, sizeof buf, f); assert(!rv); assert(strlen(buf) == TESTREAD_BLKSIZE - 800 + 1); for (i = 0; i < TESTREAD_BLKSIZE - 800; i++) { @@ -616,23 +616,23 @@ static void test_read_guts(apr_pool_t *p, const char *fname, apr_int32_t extra_f assert(buf[TESTREAD_BLKSIZE - 800] == '\n'); /* read the last newline */ - rv = apr_fgets(buf, sizeof buf, f); + rv = apr_file_gets(buf, sizeof buf, f); assert(!rv); assert(!strcmp(buf, "\n")); /* get APR_EOF */ - rv = apr_fgets(buf, sizeof buf, f); + rv = apr_file_gets(buf, sizeof buf, f); assert(rv == APR_EOF); - /* get APR_EOF with apr_getc + /* get APR_EOF with apr_file_getc */ - rv = apr_getc(buf, f); + rv = apr_file_getc(buf, f); assert(rv == APR_EOF); - /* get APR_EOF with apr_read + /* get APR_EOF with apr_file_read */ nbytes = sizeof buf; - rv = apr_read(f, buf, &nbytes); + rv = apr_file_read(f, buf, &nbytes); assert(rv == APR_EOF); - rv = apr_close(f); + rv = apr_file_close(f); assert(!rv); } @@ -645,27 +645,27 @@ static void test_bigread(apr_pool_t *p, const char *fname, apr_int32_t extra_fla /* Create a test file with known content. */ - rv = apr_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); + rv = apr_file_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); if (rv) { - fprintf(stderr, "apr_open()->%d/%s\n", + fprintf(stderr, "apr_file_open()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } nbytes = APR_BUFFERSIZE; memset(buf, 0xFE, nbytes); - rv = apr_write(f, buf, &nbytes); + rv = apr_file_write(f, buf, &nbytes); assert(!rv && nbytes == APR_BUFFERSIZE); - rv = apr_close(f); + rv = apr_file_close(f); assert(!rv); f = NULL; - rv = apr_open(&f, fname, APR_READ | extra_flags, 0, p); + rv = apr_file_open(&f, fname, APR_READ | extra_flags, 0, p); assert(!rv); nbytes = sizeof buf; - rv = apr_read(f, buf, &nbytes); + rv = apr_file_read(f, buf, &nbytes); assert(!rv); assert(nbytes == APR_BUFFERSIZE); - rv = apr_close(f); + rv = apr_file_close(f); assert(!rv); } @@ -689,7 +689,7 @@ static void test_read(apr_pool_t *p) fprintf(stdout, "\tMore unbuffered file tests......"); test_bigread(p, fname, 0); fprintf(stdout, "OK\n"); - rv = apr_remove_file(fname, p); + rv = apr_file_remove(fname, p); assert(!rv); fprintf(stdout, "\tAll read tests...........OK\n"); } diff --git a/test/testflock.c b/test/testflock.c index 52a8b36df..5ada22ee2 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -89,7 +89,7 @@ static apr_pool_t *pool = NULL; static void errmsg(const char *msg) { if (pool != NULL) - apr_destroy_pool(pool); + apr_pool_destroy(pool); fprintf(stderr, msg); exit(1); } @@ -99,12 +99,12 @@ static void do_read(void) apr_file_t *file; apr_status_t status; - if (apr_open(&file, TESTFILE, APR_WRITE, + if (apr_file_open(&file, TESTFILE, APR_WRITE, APR_OS_DEFAULT, pool) != APR_SUCCESS) errmsg("Could not open test file.\n"); printf("Test file opened.\n"); - status = apr_lock_file(file, APR_FLOCK_EXCLUSIVE | APR_FLOCK_NONBLOCK); + status = apr_file_lock(file, APR_FLOCK_EXCLUSIVE | APR_FLOCK_NONBLOCK); if (!APR_STATUS_IS_EAGAIN(status)) { char msg[200]; errmsg(apr_psprintf(pool, "Expected EAGAIN. Got %d: %s.\n", @@ -113,11 +113,11 @@ static void do_read(void) printf("First attempt: we were properly locked out.\nWaiting for lock..."); fflush(stdout); - if (apr_lock_file(file, APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) + if (apr_file_lock(file, APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) errmsg("Could not establish lock on test file."); printf(" got it.\n"); - (void) apr_close(file); + (void) apr_file_close(file); printf("Exiting.\n"); } @@ -125,19 +125,19 @@ static void do_write(void) { apr_file_t *file; - if (apr_open(&file, TESTFILE, APR_WRITE|APR_CREATE, APR_OS_DEFAULT, + if (apr_file_open(&file, TESTFILE, APR_WRITE|APR_CREATE, APR_OS_DEFAULT, pool) != APR_SUCCESS) errmsg("Could not create file.\n"); printf("Test file created.\n"); - if (apr_lock_file(file, APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) + if (apr_file_lock(file, APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) errmsg("Could not lock the file.\n"); printf("Lock created.\nSleeping..."); fflush(stdout); apr_sleep(30000000); /* 30 seconds */ - (void) apr_close(file); + (void) apr_file_close(file); printf(" done.\nExiting.\n"); } @@ -158,10 +158,10 @@ int main(int argc, const char * const *argv) errmsg("Could not initialize APR.\n"); atexit(closeapr); - if (apr_create_pool(&pool, NULL) != APR_SUCCESS) + if (apr_pool_create(&pool, NULL) != APR_SUCCESS) errmsg("Could not create global pool.\n"); - if (apr_initopt(&opt, pool, argc, argv) != APR_SUCCESS) + if (apr_getopt_init(&opt, pool, argc, argv) != APR_SUCCESS) errmsg("Could not parse options.\n"); while ((status = apr_getopt(opt, "r", &optchar, &optarg)) == APR_SUCCESS) { diff --git a/test/testmd5.c b/test/testmd5.c index cf187e4c6..7dc02adf5 100644 --- a/test/testmd5.c +++ b/test/testmd5.c @@ -91,22 +91,22 @@ static void try(const void *buf, size_t bufLen, apr_xlate_t *xlate, apr_md5_ctx_t context; unsigned char hash[MD5_DIGESTSIZE]; - rv = apr_MD5Init(&context); + rv = apr_md5_init(&context); assert(!rv); if (xlate) { #if APR_HAS_XLATE - apr_MD5SetXlate(&context, xlate); + apr_md5_set_xlate(&context, xlate); #else fprintf(stderr, "A translation handle was unexpected.\n"); #endif } - rv = apr_MD5Update(&context, buf, bufLen); + rv = apr_md5_update(&context, buf, bufLen); assert(!rv); - rv = apr_MD5Final(hash, &context); + rv = apr_md5_final(hash, &context); assert(!rv); for (i = 0; i < MD5_DIGESTSIZE; i++) { @@ -154,7 +154,7 @@ int main(int argc, char **argv) assert(!rv); atexit(apr_terminate); - rv = apr_create_pool(&pool, NULL); + rv = apr_pool_create(&pool, NULL); if (src) { #if APR_HAS_XLATE diff --git a/test/testmmap.c b/test/testmmap.c index f89c3cd22..d074a6992 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -97,7 +97,7 @@ int main(void) atexit(closeapr); fprintf(stdout,"Creating context...................."); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Failed.\n"); exit(-1); } @@ -108,7 +108,7 @@ int main(void) strncat(file1,"/testmmap.c",11); fprintf(stdout, "Opening file........................"); - rv = apr_open(&thefile, file1, flag, APR_UREAD | APR_GREAD, context); + rv = apr_file_open(&thefile, file1, flag, APR_UREAD | APR_GREAD, context); if (rv != APR_SUCCESS) { fprintf(stderr, "couldn't open file `%s': %d/%s\n", @@ -120,7 +120,7 @@ int main(void) } fprintf(stderr, "Getting file size..................."); - rv = apr_getfileinfo(&finfo, APR_FINFO_NORM, thefile); + rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); if (rv != APR_SUCCESS) { fprintf(stderr, "Didn't get file information: %d/%s\n", diff --git a/test/testoc.c b/test/testoc.c index bb641e330..813694df1 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) exit(-1); } atexit(apr_terminate); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } @@ -114,18 +114,18 @@ int main(int argc, char *argv[]) fprintf(stdout, "[PARENT] Creating procattr............."); fflush(stdout); - if (apr_createprocattr_init(&procattr, context) != APR_SUCCESS) { + if (apr_procattr_create(&procattr, context) != APR_SUCCESS) { fprintf(stderr, "Could not create attr\n"); exit(-1);; } else { - apr_setprocattr_io(procattr, APR_FULL_BLOCK, APR_NO_PIPE, APR_NO_PIPE); + apr_procattr_io_set(procattr, APR_FULL_BLOCK, APR_NO_PIPE, APR_NO_PIPE); } fprintf(stdout, "OK\n"); fprintf(stdout, "[PARENT] Starting other child.........."); fflush(stdout); - if (apr_create_process(&newproc, "./occhild", args, NULL, procattr, context) + if (apr_proc_create(&newproc, "./occhild", args, NULL, procattr, context) != APR_SUCCESS) { fprintf(stderr, "error starting other child\n"); exit(-1); @@ -134,12 +134,12 @@ int main(int argc, char *argv[]) std = newproc.in; - apr_register_other_child(&newproc, ocmaint, NULL, std, context); + apr_proc_other_child_register(&newproc, ocmaint, NULL, std, context); fprintf(stdout, "[PARENT] Sending SIGKILL to child......"); fflush(stdout); apr_sleep(1 * APR_USEC_PER_SEC); - if (apr_kill(&newproc, SIGKILL) != APR_SUCCESS) { + if (apr_proc_kill(&newproc, SIGKILL) != APR_SUCCESS) { fprintf(stderr,"couldn't send the signal!\n"); exit(-1); } @@ -147,10 +147,10 @@ int main(int argc, char *argv[]) /* allow time for things to settle... */ apr_sleep(3 * APR_USEC_PER_SEC); - apr_probe_writable_fds(); + apr_proc_probe_writable_fds(); fprintf(stdout, "[PARENT] Checking on children..........\n"); - apr_check_other_child(); + apr_proc_other_child_check(); #else fprintf(stdout, "OC failed!\n"); fprintf(stdout, "Other_child is not supported on this platform\n"); diff --git a/test/testpipe.c b/test/testpipe.c index c3657a10c..4a6a8cfc1 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -82,7 +82,7 @@ int main(void) exit(-1); } atexit(closeapr); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } @@ -90,8 +90,8 @@ int main(void) fprintf(stdout, "Testing pipe functions.\n"); fprintf(stdout, "\tCreating pipes......."); - if ((rv = apr_create_pipe(&readp, &writep, context)) != APR_SUCCESS) { - fprintf(stderr, "apr_create_pipe()->%d/%s\n", + if ((rv = apr_file_pipe_create(&readp, &writep, context)) != APR_SUCCESS) { + fprintf(stderr, "apr_file_pipe_create()->%d/%s\n", rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); exit(-1); } @@ -100,8 +100,8 @@ int main(void) } fprintf(stdout, "\tSetting pipe timeout......."); - if ((rv = apr_set_pipe_timeout(readp, 1 * APR_USEC_PER_SEC)) != APR_SUCCESS) { - fprintf(stderr, "apr_set_pipe_timeout()->%d/%s\n", + if ((rv = apr_file_pipe_timeout_set(readp, 1 * APR_USEC_PER_SEC)) != APR_SUCCESS) { + fprintf(stderr, "apr_file_pipe_timeout_set()->%d/%s\n", rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); exit(-1); } else { @@ -111,7 +111,7 @@ int main(void) fprintf(stdout, "\tReading from the pipe......."); nbytes = strlen("this is a test"); buf = (char *)apr_palloc(context, nbytes + 1); - if (apr_read(readp, buf, &nbytes) == APR_TIMEUP) { + if (apr_file_read(readp, buf, &nbytes) == APR_TIMEUP) { fprintf(stdout, "OK\n"); } else { diff --git a/test/testproc.c b/test/testproc.c index 5b66edd82..f4e9e771b 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) exit(-1); } atexit(closeapr); - apr_create_pool(&context, NULL); + apr_pool_create(&context, NULL); if (argc > 1) { @@ -102,21 +102,21 @@ int main(int argc, char *argv[]) teststr = apr_pstrdup(context, "Whooo Hoooo\0"); fprintf(stdout, "Creating directory for later use......."); - if (apr_make_dir("proctest", APR_UREAD | APR_UWRITE | APR_UEXECUTE, context) != APR_SUCCESS) { + if (apr_dir_make("proctest", APR_UREAD | APR_UWRITE | APR_UEXECUTE, context) != APR_SUCCESS) { fprintf(stderr, "Could not create dir\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "Creating procattr......."); - if (apr_createprocattr_init(&attr, context) != APR_SUCCESS) { + if (apr_procattr_create(&attr, context) != APR_SUCCESS) { fprintf(stderr, "Could not create attr\n"); exit(-1);; } fprintf(stdout, "OK.\n"); fprintf(stdout, "Setting attr pipes, all three......."); - if (apr_setprocattr_io(attr, APR_FULL_BLOCK, + if (apr_procattr_io_set(attr, APR_FULL_BLOCK, APR_CHILD_BLOCK, APR_NO_PIPE) != APR_SUCCESS) { fprintf(stderr, "Could not set pipes attr\n"); exit(-1); @@ -124,14 +124,14 @@ int main(int argc, char *argv[]) fprintf(stdout, "OK.\n"); fprintf(stdout, "Setting attr dir......."); - if (apr_setprocattr_dir(attr, "proctest") != APR_SUCCESS) { + if (apr_procattr_dir_set(attr, "proctest") != APR_SUCCESS) { fprintf(stderr, "Could not set directory attr\n"); exit(-1); } fprintf(stdout, "OK.\n"); fprintf(stdout, "Setting attr cmd type......."); - if (apr_setprocattr_cmdtype(attr, APR_PROGRAM) != APR_SUCCESS) { + if (apr_procattr_cmdtype_set(attr, APR_PROGRAM) != APR_SUCCESS) { fprintf(stderr, "Could not set cmd type attr\n"); exit(-1); } @@ -142,7 +142,7 @@ int main(int argc, char *argv[]) args[2] = NULL; fprintf(stdout, "Creating a new process......."); - if (apr_create_process(&newproc, "../testproc", args, NULL, attr, context) != APR_SUCCESS) { + if (apr_proc_create(&newproc, "../testproc", args, NULL, attr, context) != APR_SUCCESS) { fprintf(stderr, "Could not create the new process\n"); exit(-1); } @@ -154,7 +154,7 @@ int main(int argc, char *argv[]) length = 256; fprintf(stdout, "Writing the data to child......."); - if (apr_write(testfile, teststr, &length) == APR_SUCCESS) { + if (apr_file_write(testfile, teststr, &length) == APR_SUCCESS) { fprintf(stdout,"OK\n"); } else fprintf(stderr, "Write failed.\n"); @@ -166,7 +166,7 @@ int main(int argc, char *argv[]) length = 256; fprintf(stdout, "Checking the data read from pipe to child......."); buf = apr_pcalloc(context, length); - if (apr_read(testfile, buf, &length) == APR_SUCCESS) { + if (apr_file_read(testfile, buf, &length) == APR_SUCCESS) { if (!strcmp(buf, teststr)) fprintf(stdout,"OK\n"); else fprintf(stderr, "Uh-Oh\n"); @@ -174,14 +174,14 @@ int main(int argc, char *argv[]) else fprintf(stderr, "Read failed.\n"); fprintf(stdout, "Waiting for child to die......."); - if (apr_wait_proc(&newproc, APR_WAIT) != APR_CHILD_DONE) { + if (apr_proc_wait(&newproc, APR_WAIT) != APR_CHILD_DONE) { fprintf(stderr, "Wait for child failed\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "Removing directory......."); - if (apr_remove_dir("proctest", context) != APR_SUCCESS) { + if (apr_dir_remove("proctest", context) != APR_SUCCESS) { fprintf(stderr, "Could not remove directory.\n"); exit(-1); } diff --git a/test/testshmem.c b/test/testshmem.c index f88062ad9..8e9bb37be 100644 --- a/test/testshmem.c +++ b/test/testshmem.c @@ -102,7 +102,7 @@ int main(void) apr_initialize(); fprintf(stdout, "Initializing the context......."); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "could not initialize\n"); exit(-1); } @@ -128,7 +128,7 @@ int main(void) pid = fork(); if (pid == 0) { apr_sleep(1); - if (apr_open_shmem(shm) == APR_SUCCESS) { + if (apr_shm_open(shm) == APR_SUCCESS) { msgwait(1); msgput(0, "Msg received\n"); } else { diff --git a/test/testsock.c b/test/testsock.c index d672185e1..c9af113b0 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -74,8 +74,8 @@ static int run_basic_test(apr_pool_t *context) const char *args[2]; fprintf(stdout, "Creating children to run network tests.......\n"); - s1 = apr_createprocattr_init(&attr1, context); - s2 = apr_createprocattr_init(&attr2, context); + s1 = apr_procattr_create(&attr1, context); + s2 = apr_procattr_create(&attr2, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { fprintf(stderr, "Problem creating proc attrs\n"); @@ -84,30 +84,30 @@ static int run_basic_test(apr_pool_t *context) args[0] = apr_pstrdup(context, "server"); args[1] = NULL; - s1 = apr_create_process(&proc1, "./server", args, NULL, attr1, context); + s1 = apr_proc_create(&proc1, "./server", args, NULL, attr1, context); /* Sleep for 5 seconds to ensure the server is setup before we begin */ apr_sleep(5000000); args[0] = apr_pstrdup(context, "client"); - s2 = apr_create_process(&proc2, "./client", args, NULL, attr2, context); + s2 = apr_proc_create(&proc2, "./client", args, NULL, attr2, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { fprintf(stderr, "Problem spawning new process\n"); exit(-1); } - while ((s1 = apr_wait_proc(&proc1, APR_NOWAIT)) == APR_CHILD_NOTDONE && - (s2 = apr_wait_proc(&proc2, APR_NOWAIT)) == APR_CHILD_NOTDONE) { + while ((s1 = apr_proc_wait(&proc1, APR_NOWAIT)) == APR_CHILD_NOTDONE && + (s2 = apr_proc_wait(&proc2, APR_NOWAIT)) == APR_CHILD_NOTDONE) { continue; } if (s1 == APR_SUCCESS) { - apr_kill(&proc2, SIGTERM); - while (apr_wait_proc(&proc2, APR_WAIT) == APR_CHILD_NOTDONE); + apr_proc_kill(&proc2, SIGTERM); + while (apr_proc_wait(&proc2, APR_WAIT) == APR_CHILD_NOTDONE); } else { - apr_kill(&proc1, SIGTERM); - while (apr_wait_proc(&proc1, APR_WAIT) == APR_CHILD_NOTDONE); + apr_proc_kill(&proc1, SIGTERM); + while (apr_proc_wait(&proc1, APR_WAIT) == APR_CHILD_NOTDONE); } fprintf(stdout, "Network test completed.\n"); @@ -125,8 +125,8 @@ static int run_sendfile(apr_pool_t *context, int number) const char *args[3]; fprintf(stdout, "Creating children to run network tests.......\n"); - s1 = apr_createprocattr_init(&attr1, context); - s2 = apr_createprocattr_init(&attr2, context); + s1 = apr_procattr_create(&attr1, context); + s2 = apr_procattr_create(&attr2, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { fprintf(stderr, "Problem creating proc attrs\n"); @@ -136,7 +136,7 @@ static int run_sendfile(apr_pool_t *context, int number) args[0] = apr_pstrdup(context, "sendfile"); args[1] = apr_pstrdup(context, "server"); args[2] = NULL; - s1 = apr_create_process(&proc1, "./sendfile", args, NULL, attr1, context); + s1 = apr_proc_create(&proc1, "./sendfile", args, NULL, attr1, context); /* Sleep for 5 seconds to ensure the server is setup before we begin */ apr_sleep(5000000); @@ -155,25 +155,25 @@ static int run_sendfile(apr_pool_t *context, int number) break; } } - s2 = apr_create_process(&proc2, "./sendfile", args, NULL, attr2, context); + s2 = apr_proc_create(&proc2, "./sendfile", args, NULL, attr2, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { fprintf(stderr, "Problem spawning new process\n"); exit(-1); } - while ((s1 = apr_wait_proc(&proc1, APR_NOWAIT)) == APR_CHILD_NOTDONE && - (s2 = apr_wait_proc(&proc2, APR_NOWAIT)) == APR_CHILD_NOTDONE) { + while ((s1 = apr_proc_wait(&proc1, APR_NOWAIT)) == APR_CHILD_NOTDONE && + (s2 = apr_proc_wait(&proc2, APR_NOWAIT)) == APR_CHILD_NOTDONE) { continue; } if (s1 == APR_SUCCESS) { - apr_kill(&proc2, SIGTERM); - while (apr_wait_proc(&proc2, APR_WAIT) == APR_CHILD_NOTDONE); + apr_proc_kill(&proc2, SIGTERM); + while (apr_proc_wait(&proc2, APR_WAIT) == APR_CHILD_NOTDONE); } else { - apr_kill(&proc1, SIGTERM); - while (apr_wait_proc(&proc1, APR_WAIT) == APR_CHILD_NOTDONE); + apr_proc_kill(&proc1, SIGTERM); + while (apr_proc_wait(&proc1, APR_WAIT) == APR_CHILD_NOTDONE); } fprintf(stdout, "Network test completed.\n"); @@ -198,7 +198,7 @@ int main(int argc, char *argv[]) atexit(closeapr); fprintf(stdout, "Creating context......."); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Could not create context\n"); exit(-1); } diff --git a/test/testsockopt.c b/test/testsockopt.c index 6c9403d68..3759f5e3f 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -66,14 +66,14 @@ static void failure(apr_socket_t *sock) { - apr_close_socket(sock); + apr_socket_close(sock); printf("Failed!\n"); exit(-1); } static void failureno(apr_socket_t *sock) { - apr_close_socket(sock); + apr_socket_close(sock); printf("No!\n"); exit(-1); } @@ -96,11 +96,11 @@ int main(void) exit(-1); } atexit(closeapr); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } - if (apr_create_pool(&cont2, context) != APR_SUCCESS) { + if (apr_pool_create(&cont2, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } @@ -108,7 +108,7 @@ int main(void) printf("Testing socket option functions.\n"); printf("\tCreating socket.........................."); - if ((stat = apr_create_socket(&sock, APR_INET, SOCK_STREAM, context)) + if ((stat = apr_socket_create(&sock, APR_INET, SOCK_STREAM, context)) != APR_SUCCESS){ printf("Failed to create a socket!\n"); exit(-1); @@ -117,7 +117,7 @@ int main(void) printf ("\tTrying to set APR_SO_KEEPALIVE..........."); if (apr_setsocketopt(sock, APR_SO_KEEPALIVE, 1) != APR_SUCCESS){ - apr_close_socket(sock); + apr_socket_close(sock); printf("Failed!\n"); exit (-1); } @@ -125,12 +125,12 @@ int main(void) printf("\tChecking if we recorded it..............."); if (apr_getsocketopt(sock, APR_SO_KEEPALIVE, &ck) != APR_SUCCESS){ - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr,"Failed\n"); exit(-1); } if (ck != 1){ - apr_close_socket(sock); + apr_socket_close(sock); printf("No (%d)\n", ck); exit(-1); } @@ -138,7 +138,7 @@ int main(void) printf("\tTrying to set APR_SO_DEBUG..............."); if (apr_setsocketopt(sock, APR_SO_DEBUG, 1) != APR_SUCCESS){ - apr_close_socket(sock); + apr_socket_close(sock); printf("Failed\n"); exit (-1); } @@ -146,20 +146,20 @@ int main(void) printf("\tChecking if we recorded it..............."); if (apr_getsocketopt(sock, APR_SO_DEBUG, &ck) != APR_SUCCESS){ - apr_close_socket(sock); + apr_socket_close(sock); printf("Failed!\n"); exit (-1); } if (ck != 1){ printf ("No (%d)\n", ck); - apr_close_socket(sock); + apr_socket_close(sock); exit (-1); } printf ("Yes\n"); printf ("\tTrying to remove APR_SO_KEEPALIVE........"); if (apr_setsocketopt(sock, APR_SO_KEEPALIVE, 0) != APR_SUCCESS){ - apr_close_socket(sock); + apr_socket_close(sock); printf("Failed!\n"); exit (-1); } @@ -167,7 +167,7 @@ int main(void) printf ("\tDid we record the removal................"); if (apr_getsocketopt(sock, APR_SO_KEEPALIVE, &ck) != APR_SUCCESS){ - apr_close_socket(sock); + apr_socket_close(sock); printf("Didn't get value!\n"); exit(-1); } @@ -215,7 +215,7 @@ int main(void) #endif printf("\tTrying to close the socket..............."); - if ((stat = apr_close_socket(sock)) != APR_SUCCESS){ + if ((stat = apr_socket_close(sock)) != APR_SUCCESS){ printf("Failed to close the socket!\n"); exit(-1); } diff --git a/test/testthread.c b/test/testthread.c index 3e572433d..3ed5bcd21 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -77,9 +77,9 @@ void * APR_THREAD_FUNC thread_func1(void *data) { int i; for (i = 0; i < 10000; i++) { - apr_lock(thread_lock); + apr_lock_aquire(thread_lock); x++; - apr_unlock(thread_lock); + apr_lock_release(thread_lock); } return NULL; } @@ -88,9 +88,9 @@ void * APR_THREAD_FUNC thread_func2(void *data) { int i; for (i = 0; i < 10000; i++) { - apr_lock(thread_lock); + apr_lock_aquire(thread_lock); x++; - apr_unlock(thread_lock); + apr_lock_release(thread_lock); } return NULL; } @@ -99,9 +99,9 @@ void * APR_THREAD_FUNC thread_func3(void *data) { int i; for (i = 0; i < 10000; i++) { - apr_lock(thread_lock); + apr_lock_aquire(thread_lock); x++; - apr_unlock(thread_lock); + apr_lock_release(thread_lock); } return NULL; } @@ -110,9 +110,9 @@ void * APR_THREAD_FUNC thread_func4(void *data) { int i; for (i = 0; i < 10000; i++) { - apr_lock(thread_lock); + apr_lock_aquire(thread_lock); x++; - apr_unlock(thread_lock); + apr_lock_release(thread_lock); } return NULL; } @@ -132,14 +132,14 @@ int main(void) apr_initialize(); fprintf(stdout, "Initializing the context......."); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "could not initialize\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "Initializing the lock......."); - s1 = apr_create_lock(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, "lock.file", context); + s1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, "lock.file", context); if (s1 != APR_SUCCESS) { fprintf(stderr, "Could not create lock\n"); exit(-1); @@ -147,10 +147,10 @@ int main(void) fprintf(stdout, "OK\n"); fprintf(stdout, "Starting all the threads......."); - s1 = apr_create_thread(&t1, NULL, thread_func1, NULL, context); - s2 = apr_create_thread(&t2, NULL, thread_func2, NULL, context); - s3 = apr_create_thread(&t3, NULL, thread_func3, NULL, context); - s4 = apr_create_thread(&t4, NULL, thread_func4, NULL, context); + s1 = apr_thread_create(&t1, NULL, thread_func1, NULL, context); + s2 = apr_thread_create(&t2, NULL, thread_func2, NULL, context); + s3 = apr_thread_create(&t3, NULL, thread_func3, NULL, context); + s4 = apr_thread_create(&t4, NULL, thread_func4, NULL, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || s3 != APR_SUCCESS || s4 != APR_SUCCESS) { fprintf(stderr, "Error starting thread\n"); diff --git a/test/testtime.c b/test/testtime.c index a246ac3b5..20f315cf1 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -69,8 +69,8 @@ int main(void) fprintf(stdout, "Testing Time functions.\n"); - fprintf(stdout, "\tapr_now......."); - now = apr_now(); + fprintf(stdout, "\tapr_time_now......."); + now = apr_time_now(); fprintf(stdout, "OK\n"); fprintf(stdout, "\tapr_explode_localtime......."); diff --git a/test/testuuid.c b/test/testuuid.c index 6330f6c41..1d4c7e9d4 100644 --- a/test/testuuid.c +++ b/test/testuuid.c @@ -64,11 +64,11 @@ int main(int argc, char **argv) char buf[APR_UUID_FORMATTED_LENGTH + 1]; int retcode = 0; - apr_get_uuid(&uuid); - apr_format_uuid(buf, &uuid); + apr_uuid_get(&uuid); + apr_uuid_format(buf, &uuid); printf("UUID: %s\n", buf); - apr_parse_uuid(&uuid2, buf); + apr_uuid_parse(&uuid2, buf); if (memcmp(&uuid, &uuid2, sizeof(uuid)) == 0) printf("Parse appears to work.\n"); else { @@ -76,15 +76,15 @@ int main(int argc, char **argv) retcode = 1; } - apr_format_uuid(buf, &uuid2); + apr_uuid_format(buf, &uuid2); printf("parsed/reformatted UUID: %s\n", buf); /* generate two of them quickly */ - apr_get_uuid(&uuid); - apr_get_uuid(&uuid2); - apr_format_uuid(buf, &uuid); + apr_uuid_get(&uuid); + apr_uuid_get(&uuid2); + apr_uuid_format(buf, &uuid); printf("UUID 1: %s\n", buf); - apr_format_uuid(buf, &uuid2); + apr_uuid_format(buf, &uuid2); printf("UUID 2: %s\n", buf); return retcode; diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index b15f0eb81..1b33ca06d 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -61,7 +61,7 @@ struct send_pipe { int err; }; -apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) +apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) { (*new) = (apr_procattr_t *)apr_palloc(cont, sizeof(apr_procattr_t)); @@ -82,12 +82,12 @@ apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, +apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) { apr_status_t status; if (in != 0) { - if ((status = apr_create_pipe(&attr->child_in, &attr->parent_in, + if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -95,18 +95,18 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_set_pipe_timeout(attr->child_in, 0); + apr_file_pipe_timeout_set(attr->child_in, 0); break; case APR_CHILD_BLOCK: - apr_set_pipe_timeout(attr->parent_in, 0); + apr_file_pipe_timeout_set(attr->parent_in, 0); break; default: - apr_set_pipe_timeout(attr->child_in, 0); - apr_set_pipe_timeout(attr->parent_in, 0); + apr_file_pipe_timeout_set(attr->child_in, 0); + apr_file_pipe_timeout_set(attr->parent_in, 0); } } if (out) { - if ((status = apr_create_pipe(&attr->parent_out, &attr->child_out, + if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -114,18 +114,18 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_set_pipe_timeout(attr->child_out, 0); + apr_file_pipe_timeout_set(attr->child_out, 0); break; case APR_CHILD_BLOCK: - apr_set_pipe_timeout(attr->parent_out, 0); + apr_file_pipe_timeout_set(attr->parent_out, 0); break; default: - apr_set_pipe_timeout(attr->child_out, 0); - apr_set_pipe_timeout(attr->parent_out, 0); + apr_file_pipe_timeout_set(attr->child_out, 0); + apr_file_pipe_timeout_set(attr->parent_out, 0); } } if (err) { - if ((status = apr_create_pipe(&attr->parent_err, &attr->child_err, + if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -133,20 +133,20 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_set_pipe_timeout(attr->child_err, 0); + apr_file_pipe_timeout_set(attr->child_err, 0); break; case APR_CHILD_BLOCK: - apr_set_pipe_timeout(attr->parent_err, 0); + apr_file_pipe_timeout_set(attr->parent_err, 0); break; default: - apr_set_pipe_timeout(attr->child_err, 0); - apr_set_pipe_timeout(attr->parent_err, 0); + apr_file_pipe_timeout_set(attr->child_err, 0); + apr_file_pipe_timeout_set(attr->parent_err, 0); } } return APR_SUCCESS; } -apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, +apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) { char * cwd; @@ -166,20 +166,20 @@ apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, return APR_ENOMEM; } -apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, +apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach) +apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) +apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) { int pid; @@ -201,7 +201,7 @@ apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) } -apr_status_t apr_create_process(apr_proc_t *new, const char *progname, +apr_status_t apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, const char * const *env, apr_procattr_t *attr, apr_pool_t *cont) @@ -259,13 +259,13 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, resume_thread(newproc); if (attr->child_in) { - apr_close(attr->child_in); + apr_file_close(attr->child_in); } if (attr->child_out) { - apr_close(attr->child_out); + apr_file_close(attr->child_out); } if (attr->child_err) { - apr_close(attr->child_err); + apr_file_close(attr->child_err); } send_data(newproc, 0, (void*)sp, sizeof(struct send_pipe)); @@ -279,7 +279,7 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, return APR_SUCCESS; } -apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, +apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p) { int waitpid_options = WUNTRACED; @@ -297,7 +297,7 @@ apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, return errno; } -apr_status_t apr_wait_proc(apr_proc_t *proc, +apr_status_t apr_proc_wait(apr_proc_t *proc, apr_wait_how_e wait) { status_t exitval, rv; @@ -321,52 +321,52 @@ apr_status_t apr_wait_proc(apr_proc_t *proc, return APR_CHILD_NOTDONE; } -apr_status_t apr_setprocattr_childin(apr_procattr_t *attr, apr_file_t *child_in, +apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - apr_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); + apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt); if (child_in != NULL) - apr_dupfile(&attr->child_in, child_in, attr->cntxt); + apr_file_dup(&attr->child_in, child_in, attr->cntxt); if (parent_in != NULL) - apr_dupfile(&attr->parent_in, parent_in, attr->cntxt); + apr_file_dup(&attr->parent_in, parent_in, attr->cntxt); return APR_SUCCESS; } -apr_status_t apr_setprocattr_childout(apr_procattr_t *attr, apr_file_t *child_out, +apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - apr_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); + apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); if (child_out != NULL) - apr_dupfile(&attr->child_out, child_out, attr->cntxt); + apr_file_dup(&attr->child_out, child_out, attr->cntxt); if (parent_out != NULL) - apr_dupfile(&attr->parent_out, parent_out, attr->cntxt); + apr_file_dup(&attr->parent_out, parent_out, attr->cntxt); return APR_SUCCESS; } -apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, apr_file_t *child_err, +apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - apr_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); if (child_err != NULL) - apr_dupfile(&attr->child_err, child_err, attr->cntxt); + apr_file_dup(&attr->child_err, child_err, attr->cntxt); if (parent_err != NULL) - apr_dupfile(&attr->parent_err, parent_err, attr->cntxt); + apr_file_dup(&attr->parent_err, parent_err, attr->cntxt); return APR_SUCCESS; } -apr_status_t apr_setprocattr_limit(apr_procattr_t *attr, apr_int32_t what, +apr_status_t apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, void *limit) { return APR_ENOTIMPL; diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index d141d835e..58880ac81 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -54,7 +54,7 @@ #include "threadproc.h" -apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) +apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) { (*new) = (apr_threadattr_t *)apr_palloc(cont, sizeof(apr_threadattr_t)); @@ -69,7 +69,7 @@ apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) +apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) { if (on == 1){ attr->detached = 1; @@ -79,7 +79,7 @@ apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) return APR_SUCCESS; } -apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) +apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr) { if (attr->detached == 1){ return APR_DETACH; @@ -87,7 +87,7 @@ apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) return APR_NOTDETACH; } -apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, +apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont) { @@ -107,7 +107,7 @@ apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, else temp = B_NORMAL_PRIORITY; - stat = apr_create_pool(&(*new)->cntxt, cont); + stat = apr_pool_create(&(*new)->cntxt, cont); if (stat != APR_SUCCESS) { return stat; } @@ -124,7 +124,7 @@ apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { - apr_destroy_pool(thd->cntxt); + apr_pool_destroy(thd->cntxt); exit_thread ((status_t)retval); return APR_SUCCESS; } @@ -149,25 +149,25 @@ apr_status_t apr_thread_detach(apr_thread_t *thd) } } -apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread) +apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { - return apr_get_userdata(data, key, thread->cntxt); + return apr_pool_userdata_get(data, key, thread->cntxt); } -apr_status_t apr_set_threaddata(void *data, const char *key, +apr_status_t apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread) { - return apr_set_userdata(data, key, cleanup, thread->cntxt); + return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); } -apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd) +apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) { *thethd = &thd->td; return APR_SUCCESS; } -apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, +apr_status_t apr_os_thread_pupt(apr_thread_t **thd, apr_os_thread_t *thethd, apr_pool_t *cont) { if (cont == NULL) { diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c index 037ce46a1..f6d34f222 100644 --- a/threadproc/beos/threadpriv.c +++ b/threadproc/beos/threadpriv.c @@ -58,7 +58,7 @@ static struct beos_key key_table[BEOS_MAX_DATAKEYS]; static struct beos_private_data *beos_data[BEOS_MAX_DATAKEYS]; static sem_id lock; -apr_status_t apr_create_thread_private(apr_threadkey_t **key, +apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) { (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); @@ -82,7 +82,7 @@ apr_status_t apr_create_thread_private(apr_threadkey_t **key, return APR_ENOMEM; } -apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) +apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) { thread_id tid; int i, index=0; @@ -114,7 +114,7 @@ apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) return APR_SUCCESS; } -apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) +apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) { thread_id tid; int i,index = 0, ret; @@ -169,7 +169,7 @@ apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) return APR_ENOMEM; } -apr_status_t apr_delete_thread_private(apr_threadkey_t *key) +apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) { if (key->key < BEOS_MAX_DATAKEYS){ acquire_sem(key_table[key->key].lock); @@ -184,26 +184,26 @@ apr_status_t apr_delete_thread_private(apr_threadkey_t *key) return APR_SUCCESS; } -apr_status_t apr_get_threadkeydata(void **data, const char *key, +apr_status_t apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) { - return apr_get_userdata(data, key, threadkey->cntxt); + return apr_pool_userdata_get(data, key, threadkey->cntxt); } -apr_status_t apr_set_threadkeydata(void *data, const char *key, +apr_status_t apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey) { - return apr_set_userdata(data, key, cleanup, threadkey->cntxt); + return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); } -apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key) +apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, +apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, apr_os_threadkey_t *thekey, apr_pool_t *cont) { if (cont == NULL) { diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 9231c6686..4c0f2b66b 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -71,7 +71,7 @@ #include <process.h> #include <stdlib.h> -apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) +apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) { (*new) = (apr_procattr_t *)apr_palloc(cont, sizeof(apr_procattr_t)); @@ -92,12 +92,12 @@ apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, +apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) { apr_status_t stat; if (in) { - if ((stat = apr_create_pipe(&attr->child_in, &attr->parent_in, + if ((stat = apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt)) != APR_SUCCESS) { return stat; } @@ -105,18 +105,18 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_set_pipe_timeout(attr->child_in, 0); + apr_file_pipe_timeout_set(attr->child_in, 0); break; case APR_CHILD_BLOCK: - apr_set_pipe_timeout(attr->parent_in, 0); + apr_file_pipe_timeout_set(attr->parent_in, 0); break; default: - apr_set_pipe_timeout(attr->child_in, 0); - apr_set_pipe_timeout(attr->parent_in, 0); + apr_file_pipe_timeout_set(attr->child_in, 0); + apr_file_pipe_timeout_set(attr->parent_in, 0); } } if (out) { - if ((stat = apr_create_pipe(&attr->parent_out, &attr->child_out, + if ((stat = apr_file_pipe_create(&attr->parent_out, &attr->child_out, attr->cntxt)) != APR_SUCCESS) { return stat; } @@ -124,18 +124,18 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_set_pipe_timeout(attr->child_out, 0); + apr_file_pipe_timeout_set(attr->child_out, 0); break; case APR_CHILD_BLOCK: - apr_set_pipe_timeout(attr->parent_out, 0); + apr_file_pipe_timeout_set(attr->parent_out, 0); break; default: - apr_set_pipe_timeout(attr->child_out, 0); - apr_set_pipe_timeout(attr->parent_out, 0); + apr_file_pipe_timeout_set(attr->child_out, 0); + apr_file_pipe_timeout_set(attr->parent_out, 0); } } if (err) { - if ((stat = apr_create_pipe(&attr->parent_err, &attr->child_err, + if ((stat = apr_file_pipe_create(&attr->parent_err, &attr->child_err, attr->cntxt)) != APR_SUCCESS) { return stat; } @@ -143,68 +143,68 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_set_pipe_timeout(attr->child_err, 0); + apr_file_pipe_timeout_set(attr->child_err, 0); break; case APR_CHILD_BLOCK: - apr_set_pipe_timeout(attr->parent_err, 0); + apr_file_pipe_timeout_set(attr->parent_err, 0); break; default: - apr_set_pipe_timeout(attr->child_err, 0); - apr_set_pipe_timeout(attr->parent_err, 0); + apr_file_pipe_timeout_set(attr->child_err, 0); + apr_file_pipe_timeout_set(attr->parent_err, 0); } } return APR_SUCCESS; } -apr_status_t apr_setprocattr_childin(apr_procattr_t *attr, apr_file_t *child_in, +apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - apr_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); + apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt); if (child_in != NULL) - apr_dupfile(&attr->child_in, child_in, attr->cntxt); + apr_file_dup(&attr->child_in, child_in, attr->cntxt); if (parent_in != NULL) - apr_dupfile(&attr->parent_in, parent_in, attr->cntxt); + apr_file_dup(&attr->parent_in, parent_in, attr->cntxt); return APR_SUCCESS; } -apr_status_t apr_setprocattr_childout(apr_procattr_t *attr, apr_file_t *child_out, +apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - apr_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); + apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); if (child_out != NULL) - apr_dupfile(&attr->child_out, child_out, attr->cntxt); + apr_file_dup(&attr->child_out, child_out, attr->cntxt); if (parent_out != NULL) - apr_dupfile(&attr->parent_out, parent_out, attr->cntxt); + apr_file_dup(&attr->parent_out, parent_out, attr->cntxt); return APR_SUCCESS; } -apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, apr_file_t *child_err, +apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - apr_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); if (child_err != NULL) - apr_dupfile(&attr->child_err, child_err, attr->cntxt); + apr_file_dup(&attr->child_err, child_err, attr->cntxt); if (parent_err != NULL) - apr_dupfile(&attr->parent_err, parent_err, attr->cntxt); + apr_file_dup(&attr->parent_err, parent_err, attr->cntxt); return APR_SUCCESS; } -apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir) +apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) { attr->currdir = apr_pstrdup(attr->cntxt, dir); if (attr->currdir) { @@ -213,20 +213,20 @@ apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir) return APR_ENOMEM; } -apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, +apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach) +apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) +apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) { int pid; @@ -277,7 +277,7 @@ static char *double_quotes(apr_pool_t *cntxt, const char *str) -apr_status_t apr_create_process(apr_proc_t *proc, const char *progname, +apr_status_t apr_proc_create(apr_proc_t *proc, const char *progname, const char * const *args, const char * const *env, apr_procattr_t *attr, apr_pool_t *cont) @@ -348,14 +348,14 @@ apr_status_t apr_create_process(apr_proc_t *proc, const char *progname, strcpy(interpreter, "#!" SHELL_PATH); extra_arg = "/C"; } else if (stricmp(extension, ".exe") != 0) { - status = apr_open(&progfile, progname, APR_READ|APR_BUFFERED, 0, cont); + status = apr_file_open(&progfile, progname, APR_READ|APR_BUFFERED, 0, cont); if (status != APR_SUCCESS && APR_STATUS_IS_ENOENT(status)) { progname = apr_pstrcat(cont, progname, ".exe", NULL); } if (status == APR_SUCCESS) { - status = apr_fgets(interpreter, sizeof(interpreter), progfile); + status = apr_file_gets(interpreter, sizeof(interpreter), progfile); if (status == APR_SUCCESS) { if (interpreter[0] == '#' && interpreter[1] == '!') { @@ -376,7 +376,7 @@ apr_status_t apr_create_process(apr_proc_t *proc, const char *progname, } } } - apr_close(progfile); + apr_file_close(progfile); } i = 0; @@ -461,21 +461,21 @@ apr_status_t apr_create_process(apr_proc_t *proc, const char *progname, } if (attr->child_in) { - apr_close(attr->child_in); + apr_file_close(attr->child_in); dup = STDIN_FILENO; DosDupHandle(save_in, &dup); DosClose(save_in); } if (attr->child_out) { - apr_close(attr->child_out); + apr_file_close(attr->child_out); dup = STDOUT_FILENO; DosDupHandle(save_out, &dup); DosClose(save_out); } if (attr->child_err) { - apr_close(attr->child_err); + apr_file_close(attr->child_err); dup = STDERR_FILENO; DosDupHandle(save_err, &dup); DosClose(save_err); @@ -492,7 +492,7 @@ apr_status_t apr_create_process(apr_proc_t *proc, const char *progname, -apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, +apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p) { RESULTCODES codes; @@ -520,7 +520,7 @@ apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, -apr_status_t apr_wait_proc(apr_proc_t *proc, +apr_status_t apr_proc_wait(apr_proc_t *proc, apr_wait_how_e wait) { RESULTCODES codes; diff --git a/threadproc/os2/signals.c b/threadproc/os2/signals.c index 56170f401..e15697d5a 100644 --- a/threadproc/os2/signals.c +++ b/threadproc/os2/signals.c @@ -62,7 +62,7 @@ #include <string.h> #include <sys/wait.h> -apr_status_t apr_kill(apr_proc_t *proc, int signal) +apr_status_t apr_proc_kill(apr_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 a99eb5968..b0682e58a 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -61,7 +61,7 @@ #include "fileio.h" #include <stdlib.h> -apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) +apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) { (*new) = (apr_threadattr_t *)apr_palloc(cont, sizeof(apr_threadattr_t)); @@ -76,7 +76,7 @@ apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) -apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) +apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) { attr->attr |= APR_THREADATTR_DETACHED; return APR_SUCCESS; @@ -84,7 +84,7 @@ apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) -apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) +apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr) { return (attr->attr & APR_THREADATTR_DETACHED) ? APR_DETACH : APR_NOTDETACH; } @@ -99,7 +99,7 @@ static void apr_thread_begin(void *arg) -apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, +apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont) { @@ -117,14 +117,14 @@ apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, thread->attr = attr; thread->func = func; thread->data = data; - stat = apr_create_pool(&thread->cntxt, cont); + stat = apr_pool_create(&thread->cntxt, cont); if (stat != APR_SUCCESS) { return stat; } if (attr == NULL) { - stat = apr_create_threadattr(&thread->attr, thread->cntxt); + stat = apr_threadattr_create(&thread->attr, thread->cntxt); if (stat != APR_SUCCESS) { return stat; diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c index 15143e512..24291b8f4 100644 --- a/threadproc/os2/threadpriv.c +++ b/threadproc/os2/threadpriv.c @@ -59,7 +59,7 @@ #include "apr_lib.h" #include "fileio.h" -apr_status_t apr_create_thread_private(apr_threadkey_t **key, +apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) { (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); @@ -72,19 +72,19 @@ apr_status_t apr_create_thread_private(apr_threadkey_t **key, return APR_OS2_STATUS(DosAllocThreadLocalMemory(1, &((*key)->key))); } -apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) +apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) { (*new) = (void *)*(key->key); return APR_SUCCESS; } -apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) +apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) { *(key->key) = (ULONG)priv; return APR_SUCCESS; } -apr_status_t apr_delete_thread_private(apr_threadkey_t *key) +apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) { return APR_OS2_STATUS(DosFreeThreadLocalMemory(key->key)); } diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 6f91f21e4..58b49493a 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -56,7 +56,7 @@ #include "apr_strings.h" #include "apr_portable.h" -apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) +apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) { (*new) = (apr_procattr_t *)apr_pcalloc(cont, sizeof(apr_procattr_t)); @@ -68,12 +68,12 @@ apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, +apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) { apr_status_t status; if (in != 0) { - if ((status = apr_create_pipe(&attr->child_in, &attr->parent_in, + if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -81,18 +81,18 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_set_pipe_timeout(attr->child_in, 0); + apr_file_pipe_timeout_set(attr->child_in, 0); break; case APR_CHILD_BLOCK: - apr_set_pipe_timeout(attr->parent_in, 0); + apr_file_pipe_timeout_set(attr->parent_in, 0); break; default: - apr_set_pipe_timeout(attr->child_in, 0); - apr_set_pipe_timeout(attr->parent_in, 0); + apr_file_pipe_timeout_set(attr->child_in, 0); + apr_file_pipe_timeout_set(attr->parent_in, 0); } } if (out) { - if ((status = apr_create_pipe(&attr->parent_out, &attr->child_out, + if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -100,18 +100,18 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_set_pipe_timeout(attr->child_out, 0); + apr_file_pipe_timeout_set(attr->child_out, 0); break; case APR_CHILD_BLOCK: - apr_set_pipe_timeout(attr->parent_out, 0); + apr_file_pipe_timeout_set(attr->parent_out, 0); break; default: - apr_set_pipe_timeout(attr->child_out, 0); - apr_set_pipe_timeout(attr->parent_out, 0); + apr_file_pipe_timeout_set(attr->child_out, 0); + apr_file_pipe_timeout_set(attr->parent_out, 0); } } if (err) { - if ((status = apr_create_pipe(&attr->parent_err, &attr->child_err, + if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -119,69 +119,69 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_set_pipe_timeout(attr->child_err, 0); + apr_file_pipe_timeout_set(attr->child_err, 0); break; case APR_CHILD_BLOCK: - apr_set_pipe_timeout(attr->parent_err, 0); + apr_file_pipe_timeout_set(attr->parent_err, 0); break; default: - apr_set_pipe_timeout(attr->child_err, 0); - apr_set_pipe_timeout(attr->parent_err, 0); + apr_file_pipe_timeout_set(attr->child_err, 0); + apr_file_pipe_timeout_set(attr->parent_err, 0); } } return APR_SUCCESS; } -apr_status_t apr_setprocattr_childin(apr_procattr_t *attr, apr_file_t *child_in, +apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - apr_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); + apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt); if (child_in != NULL) - apr_dupfile(&attr->child_in, child_in, attr->cntxt); + apr_file_dup(&attr->child_in, child_in, attr->cntxt); if (parent_in != NULL) - apr_dupfile(&attr->parent_in, parent_in, attr->cntxt); + apr_file_dup(&attr->parent_in, parent_in, attr->cntxt); return APR_SUCCESS; } -apr_status_t apr_setprocattr_childout(apr_procattr_t *attr, apr_file_t *child_out, +apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - apr_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); + apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); if (child_out != NULL) - apr_dupfile(&attr->child_out, child_out, attr->cntxt); + apr_file_dup(&attr->child_out, child_out, attr->cntxt); if (parent_out != NULL) - apr_dupfile(&attr->parent_out, parent_out, attr->cntxt); + apr_file_dup(&attr->parent_out, parent_out, attr->cntxt); return APR_SUCCESS; } -apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, apr_file_t *child_err, +apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - apr_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); if (child_err != NULL) - apr_dupfile(&attr->child_err, child_err, attr->cntxt); + apr_file_dup(&attr->child_err, child_err, attr->cntxt); if (parent_err != NULL) - apr_dupfile(&attr->parent_err, parent_err, attr->cntxt); + apr_file_dup(&attr->parent_err, parent_err, attr->cntxt); return APR_SUCCESS; } -apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, +apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) { attr->currdir = apr_pstrdup(attr->cntxt, dir); @@ -191,20 +191,20 @@ apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, return APR_ENOMEM; } -apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, +apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach) +apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) +apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) { int pid; @@ -270,7 +270,7 @@ static apr_status_t limit_proc(apr_procattr_t *attr) return APR_SUCCESS; } -apr_status_t apr_create_process(apr_proc_t *new, const char *progname, +apr_status_t apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, const char * const *env, apr_procattr_t *attr, apr_pool_t *cont) @@ -288,19 +288,19 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, int status; /* child process */ if (attr->child_in) { - apr_close(attr->parent_in); + apr_file_close(attr->parent_in); dup2(attr->child_in->filedes, STDIN_FILENO); - apr_close(attr->child_in); + apr_file_close(attr->child_in); } if (attr->child_out) { - apr_close(attr->parent_out); + apr_file_close(attr->parent_out); dup2(attr->child_out->filedes, STDOUT_FILENO); - apr_close(attr->child_out); + apr_file_close(attr->child_out); } if (attr->child_err) { - apr_close(attr->parent_err); + apr_file_close(attr->parent_err); dup2(attr->child_err->filedes, STDERR_FILENO); - apr_close(attr->child_err); + apr_file_close(attr->child_err); } apr_signal(SIGCHLD, SIG_DFL); /*not sure if this is needed or not */ @@ -311,7 +311,7 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, } } - apr_cleanup_for_exec(); + apr_pool_cleanup_for_exec(); if ((status = limit_proc(attr)) != APR_SUCCESS) { return status; @@ -333,13 +333,13 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, } newargs[i + 2] = NULL; if (attr->detached) { - apr_detach(); + apr_proc_detach(); } execve(SHELL_PATH, (char * const *) newargs, (char * const *)env); } else { if (attr->detached) { - apr_detach(); + apr_proc_detach(); } execve(progname, (char * const *)args, (char * const *)env); } @@ -348,18 +348,18 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, } /* Parent process */ if (attr->child_in) { - apr_close(attr->child_in); + apr_file_close(attr->child_in); } if (attr->child_out) { - apr_close(attr->child_out); + apr_file_close(attr->child_out); } if (attr->child_err) { - apr_close(attr->child_err); + apr_file_close(attr->child_err); } return APR_SUCCESS; } -apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, +apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p) { int waitpid_options = WUNTRACED; @@ -377,7 +377,7 @@ apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, return errno; } -apr_status_t apr_wait_proc(apr_proc_t *proc, +apr_status_t apr_proc_wait(apr_proc_t *proc, apr_wait_how_e waithow) { pid_t status; @@ -401,7 +401,7 @@ apr_status_t apr_wait_proc(apr_proc_t *proc, return errno; } -apr_status_t apr_setprocattr_limit(apr_procattr_t *attr, apr_int32_t what, +apr_status_t apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, struct rlimit *limit) { switch(what) { diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index e29954cda..dd2fffb1e 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -54,7 +54,7 @@ #include "threadproc.h" -apr_status_t apr_detach(void) +apr_status_t apr_proc_detach(void) { int x; pid_t pgrp; diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index cd561fa82..c402fb446 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -59,7 +59,7 @@ #include <signal.h> #endif -apr_status_t apr_kill(apr_proc_t *proc, int sig) +apr_status_t apr_proc_kill(apr_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 c083fb89e..457bccdad 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -59,7 +59,7 @@ #if APR_HAS_THREADS #if APR_HAVE_PTHREAD_H -apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) +apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) { apr_status_t stat; @@ -82,7 +82,7 @@ apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) return stat; } -apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) +apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) { apr_status_t stat; #ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR @@ -102,7 +102,7 @@ apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) } } -apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) +apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr) { int state; @@ -116,7 +116,7 @@ apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) return APR_NOTDETACH; } -apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, +apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont) { @@ -142,7 +142,7 @@ apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, else temp = NULL; - stat = apr_create_pool(&(*new)->cntxt, cont); + stat = apr_pool_create(&(*new)->cntxt, cont); if (stat != APR_SUCCESS) { return stat; } @@ -160,7 +160,7 @@ apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { - apr_destroy_pool(thd->cntxt); + apr_pool_destroy(thd->cntxt); pthread_exit(retval); return APR_SUCCESS; } @@ -199,25 +199,25 @@ apr_status_t apr_thread_detach(apr_thread_t *thd) } } -apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread) +apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { - return apr_get_userdata(data, key, thread->cntxt); + return apr_pool_userdata_get(data, key, thread->cntxt); } -apr_status_t apr_set_threaddata(void *data, const char *key, +apr_status_t apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread) { - return apr_set_userdata(data, key, cleanup, thread->cntxt); + return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); } -apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd) +apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) { *thethd = thd->td; return APR_SUCCESS; } -apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, +apr_status_t apr_os_thread_pupt(apr_thread_t **thd, apr_os_thread_t *thethd, apr_pool_t *cont) { if (cont == NULL) { @@ -235,77 +235,77 @@ apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, #if !APR_HAS_THREADS -apr_status_t apr_create_thread(apr_thread_t **new_thread, apr_threadattr_t *attr, +apr_status_t apr_thread_create(apr_thread_t **new_thread, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont) { return APR_ENOTIMPL; } -apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) +apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) { return APR_ENOTIMPL; } -apr_status_t apr_create_thread_private(apr_threadkey_t **key, void (*dest)(void *), +apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) { return APR_ENOTIMPL; } -apr_status_t apr_delete_thread_private(apr_threadkey_t *key) +apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) { return APR_ENOTIMPL; } -apr_status_t apr_get_os_thread(void); /* avoid warning for no prototype */ +apr_status_t apr_os_thread_get(void); /* avoid warning for no prototype */ -apr_status_t apr_get_os_thread(void) +apr_status_t apr_os_thread_get(void) { return APR_ENOTIMPL; } -apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) +apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr) { return APR_ENOTIMPL; } -apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread) +apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { return APR_ENOTIMPL; } -apr_status_t apr_get_threadkeydata(void **data, const char *key, +apr_status_t apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) { return APR_ENOTIMPL; } -apr_status_t apr_get_thread_private(void **new_mem, apr_threadkey_t *key) +apr_status_t apr_threadkey_private_get(void **new_mem, apr_threadkey_t *key) { return APR_ENOTIMPL; } -apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) +apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) { return APR_ENOTIMPL; } -apr_status_t apr_set_threaddata(void *data, const char *key, +apr_status_t apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup)(void *), apr_thread_t *thread) { return APR_ENOTIMPL; } -apr_status_t apr_set_threadkeydata(void *data, const char *key, +apr_status_t apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey) { return APR_ENOTIMPL; } -apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) +apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) { return APR_ENOTIMPL; } diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 9843f2e91..0780335f8 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -59,7 +59,7 @@ #if APR_HAS_THREADS #if APR_HAVE_PTHREAD_H -apr_status_t apr_create_thread_private(apr_threadkey_t **key, +apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) { apr_status_t stat; @@ -77,7 +77,7 @@ apr_status_t apr_create_thread_private(apr_threadkey_t **key, return stat; } -apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) +apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) { #ifdef PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS if (pthread_getspecific(key->key,new)) @@ -88,7 +88,7 @@ apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) return APR_SUCCESS; } -apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) +apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) { apr_status_t stat; if ((stat = pthread_setspecific(key->key, priv)) == 0) { @@ -100,7 +100,7 @@ apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) } #ifdef HAVE_PTHREAD_KEY_DELETE -apr_status_t apr_delete_thread_private(apr_threadkey_t *key) +apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) { apr_status_t stat; if ((stat = pthread_key_delete(key->key)) == 0) { @@ -110,26 +110,26 @@ apr_status_t apr_delete_thread_private(apr_threadkey_t *key) } #endif -apr_status_t apr_get_threadkeydata(void **data, const char *key, +apr_status_t apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) { - return apr_get_userdata(data, key, threadkey->cntxt); + return apr_pool_userdata_get(data, key, threadkey->cntxt); } -apr_status_t apr_set_threadkeydata(void *data, const char *key, +apr_status_t apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey) { - return apr_set_userdata(data, key, cleanup, threadkey->cntxt); + return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); } -apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key) +apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, +apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, apr_os_threadkey_t *thekey, apr_pool_t *cont) { if (cont == NULL) { @@ -146,9 +146,9 @@ apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, #endif /* APR_HAS_THREADS */ #if !APR_HAS_THREADS -apr_status_t apr_get_os_threadkey(void); /* avoid warning for no prototype */ +apr_status_t apr_os_threadkey_get(void); /* avoid warning for no prototype */ -apr_status_t apr_get_os_threadkey(void) +apr_status_t apr_os_threadkey_get(void) { return APR_ENOTIMPL; } diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index c0fe0c8f0..9d2e3a422 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -71,7 +71,7 @@ * */ -APR_DECLARE(apr_status_t) apr_createprocattr_init(apr_procattr_t **new, +APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) { (*new) = (apr_procattr_t *)apr_palloc(cont, sizeof(apr_procattr_t)); @@ -152,7 +152,7 @@ static apr_status_t make_inheritable_duplicate(apr_file_t *original, if (original == NULL) return APR_SUCCESS; - /* Can't use apr_dupfile here because it creates a non-inhertible + /* Can't use apr_file_dup here because it creates a non-inhertible * handle, and apr_open_file'd apr_file_t's are non-inheritable, * so we must assume we need to make an inheritable handle. */ @@ -170,7 +170,7 @@ static apr_status_t make_inheritable_duplicate(apr_file_t *original, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_setprocattr_io(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) @@ -204,7 +204,7 @@ APR_DECLARE(apr_status_t) apr_setprocattr_io(apr_procattr_t *attr, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_setprocattr_childin(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) { @@ -227,7 +227,7 @@ APR_DECLARE(apr_status_t) apr_setprocattr_childin(apr_procattr_t *attr, return stat; } -APR_DECLARE(apr_status_t) apr_setprocattr_childout(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) { @@ -250,7 +250,7 @@ APR_DECLARE(apr_status_t) apr_setprocattr_childout(apr_procattr_t *attr, return stat; } -APR_DECLARE(apr_status_t) apr_setprocattr_childerr(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) { @@ -273,7 +273,7 @@ APR_DECLARE(apr_status_t) apr_setprocattr_childerr(apr_procattr_t *attr, return stat; } -APR_DECLARE(apr_status_t) apr_setprocattr_dir(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) { char path[MAX_PATH]; @@ -297,14 +297,14 @@ APR_DECLARE(apr_status_t) apr_setprocattr_dir(apr_procattr_t *attr, return APR_ENOMEM; } -APR_DECLARE(apr_status_t) apr_setprocattr_cmdtype(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_setprocattr_detach(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t det) { attr->detached = det; @@ -312,11 +312,11 @@ APR_DECLARE(apr_status_t) apr_setprocattr_detach(apr_procattr_t *attr, } /* TODO: - * apr_create_process with APR_SHELLCMD on Win9x won't work due to MS KB: + * apr_proc_create with APR_SHELLCMD on Win9x won't work due to MS KB: * Q150956 */ -APR_DECLARE(apr_status_t) apr_create_process(apr_proc_t *new, +APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, const char * const *env, @@ -440,13 +440,13 @@ APR_DECLARE(apr_status_t) apr_create_process(apr_proc_t *new, new->pid = (pid_t) pi.hProcess; if (attr->child_in) { - apr_close(attr->child_in); + apr_file_close(attr->child_in); } if (attr->child_out) { - apr_close(attr->child_out); + apr_file_close(attr->child_out); } if (attr->child_err) { - apr_close(attr->child_err); + apr_file_close(attr->child_err); } CloseHandle(pi.hThread); @@ -456,7 +456,7 @@ APR_DECLARE(apr_status_t) apr_create_process(apr_proc_t *new, return apr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_wait_proc(apr_proc_t *proc, apr_wait_how_e wait) +APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, apr_wait_how_e wait) { DWORD stat; if (!proc) diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index 056de8904..dc59c8690 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. */ -APR_DECLARE(apr_status_t) apr_kill(apr_proc_t *proc, int signal) +APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signal) { if (TerminateProcess((HANDLE)proc->pid, signal) == 0) { return apr_get_os_error(); diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 231d2e366..b243d8359 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -61,7 +61,7 @@ #include <process.h> -APR_DECLARE(apr_status_t) apr_create_threadattr(apr_threadattr_t **new, +APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) { (*new) = (apr_threadattr_t *)apr_palloc(cont, @@ -75,21 +75,21 @@ APR_DECLARE(apr_status_t) apr_create_threadattr(apr_threadattr_t **new, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_setthreadattr_detach(apr_threadattr_t *attr, +APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) { attr->detach = on; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_getthreadattr_detach(apr_threadattr_t *attr) +APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr) { if (attr->detach == 1) return APR_DETACH; return APR_NOTDETACH; } -APR_DECLARE(apr_status_t) apr_create_thread(apr_thread_t **new, +APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont) @@ -106,7 +106,7 @@ APR_DECLARE(apr_status_t) apr_create_thread(apr_thread_t **new, (*new)->cntxt = cont; - stat = apr_create_pool(&(*new)->cntxt, cont); + stat = apr_pool_create(&(*new)->cntxt, cont); if (stat != APR_SUCCESS) { return stat; } @@ -133,7 +133,7 @@ APR_DECLARE(apr_status_t) apr_create_thread(apr_thread_t **new, APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { - apr_destroy_pool(thd->cntxt); + apr_pool_destroy(thd->cntxt); _endthreadex(*retval); return APR_SUCCESS; } @@ -164,20 +164,20 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) } } -APR_DECLARE(apr_status_t) apr_get_threaddata(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { - return apr_get_userdata(data, key, thread->cntxt); + return apr_pool_userdata_get(data, key, thread->cntxt); } -APR_DECLARE(apr_status_t) apr_set_threaddata(void *data, const char *key, +APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread) { - return apr_set_userdata(data, key, cleanup, thread->cntxt); + return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); } -APR_DECLARE(apr_status_t) apr_get_os_thread(apr_os_thread_t **thethd, +APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) { if (thd == NULL) { @@ -187,7 +187,7 @@ APR_DECLARE(apr_status_t) apr_get_os_thread(apr_os_thread_t **thethd, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_put_os_thread(apr_thread_t **thd, +APR_DECLARE(apr_status_t) apr_os_thread_pupt(apr_thread_t **thd, apr_os_thread_t *thethd, apr_pool_t *cont) { diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index 701282356..da0baf216 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -59,7 +59,7 @@ #include "apr_errno.h" #include "apr_portable.h" -APR_DECLARE(apr_status_t) apr_create_thread_private(apr_threadkey_t **key, +APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) { @@ -69,7 +69,7 @@ APR_DECLARE(apr_status_t) apr_create_thread_private(apr_threadkey_t **key, return apr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_get_thread_private(void **new, +APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, apr_threadkey_t *key) { if ((*new) = TlsGetValue(key->key)) { @@ -78,7 +78,7 @@ APR_DECLARE(apr_status_t) apr_get_thread_private(void **new, return apr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_set_thread_private(void *priv, +APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t *key) { if (TlsSetValue(key->key, priv)) { @@ -87,7 +87,7 @@ APR_DECLARE(apr_status_t) apr_set_thread_private(void *priv, return apr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_delete_thread_private(apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) { if (TlsFree(key->key)) { return APR_SUCCESS; @@ -95,27 +95,27 @@ APR_DECLARE(apr_status_t) apr_delete_thread_private(apr_threadkey_t *key) return apr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_get_threadkeydata(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) { - return apr_get_userdata(data, key, threadkey->cntxt); + return apr_pool_userdata_get(data, key, threadkey->cntxt); } -APR_DECLARE(apr_status_t) apr_set_threadkeydata(void *data, const char *key, +APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup)(void *), apr_threadkey_t *threadkey) { - return apr_set_userdata(data, key, cleanup, threadkey->cntxt); + return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); } -APR_DECLARE(apr_status_t) apr_get_os_threadkey(apr_os_threadkey_t *thekey, +APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_put_os_threadkey(apr_threadkey_t **key, +APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, apr_os_threadkey_t *thekey, apr_pool_t *cont) { diff --git a/time/unix/time.c b/time/unix/time.c index 7eb421970..db468b099 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -79,7 +79,7 @@ apr_status_t apr_ansi_time_to_apr_time(apr_time_t *result, time_t input) } -apr_time_t apr_now(void) +apr_time_t apr_time_now(void) { struct timeval tv; gettimeofday(&tv, NULL); @@ -211,14 +211,14 @@ apr_status_t apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt) return APR_SUCCESS; } -apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime) +apr_status_t apr_os_imp_time_get(apr_os_imp_time_t **ostime, apr_time_t *aprtime) { (*ostime)->tv_usec = *aprtime % APR_USEC_PER_SEC; (*ostime)->tv_sec = *aprtime / APR_USEC_PER_SEC; return APR_SUCCESS; } -apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, +apr_status_t apr_os_exp_time_get(apr_os_exp_time_t **ostime, apr_exploded_time_t *aprtime) { (*ostime)->tm_sec = aprtime->tm_sec; @@ -233,14 +233,14 @@ apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, return APR_SUCCESS; } -apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime, +apr_status_t apr_os_imp_time_put(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont) { *aprtime = (*ostime)->tv_sec * APR_USEC_PER_SEC + (*ostime)->tv_usec; return APR_SUCCESS; } -apr_status_t apr_put_os_exp_time(apr_exploded_time_t *aprtime, +apr_status_t apr_os_exp_time_pupt(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont) { aprtime->tm_sec = (*ostime)->tm_sec; diff --git a/time/win32/time.c b/time/win32/time.c index 6d46f69f6..b106d2dc4 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -145,7 +145,7 @@ APR_DECLARE(apr_status_t) apr_ansi_time_to_apr_time(apr_time_t *result, } /* Return micro-seconds since the Unix epoch (jan. 1, 1970) UTC */ -APR_DECLARE(apr_time_t) apr_now(void) +APR_DECLARE(apr_time_t) apr_time_now(void) { LONGLONG aprtime = 0; FILETIME time; @@ -213,7 +213,7 @@ APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *t, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_os_imp_time(apr_os_imp_time_t **ostime, +APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime, apr_time_t *aprtime) { /* TODO: Consider not passing in pointer to apr_time_t (e.g., call by value) */ @@ -221,7 +221,7 @@ APR_DECLARE(apr_status_t) apr_get_os_imp_time(apr_os_imp_time_t **ostime, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_os_exp_time(apr_os_exp_time_t **ostime, +APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, apr_exploded_time_t *aprexptime) { (*ostime)->wYear = aprexptime->tm_year + 1900; @@ -235,7 +235,7 @@ APR_DECLARE(apr_status_t) apr_get_os_exp_time(apr_os_exp_time_t **ostime, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_put_os_imp_time(apr_time_t *aprtime, +APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont) { @@ -243,7 +243,7 @@ APR_DECLARE(apr_status_t) apr_put_os_imp_time(apr_time_t *aprtime, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_put_os_exp_time(apr_exploded_time_t *aprtime, +APR_DECLARE(apr_status_t) apr_os_exp_time_pupt(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont) { |