diff options
Diffstat (limited to 'file_io/os2')
-rw-r--r-- | file_io/os2/dir.c | 38 | ||||
-rw-r--r-- | file_io/os2/filedup.c | 12 | ||||
-rw-r--r-- | file_io/os2/fileio.h | 16 | ||||
-rw-r--r-- | file_io/os2/filestat.c | 12 | ||||
-rw-r--r-- | file_io/os2/maperrorcode.c | 4 | ||||
-rw-r--r-- | file_io/os2/open.c | 46 | ||||
-rw-r--r-- | file_io/os2/pipe.c | 18 | ||||
-rw-r--r-- | file_io/os2/readwrite.c | 52 | ||||
-rw-r--r-- | file_io/os2/seek.c | 10 |
9 files changed, 104 insertions, 104 deletions
diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 34f973ec6..05674c69e 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -60,23 +60,23 @@ #define INCL_DOS #include <os2.h> -static ap_status_t dir_cleanup(void *thedir) +static apr_status_t dir_cleanup(void *thedir) { - ap_dir_t *dir = thedir; - return ap_closedir(dir); + apr_dir_t *dir = thedir; + return apr_closedir(dir); } -ap_status_t ap_opendir(ap_dir_t **new, const char *dirname, ap_pool_t *cntxt) +apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cntxt) { - ap_dir_t *thedir = (ap_dir_t *)ap_palloc(cntxt, sizeof(ap_dir_t)); + apr_dir_t *thedir = (apr_dir_t *)apr_palloc(cntxt, sizeof(apr_dir_t)); if (thedir == NULL) return APR_ENOMEM; thedir->cntxt = cntxt; - thedir->dirname = ap_pstrdup(cntxt, dirname); + thedir->dirname = apr_pstrdup(cntxt, dirname); if (thedir->dirname == NULL) return APR_ENOMEM; @@ -84,13 +84,13 @@ ap_status_t ap_opendir(ap_dir_t **new, const char *dirname, ap_pool_t *cntxt) thedir->handle = 0; thedir->validentry = FALSE; *new = thedir; - ap_register_cleanup(cntxt, thedir, dir_cleanup, ap_null_cleanup); + apr_register_cleanup(cntxt, thedir, dir_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_closedir(ap_dir_t *thedir) +apr_status_t apr_closedir(apr_dir_t *thedir) { int rv = 0; @@ -107,14 +107,14 @@ ap_status_t ap_closedir(ap_dir_t *thedir) -ap_status_t ap_readdir(ap_dir_t *thedir) +apr_status_t apr_readdir(apr_dir_t *thedir) { int rv; ULONG entries = 1; if (thedir->handle == 0) { thedir->handle = HDIR_CREATE; - rv = DosFindFirst(ap_pstrcat(thedir->cntxt, thedir->dirname, "/*", NULL), &thedir->handle, + rv = DosFindFirst(apr_pstrcat(thedir->cntxt, thedir->dirname, "/*", NULL), &thedir->handle, FILE_ARCHIVED|FILE_DIRECTORY|FILE_SYSTEM|FILE_HIDDEN|FILE_READONLY, &thedir->entry, sizeof(thedir->entry), &entries, FIL_STANDARD); } else { @@ -136,28 +136,28 @@ ap_status_t ap_readdir(ap_dir_t *thedir) -ap_status_t ap_rewinddir(ap_dir_t *thedir) +apr_status_t apr_rewinddir(apr_dir_t *thedir) { - return ap_closedir(thedir); + return apr_closedir(thedir); } -ap_status_t ap_make_dir(const char *path, ap_fileperms_t perm, ap_pool_t *cont) +apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) { return APR_OS2_STATUS(DosCreateDir(path, NULL)); } -ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont) +apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) { return APR_OS2_STATUS(DosDeleteDir(path)); } -ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir) +apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir) { if (thedir->validentry) { *size = thedir->entry.cbFile; @@ -169,7 +169,7 @@ ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir) -ap_status_t ap_dir_entry_mtime(ap_time_t *time, ap_dir_t *thedir) +apr_status_t apr_dir_entry_mtime(apr_time_t *time, apr_dir_t *thedir) { if (thedir->validentry) { ap_os2_time_to_ap_time(time, thedir->entry.fdateLastWrite, thedir->entry.ftimeLastWrite); @@ -181,7 +181,7 @@ ap_status_t ap_dir_entry_mtime(ap_time_t *time, ap_dir_t *thedir) -ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) +apr_status_t apr_dir_entry_ftype(ap_filetype_e *type, apr_dir_t *thedir) { int rc; HFILE hFile; @@ -193,7 +193,7 @@ ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) *type = APR_DIR; return APR_SUCCESS; } else { - rc = DosOpen(ap_pstrcat(thedir->cntxt, thedir->dirname, "/", thedir->entry.achName, NULL) , + rc = DosOpen(apr_pstrcat(thedir->cntxt, thedir->dirname, "/", thedir->entry.achName, NULL) , &hFile, &action, 0, 0, OPEN_ACTION_FAIL_IF_NEW|OPEN_ACTION_OPEN_IF_EXISTS, OPEN_SHARE_DENYNONE|OPEN_ACCESS_READONLY, NULL); @@ -216,7 +216,7 @@ ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) -ap_status_t ap_get_dir_filename(char **new, ap_dir_t *thedir) +apr_status_t apr_get_dir_filename(char **new, apr_dir_t *thedir) { if (thedir->validentry) { *new = thedir->entry.achName; diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index d3cedd6a7..a921d096b 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -60,13 +60,13 @@ #define INCL_DOS #include <os2.h> -ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) +apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { int rv; - ap_file_t *dup_file; + apr_file_t *dup_file; if (*new_file == NULL) { - dup_file = (ap_file_t *)ap_palloc(p, sizeof(ap_file_t)); + dup_file = (apr_file_t *)apr_palloc(p, sizeof(apr_file_t)); if (dup_file == NULL) { return APR_ENOMEM; @@ -84,7 +84,7 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) return APR_OS2_STATUS(rv); } - dup_file->fname = ap_pstrdup(dup_file->cntxt, old_file->fname); + dup_file->fname = apr_pstrdup(dup_file->cntxt, old_file->fname); dup_file->buffered = old_file->buffered; dup_file->isopen = old_file->isopen; dup_file->flags = old_file->flags; @@ -92,8 +92,8 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) dup_file->pipe = old_file->pipe; if (*new_file == NULL) { - ap_register_cleanup(dup_file->cntxt, dup_file, apr_file_cleanup, - ap_null_cleanup); + apr_register_cleanup(dup_file->cntxt, dup_file, apr_file_cleanup, + apr_null_cleanup); *new_file = dup_file; } diff --git a/file_io/os2/fileio.h b/file_io/os2/fileio.h index 738e17f2e..6aa1be1c5 100644 --- a/file_io/os2/fileio.h +++ b/file_io/os2/fileio.h @@ -67,14 +67,14 @@ #define APR_FILE_BUFSIZE 4096 -struct ap_file_t { - ap_pool_t *cntxt; +struct apr_file_t { + apr_pool_t *cntxt; HFILE filedes; char * fname; int isopen; int buffered; int eof_hit; - ap_int32_t flags; + apr_int32_t flags; int timeout; int pipe; HEV pipeSem; @@ -85,19 +85,19 @@ struct ap_file_t { unsigned long dataRead; // amount of valid data read into buffer int direction; // buffer being used for 0 = read, 1 = write unsigned long filePtr; // position in file of handle - ap_lock_t *mutex; // mutex semaphore, must be owned to access the above fields + apr_lock_t *mutex; // mutex semaphore, must be owned to access the above fields }; -struct ap_dir_t { - ap_pool_t *cntxt; +struct apr_dir_t { + apr_pool_t *cntxt; char *dirname; ULONG handle; FILEFINDBUF3 entry; int validentry; }; -ap_status_t apr_file_cleanup(void *); -ap_status_t ap_os2_time_to_ap_time(ap_time_t *result, FDATE os2date, FTIME os2time); +apr_status_t apr_file_cleanup(void *); +apr_status_t ap_os2_time_to_ap_time(apr_time_t *result, FDATE os2date, FTIME os2time); #endif /* ! FILE_IO_H */ diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 96d0deb2d..43dc3f152 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -61,7 +61,7 @@ #include <os2.h> -static void FS3_to_finfo(ap_finfo_t *finfo, FILESTATUS3 *fstatus) +static void FS3_to_finfo(apr_finfo_t *finfo, FILESTATUS3 *fstatus) { finfo->protection = (fstatus->attrFile & FILE_READONLY) ? 0555 : 0777; @@ -82,7 +82,7 @@ static void FS3_to_finfo(ap_finfo_t *finfo, FILESTATUS3 *fstatus) -static ap_status_t handle_type(ap_filetype_e *ftype, HFILE file) +static apr_status_t handle_type(ap_filetype_e *ftype, HFILE file) { ULONG filetype, fileattr, rc; @@ -110,7 +110,7 @@ static ap_status_t handle_type(ap_filetype_e *ftype, HFILE file) -ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) +apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) { ULONG rc; FILESTATUS3 fstatus; @@ -137,13 +137,13 @@ ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) return APR_OS2_STATUS(rc); } -ap_status_t ap_setfileperms(const char *fname, ap_fileperms_t perms) +apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) { return APR_ENOTIMPL; } -ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) +apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) { ULONG rc; FILESTATUS3 fstatus; @@ -156,7 +156,7 @@ ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) FS3_to_finfo(finfo, &fstatus); return APR_SUCCESS; } else if (rc == ERROR_INVALID_ACCESS) { - memset(finfo, 0, sizeof(ap_finfo_t)); + memset(finfo, 0, sizeof(apr_finfo_t)); finfo->protection = 0444; finfo->filetype = APR_CHR; return APR_SUCCESS; diff --git a/file_io/os2/maperrorcode.c b/file_io/os2/maperrorcode.c index 209eec026..5fa398151 100644 --- a/file_io/os2/maperrorcode.c +++ b/file_io/os2/maperrorcode.c @@ -115,7 +115,7 @@ static int errormap[][2] = { #define MAPSIZE (sizeof(errormap)/sizeof(errormap[0])) -int ap_canonical_error(ap_status_t err) +int apr_canonical_error(apr_status_t err) { int rv = -1, index; @@ -129,7 +129,7 @@ int ap_canonical_error(ap_status_t err) if (index<MAPSIZE) rv = errormap[index][1]; else - fprintf(stderr, "ap_canonical_error: Unknown OS/2 error code %d\n", err ); + fprintf(stderr, "apr_canonical_error: Unknown OS/2 error code %d\n", err ); return rv; } diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 0e77ad27c..14c28617d 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -58,21 +58,21 @@ #include "apr_portable.h" #include <string.h> -ap_status_t apr_file_cleanup(void *thefile) +apr_status_t apr_file_cleanup(void *thefile) { - ap_file_t *file = thefile; - return ap_close(file); + apr_file_t *file = thefile; + return apr_close(file); } -ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fileperms_t perm, ap_pool_t *cntxt) +apr_status_t apr_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; int rv; ULONG action; - ap_file_t *dafile = (ap_file_t *)ap_palloc(cntxt, sizeof(ap_file_t)); + apr_file_t *dafile = (apr_file_t *)apr_palloc(cntxt, sizeof(apr_file_t)); *new = dafile; dafile->cntxt = cntxt; @@ -95,8 +95,8 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil dafile->buffered = (flag & APR_BUFFERED) > 0; if (dafile->buffered) { - dafile->buffer = ap_palloc(cntxt, APR_FILE_BUFSIZE); - rv = ap_create_lock(&dafile->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cntxt); + dafile->buffer = apr_palloc(cntxt, APR_FILE_BUFSIZE); + rv = apr_create_lock(&dafile->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cntxt); if (rv) return rv; @@ -135,26 +135,26 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil return APR_OS2_STATUS(rv); dafile->isopen = TRUE; - dafile->fname = ap_pstrdup(cntxt, fname); + dafile->fname = apr_pstrdup(cntxt, fname); dafile->filePtr = 0; dafile->bufpos = 0; dafile->dataRead = 0; dafile->direction = 0; dafile->pipe = FALSE; - ap_register_cleanup(dafile->cntxt, dafile, apr_file_cleanup, ap_null_cleanup); + apr_register_cleanup(dafile->cntxt, dafile, apr_file_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_close(ap_file_t *file) +apr_status_t apr_close(apr_file_t *file) { ULONG rc; - ap_status_t status; + apr_status_t status; if (file && file->isopen) { - ap_flush(file); + apr_flush(file); rc = DosClose(file->filedes); if (rc == 0) { @@ -170,14 +170,14 @@ ap_status_t ap_close(ap_file_t *file) } if (file->buffered) - ap_destroy_lock(file->mutex); + apr_destroy_lock(file->mutex); return APR_SUCCESS; } -ap_status_t ap_remove_file(const char *path, ap_pool_t *cntxt) +apr_status_t apr_remove_file(const char *path, apr_pool_t *cntxt) { ULONG rc = DosDelete(path); return APR_OS2_STATUS(rc); @@ -185,8 +185,8 @@ ap_status_t ap_remove_file(const char *path, ap_pool_t *cntxt) -ap_status_t ap_rename_file(const char *from_path, const char *to_path, - ap_pool_t *p) +apr_status_t apr_rename_file(const char *from_path, const char *to_path, + apr_pool_t *p) { ULONG rc = DosMove(from_path, to_path); @@ -203,7 +203,7 @@ ap_status_t ap_rename_file(const char *from_path, const char *to_path, -ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) +apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) { if (file == NULL) { return APR_ENOFILE; @@ -215,11 +215,11 @@ ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) -ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, ap_pool_t *cont) +apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) { - ap_os_file_t *dafile = thefile; + apr_os_file_t *dafile = thefile; if ((*file) == NULL) { - (*file) = (ap_file_t *)ap_palloc(cont, sizeof(ap_file_t)); + (*file) = (apr_file_t *)apr_palloc(cont, sizeof(apr_file_t)); (*file)->cntxt = cont; } (*file)->filedes = *dafile; @@ -233,7 +233,7 @@ ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, ap_pool_t *c -ap_status_t ap_eof(ap_file_t *fptr) +apr_status_t apr_eof(apr_file_t *fptr) { if (!fptr->isopen || fptr->eof_hit == 1) { return APR_EOF; @@ -243,9 +243,9 @@ ap_status_t ap_eof(ap_file_t *fptr) -ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont) +apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { - (*thefile) = ap_palloc(cont, sizeof(ap_file_t)); + (*thefile) = apr_palloc(cont, sizeof(apr_file_t)); if ((*thefile) == NULL) { return APR_ENOMEM; } diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 8c4482188..c3b01aa8e 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -60,7 +60,7 @@ #include <string.h> #include <process.h> -ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) +apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) { ULONG filedes[2]; ULONG rc, action; @@ -90,7 +90,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) return APR_OS2_STATUS(rc); } - (*in) = (ap_file_t *)ap_palloc(cont, sizeof(ap_file_t)); + (*in) = (apr_file_t *)apr_palloc(cont, sizeof(apr_file_t)); rc = DosCreateEventSem(NULL, &(*in)->pipeSem, DC_SEM_SHARED, FALSE); if (rc) { @@ -114,31 +114,31 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) (*in)->cntxt = cont; (*in)->filedes = filedes[0]; - (*in)->fname = ap_pstrdup(cont, pipename); + (*in)->fname = apr_pstrdup(cont, pipename); (*in)->isopen = TRUE; (*in)->buffered = FALSE; (*in)->flags = 0; (*in)->pipe = 1; (*in)->timeout = -1; - ap_register_cleanup(cont, *in, apr_file_cleanup, ap_null_cleanup); + apr_register_cleanup(cont, *in, apr_file_cleanup, apr_null_cleanup); - (*out) = (ap_file_t *)ap_palloc(cont, sizeof(ap_file_t)); + (*out) = (apr_file_t *)apr_palloc(cont, sizeof(apr_file_t)); (*out)->cntxt = cont; (*out)->filedes = filedes[1]; - (*out)->fname = ap_pstrdup(cont, pipename); + (*out)->fname = apr_pstrdup(cont, pipename); (*out)->isopen = TRUE; (*out)->buffered = FALSE; (*out)->flags = 0; (*out)->pipe = 1; (*out)->timeout = -1; - ap_register_cleanup(cont, *out, apr_file_cleanup, ap_null_cleanup); + apr_register_cleanup(cont, *out, apr_file_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_create_namedpipe(const char *filename, ap_fileperms_t perm, ap_pool_t *cont) +apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) { /* Not yet implemented, interface not suitable */ return APR_ENOTIMPL; @@ -146,7 +146,7 @@ ap_status_t ap_create_namedpipe(const char *filename, ap_fileperms_t perm, ap_po -ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) +apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) { if (thepipe->pipe == 1) { thepipe->timeout = timeout; diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 234689aaa..5bf040ac3 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -62,7 +62,7 @@ #include <os2.h> #include <malloc.h> -ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) +apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *nbytes) { ULONG rc = 0; ULONG bytesread; @@ -77,10 +77,10 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) ULONG blocksize; ULONG size = *nbytes; - ap_lock(thefile->mutex); + apr_lock(thefile->mutex); if (thefile->direction == 1) { - ap_flush(thefile); + apr_flush(thefile); thefile->bufpos = 0; thefile->direction = 0; thefile->dataRead = 0; @@ -106,7 +106,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) } *nbytes = rc == 0 ? pos - (char *)buf : 0; - ap_unlock(thefile->mutex); + apr_unlock(thefile->mutex); return APR_OS2_STATUS(rc); } else { if (thefile->pipe) @@ -138,7 +138,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) -ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) +apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes) { ULONG rc = 0; ULONG byteswritten; @@ -153,7 +153,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) int blocksize; int size = *nbytes; - ap_lock(thefile->mutex); + apr_lock(thefile->mutex); if ( thefile->direction == 0 ) { // Position file pointer for writing at the offset we are logically reading from @@ -166,7 +166,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) while (rc == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) // write buffer is full - rc = ap_flush(thefile); + rc = apr_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); @@ -175,7 +175,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) size -= blocksize; } - ap_unlock(thefile->mutex); + apr_unlock(thefile->mutex); return APR_OS2_STATUS(rc); } else { rc = DosWrite(thefile->filedes, buf, *nbytes, &byteswritten); @@ -194,7 +194,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) #ifdef HAVE_WRITEV -ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, ap_size_t nvec, ap_ssize_t *nbytes) +apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_ssize_t *nbytes) { int bytes; if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { @@ -210,7 +210,7 @@ ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, ap_size_t nve -ap_status_t ap_putc(char ch, ap_file_t *thefile) +apr_status_t apr_putc(char ch, apr_file_t *thefile) { ULONG rc; ULONG byteswritten; @@ -230,15 +230,15 @@ ap_status_t ap_putc(char ch, ap_file_t *thefile) -ap_status_t ap_ungetc(char ch, ap_file_t *thefile) +apr_status_t apr_ungetc(char ch, apr_file_t *thefile) { - ap_off_t offset = -1; - return ap_seek(thefile, APR_CUR, &offset); + apr_off_t offset = -1; + return apr_seek(thefile, APR_CUR, &offset); } -ap_status_t ap_getc(char *ch, ap_file_t *thefile) +apr_status_t apr_getc(char *ch, apr_file_t *thefile) { ULONG rc; int bytesread; @@ -248,7 +248,7 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) } bytesread = 1; - rc = ap_read(thefile, ch, &bytesread); + rc = apr_read(thefile, ch, &bytesread); if (rc) { return rc; @@ -264,17 +264,17 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) -ap_status_t ap_puts(const char *str, ap_file_t *thefile) +apr_status_t apr_puts(const char *str, apr_file_t *thefile) { - ap_ssize_t len; + apr_ssize_t len; len = strlen(str); - return ap_write(thefile, str, &len); + return apr_write(thefile, str, &len); } -ap_status_t ap_flush(ap_file_t *thefile) +apr_status_t apr_flush(apr_file_t *thefile) { if (thefile->buffered) { ULONG written = 0; @@ -299,15 +299,15 @@ ap_status_t ap_flush(ap_file_t *thefile) -ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) +apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) { ssize_t readlen; - ap_status_t rv = APR_SUCCESS; + apr_status_t rv = APR_SUCCESS; int i; for (i = 0; i < len-1; i++) { readlen = 1; - rv = ap_read(thefile, str+i, &readlen); + rv = apr_read(thefile, str+i, &readlen); if (readlen != 1) { rv = APR_EOF; @@ -325,7 +325,7 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) -APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) +APR_EXPORT(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) { int cc; va_list ap; @@ -337,8 +337,8 @@ APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) return 0; } va_start(ap, format); - len = ap_vsnprintf(buf, HUGE_STRING_LEN, format, ap); - cc = ap_puts(buf, fptr); + len = apr_vsnprintf(buf, HUGE_STRING_LEN, format, ap); + cc = apr_puts(buf, fptr); va_end(ap); free(buf); return (cc == APR_SUCCESS) ? len : -1; @@ -346,7 +346,7 @@ APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) -ap_status_t ap_file_check_read(ap_file_t *fd) +apr_status_t ap_file_check_read(apr_file_t *fd) { int rc; diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index e303cf41c..948f423f6 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -63,13 +63,13 @@ -static ap_status_t setptr(ap_file_t *thefile, unsigned long pos ) +static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) { long newbufpos; ULONG rc; if (thefile->direction == 1) { - ap_flush(thefile); + apr_flush(thefile); thefile->bufpos = thefile->direction = thefile->dataRead = 0; } @@ -89,7 +89,7 @@ static ap_status_t setptr(ap_file_t *thefile, unsigned long pos ) -ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) +apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) { if (!thefile->isopen) { return APR_EBADF; @@ -97,7 +97,7 @@ ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) if (thefile->buffered) { int rc = EINVAL; - ap_finfo_t finfo; + apr_finfo_t finfo; switch (where) { case APR_SET: @@ -109,7 +109,7 @@ ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) break; case APR_END: - rc = ap_getfileinfo(&finfo, thefile); + rc = apr_getfileinfo(&finfo, thefile); if (rc == APR_SUCCESS) rc = setptr(thefile, finfo.size - *offset); break; |