diff options
author | striker <striker@13f79535-47bb-0310-9956-ffa450edef68> | 2002-03-20 08:54:43 +0000 |
---|---|---|
committer | striker <striker@13f79535-47bb-0310-9956-ffa450edef68> | 2002-03-20 08:54:43 +0000 |
commit | 511d718a6fde86299b6d662cb9a1db790ebbda83 (patch) | |
tree | 450c58cbf1f95ac51346a4af9529b5d1dceafb65 /file_io | |
parent | 92997be1ac1dda04a9d67d4e7e9efd96fbfbedbb (diff) | |
download | libapr-511d718a6fde86299b6d662cb9a1db790ebbda83.tar.gz |
Rename the "cntxt" members of the fileio structures to "pool".
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63164 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io')
-rw-r--r-- | file_io/netware/filestat.c | 18 | ||||
-rw-r--r-- | file_io/netware/pipe.c | 20 | ||||
-rw-r--r-- | file_io/os2/dir.c | 24 | ||||
-rw-r--r-- | file_io/os2/filedup.c | 6 | ||||
-rw-r--r-- | file_io/os2/open.c | 40 | ||||
-rw-r--r-- | file_io/os2/pipe.c | 20 | ||||
-rw-r--r-- | file_io/unix/dir.c | 28 | ||||
-rw-r--r-- | file_io/unix/fileacc.c | 4 | ||||
-rw-r--r-- | file_io/unix/filedup.c | 4 | ||||
-rw-r--r-- | file_io/unix/filestat.c | 14 | ||||
-rw-r--r-- | file_io/unix/mktemp.c | 2 | ||||
-rw-r--r-- | file_io/unix/open.c | 42 | ||||
-rw-r--r-- | file_io/unix/pipe.c | 16 | ||||
-rw-r--r-- | file_io/win32/dir.c | 26 | ||||
-rw-r--r-- | file_io/win32/filedup.c | 6 | ||||
-rw-r--r-- | file_io/win32/filestat.c | 28 | ||||
-rw-r--r-- | file_io/win32/open.c | 42 | ||||
-rw-r--r-- | file_io/win32/pipe.c | 16 | ||||
-rw-r--r-- | file_io/win32/readwrite.c | 4 |
19 files changed, 180 insertions, 180 deletions
diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index ce1864523..6a54ae2f5 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -119,7 +119,7 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, struct stat info; if (fstat(thefile->filedes, &info) == 0) { - finfo->cntxt = thefile->cntxt; + finfo->pool = thefile->pool; finfo->fname = thefile->fname; fill_out_finfo(finfo, &info, wanted); return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; @@ -142,12 +142,12 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attributes, apr_fileattrs_t attr_mask, - apr_pool_t *cont) + apr_pool_t *pool) { apr_status_t status; apr_finfo_t finfo; - status = apr_stat(&finfo, fname, APR_FINFO_PROT, cont); + status = apr_stat(&finfo, fname, APR_FINFO_PROT, pool); if (!APR_STATUS_IS_SUCCESS(status)) return status; @@ -288,7 +288,7 @@ int cstat (const char *path, struct stat *buf) APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) + apr_int32_t wanted, apr_pool_t *pool) { struct stat info; int srv; @@ -297,15 +297,15 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, srv = cstat(fname, &info); if (srv == 0) { - finfo->cntxt = cont; + finfo->pool = pool; finfo->fname = fname; fill_out_finfo(finfo, &info, wanted); if (wanted & APR_FINFO_LINK) wanted &= ~APR_FINFO_LINK; if (wanted & APR_FINFO_NAME) { - s = strrchr(case_filename(cont, fname), '/'); + s = strrchr(case_filename(pool, fname), '/'); if (s) { - finfo->name = apr_pstrdup(cont, &s[1]); + finfo->name = apr_pstrdup(pool, &s[1]); finfo->valid |= APR_FINFO_NAME; } } @@ -349,8 +349,8 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, /* Perhaps this becomes nothing but a macro? */ APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) + apr_int32_t wanted, apr_pool_t *pool) { - return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, cont); + return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, pool); } diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index 7b86c7d87..46ae051d9 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -144,7 +144,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_int return APR_EINVAL; } -APR_DECLARE(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_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) { char tname[L_tmpnam+1]; int filedes[2]; @@ -156,17 +156,17 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out if ((filedes[0] = pipe_open(tname, O_RDONLY) != -1) && (filedes[1] = pipe_open(tname, O_WRONLY) != -1)) { - (*in) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); - (*out) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); + (*in) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + (*out) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); - (*in)->cntxt = - (*out)->cntxt = cont; + (*in)->pool = + (*out)->pool = pool; (*in)->filedes = filedes[0]; (*out)->filedes = filedes[1]; (*in)->pipe = (*out)->pipe = 1; - (*out)->fname = apr_pstrdup(cont, tname); - (*in)->fname = apr_pstrdup(cont, tname);; + (*out)->fname = apr_pstrdup(pool, tname); + (*in)->fname = apr_pstrdup(pool, tname);; (*in)->buffered = (*out)->buffered = 0; (*in)->blocking = @@ -184,16 +184,16 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return errno; } - apr_pool_cleanup_register((*in)->cntxt, (void *)(*in), apr_netware_pipe_cleanup, + apr_pool_cleanup_register((*in)->pool, (void *)(*in), apr_netware_pipe_cleanup, apr_pool_cleanup_null); - apr_pool_cleanup_register((*out)->cntxt, (void *)(*out), apr_netware_pipe_cleanup, + apr_pool_cleanup_register((*out)->pool, (void *)(*out), apr_netware_pipe_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, - apr_fileperms_t perm, apr_pool_t *cont) + apr_fileperms_t perm, apr_pool_t *pool) { return APR_ENOTIMPL; } diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index fbc6f56ae..7c1bfe748 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -67,15 +67,15 @@ static apr_status_t dir_cleanup(void *thedir) -APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cntxt) +APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *pool) { - apr_dir_t *thedir = (apr_dir_t *)apr_palloc(cntxt, sizeof(apr_dir_t)); + apr_dir_t *thedir = (apr_dir_t *)apr_palloc(pool, sizeof(apr_dir_t)); if (thedir == NULL) return APR_ENOMEM; - thedir->cntxt = cntxt; - thedir->dirname = apr_pstrdup(cntxt, dirname); + thedir->pool = pool; + thedir->dirname = apr_pstrdup(pool, dirname); if (thedir->dirname == NULL) return APR_ENOMEM; @@ -83,7 +83,7 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, apr thedir->handle = 0; thedir->validentry = FALSE; *new = thedir; - apr_pool_cleanup_register(cntxt, thedir, dir_cleanup, apr_pool_cleanup_null); + apr_pool_cleanup_register(pool, thedir, dir_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -114,14 +114,14 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, if (thedir->handle == 0) { thedir->handle = HDIR_CREATE; - rv = DosFindFirst(apr_pstrcat(thedir->cntxt, thedir->dirname, "/*", NULL), &thedir->handle, + rv = DosFindFirst(apr_pstrcat(thedir->pool, thedir->dirname, "/*", NULL), &thedir->handle, FILE_ARCHIVED|FILE_DIRECTORY|FILE_SYSTEM|FILE_HIDDEN|FILE_READONLY, &thedir->entry, sizeof(thedir->entry), &entries, FIL_STANDARD); } else { rv = DosFindNext(thedir->handle, &thedir->entry, sizeof(thedir->entry), &entries); } - finfo->cntxt = thedir->cntxt; + finfo->pool = thedir->pool; finfo->fname = NULL; finfo->valid = 0; @@ -168,14 +168,14 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir) -APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *pool) { return APR_OS2_STATUS(DosCreateDir(path, NULL)); } -APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool) { return APR_OS2_STATUS(DosDeleteDir(path)); } @@ -194,11 +194,11 @@ APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, 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) + apr_pool_t *pool) { if ((*dir) == NULL) { - (*dir) = (apr_dir_t *)apr_pcalloc(cont, sizeof(apr_dir_t)); - (*dir)->cntxt = cont; + (*dir) = (apr_dir_t *)apr_pcalloc(pool, sizeof(apr_dir_t)); + (*dir)->pool = pool; } (*dir)->handle = *thedir; return APR_SUCCESS; diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index ddce0d1cf..678f2dcc7 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -76,14 +76,14 @@ static apr_status_t file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_po dup_file = *new_file; } - dup_file->cntxt = p; + dup_file->pool = p; rv = DosDupHandle(old_file->filedes, &dup_file->filedes); if (rv) { return APR_OS2_STATUS(rv); } - dup_file->fname = apr_pstrdup(dup_file->cntxt, old_file->fname); + dup_file->fname = apr_pstrdup(dup_file->pool, old_file->fname); dup_file->buffered = old_file->buffered; dup_file->isopen = old_file->isopen; dup_file->flags = old_file->flags & ~APR_INHERIT; @@ -91,7 +91,7 @@ static apr_status_t file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_po dup_file->pipe = old_file->pipe; if (*new_file == NULL) { - apr_pool_cleanup_register(dup_file->cntxt, dup_file, apr_file_cleanup, + apr_pool_cleanup_register(dup_file->pool, dup_file, apr_file_cleanup, apr_pool_cleanup_null); *new_file = dup_file; } diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 45a28606f..cef62e53b 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -68,16 +68,16 @@ apr_status_t apr_file_cleanup(void *thefile) -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 *cntxt) +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 *pool) { int oflags = 0; int mflags = OPEN_FLAGS_FAIL_ON_ERROR|OPEN_SHARE_DENYNONE; int rv; ULONG action; - apr_file_t *dafile = (apr_file_t *)apr_palloc(cntxt, sizeof(apr_file_t)); + apr_file_t *dafile = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t)); *new = dafile; - dafile->cntxt = cntxt; + dafile->pool = pool; dafile->isopen = FALSE; dafile->eof_hit = FALSE; dafile->buffer = NULL; @@ -98,8 +98,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr dafile->buffered = (flag & APR_BUFFERED) > 0; if (dafile->buffered) { - dafile->buffer = apr_palloc(cntxt, APR_FILE_BUFSIZE); - rv = apr_thread_mutex_create(&dafile->mutex, 0, cntxt); + dafile->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); + rv = apr_thread_mutex_create(&dafile->mutex, 0, pool); if (rv) return rv; @@ -138,7 +138,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr return APR_OS2_STATUS(rv); dafile->isopen = TRUE; - dafile->fname = apr_pstrdup(cntxt, fname); + dafile->fname = apr_pstrdup(pool, fname); dafile->filePtr = 0; dafile->bufpos = 0; dafile->dataRead = 0; @@ -146,7 +146,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr dafile->pipe = FALSE; if (!(flag & APR_FILE_NOCLEANUP)) { - apr_pool_cleanup_register(dafile->cntxt, dafile, apr_file_cleanup, apr_file_cleanup); + apr_pool_cleanup_register(dafile->pool, dafile, apr_file_cleanup, apr_file_cleanup); } return APR_SUCCESS; } @@ -182,7 +182,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) -APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cntxt) +APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool) { ULONG rc = DosDelete(path); return APR_OS2_STATUS(rc); @@ -216,12 +216,12 @@ APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, apr_file_t *fi -APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_int32_t flags, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_int32_t flags, apr_pool_t *pool) { apr_os_file_t *dafile = thefile; - (*file) = apr_palloc(cont, sizeof(apr_file_t)); - (*file)->cntxt = cont; + (*file) = apr_palloc(pool, sizeof(apr_file_t)); + (*file)->pool = pool; (*file)->filedes = *dafile; (*file)->isopen = TRUE; (*file)->buffered = FALSE; @@ -241,33 +241,33 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) } -APR_DECLARE(apr_status_t) apr_file_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 *pool) { apr_os_file_t fd = 2; - return apr_os_file_put(thefile, &fd, 0, cont); + return apr_os_file_put(thefile, &fd, 0, pool); } -APR_DECLARE(apr_status_t) apr_file_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 *pool) { apr_os_file_t fd = 1; - return apr_os_file_put(thefile, &fd, 0, cont); + return apr_os_file_put(thefile, &fd, 0, pool); } -APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *pool) { apr_os_file_t fd = 0; - return apr_os_file_put(thefile, &fd, 0, cont); + return apr_os_file_put(thefile, &fd, 0, pool); } -APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); +APR_POOL_IMPLEMENT_ACCESSOR(file); -APR_IMPLEMENT_SET_INHERIT(file, flags, cntxt, apr_file_cleanup) +APR_IMPLEMENT_SET_INHERIT(file, flags, pool, apr_file_cleanup) -APR_IMPLEMENT_UNSET_INHERIT(file, flags, cntxt, apr_file_cleanup) +APR_IMPLEMENT_UNSET_INHERIT(file, flags, pool, apr_file_cleanup) diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 42025f5c7..33e14cf57 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -61,7 +61,7 @@ #include <string.h> #include <process.h> -APR_DECLARE(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_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) { ULONG filedes[2]; ULONG rc, action; @@ -91,7 +91,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return APR_OS2_STATUS(rc); } - (*in) = (apr_file_t *)apr_palloc(cont, sizeof(apr_file_t)); + (*in) = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t)); rc = DosCreateEventSem(NULL, &(*in)->pipeSem, DC_SEM_SHARED, FALSE); if (rc) { @@ -113,35 +113,35 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return APR_OS2_STATUS(rc); } - (*in)->cntxt = cont; + (*in)->pool = pool; (*in)->filedes = filedes[0]; - (*in)->fname = apr_pstrdup(cont, pipename); + (*in)->fname = apr_pstrdup(pool, pipename); (*in)->isopen = TRUE; (*in)->buffered = FALSE; (*in)->flags = 0; (*in)->pipe = 1; (*in)->timeout = -1; (*in)->blocking = BLK_ON; - apr_pool_cleanup_register(cont, *in, apr_file_cleanup, apr_pool_cleanup_null); + apr_pool_cleanup_register(pool, *in, apr_file_cleanup, apr_pool_cleanup_null); - (*out) = (apr_file_t *)apr_palloc(cont, sizeof(apr_file_t)); - (*out)->cntxt = cont; + (*out) = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t)); + (*out)->pool = pool; (*out)->filedes = filedes[1]; - (*out)->fname = apr_pstrdup(cont, pipename); + (*out)->fname = apr_pstrdup(pool, pipename); (*out)->isopen = TRUE; (*out)->buffered = FALSE; (*out)->flags = 0; (*out)->pipe = 1; (*out)->timeout = -1; (*out)->blocking = BLK_ON; - apr_pool_cleanup_register(cont, *out, apr_file_cleanup, apr_pool_cleanup_null); + apr_pool_cleanup_register(pool, *out, apr_file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *pool) { /* Not yet implemented, interface not suitable */ return APR_ENOTIMPL; diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 2e02d78a7..fe8003ed6 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -73,7 +73,7 @@ static apr_status_t dir_cleanup(void *thedir) } } -apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont) +apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *pool) { /* On some platforms (e.g., Linux+GNU libc), d_name[] in struct * dirent is declared with enough storage for the name. On other @@ -84,18 +84,18 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont (sizeof((*new)->entry->d_name) > 1 ? sizeof(struct dirent) : sizeof (struct dirent) + 255); - (*new) = (apr_dir_t *)apr_palloc(cont, sizeof(apr_dir_t)); + (*new) = (apr_dir_t *)apr_palloc(pool, sizeof(apr_dir_t)); - (*new)->cntxt = cont; - (*new)->dirname = apr_pstrdup(cont, dirname); + (*new)->pool = pool; + (*new)->dirname = apr_pstrdup(pool, dirname); (*new)->dirstruct = opendir(dirname); - (*new)->entry = apr_pcalloc(cont, dirent_size); + (*new)->entry = apr_pcalloc(pool, dirent_size); if ((*new)->dirstruct == NULL) { return errno; } else { - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), dir_cleanup, + apr_pool_cleanup_register((*new)->pool, (void *)(*new), dir_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -103,7 +103,7 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont apr_status_t apr_dir_close(apr_dir_t *thedir) { - return apr_pool_cleanup_run(thedir->cntxt, thedir, dir_cleanup); + return apr_pool_cleanup_run(thedir->pool, thedir, dir_cleanup); } apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, @@ -159,7 +159,7 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, if (fspec[off - 1] != '/') fspec[off++] = '/'; apr_cpystrn(fspec + off, thedir->entry->d_name, sizeof(fspec) - off); - ret = apr_lstat(finfo, fspec, wanted, thedir->cntxt); + ret = apr_lstat(finfo, fspec, wanted, thedir->pool); } if (wanted && (ret == APR_SUCCESS || ret == APR_INCOMPLETE)) { @@ -170,7 +170,7 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, /* We don't bail because we fail to stat, when we are only -required- * to readdir... but the result will be APR_INCOMPLETE */ - finfo->cntxt = thedir->cntxt; + finfo->pool = thedir->pool; finfo->valid = 0; } @@ -192,7 +192,7 @@ apr_status_t apr_dir_rewind(apr_dir_t *thedir) return APR_SUCCESS; } -apr_status_t apr_dir_make(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 *pool) { mode_t mode = apr_unix_perms2mode(perm); @@ -204,7 +204,7 @@ apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *co } } -apr_status_t apr_dir_remove(const char *path, apr_pool_t *cont) +apr_status_t apr_dir_remove(const char *path, apr_pool_t *pool) { if (rmdir(path) == 0) { return APR_SUCCESS; @@ -224,11 +224,11 @@ apr_status_t apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir) } apr_status_t apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, - apr_pool_t *cont) + apr_pool_t *pool) { if ((*dir) == NULL) { - (*dir) = (apr_dir_t *)apr_pcalloc(cont, sizeof(apr_dir_t)); - (*dir)->cntxt = cont; + (*dir) = (apr_dir_t *)apr_pcalloc(pool, sizeof(apr_dir_t)); + (*dir)->pool = pool; } (*dir)->dirstruct = thedir; return APR_SUCCESS; diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 6b5d4677a..8b50488bf 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -130,12 +130,12 @@ apr_fileperms_t apr_unix_mode2perms(mode_t mode) APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key, apr_file_t *file) { - return apr_pool_userdata_get(data, key, file->cntxt); + return apr_pool_userdata_get(data, key, file->pool); } 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_pool_userdata_set(data, key, cleanup, file->cntxt); + return apr_pool_userdata_set(data, key, cleanup, file->pool); } diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 87b76fdbb..8c43de810 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -70,7 +70,7 @@ static apr_status_t _file_dup(apr_file_t **new_file, if ((*new_file) == NULL) { return APR_ENOMEM; } - (*new_file)->cntxt = p; + (*new_file)->pool = p; } else { /* We can't dup2 unless we have a valid new_file */ return APR_EINVAL; @@ -132,7 +132,7 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, /* we do this here as we don't want to double register an existing * apr_file_t for cleanup */ - apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), + apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), apr_unix_file_cleanup, apr_unix_file_cleanup); return rv; diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 15d029d09..1ca88bbb9 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -112,7 +112,7 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, struct stat info; if (fstat(thefile->filedes, &info) == 0) { - finfo->cntxt = thefile->cntxt; + finfo->pool = thefile->pool; finfo->fname = thefile->fname; fill_out_finfo(finfo, &info, wanted); return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; @@ -135,12 +135,12 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attributes, apr_fileattrs_t attr_mask, - apr_pool_t *cont) + apr_pool_t *pool) { apr_status_t status; apr_finfo_t finfo; - status = apr_stat(&finfo, fname, APR_FINFO_PROT, cont); + status = apr_stat(&finfo, fname, APR_FINFO_PROT, pool); if (!APR_STATUS_IS_SUCCESS(status)) return status; @@ -184,7 +184,7 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) + apr_int32_t wanted, apr_pool_t *pool) { struct stat info; int srv; @@ -195,7 +195,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, srv = stat(fname, &info); if (srv == 0) { - finfo->cntxt = cont; + finfo->pool = pool; finfo->fname = fname; fill_out_finfo(finfo, &info, wanted); if (wanted & APR_FINFO_LINK) @@ -240,8 +240,8 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, /* Perhaps this becomes nothing but a macro? */ APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) + apr_int32_t wanted, apr_pool_t *pool) { - return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, cont); + return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, pool); } diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 2acf60436..20cd1d1ba 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -228,7 +228,7 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i apr_os_file_put(fp, &fd, flags, p); (*fp)->fname = apr_pstrdup(p, template); - apr_pool_cleanup_register((*fp)->cntxt, (void *)(*fp), + apr_pool_cleanup_register((*fp)->pool, (void *)(*fp), apr_unix_file_cleanup, apr_unix_file_cleanup); #endif return APR_SUCCESS; diff --git a/file_io/unix/open.c b/file_io/unix/open.c index ff2d4071b..95cbea085 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -90,15 +90,15 @@ 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) + apr_pool_t *pool) { int oflags = 0; #if APR_HAS_THREADS apr_status_t rv; #endif - (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); - (*new)->cntxt = cont; + (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + (*new)->pool = pool; (*new)->flags = flag; (*new)->filedes = -1; @@ -115,17 +115,17 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, return APR_EACCES; } - (*new)->fname = apr_pstrdup(cont, fname); + (*new)->fname = apr_pstrdup(pool, fname); (*new)->blocking = BLK_ON; (*new)->buffered = (flag & APR_BUFFERED) > 0; if ((*new)->buffered) { - (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); + (*new)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); #if APR_HAS_THREADS if ((*new)->flags & APR_XTHREAD) { rv = apr_thread_mutex_create(&((*new)->thlock), - APR_THREAD_MUTEX_DEFAULT, cont); + APR_THREAD_MUTEX_DEFAULT, pool); if (rv) { return rv; } @@ -176,7 +176,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, (*new)->direction = 0; if (!(flag & APR_FILE_NOCLEANUP)) { - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + apr_pool_cleanup_register((*new)->pool, (void *)(*new), apr_unix_file_cleanup, apr_unix_file_cleanup); } return APR_SUCCESS; @@ -184,10 +184,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) { - return apr_pool_cleanup_run(file->cntxt, file, apr_unix_file_cleanup); + return apr_pool_cleanup_run(file->pool, file, apr_unix_file_cleanup); } -APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool) { if (unlink(path) == 0) { return APR_SUCCESS; @@ -216,12 +216,12 @@ APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, - apr_int32_t flags, apr_pool_t *cont) + apr_int32_t flags, apr_pool_t *pool) { int *dafile = thefile; - (*file) = apr_pcalloc(cont, sizeof(apr_file_t)); - (*file)->cntxt = cont; + (*file) = apr_pcalloc(pool, sizeof(apr_file_t)); + (*file)->pool = pool; (*file)->eof_hit = 0; (*file)->buffered = 0; (*file)->blocking = BLK_UNKNOWN; /* in case it is a pipe */ @@ -244,31 +244,31 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) } APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, - apr_pool_t *cont) + apr_pool_t *pool) { int fd = STDERR_FILENO; - return apr_os_file_put(thefile, &fd, 0, cont); + return apr_os_file_put(thefile, &fd, 0, pool); } APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, - apr_pool_t *cont) + apr_pool_t *pool) { int fd = STDOUT_FILENO; - return apr_os_file_put(thefile, &fd, 0, cont); + return apr_os_file_put(thefile, &fd, 0, pool); } APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, - apr_pool_t *cont) + apr_pool_t *pool) { int fd = STDIN_FILENO; - return apr_os_file_put(thefile, &fd, 0, cont); + return apr_os_file_put(thefile, &fd, 0, pool); } -APR_IMPLEMENT_SET_INHERIT(file, flags, cntxt, apr_unix_file_cleanup) +APR_IMPLEMENT_SET_INHERIT(file, flags, pool, apr_unix_file_cleanup) -APR_IMPLEMENT_UNSET_INHERIT(file, flags, cntxt, apr_unix_file_cleanup) +APR_IMPLEMENT_UNSET_INHERIT(file, flags, pool, apr_unix_file_cleanup) -APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt) +APR_POOL_IMPLEMENT_ACCESSOR(file) diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index d00e4adf8..8672c632d 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -168,7 +168,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_int return APR_EINVAL; } -APR_DECLARE(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_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) { int filedes[2]; @@ -176,8 +176,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return errno; } - (*in) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); - (*in)->cntxt = cont; + (*in) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + (*in)->pool = pool; (*in)->filedes = filedes[0]; (*in)->pipe = 1; (*in)->fname = NULL; @@ -189,8 +189,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*in)->thlock = NULL; #endif - (*out) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); - (*out)->cntxt = cont; + (*out) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + (*out)->pool = pool; (*out)->filedes = filedes[1]; (*out)->pipe = 1; (*out)->fname = NULL; @@ -201,15 +201,15 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*in)->thlock = NULL; #endif - apr_pool_cleanup_register((*in)->cntxt, (void *)(*in), apr_unix_file_cleanup, + apr_pool_cleanup_register((*in)->pool, (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_register((*out)->pool, (void *)(*out), apr_unix_file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, - apr_fileperms_t perm, apr_pool_t *cont) + apr_fileperms_t perm, apr_pool_t *pool) { mode_t mode = apr_unix_perms2mode(perm); diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 50a9f3666..39e23f6bd 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -84,14 +84,14 @@ static apr_status_t dir_cleanup(void *thedir) } APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, - apr_pool_t *cont) + apr_pool_t *pool) { int len = strlen(dirname); - (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); + (*new) = apr_pcalloc(pool, sizeof(apr_dir_t)); /* Leave room here to add and pop the '*' wildcard for FindFirstFile * and double-null terminate so we have one character to change. */ - (*new)->dirname = apr_palloc(cont, len + 3); + (*new)->dirname = apr_palloc(pool, len + 3); memcpy((*new)->dirname, dirname, len); if (len && (*new)->dirname[len - 1] != '/') { (*new)->dirname[len++] = '/'; @@ -104,8 +104,8 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, { /* Create a buffer for the longest file name we will ever see */ - (*new)->w.entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW)); - (*new)->name = apr_pcalloc(cont, APR_FILE_MAX * 3 + 1); + (*new)->w.entry = apr_pcalloc(pool, sizeof(WIN32_FIND_DATAW)); + (*new)->name = apr_pcalloc(pool, APR_FILE_MAX * 3 + 1); } #endif #if APR_HAS_ANSI_FS @@ -121,20 +121,20 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, (*new) = NULL; return APR_ENAMETOOLONG; } - (*new)->n.entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW)); + (*new)->n.entry = apr_pcalloc(pool, sizeof(WIN32_FIND_DATAW)); } #endif (*new)->rootlen = len - 1; - (*new)->cntxt = cont; + (*new)->pool = pool; (*new)->dirhand = INVALID_HANDLE_VALUE; - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), dir_cleanup, + apr_pool_cleanup_register((*new)->pool, (void *)(*new), dir_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *dir) { - apr_pool_cleanup_kill(dir->cntxt, dir, dir_cleanup); + apr_pool_cleanup_kill(dir->pool, dir, dir_cleanup); return dir_cleanup(dir); } @@ -215,7 +215,7 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) thedir->w.entry, 0, wanted); - finfo->cntxt = thedir->cntxt; + finfo->pool = thedir->pool; finfo->valid |= APR_FINFO_NAME; finfo->name = fname; @@ -270,7 +270,7 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *dir) } APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, - apr_pool_t *cont) + apr_pool_t *pool) { #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE @@ -295,7 +295,7 @@ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool) { #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE @@ -332,7 +332,7 @@ APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, - apr_pool_t *cont) + apr_pool_t *pool) { return APR_ENOTIMPL; } diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 7970f8ba6..524d11394 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -77,12 +77,12 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, (*new_file) = (apr_file_t *) apr_pcalloc(p, sizeof(apr_file_t)); (*new_file)->filehand = newhand; (*new_file)->flags = old_file->flags & ~APR_INHERIT; - (*new_file)->cntxt = p; + (*new_file)->pool = p; (*new_file)->fname = apr_pstrdup(p, old_file->fname); (*new_file)->append = old_file->append; (*new_file)->buffered = FALSE; - apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), file_cleanup, + apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; @@ -142,7 +142,7 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, new_file->flags = newflags; new_file->filehand = newhand; - new_file->fname = apr_pstrdup(new_file->cntxt, old_file->fname); + new_file->fname = apr_pstrdup(new_file->pool, old_file->fname); new_file->append = old_file->append; new_file->buffered = FALSE; diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 686c7faa4..0dadf4bb7 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -155,7 +155,7 @@ static void resolve_prot(apr_finfo_t *finfo, apr_int32_t wanted, PACL dacl) } static apr_status_t resolve_ident(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) + apr_int32_t wanted, apr_pool_t *pool) { apr_file_t *thefile = NULL; apr_status_t rv; @@ -172,7 +172,7 @@ static apr_status_t resolve_ident(apr_finfo_t *finfo, const char *fname, ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0) | ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) ? APR_READCONTROL : 0), - APR_OS_DEFAULT, cont)) == APR_SUCCESS) { + APR_OS_DEFAULT, pool)) == APR_SUCCESS) { rv = apr_file_info_get(finfo, wanted, thefile); finfo->filehand = NULL; apr_file_close(thefile); @@ -184,7 +184,7 @@ static apr_status_t resolve_ident(apr_finfo_t *finfo, const char *fname, */ if ((rv = apr_file_open(&thefile, fname, ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0), - APR_OS_DEFAULT, cont)) == APR_SUCCESS) { + APR_OS_DEFAULT, pool)) == APR_SUCCESS) { rv = apr_file_info_get(finfo, wanted & ~(APR_FINFO_PROT | APR_FINFO_OWNER), thefile); @@ -281,7 +281,7 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, else return APR_INCOMPLETE; if (rv == ERROR_SUCCESS) - apr_pool_cleanup_register(finfo->cntxt, pdesc, free_localheap, + apr_pool_cleanup_register(finfo->pool, pdesc, free_localheap, apr_pool_cleanup_null); else user = grp = dacl = NULL; @@ -414,7 +414,7 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want } } - finfo->cntxt = thefile->cntxt; + finfo->pool = thefile->pool; /* Extra goodies known only by GetFileInformationByHandle() */ finfo->inode = (apr_ino_t)FileInfo.nFileIndexLow @@ -440,7 +440,7 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, } APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) + apr_int32_t wanted, apr_pool_t *pool) { /* XXX: is constant - needs testing - which requires a lighter-weight root test fn */ int isroot = 0; @@ -474,7 +474,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, * to the get file info by handle method. If we fail, or the user * also asks for the file name, continue by our usual means. */ - if ((ident_rv = resolve_ident(finfo, fname, wanted, cont)) + if ((ident_rv = resolve_ident(finfo, fname, wanted, pool)) == APR_SUCCESS) return ident_rv; else if (ident_rv == APR_INCOMPLETE) @@ -509,7 +509,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, FileInfo.w.cFileName)) { return APR_ENAMETOOLONG; } - filename = apr_pstrdup(cont, tmpname); + filename = apr_pstrdup(pool, tmpname); } } #endif @@ -530,7 +530,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, */ if (GetDriveType(fname) != DRIVE_UNKNOWN) { - finfo->cntxt = cont; + finfo->pool = pool; finfo->filetype = 0; finfo->mtime = apr_time_now(); finfo->protection |= APR_WREAD | APR_WEXECUTE | APR_WWRITE; @@ -556,7 +556,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, return apr_get_os_error(); } FindClose(hFind); - filename = apr_pstrdup(cont, FileInfo.n.cFileName); + filename = apr_pstrdup(pool, FileInfo.n.cFileName); } #endif @@ -592,7 +592,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, #endif } } - finfo->cntxt = cont; + finfo->pool = pool; } if (filename && !isroot) { @@ -613,15 +613,15 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, } APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) + apr_int32_t wanted, apr_pool_t *pool) { - return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, cont); + return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, pool); } APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attributes, apr_fileattrs_t attr_mask, - apr_pool_t *cont) + apr_pool_t *pool) { DWORD flags; apr_status_t rv; diff --git a/file_io/win32/open.c b/file_io/win32/open.c index f50501b10..e0615076b 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -278,7 +278,7 @@ apr_status_t file_cleanup(void *thefile) 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) + apr_pool_t *pool) { HANDLE handle = INVALID_HANDLE_VALUE; DWORD oflags = 0; @@ -359,10 +359,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, return apr_get_os_error(); } - (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); - (*new)->cntxt = cont; + (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + (*new)->pool = pool; (*new)->filehand = handle; - (*new)->fname = apr_pstrdup(cont, fname); + (*new)->fname = apr_pstrdup(pool, fname); (*new)->flags = flag; if (flag & APR_APPEND) { @@ -375,13 +375,13 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, if (flag & APR_BUFFERED) { (*new)->buffered = 1; - (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); + (*new)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); rv = apr_thread_mutex_create(&(*new)->mutex, APR_THREAD_MUTEX_DEFAULT, - cont); + pool); if (rv) { if (file_cleanup(*new) == APR_SUCCESS) { - apr_pool_cleanup_kill(cont, *new, file_cleanup); + apr_pool_cleanup_kill(pool, *new, file_cleanup); } return rv; } @@ -404,7 +404,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, (*new)->filePtr = 0; if (!(flag & APR_FILE_NOCLEANUP)) { - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), file_cleanup, + apr_pool_cleanup_register((*new)->pool, (void *)(*new), file_cleanup, apr_pool_cleanup_null); } return APR_SUCCESS; @@ -414,7 +414,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) { apr_status_t stat; if ((stat = file_cleanup(file)) == APR_SUCCESS) { - apr_pool_cleanup_kill(file->cntxt, file, file_cleanup); + apr_pool_cleanup_kill(file->pool, file, file_cleanup); if (file->buffered) apr_thread_mutex_destroy(file->mutex); @@ -424,7 +424,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) return stat; } -APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool) { #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE @@ -449,7 +449,7 @@ APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont) APR_DECLARE(apr_status_t) apr_file_rename(const char *frompath, const char *topath, - apr_pool_t *cont) + apr_pool_t *pool) { IF_WIN_OS_IS_UNICODE { @@ -512,10 +512,10 @@ APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_int32_t flags, - apr_pool_t *cont) + apr_pool_t *pool) { - (*file) = apr_pcalloc(cont, sizeof(apr_file_t)); - (*file)->cntxt = cont; + (*file) = apr_pcalloc(pool, sizeof(apr_file_t)); + (*file)->pool = pool; (*file)->filehand = *thefile; (*file)->ungetchar = -1; /* no char avail */ (*file)->flags; @@ -530,7 +530,7 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_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 *pool) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -547,11 +547,11 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t return rv; } - return apr_os_file_put(thefile, &file_handle, 0, cont); + return apr_os_file_put(thefile, &file_handle, 0, pool); #endif } -APR_DECLARE(apr_status_t) apr_file_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 *pool) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -568,11 +568,11 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t return rv; } - return apr_os_file_put(thefile, &file_handle, 0, cont); + return apr_os_file_put(thefile, &file_handle, 0, pool); #endif } -APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *pool) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -589,11 +589,11 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t * return rv; } - return apr_os_file_put(thefile, &file_handle, 0, cont); + return apr_os_file_put(thefile, &file_handle, 0, pool); #endif } -APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); +APR_POOL_IMPLEMENT_ACCESSOR(file); APR_DECLARE_SET_INHERIT(file) { return; diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 1f1fd5ca4..9d1a12841 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -99,7 +99,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out sa.lpSecurityDescriptor = NULL; (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); - (*in)->cntxt = p; + (*in)->pool = p; (*in)->fname = NULL; (*in)->pipe = 1; (*in)->timeout = -1; @@ -111,7 +111,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*in)->direction = 0; (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); - (*out)->cntxt = p; + (*out)->pool = p; (*in)->fname = NULL; (*out)->pipe = 1; (*out)->timeout = -1; @@ -126,9 +126,9 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return apr_get_os_error(); } - apr_pool_cleanup_register((*in)->cntxt, (void *)(*in), file_cleanup, + apr_pool_cleanup_register((*in)->pool, (void *)(*in), file_cleanup, apr_pool_cleanup_null); - apr_pool_cleanup_register((*out)->cntxt, (void *)(*out), file_cleanup, + apr_pool_cleanup_register((*out)->pool, (void *)(*out), file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; #endif @@ -172,7 +172,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, sa.lpSecurityDescriptor = NULL; (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); - (*in)->cntxt = p; + (*in)->pool = p; (*in)->fname = NULL; (*in)->pipe = 1; (*in)->timeout = -1; @@ -185,7 +185,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, (*in)->pOverlapped = NULL; (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); - (*out)->cntxt = p; + (*out)->pool = p; (*out)->fname = NULL; (*out)->pipe = 1; (*out)->timeout = -1; @@ -242,9 +242,9 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, } } - apr_pool_cleanup_register((*in)->cntxt, (void *)(*in), file_cleanup, + apr_pool_cleanup_register((*in)->pool, (void *)(*in), file_cleanup, apr_pool_cleanup_null); - apr_pool_cleanup_register((*out)->cntxt, (void *)(*out), file_cleanup, + apr_pool_cleanup_register((*out)->pool, (void *)(*out), file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; #endif /* _WIN32_WCE */ diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index b93fd6035..fa29734e7 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -173,7 +173,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size * Threads should NOT share an apr_file_t or its hEvent. */ if ((thefile->flags & APR_XTHREAD) && !thefile->pOverlapped ) { - thefile->pOverlapped = (OVERLAPPED*) apr_pcalloc(thefile->cntxt, + thefile->pOverlapped = (OVERLAPPED*) apr_pcalloc(thefile->pool, sizeof(OVERLAPPED)); thefile->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); if (!thefile->pOverlapped->hEvent) { @@ -258,7 +258,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a * Threads should NOT share an apr_file_t or its hEvent. */ if ((thefile->flags & APR_XTHREAD) && !thefile->pOverlapped ) { - thefile->pOverlapped = (OVERLAPPED*) apr_pcalloc(thefile->cntxt, + thefile->pOverlapped = (OVERLAPPED*) apr_pcalloc(thefile->pool, sizeof(OVERLAPPED)); thefile->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); if (!thefile->pOverlapped->hEvent) { |