aboutsummaryrefslogtreecommitdiff
path: root/file_io/os2/readwrite.c
diff options
context:
space:
mode:
authorDoug MacEachern <dougm@apache.org>2001-02-08 07:45:23 +0000
committerDoug MacEachern <dougm@apache.org>2001-02-08 07:45:23 +0000
commitbc1b73cb6002c158ead8d736f25eb70d5124ecda (patch)
tree136752321dd3e22c22463c9ab35a700ab0507729 /file_io/os2/readwrite.c
parent2d3db4e26d42b1fd65bb65bc17f247b0c78a25f6 (diff)
downloadapr-bc1b73cb6002c158ead8d736f25eb70d5124ecda.tar.gz
apr-bc1b73cb6002c158ead8d736f25eb70d5124ecda.zip
renaming various functions for consistency sake
see: http://apr.apache.org/~dougm/apr_rename.pl PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61194 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io/os2/readwrite.c')
-rw-r--r--file_io/os2/readwrite.c42
1 files changed, 21 insertions, 21 deletions
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;