You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@hyperreal.org on 1999/07/28 20:11:04 UTC
cvs commit: apache-apr/apr/locks/unix locks.c
rbb 99/07/28 11:11:03
Modified: apr configure.in
apr/file_io/unix open.c pipe.c readwrite.c seek.c
apr/locks/unix locks.c
Log:
More Doc updates. Slowly but surely working my way through all the dirs to get everything documented well.
Revision Changes Path
1.32 +1 -1 apache-apr/apr/configure.in
Index: configure.in
===================================================================
RCS file: /home/cvs/apache-apr/apr/configure.in,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- configure.in 1999/07/27 17:58:27 1.31
+++ configure.in 1999/07/28 18:10:56 1.32
@@ -184,7 +184,7 @@
dnl Checks for library functions.
AC_CHECK_FUNCS(strcasecmp stricmp poll setsid)
-AC_CHECK_FUNCS(sigaction)
+AC_CHECK_FUNCS(sigaction writev)
dnl Start building stuff from our information
AC_SUBST(LDLIBS)
1.32 +3 -2 apache-apr/apr/file_io/unix/open.c
Index: open.c
===================================================================
RCS file: /home/cvs/apache-apr/apr/file_io/unix/open.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- open.c 1999/07/27 19:26:14 1.31
+++ open.c 1999/07/28 18:10:57 1.32
@@ -201,10 +201,11 @@
}
/* ***APRDOC********************************************************
- * ap_status_t ap_get_os_file(ap_file_t *, ap_os_file_t *)
+ * ap_status_t ap_put_os_file(ap_context_t *, ap_file_t *, ap_os_file_t *)
* convert the file from os specific type to apr type.
- * arg 1) The os specific file to convert
+ * arg 1) The context to use if it is needed.
* arg 2) The apr file we are converting to.
+ * arg 3) The os specific file to convert
*/
ap_status_t ap_put_os_file(ap_context_t *cont, struct file_t **file,
ap_os_file_t *thefile)
1.12 +19 -3 apache-apr/apr/file_io/unix/pipe.c
Index: pipe.c
===================================================================
RCS file: /home/cvs/apache-apr/apr/file_io/unix/pipe.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- pipe.c 1999/06/02 18:44:33 1.11
+++ pipe.c 1999/07/28 18:10:58 1.12
@@ -63,6 +63,13 @@
#include <sys/types.h>
#include <sys/stat.h>
+/* ***APRDOC********************************************************
+ * ap_status_t ap_create_pipe(ap_context_t *, ap_file_t **, ap_file_t **)
+ * Create an anonymous pipt.
+ * arg 1) The context to operate on.
+ * arg 2) The file descriptor to use as input to the pipe.
+ * arg 3) The file descriptor to use as output from the pipe.
+ */
ap_status_t ap_create_pipe(ap_context_t *cont, struct file_t **in, struct file_t **out)
{
int filedes[2];
@@ -84,7 +91,17 @@
return APR_SUCCESS;
}
-ap_status_t ap_create_namedpipe(ap_context_t *cont, char *dirpath, ap_fileperms_t perm, char **new)
+/* ***APRDOC********************************************************
+ * ap_status_t ap_create_namedpipe(ap_context_t *, char *, ap_fileperms_t,
+ * char **)
+ * Create a named pipt.
+ * arg 1) The context to operate on.
+ * arg 2) The The directory to create the pipe in.
+ * arg 3) The permissions for the newly created pipe.
+ * arg 4) The name of the new pipe.
+ */
+ap_status_t ap_create_namedpipe(ap_context_t *cont, char *dirpath,
+ ap_fileperms_t perm, char **new)
{
mode_t mode = get_fileperms(perm);
@@ -94,5 +111,4 @@
}
return APR_SUCCESS;
}
-
-
+
1.13 +35 -1 apache-apr/apr/file_io/unix/readwrite.c
Index: readwrite.c
===================================================================
RCS file: /home/cvs/apache-apr/apr/file_io/unix/readwrite.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- readwrite.c 1999/05/26 13:46:55 1.12
+++ readwrite.c 1999/07/28 18:10:58 1.13
@@ -62,6 +62,17 @@
#include <unistd.h>
#include <sys/uio.h>
+/* ***APRDOC********************************************************
+ * ap_status_t ap_read(ap_file_t *, void *, ap_ssize_t *)
+ * Read data from the specified file.
+ * arg 1) The file descriptor to read from.
+ * arg 2) The buffer to store the data to.
+ * arg 3) The number of bytes to read.
+ * NOTE: ap_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.
+ */
ap_status_t ap_read(const struct file_t *thefile, void *buf, ap_ssize_t *nbytes)
{
ap_ssize_t rv;
@@ -77,6 +88,17 @@
return APR_SUCCESS;
}
+/* ***APRDOC********************************************************
+ * ap_status_t ap_write(ap_file_t *, void *, ap_ssize_t *)
+ * Write data to the specified file.
+ * arg 1) The file descriptor to write to.
+ * arg 2) The buffer which contains the data.
+ * arg 3) The number of bytes to write.
+ * NOTE: ap_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.
+ */
ap_status_t ap_write(struct file_t *thefile, void *buf, ap_ssize_t *nbytes)
{
ap_size_t rv;
@@ -101,6 +123,18 @@
return APR_SUCCESS;
}
+/* ***APRDOC********************************************************
+ * ap_status_t ap_writev(ap_file_t *, ap_iovec_t *, ap_ssize_t *)
+ * Write data from ap_iovec array to the specified file.
+ * arg 1) The file descriptor to write to.
+ * arg 2) The array from which to get the data to write to the file.
+ * arg 3) The number of elements in the ap_iovec array. This must be
+ * smaller than AP_MAX_IOVEC_SIZE. If it isn't, the function will
+ * fail with APR_EINVAL.
+ * NOTE: The third arguement is updated with the number of bytes actually
+ * written on function exit.
+ */
+#ifdef HAVE_WRITEV
ap_status_t ap_writev(struct file_t *thefile, const struct iovec_t *vec, ap_ssize_t *iocnt)
{
int bytes;
@@ -113,5 +147,5 @@
return APR_SUCCESS;
}
}
-
+#endif
1.7 +12 -0 apache-apr/apr/file_io/unix/seek.c
Index: seek.c
===================================================================
RCS file: /home/cvs/apache-apr/apr/file_io/unix/seek.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- seek.c 1999/05/24 17:28:16 1.6
+++ seek.c 1999/07/28 18:10:58 1.7
@@ -58,6 +58,18 @@
#include <errno.h>
#include <string.h>
+/* ***APRDOC********************************************************
+ * ap_status_t ap_seek(ap_file_t *, ap_seek_where_t, ap_off_t *)
+ * Move the read/write file offset to a specified byte within a file.
+ * arg 1) The file descriptor
+ * arg 2) How to move the pointer, one of:
+ * APR_SET -- set the offset to offset
+ * APR_CUR -- add the offset to the current position
+ * APR_END -- add the offset to the current file size
+ * arg 3) The offset to move the pointer to.
+ * NOTE: The third argument is modified to be the offset the pointer
+ * was actually moved to.
+ */
ap_status_t ap_seek(struct file_t *thefile, ap_seek_where_t where, ap_off_t *offset)
{
ap_off_t rv;
1.13 +61 -0 apache-apr/apr/locks/unix/locks.c
Index: locks.c
===================================================================
RCS file: /home/cvs/apache-apr/apr/locks/unix/locks.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- locks.c 1999/07/06 17:01:39 1.12
+++ locks.c 1999/07/28 18:11:02 1.13
@@ -58,6 +58,23 @@
#include "locks.h"
#include <string.h>
+/* ***APRDOC********************************************************
+ * ap_status_t ap_create_lock(ap_context_t *, ap_locktype_e, char *,
+ * ap_lock_t **)
+ * Create a new instance of a lock structure.
+ * arg 1) The context to operate on.
+ * arg 2) The type of lock to create, one of:
+ * APR_CROSS_PROCESS -- lock processes from the protected area.
+ * APR_INTRAPROCESS -- lock threads from the protected area.
+ * APR_LOCKALL -- lock processes and threads from the
+ * protected area.
+ * arg 3) 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.
+ * arg 4) The newly created lock structure.
+ * NOTE: APR_CROSS_PROCESS may lock both processes and threads, but it is
+ * only garaunteed to lock processes.
+ */
ap_status_t ap_create_lock(ap_context_t *cont, ap_locktype_e type, char *fname, struct lock_t **lock)
{
struct lock_t *new;
@@ -83,6 +100,11 @@
return APR_SUCCESS;
}
+/* ***APRDOC********************************************************
+ * ap_status_t ap_lock(ap_lock_t *)
+ * Lock a protected region.
+ * arg 1) The lock to set.
+ */
ap_status_t ap_lock(struct lock_t *lock)
{
ap_status_t stat;
@@ -99,6 +121,11 @@
return APR_SUCCESS;
}
+/* ***APRDOC********************************************************
+ * ap_status_t ap_unlock(ap_lock_t *)
+ * Unlock a protected region.
+ * arg 1) The lock to reset.
+ */
ap_status_t ap_unlock(struct lock_t *lock)
{
ap_status_t stat;
@@ -116,6 +143,13 @@
return APR_SUCCESS;
}
+/* ***APRDOC********************************************************
+ * ap_status_t ap_destroy_lock(ap_lock_t *)
+ * Free the memory associated with a lock.
+ * arg 1) The lock to free.
+ * NOTE: If the lock is currently active when it is destroyed, it
+ * will be unlocked first.
+ */
ap_status_t ap_destroy_lock(struct lock_t *lock)
{
ap_status_t stat;
@@ -132,6 +166,20 @@
return APR_SUCCESS;
}
+/* ***APRDOC********************************************************
+ * ap_status_t ap_child_init_lock(ap_context_t *, char *, ap_lock_t **)
+ * Re-open a lock in a child process.
+ * arg 1) The context to operate on.
+ * arg 2) 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 ap_create_lock
+ * arg 1) The newly re-opened lock structure.
+ * NOTE: 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.
+ */
ap_status_t ap_child_init_lock(ap_context_t *cont, char *fname, struct lock_t **lock)
{
ap_status_t stat;
@@ -177,6 +225,12 @@
}
}
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_os_lock(ap_lock_t **, ap_os_lock_t *)
+ * onvert the lock from os specific type to apr type
+ * arg 1) The apr lock to convert.
+ * arg 2) The os specific lock we are converting to.
+ */
ap_status_t ap_get_os_lock(struct lock_t *lock, ap_os_lock_t *oslock)
{
if (lock == NULL) {
@@ -197,6 +251,13 @@
return APR_SUCCESS;
}
+/* ***APRDOC********************************************************
+ * ap_status_t ap_put_os_lock(ap_context_t *, ap_lock_t **, ap_os_lock_t *)
+ * onvert the lock from os specific type to apr type
+ * arg 1) The context to use if it is needed.
+ * arg 2) The apr lock we are converting to.
+ * arg 3) The os specific lock to convert.
+ */
ap_status_t ap_put_os_lock(ap_context_t *cont, struct lock_t **lock,
ap_os_lock_t *thelock)
{