summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dso/unix/dso.c25
-rw-r--r--file_io/unix/dir.c14
-rw-r--r--file_io/unix/open.c18
-rw-r--r--include/apr_dso.h28
-rw-r--r--include/apr_general.h67
-rw-r--r--include/apr_getopt.h19
-rw-r--r--include/apr_lock.h74
-rw-r--r--include/apr_mmap.h23
-rw-r--r--include/apr_network_io.h330
-rw-r--r--include/apr_portable.h143
-rw-r--r--include/apr_shmem.h79
-rw-r--r--include/apr_thread_proc.h330
-rw-r--r--include/apr_time.h33
-rw-r--r--include/arch/unix/mmap.c14
-rw-r--r--locks/unix/locks.c83
-rw-r--r--misc/unix/getopt.c19
-rw-r--r--misc/unix/otherchild.c35
-rw-r--r--misc/unix/start.c61
-rw-r--r--misc/win32/getopt.c19
-rw-r--r--mmap/unix/common.c7
-rw-r--r--mmap/unix/mmap.c14
-rw-r--r--network_io/unix/poll.c82
-rw-r--r--network_io/unix/sendrecv.c47
-rw-r--r--network_io/unix/sockaddr.c72
-rw-r--r--network_io/unix/sockets.c85
-rw-r--r--network_io/unix/sockopt.c32
-rw-r--r--network_io/win32/sockaddr.c70
-rw-r--r--shmem/unix/shmem.c71
-rw-r--r--threadproc/unix/proc.c145
-rw-r--r--threadproc/unix/procsup.c22
-rw-r--r--threadproc/unix/signals.c6
-rw-r--r--threadproc/unix/thread.c76
-rw-r--r--threadproc/unix/threadpriv.c59
-rw-r--r--time/unix/time.c55
34 files changed, 1122 insertions, 1135 deletions
diff --git a/dso/unix/dso.c b/dso/unix/dso.c
index 169f046f5..35072a66d 100644
--- a/dso/unix/dso.c
+++ b/dso/unix/dso.c
@@ -54,22 +54,10 @@
#include "dso.h"
-/* ***APRDOC********************************************************
- * ap_status_t ap_dso_init(void)
- * Initialize the underlying DSO library.
- */
ap_status_t ap_dso_init(void){
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path,
- * ap_context_t *ctx)
- * Load a DSO library.
- * arg 1) Location to store new handle for the DSO.
- * arg 2) Path to the DSO library
- * arg 3) Context to use.
- */
ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path,
ap_context_t *ctx)
{
@@ -91,11 +79,6 @@ ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path,
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_dso_unload(ap_dso_handle_t *handle)
- * Close a DSO library.
- * arg 1) handle to close.
- */
ap_status_t ap_dso_unload(ap_dso_handle_t *handle)
{
#if defined(HPUX) || defined(HPUX10) || defined(HPUX11)
@@ -109,14 +92,6 @@ ap_status_t ap_dso_unload(ap_dso_handle_t *handle)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle
- * const char *symname)
- * Load a symbol from a DSO handle.
- * arg 1) Location to store the loaded symbol
- * arg 2) handle to load from.
- * arg 3) Name of the symbol to load.
- */
ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym,
ap_dso_handle_t *handle,
const char *symname)
diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c
index bc9d1a9e5..abc50981c 100644
--- a/file_io/unix/dir.c
+++ b/file_io/unix/dir.c
@@ -265,12 +265,6 @@ ap_status_t ap_get_dir_filename(char **new, ap_dir_t *thedir)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir)
- * convert the dir from apr type to os specific type.
- * arg 1) The os specific dir we are converting to
- * arg 2) The apr dir to convert.
- */
ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir)
{
if (dir == NULL) {
@@ -280,14 +274,6 @@ ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_put_os_dir(ap_dir_t **dir, ap_os_dir_t *thedir,
- * ap_context_t *cont)
- * convert the dir from os specific type to apr type.
- * arg 1) The apr dir we are converting to.
- * arg 2) The os specific dir to convert
- * arg 3) The context to use when creating to apr directory.
- */
ap_status_t ap_put_os_dir(ap_dir_t **dir, ap_os_dir_t *thedir,
ap_context_t *cont)
{
diff --git a/file_io/unix/open.c b/file_io/unix/open.c
index 59e816ab1..54f106477 100644
--- a/file_io/unix/open.c
+++ b/file_io/unix/open.c
@@ -168,14 +168,6 @@ ap_status_t ap_remove_file(char *path, ap_context_t *cont)
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file)
- * convert the file from apr type to os specific type.
- * arg 1) The os specific file we are converting to
- * arg 2) The apr file to convert.
- * NOTE: On Unix, it is only possible to get a file descriptor from
- * an apr file type.
- */
ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file)
{
if (thefile == NULL)
@@ -189,16 +181,6 @@ ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile,
- * ap_context_t *cont)
- * convert the file from os specific type to apr type.
- * arg 1) The apr file we are converting to.
- * arg 2) The os specific file to convert
- * arg 3) The context to use if it is needed.
- * NOTE: On Unix, it is only possible to put a file descriptor into
- * an apr file type.
- */
ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile,
ap_context_t *cont)
{
diff --git a/include/apr_dso.h b/include/apr_dso.h
index fa5aa947c..512ddf012 100644
--- a/include/apr_dso.h
+++ b/include/apr_dso.h
@@ -65,10 +65,38 @@ extern "C" {
typedef struct ap_dso_handle_t ap_dso_handle_t;
typedef void * ap_dso_handle_sym_t;
+/* ***APRDOC********************************************************
+ * ap_status_t ap_dso_init(void)
+ * Initialize the underlying DSO library.
+ */
ap_status_t ap_dso_init(void);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path,
+ * ap_context_t *ctx)
+ * Load a DSO library.
+ * arg 1) Location to store new handle for the DSO.
+ * arg 2) Path to the DSO library
+ * arg 3) Context to use.
+ */
ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path,
ap_context_t *ctx);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_dso_unload(ap_dso_handle_t *handle)
+ * Close a DSO library.
+ * arg 1) handle to close.
+ */
ap_status_t ap_dso_unload(ap_dso_handle_t *handle);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle
+ * const char *symname)
+ * Load a symbol from a DSO handle.
+ * arg 1) Location to store the loaded symbol
+ * arg 2) handle to load from.
+ * arg 3) Name of the symbol to load.
+ */
ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle,
const char *symname);
#ifdef __cplusplus
diff --git a/include/apr_general.h b/include/apr_general.h
index 1fc9c214d..1cbcd6af5 100644
--- a/include/apr_general.h
+++ b/include/apr_general.h
@@ -215,15 +215,82 @@ typedef int ap_signum_t;
/* Context functions */
+/* ***APRDOC********************************************************
+ * ap_status_t ap_create_context(ap_context_t **newcont, ap_context_t *cont)
+ * Create a new context.
+ * arg 1) The context we have just created.
+ * arg 2) The parent context. If this is NULL, the new context is a root
+ * context. If it is non-NULL, the new context will inherit all
+ * of it's parent context's attributes, except the ap_context_t will be a
+ * sub-pool.
+ */
ap_status_t ap_create_context(ap_context_t **newcont, ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_destroy_context(ap_context_t *cont)
+ * Free the context and all of it's child contexts'.
+ * arg 1) The context to free.
+ */
ap_status_t ap_destroy_context(struct ap_context_t *cont);
ap_status_t ap_exit(ap_context_t *);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_userdata(void *data, char *key,
+ * ap_status_t (*cleanup) (void *),
+ * ap_context_t *cont)
+ * Set the data associated with the current context.
+ * arg 1) The user data associated with the context.
+ * arg 2) The key to use for association
+ * arg 3) The cleanup program to use to cleanup the data;
+ * arg 4) The current context.
+ * NOTE: The data to be attached to the context should have the same
+ * life span as the context it is being attached to.
+ *
+ * Users of APR must take EXTREME care when choosing a key to
+ * use for their data. It is possible to accidentally overwrite
+ * 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.
+ */
ap_status_t ap_set_userdata(void *data, char *key,
ap_status_t (*cleanup) (void *),
ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_userdata(void **data, char *key, ap_context_t *cont)
+ * Return the data associated with the current context.
+ * arg 1) The key for the data to retrieve
+ * arg 2) The user data associated with the context.
+ * arg 3) The current context.
+ */
ap_status_t ap_get_userdata(void **, char *key, ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_initialize(void)
+ * Setup any APR internal data structures. This MUST be the first
+ * function called for any APR program.
+ */
ap_status_t ap_initialize(void);
+
+/* ***APRDOC*******************************************************
+ * void ap_terminate(void)
+ * Tear down any APR internal data structures which aren't
+ * torn down automatically. An APR program must call this
+ * function at termination once it has stopped using APR
+ * services.
+ */
void ap_terminate(void);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_abort(int (*apr_abort)(int retcode), ap_context_t *cont)
+ * Set the APR_ABORT function.
+ * NOTE: This is in for backwards compatability. If the program using
+ * APR wants APR to exit on a memory allocation error, then this
+ * function should be called to set the function to use in order
+ * to actually exit the program. If this function is not called,
+ * then APR will return an error and expect the calling program to
+ * deal with the error accordingly.
+ */
ap_status_t ap_set_abort(int (*apr_abort)(int retcode), ap_context_t *cont);
#ifdef __cplusplus
diff --git a/include/apr_getopt.h b/include/apr_getopt.h
index 97e12bfd8..b0bf7eec9 100644
--- a/include/apr_getopt.h
+++ b/include/apr_getopt.h
@@ -63,6 +63,25 @@ API_VAR_IMPORT int
API_VAR_IMPORT char *
ap_optarg; /* argument associated with option */
+/* ***APRDOC********************************************************
+ * ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv,
+ * const char *ostr, ap_int32_t *rv, ap_context_t *cont)
+ * Parse the command line options passed to the program.
+ * arg 1) The number of arguments passed to ap_getopt to parse
+ * arg 2) The array of command line options to parse
+ * arg 3) A string of characters that are acceptable options to the program.
+ * characters followed by ":" are required to have an option
+ * associated
+ * arg 4) The next option found. There are four potential values for
+ * this variable on exit. They are:
+ * APR_EOF -- No more options to parse
+ * APR_BADCH -- Found a bad option character
+ * APR_BADARG -- Missing parameter for the found option
+ * Other -- The next option found.
+ * arg 5) The context to operate on.
+ * NOTE: Arguments 2 and 3 are most commonly argc and argv from
+ * main(argc, argv)
+ */
ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr,
ap_int32_t *rv, ap_context_t *cont);
diff --git a/include/apr_lock.h b/include/apr_lock.h
index bf6372232..11ac4c811 100644
--- a/include/apr_lock.h
+++ b/include/apr_lock.h
@@ -69,16 +69,90 @@ typedef enum {APR_MUTEX, APR_READWRITE} ap_locktype_e;
typedef struct ap_lock_t ap_lock_t;
/* Function definitions */
+/* ***APRDOC********************************************************
+ * ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type,
+ * ap_lockscope_e scope, char *fname,
+ * ap_context_t *cont)
+ * Create a new instance of a lock structure.
+ * arg 1) The newly created lock structure.
+ * arg 2) The type of lock to create, one of:
+ * APR_MUTEX
+ * APR_READWRITE
+ * arg 3) The scope of the 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 4) 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 5) The context to operate on.
+ * NOTE: APR_CROSS_PROCESS may lock both processes and threads, but it is
+ * only guaranteed to lock processes.
+ */
ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type,
ap_lockscope_e scope, char *fname,
ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_lock(ap_lock_t *lock)
+ * Lock a protected region.
+ * arg 1) The lock to set.
+ */
ap_status_t ap_lock(ap_lock_t *lock);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_unlock(ap_lock_t *lock)
+ * Unlock a protected region.
+ * arg 1) The lock to reset.
+ */
ap_status_t ap_unlock(ap_lock_t *lock);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_destroy_lock(ap_lock_t *lock)
+ * 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(ap_lock_t *lock);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_child_init_lock(ap_lock_t **lock, char *fname,
+ * ap_context_t *cont)
+ * Re-open a lock in a child process.
+ * arg 1) The newly re-opened lock structure.
+ * 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 3) The context to operate on.
+ * 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_lock_t **lock, char *fname,
ap_context_t *cont);
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_lockdata(ap_lock_t *lock, char *key, void *data)
+ * Return the context associated with the current lock.
+ * arg 1) The currently open lock.
+ * arg 2) The key to use when retreiving data associated with this lock
+ * arg 3) The user data associated with the lock.
+ */
ap_status_t ap_get_lockdata(ap_lock_t *lock, char *key, void *data);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, char *key,
+ ap_status_t (*cleanup) (void *))
+ * Return the context associated with the current lock.
+ * arg 1) The currently open lock.
+ * arg 2) The user data to associate with the lock.
+ * arg 3) The key to use when associating data with this lock
+ * arg 4) The cleanup to use when the lock is destroyed.
+ */
ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, char *key,
ap_status_t (*cleanup) (void *));
diff --git a/include/apr_mmap.h b/include/apr_mmap.h
index 76aff543c..06cef140c 100644
--- a/include/apr_mmap.h
+++ b/include/apr_mmap.h
@@ -69,13 +69,32 @@ typedef struct ap_mmap_t ap_mmap_t;
/* Function definitions */
-/* creation */
+/* ***APRDOC********************************************************
+ * ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset)
+ * Create a new mmap'ed file out of an existing APR file.
+ * arg 1) The newly created mmap'ed file.
+ * arg 2) The file turn into an mmap.
+ * arg 3) The offset into the file to start the data pointer at.
+ * arg 4) The size of the file
+ * arg 5) The context to use when creating the mmap.
+ */
ap_status_t ap_mmap_create(ap_mmap_t ** newmmap, ap_file_t *file, ap_off_t offset,
ap_size_t size, ap_context_t *cntxt);
-/* destruction */
+/* ***APRDOC********************************************************
+ * ap_status_t ap_mmap_delete(ap_mmap_t *mmap)
+ * Remove a mmap'ed.
+ * arg 1) The mmap'ed file.
+ */
ap_status_t ap_mmap_delete(ap_mmap_t *mmap);
+/* ***APRDOC********************************************************
+ * ap_status_t ap_mmap_offset(void **addr, ap_mmap_t *mmap, ap_offset_t offset)
+ * Move the pointer into the mmap'ed file to the specified offset.
+ * arg 1) The pointer to the offset specified.
+ * arg 2) The mmap'ed file.
+ * arg 3) The offset to move to.
+ */
ap_status_t ap_mmap_offset(void **addr, ap_mmap_t *mmap, ap_off_t offset);
#ifdef __cplusplus
diff --git a/include/apr_network_io.h b/include/apr_network_io.h
index 7d0799a11..9e32eb7b2 100644
--- a/include/apr_network_io.h
+++ b/include/apr_network_io.h
@@ -137,56 +137,386 @@ struct ap_hdtr_t {
/* function definitions */
+/* ***APRDOC********************************************************
+ * ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_context_t *cont)
+ * Create a socket for tcp communication.
+ * arg 1) The new socket that has been setup.
+ * arg 2) The context to use
+ */
ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how)
+ * Shutdown either reading, writing, or both sides of a tcp socket.
+ * arg 1) The socket to close
+ * arg 2) How to shutdown the socket. One of:
+ * APR_SHUTDOWN_READ -- no longer allow read requests
+ * APR_SHUTDOWN_WRITE -- no longer allow write requests
+ * APR_SHUTDOWN_READWRITE -- no longer allow read or write requests
+ * NOTE: This does not actually close the socket descriptor, it just
+ * controls which calls are still valid on the socket.
+ */
ap_status_t ap_shutdown(ap_socket_t *ithesocket, ap_shutdown_how_e how);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_close_socket(ap_socket_t *thesocket)
+ * Close a tcp socket.
+ * arg 1) The socket to close
+ */
ap_status_t ap_close_socket(ap_socket_t *thesocket);
+/* ***APRDOC********************************************************
+ * ap_status_t ap_bind(ap_socket_t *sock)
+ * Bind the socket to it's assocaited port
+ * arg 1) The socket to bind
+ * NOTE: This is where we will find out if there is any other process
+ * using the selected port.
+ */
ap_status_t ap_bind(ap_socket_t *sock);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog)
+ * Listen to a bound socketi for connections.
+ * arg 1) The socket to listen on
+ * arg 2) The number of outstanding connections allowed in the sockets
+ * listen queue. If this value is less than zero, the listen
+ * queue size is set to zero.
+ */
ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock,
+ ap_context_t *connection_context)
+ * Accept a new connection request
+ * arg 1) A copy of the socket that is connected to the socket that
+ * made the connection request. This is the socket which should
+ * be used for all future communication.
+ * arg 2) The socket we are listening on.
+ * arg 3) The context for the new socket.
+ */
ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock,
ap_context_t *connection_context);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_connect(ap_socket_t *sock, char *hostname)
+ * Issue a connection request to a socket either on the same machine
+ * or a different one.
+ * arg 1) The socket we wish to use for our side of the connection
+ * arg 2) The hostname of the machine we wish to connect to. If NULL,
+ * APR assumes that the sockaddr_in in the apr_socket is completely
+ * filled out.
+ */
ap_status_t ap_connect(ap_socket_t *sock, char *hostname);
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock)
+ * Get name of the machine we are currently connected to.
+ * arg 1) A buffer to store the hostname in.
+ * arg 2) The socket to examine.
+ */
ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_context_t *cont)
+ * Get name of the current machine
+ * arg 1) A buffer to store the hostname in.
+ * arg 2) The maximum length of the hostname that can be stored in the
+ * buffer provided.
+ * arg 3) The context to use.
+ */
ap_status_t ap_gethostname(char *buf, int len, ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *sock)
+ * Return the context associated with the current socket.
+ * arg 1) The currently open socket.
+ * arg 2) The user data associated with the socket.
+ */
ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *sock);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, char *key,
+ ap_status_t (*cleanup) (void *))
+ * Set the context associated with the current socket.
+ * arg 1) The currently open socket.
+ * arg 2) The user data to associate with the socket.
+ * arg 3) The key to associate with the data.
+ * arg 4) The cleanup to call when the socket is destroyed.
+ */
ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, char *key,
ap_status_t (*cleanup) (void*));
+/* ***APRDOC********************************************************
+ * ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len)
+ * Send data over a network.
+ * arg 1) The socket to send the data over.
+ * arg 2) The buffer which contains the data to be sent.
+ * arg 3) The maximum number of bytes to send
+ * NOTE: This functions acts like a blocking write by default. To change
+ * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option.
+ * The number of bytes actually sent is stored in argument 3.
+ */
ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec,
+ ap_int32_t nvec, ap_int32_t *len)
+ * Send multiple packets of data over a network.
+ * arg 1) The socket to send the data over.
+ * arg 2) The array of iovec structs containing the data to send
+ * arg 3) The number of iovec structs in the array
+ * arg 4) Receives the number of bytes actually written
+ * NOTE: This functions acts like a blocking write by default. To change
+ * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option.
+ * The number of bytes actually sent is stored in argument 3.
+ */
ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec,
ap_int32_t nvec, ap_int32_t *len);
+
#if APR_HAS_SENDFILE
+/* ***APRDOC********************************************************
+ * ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, ap_hdtr_t *hdtr,
+ * ap_off_t *offset, ap_size_t *len, ap_int32_t flags)
+ * Send a file from an open file descriptor to a socket, along with
+ * optional headers and trailers
+ * arg 1) The socket to which we're writing
+ * arg 2) The open file from which to read
+ * arg 3) A structure containing the headers and trailers to send
+ * arg 4) Offset into the file where we should begin writing
+ * arg 5) Number of bytes to send
+ * arg 6) OS-specific flags to pass to sendfile()
+ * NOTE: This functions acts like a blocking write by default. To change
+ * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option.
+ * The number of bytes actually sent is stored in argument 5.
+ */
ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, ap_hdtr_t *hdtr,
ap_off_t *offset, ap_size_t *len, ap_int32_t flags);
#endif
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len)
+ * Read data from a network.
+ * arg 1) The socket to read the data from.
+ * arg 2) The buffer to store the data in.
+ * arg 3) The maximum number of bytes to read
+ * NOTE: This functions acts like a blocking write by default. To change
+ * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option.
+ * The number of bytes actually sent is stored in argument 3.
+ */
ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len);
+/* ***APRDOC********************************************************
+ * ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on)
+ * Setup socket options for the specified socket
+ * arg 1) The socket to set up.
+ * arg 2) The option we would like to configure. One of:
+ * APR_SO_DEBUG -- turn on debugging information
+ * APR_SO_KEEPALIVE -- keep connections active
+ * APR_SO_LINGER -- lingers on close if data is present
+ * APR_SO_NONBLOCK -- Turns blocking on/off for socket
+ * APR_SO_REUSEADDR -- The rules used in validating addresses
+ * supplied to bind should allow reuse
+ * of local addresses.
+ * APR_SO_TIMEOUT -- Set the timeout value in seconds.
+ * values < 0 mean wait forever. 0 means
+ * don't wait at all.
+ * APR_SO_SNDBUF -- Set the SendBufferSize
+ * arg 3) Are we turning the option on or off.
+ */
ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on);
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port)
+ * Assocaite a local port with a socket.
+ * arg 1) The socket to set
+ * arg 2) The local port this socket will be dealing with.
+ * NOTE: This does not bind the two together, it is just telling apr
+ * that this socket is going to use this port if possible. If
+ * the port is already used, we won't find out about it here.
+ */
ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port)
+ * Assocaite a remote port with a socket.
+ * arg 1) The socket to enquire about.
+ * arg 2) The local port this socket will be dealing with.
+ * NOTE: This does not make a connection to the remote port, it is just
+ * telling apr which port ap_connect() should attempt to connect to.
+ */
ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock)
+ * Return the local port with a socket.
+ * arg 1) The local port this socket is associated with.
+ * arg 2) The socket to enquire about.
+ */
ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock)
+ * Return the remote port associated with a socket.
+ * arg 1) The remote port this socket is associated with.
+ * arg 2) The socket to enquire about.
+ */
ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, cont char *addr)
+ * Assocaite a local socket addr with an apr socket.
+ * arg 1) The socket to use
+ * arg 2) The IP address to attach to the socket.
+ * Use APR_ANYADDR to use any IP addr on the machine.
+ * NOTE: This does not bind the two together, it is just telling apr
+ * that this socket is going to use this address if possible.
+ */
ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, cont char *addr)
+ * Assocaite a remote socket addr with an apr socket.
+ * arg 1) The socket to use
+ * arg 2) The IP address to attach to the socket.
+ * NOTE: This does not make a connection to the remote address, it is just
+ * telling apr which address ap_connect() should attempt to connect to.
+ */
ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock)
+ * Return the local IP address associated with an apr socket.
+ * arg 1) The local IP address associated with the socket.
+ * arg 2) The socket to use
+ */
ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock)
+ * Return the remote IP address associated with an apr socket.
+ * arg 1) The remote IP address associated with the socket.
+ * arg 2) The socket to use
+ */
ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock);
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_local_name(struct sockaddr_in **name,
+ * const ap_socket_t *sock)
+ * Return the local socket name as a BSD style struct sockaddr_in.
+ * arg 1) The local name associated with the socket.
+ * arg 2) The socket to use
+ */
ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_remote_name(struct sockaddr_in **name,
+ * const ap_socket_t *sock)
+ * Return the remote socket name as a BSD style struct sockaddr_in.
+ * arg 1) The remote name associated with the socket.
+ * arg 2) The socket to use
+ */
ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *sock);
+/* ***APRDOC********************************************************
+ * ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num,
+ * ap_context_t *cont)
+ * Setup the memory required for poll to operate properly.
+ * arg 1) The poll structure to be used.
+ * arg 2) The number of socket descriptors to be polled.
+ * arg 3) The context to operate on.
+ */
ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num,
ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds,
+ * ap_int32_t timeout)
+ * Poll the sockets in the poll structure. This is a blocking call,
+ * and it will not return until either a socket has been signalled, or
+ * the timeout has expired.
+ * arg 1) The poll structure we will be using.
+ * arg 2) The number of sockets we are polling.
+ * arg 3) The amount of time in seconds to wait. This is a maximum, not
+ * a minimum. If a socket is signalled, we will wake up before this
+ * time. A negative number means wait until a socket is signalled.
+ * NOTE: The number of sockets signalled is returned in the second argument.
+ */
ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, ap_int32_t timeout);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock,
+ * ap_int16_t event)
+ * Add a socket to the poll structure.
+ * arg 1) The poll structure we will be using.
+ * arg 2) The socket to add to the current poll structure.
+ * arg 3) The events to look for when we do the poll. One of:
+ * APR_POLLIN -- signal if read will not block
+ * APR_POLLPRI -- signal if prioirty data is availble to be read
+ * APR_POLLOUT -- signal if write will not block
+ */
ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, ap_socket_t *socket,
ap_int16_t event);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock,
+ * ap_int16_t events)
+ * Add a socket to the poll structure.
+ * arg 1) The poll structure we will be using.
+ * arg 2) The socket to remove from the current poll structure.
+ * arg 3) The events to stop looking for during the poll. One of:
+ * APR_POLLIN -- signal if read will not block
+ * APR_POLLPRI -- signal if prioirty data is availble to be read
+ * APR_POLLOUT -- signal if write will not block
+ */
ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock,
ap_int16_t events);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events)
+ * Remove all sockets from the poll structure.
+ * arg 1) The poll structure we will be using.
+ * arg 2) The events to clear from all sockets. One of:
+ * APR_POLLIN -- signal if read will not block
+ * APR_POLLPRI -- signal if prioirty data is availble to be read
+ * APR_POLLOUT -- signal if write will not block
+ */
ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_revents(ap_int_16_t *event, ap_socket_t *sock,
+ * ap_pollfd_t *aprset)
+ * Get the return events for the specified socket.
+ * arg 1) The returned events for the socket. One of:
+ * APR_POLLIN -- Data is available to be read
+ * APR_POLLPRI -- Prioirty data is availble to be read
+ * APR_POLLOUT -- Write will succeed
+ * APR_POLLERR -- An error occurred on the socket
+ * APR_POLLHUP -- The connection has been terminated
+ * APR_POLLNVAL -- This is an invalid socket to poll on.
+ * Socket not open.
+ * arg 2) The socket we wish to get information about.
+ * arg 3) The poll structure we will be using.
+ */
ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock,
ap_pollfd_t *aprset);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data)
+ * Return the context associated with the current poll.
+ * arg 1) The currently open pollfd.
+ * arg 2) The key to use for retreiving data associated with a poll struct.
+ * arg 3) The user data associated with the pollfd.
+ */
ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char *key,
+ ap_status_t (*cleanup) (void *))
+ * Return the context associated with the current poll.
+ * arg 1) The currently open pollfd.
+ * arg 2) The user data to associate with the pollfd.
+
+ */
ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char *key,
ap_status_t (*cleanup) (void *));
diff --git a/include/apr_portable.h b/include/apr_portable.h
index ea4503e85..a2d7317f3 100644
--- a/include/apr_portable.h
+++ b/include/apr_portable.h
@@ -178,33 +178,176 @@ typedef struct timeval ap_os_imp_time_t;
typedef struct tm ap_os_exp_time_t;
#endif
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file)
+ * convert the file from apr type to os specific type.
+ * arg 1) The os specific file we are converting to
+ * arg 2) The apr file to convert.
+ * NOTE: On Unix, it is only possible to get a file descriptor from
+ * an apr file type.
+ */
ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir)
+ * convert the dir from apr type to os specific type.
+ * arg 1) The os specific dir we are converting to
+ * arg 2) The apr dir to convert.
+ */
ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock)
+ * Convert the socket from an apr type to an OS specific socket
+ * arg 1) The socket to convert.
+ * arg 2) The os specifc equivelant of the apr socket..
+ */
ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock)
+ * onvert the lock from os specific type to apr type
+ * arg 1) The os specific lock we are converting to.
+ * arg 2) The apr lock to convert.
+ */
ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc)
+ * convert the proc from os specific type to apr type.
+ * arg 1) The os specific proc we are converting to
+ * arg 2) The apr proc we are converting
+ */
ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **ostime, ap_exploded_time_t *aprtime)
+ * Get the exploded time in the platforms native format.
+ * arg 1) the native time format
+ * arg 2) the time to convert
+ */
ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **, ap_exploded_time_t *);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **ostime, ap_time_t *aprtime)
+ * Get the imploded time in the platforms native format.
+ * arg 1) the native time format
+ * arg 2) the time to convert
+ */
ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **, ap_time_t *);
#if APR_HAS_THREADS
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_os_thread(ap_thread_t *thethd, ap_os_thread_t *thd)
+ * convert the thread to os specific type from apr type.
+ * arg 1) The apr thread to convert
+ * arg 2) The os specific thread we are converting to
+ */
ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, ap_thread_t *thd);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_os_threadkey(ap_threadkey_t *thekey, ap_os_threadkey_t *key)
+ * convert the thread private memory key to os specific type
+ * from an apr type.
+ * arg 1) The apr handle we are converting from.
+ * arg 2) The os specific handle we are converting to.
+ */
ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key);
#endif
+/* ***APRDOC********************************************************
+ * ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile,
+ * ap_context_t *cont)
+ * convert the file from os specific type to apr type.
+ * arg 1) The apr file we are converting to.
+ * arg 2) The os specific file to convert
+ * arg 3) The context to use if it is needed.
+ * NOTE: On Unix, it is only possible to put a file descriptor into
+ * an apr file type.
+ */
ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile,
ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_put_os_dir(ap_dir_t **dir, ap_os_dir_t *thedir,
+ * ap_context_t *cont)
+ * convert the dir from os specific type to apr type.
+ * arg 1) The apr dir we are converting to.
+ * arg 2) The os specific dir to convert
+ * arg 3) The context to use when creating to apr directory.
+ */
ap_status_t ap_put_os_dir(ap_dir_t **dir, ap_os_dir_t *thedir,
ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_socket_t *thesock,
+ * ap_context_t *cont)
+ * Convert a socket from the os specific type to the apr type
+ * arg 1) The context to use.
+ * arg 2) The socket to convert to.
+ * arg 3) The socket we are converting to an apr type.
+ */
ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock,
ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *,
+ * ap_context_t *cont)
+ * onvert the lock from os specific type to apr type
+ * arg 1) The apr lock we are converting to.
+ * arg 2) The os specific lock to convert.
+ * arg 3) The context to use if it is needed.
+ */
ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *thelock,
ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_put_os_proc(ap_proc_t *proc, ap_os_proc_t *theproc,
+ * ap_context_t *cont)
+ * convert the proc from os specific type to apr type.
+ * arg 1) The apr proc we are converting to.
+ * arg 2) The os specific proc to convert
+ * arg 3) The context to use if it is needed.
+ */
ap_status_t ap_put_os_proc(ap_proc_t **proc, ap_os_proc_t *theproc,
ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_put_os_imp_time(ap_time_t *aprtime, ap_os_imp_time_t **ostime, ap_context_t, *cont)
+ * Put the imploded time in the APR format.
+ * arg 1) the APR time format
+ * arg 2) the time to convert
+ * arg 3) the context to use if necessary
+ */
ap_status_t ap_put_os_imp_time(ap_time_t *, ap_os_imp_time_t **, ap_context_t *);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime, ap_os_exp_time_t **ostime, ap_context_t, *cont)
+ * Put the exploded time in the APR format.
+ * arg 1) the APR time format
+ * arg 2) the time to convert
+ * arg 3) the context to use if necessary
+ */
ap_status_t ap_put_os_exp_time(ap_exploded_time_t *, ap_os_exp_time_t **, ap_context_t *);
#if APR_HAS_THREADS
+/* ***APRDOC********************************************************
+ * ap_status_t ap_put_os_thread(ap_thread_t *thd, ap_os_thread_t *thethd,
+ * ap_context_t *cont)
+ * convert the thread from os specific type to apr type.
+ * arg 1) The apr thread we are converting to.
+ * arg 2) The os specific thread to convert
+ * arg 3) The context to use if it is needed.
+ */
ap_status_t ap_put_os_thread(ap_thread_t **thd, ap_os_thread_t *thethd,
ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_put_os_threadkey(ap_threadkey_t *key, ap_os_threadkey_t *thekey,
+ * ap_context_t *cont)
+ * convert the thread private memory key from os specific type to apr type.
+ * arg 1) The apr handle we are converting to.
+ * arg 2) The os specific handle to convert
+ * arg 3) The context to use if it is needed.
+ */
ap_status_t ap_put_os_threadkey(ap_threadkey_t **key, ap_os_threadkey_t *thekey,
ap_context_t *cont);
#endif
diff --git a/include/apr_shmem.h b/include/apr_shmem.h
index b0496b416..387a11f08 100644
--- a/include/apr_shmem.h
+++ b/include/apr_shmem.h
@@ -73,14 +73,93 @@ typedef key_t ap_shm_name_t;
typedef struct shmem_t ap_shmem_t;
+/* ***APRDOC********************************************************
+ * ap_status_t ap_shm_init(ap_shmem_t *m, ap_size_t reqsize, char *file)
+ * Create a pool of shared memory for use later.
+ * arg 1) The shared memory block.
+ * arg 2) The size of the shared memory pool.
+ * arg 3) The file to use for the shared memory on platforms that
+ * require it.
+ * arg 4) The context to use
+ */
ap_status_t ap_shm_init(ap_shmem_t **m, ap_size_t reqsize, const char *file, ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_shm_destroy(ap_shmem_t *m)
+ * Destroy the shared memory block.
+ * arg 1) The shared memory block to destroy.
+ */
ap_status_t ap_shm_destroy(ap_shmem_t *m);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_shm_malloc(ap_shmem_t *c, ap_size_t reqsize)
+ * allocate memory from the block of shared memory.
+ * arg 1) The shared memory block to destroy.
+ * arg 2) How much memory to allocate
+ */
void *ap_shm_malloc(ap_shmem_t *c, ap_size_t reqsize);
+
+/* ***APRDOC********************************************************
+ * void *ap_shm_calloc(ap_shmem_t *shared, ap_size_t size)
+ * allocate memory from the block of shared memory and initialize it
+ * to zero.
+ * arg 1) The shared memory block to destroy.
+ * arg 2) How much memory to allocate
+ */
void *ap_shm_calloc(ap_shmem_t *shared, ap_size_t size);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_shm_free(ap_shmem_t *shared, void *entity)
+ * free shared memory previously allocated.
+ * arg 1) The shared memory block to destroy.
+ */
ap_status_t ap_shm_free(ap_shmem_t *shared, void *free);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name)
+ * Get the name of the shared memory segment if not using
+ * anonymous shared memory.
+ * arg 1) The shared memory block to destroy.
+ * arg 2) The name of the shared memory block, NULL if anonymous
+ * shared memory.
+ * return) APR_USES_ANONYMOUS_SHM if we are using anonymous shared
+ * memory. APR_USES_FILEBASED_SHM if our shared memory is
+ * 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.
+ */
ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_shm_name(ap_shmem_t *c, ap_shm_name_t *name)
+ * Set the name of the shared memory segment if not using
+ * anonymous shared memory. This is to allow processes to open
+ * shared memory created by another process.
+ * arg 1) The shared memory block to destroy.
+ * arg 2) The name of the shared memory block, NULL if anonymous
+ * shared memory.
+ * 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.
+ */
ap_status_t ap_set_shm_name(ap_shmem_t *c, ap_shm_name_t *name);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_open_shmem(ap_shmem_t *c)
+ * Open the shared memory block in a child process.
+ * arg 1) The shared memory block to open in the child.
+ * return) This should be called after ap_set_shm_name. The ap_shmem_t
+ * variable must refer to the memory segment to open.
+ */
ap_status_t ap_open_shmem(ap_shmem_t *c);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_shm_avail(ap_shmem_t *c, ap_size_t *size)
+ * Determine how much memory is available in the specified shared
+ * memory block
+ * arg 1) The shared memory block to open in the child.
+ * arg 2) The amount of space available in the shared memory block.
+ */
ap_status_t ap_shm_avail(ap_shmem_t *c, ap_size_t *avail);
#ifdef __cplusplus
diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h
index 6f99b11ee..69ea84805 100644
--- a/include/apr_thread_proc.h
+++ b/include/apr_thread_proc.h
@@ -101,71 +101,401 @@ typedef struct ap_other_child_rec_t ap_other_child_rec_t;
typedef void *(API_THREAD_FUNC *ap_thread_start_t)(void *);
/* Thread Function definitions */
+/* ***APRDOC********************************************************
+ * ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_context_t *cont)
+ * Create and initialize a new threadattr variable
+ * arg 1) The newly created threadattr.
+ * arg 2) The context to use
+ */
ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on)
+ * Set if newly created threads should be created in detach mode.
+ * arg 1) The threadattr to affect
+ * arg 2) Thread detach state on or off
+ */
ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr)
+ * Get the detach mode for this threadattr.
+ * arg 1) The threadattr to reference
+ */
ap_status_t ap_getthreadattr_detach(ap_threadattr_t *iattr);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr,
+ * ap_thread_start_t func, void *data,
+ * ap_context_t *cont)
+ * Create a new thread of execution
+ * arg 1) The newly created thread handle.
+ * arg 2) The threadattr to use to determine how to create the thread
+ * arg 3) The function to start the new thread in
+ * arg 4) Any data to be passed to the starting function
+ * arg 5) The context to use
+ */
ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr,
ap_thread_start_t func, void *data,
ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval)
+ * stop the current thread
+ * arg 1) The thread to stop
+ * arg 2) The return value to pass back to any thread that cares
+ */
ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd)
+ * block until the desired thread stops executing.
+ * arg 1) The return value from the dead thread.
+ * arg 2) The thread to join
+ */
ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_thread_detach(ap_thread_t *thd)
+ * detach a thread
+ * arg 1) The thread to detach
+ */
ap_status_t ap_thread_detach(ap_thread_t *thd);
ap_status_t ap_cancel_thread(ap_thread_t *thd);
ap_status_t ap_setcanceltype(ap_int32_t type, ap_context_t *cont);
ap_status_t ap_setcancelstate(ap_int32_t type, ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_threaddata(void **data, char *key, ap_thread_t *thread)
+ * Return the context associated with the current thread.
+ * arg 1) The user data associated with the thread.
+ * arg 2) The key to associate with the data
+ * arg 3) The currently open thread.
+ */
ap_status_t ap_get_threaddata(void **data, char *key, ap_thread_t *thread);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_threaddata(void *data, char *key,
+ ap_status_t (*cleanup) (void *),
+ ap_thread_t *thread)
+ * Return the context associated with the current thread.
+ * arg 1) The user data to associate with the thread.
+ * arg 2) The key to use for associating the data with the tread
+ * arg 3) The cleanup routine to use when the thread is destroyed.
+ * arg 4) The currently open thread.
+ */
ap_status_t ap_set_threaddata(void *data, char *key,
ap_status_t (*cleanup) (void *),
ap_thread_t *thread);
+/* ***APRDOC********************************************************
+ * ap_status_t ap_create_thread_private(ap_threadkey_t **key,
+ * void (*dest)(void *),
+ * ap_context_t *cont)
+ * Create and initialize a new thread private address space
+ * arg 1) The thread private handle.
+ * arg 2) The destructor to use when freeing the private memory.
+ * arg 3) The context to use
+ */
ap_status_t ap_create_thread_private(ap_threadkey_t **key, void (*dest)(void *),
ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key)
+ * Get a pointer to the thread private memory
+ * arg 1) The data stored in private memory
+ * arg 2) The handle for the desired thread private memory
+ */
ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key)
+ * Set the data to be stored in thread private memory
+ * arg 1) The data to be stored in private memory
+ * arg 2) The handle for the desired thread private memory
+ */
ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_delete_thread_private(ap_threadkey_t *key)
+ * Free the thread private memory
+ * arg 1) The handle for the desired thread private memory
+ */
ap_status_t ap_delete_thread_private(ap_threadkey_t *key);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_threadkeydata(void **data, char *key,
+ * ap_threadkey_t *threadkey)
+ * Return the context associated with the current threadkey.
+ * arg 1) The user data associated with the threadkey.
+ * arg 2) The key associated with the data
+ * arg 3) The currently open threadkey.
+ */
ap_status_t ap_get_threadkeydata(void **data, char *key, ap_threadkey_t *threadkey);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_threadkeydata(void *data, char *key,
+ ap_status_t (*cleanup) (void *),
+ ap_threadkey_t *threadkey)
+ * Return the context associated with the current threadkey.
+ * arg 1) The data to set.
+ * arg 1) The key to associate with the data.
+ * arg 2) The user data to associate with the threadkey.
+ * arg 1) The currently open threadkey.
+ */
ap_status_t ap_set_threadkeydata(void *data, char *key,
ap_status_t (*cleanup) (void *),
ap_threadkey_t *threadkey);
/* Process Function definitions */
+/* ***APRDOC********************************************************
+ * ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_context_t *cont)
+ * Create and initialize a new procattr variable
+ * arg 1) The newly created procattr.
+ * arg 2) The context to use
+ */
ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in,
+ * ap_int32_t *out, ap_int32_t err)
+ * Determine if any of stdin, stdout, or stderr should be linked
+ * to pipes when starting a child process.
+ * arg 1) The procattr we care about.
+ * arg 2) Should stdin be a pipe bnack to the parent?
+ * arg 3) Should stdout be a pipe bnack to the parent?
+ * arg 4) Should stderr be a pipe bnack to the parent?
+ */
ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in,
ap_int32_t out, ap_int32_t err);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_setprocattr_childin(ap_procattr_t *attr, ap_file_t *child_in,
+ * ap_file_t *parent_in)
+ * Set the child_in and/or parent_in values to existing ap_file_t
+ * values. 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 mutiple
+ * process invocations - such as a log file. You can save some
+ * extra function calls by not creating your own pipe since this
+ * creates one in the process space for you.
+ * arg 1) The procattr we care about.
+ * arg 2) ap_file_t value to use as child_in. Must be a valid file.
+ * arg 3) ap_file_t value to use as parent_in. Must be a valid file.
+ */
ap_status_t ap_setprocattr_childin(struct ap_procattr_t *attr, ap_file_t *child_in,
ap_file_t *parent_in);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_setprocattr_childout(ap_procattr_t *attr,
+ * ap_file_t *child_out,
+ * ap_file_t *parent_out)
+ * Set the child_out and parent_out values to existing ap_file_t
+ * values. 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 mutiple
+ * process invocations - such as a log file.
+ * arg 1) The procattr we care about.
+ * arg 2) ap_file_t value to use as child_out. Must be a valid file.
+ * arg 3) ap_file_t value to use as parent_out. Must be a valid file.
+ */
ap_status_t ap_setprocattr_childout(struct ap_procattr_t *attr,
ap_file_t *child_out,
ap_file_t *parent_out);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_setprocattr_childerr(ap_procattr_t *attr,
+ * ap_file_t *child_err,
+ * ap_file_t *parent_err)
+ * Set the child_err and parent_err values to existing ap_file_t
+ * values. 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 mutiple
+ * process invocations - such as a log file.
+ * arg 1) The procattr we care about.
+ * arg 2) ap_file_t value to use as child_err. Must be a valid file.
+ * arg 3) ap_file_t value to use as parent_err. Must be a valid file.
+ */
ap_status_t ap_setprocattr_childerr(struct ap_procattr_t *attr,
ap_file_t *child_err,
ap_file_t *parent_err);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, constchar *dir)
+ * Set which directory the child process should start executing in.
+ * arg 1) The procattr we care about.
+ * arg 2) Which dir to start in. By default, this is the same dir as
+ * the parent currently resides in, when the createprocess call
+ * is made.
+ */
ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, const char *dir);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr, ap_cmdtype_e cmd)
+ * Set what type of command the child process will call.
+ * arg 1) The procattr we care about.
+ * arg 2) The type of command. One of:
+ * APR_SHELLCMD -- Shell script
+ * APR_PROGRAM -- Executable program (default)
+ */
ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr, ap_cmdtype_e cmd);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach)
+ * Determine if the chlid should start in detached state.
+ * arg 1) The procattr we care about.
+ * arg 2) Should the child start in detached state? Default is no.
+ */
ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_procdata(char *key, void *data, ap_proc_t *proc)
+ * Return the context associated with the current proc.
+ * arg 1) The key associated with the data to retreive.
+ * arg 2) The user data associated with the proc.
+ * arg 3) The currently open proc.
+ */
ap_status_t ap_get_procdata(char *key, void *data, ap_proc_t *proc);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_procdata(void *data, char *key,
+ * ap_status_t (*cleanup) (void *), ap_proc_t *proc)
+ * Return the context associated with the current proc.
+ * arg 2) The user data to associate with the file.
+ * arg 3) The key to use for assocaiteing data with the file.
+ * arg 4) The cleanup routine to use when the file is destroyed.
+ * arg 1) The current process.
+ */
ap_status_t ap_set_procdata(void *data, char *key,
ap_status_t (*cleanup) (void *), ap_proc_t *proc);
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_childin(ap_file_t **new, ap_proc_t *proc)
+ * Get the file handle that is assocaited with a child's stdin.
+ * arg 1) The returned file handle.
+ * arg 2) The process handle that corresponds to the desired child process
+ */
ap_status_t ap_get_childin(ap_file_t **new, ap_proc_t *proc);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_childout(ap_file_t **new, ap_proc_t *proc)
+ * Get the file handle that is assocaited with a child's stdout.
+ * arg 1) The returned file handle.
+ * arg 2) The process handle that corresponds to the desired child process
+ */
ap_status_t ap_get_childout(ap_file_t **new, ap_proc_t *proc);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_childerr(ap_file_t **new, ap_proc_t *proc)
+ * Get the file handle that is assocaited with a child's stderr.
+ * arg 1) The returned file handle.
+ * arg 2) The process handle that corresponds to the desired child process
+ */
ap_status_t ap_get_childerr(ap_file_t **new, ap_proc_t *proc);
+/* ***APRDOC********************************************************
+ * ap_status_t ap_fork(ap_proc_t **proc, ap_context_t *cont)
+ * This is currently the only non-portable call in APR. This executes
+ * a standard unix fork.
+ * arg 1) The resulting process handle.
+ * arg 2) The context to use.
+ */
ap_status_t ap_fork(ap_proc_t **proc, ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_create_process(ap_proc_t **new, const char *progname,
+ * char *const args[], char **env,
+ * ap_procattr_t *attr, ap_context_t *cont)
+ * Create a new process and execute a new program within that process.
+ * arg 1) The resulting process handle.
+ * arg 2) The program to run
+ * arg 3) the arguments to pass to the new program. The first one should
+ * be the program name.
+ * arg 4) The new environment ap_table_t for the new process. This should be a
+ * list of NULL-terminated strings.
+ * arg 5) the procattr we should use to determine how to create the new
+ * process
+ * arg 6) The context to use.
+ */
ap_status_t ap_create_process(ap_proc_t **new, const char *progname,
char *const args[], char **env,
ap_procattr_t *attr, ap_context_t *cont);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how waithow)
+ * Wait for a child process to die
+ * arg 1) The process handle that corresponds to the desired child process
+ * arg 2) How should we wait. One of:
+ * APR_WAIT -- block until the child process dies.
+ * APR_NOWAIT -- return immediately regardless of if the
+ * child is dead or not.
+ * NOTE: The childs status is in the return code to this process. It is
+ * one of:
+ * APR_CHILD_DONE -- child is no longer running.
+ * APR_CHILD_NOTDONE -- child is still running.
+ */
ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how_e waithow);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_detach(ap_proc_t **new, ap_context_t *cont)
+ * Detach the process from the controlling terminal.
+ * arg 1) The new process handler
+ * arg 2) The context to use if it is needed.
+ */
ap_status_t ap_detach(ap_proc_t **new, ap_context_t *cont);
+/* ***APRDOC********************************************************
+ * void ap_register_other_child(ap_proc_t *pid,
+ * void (*maintenance) (int reason, void *data),
+ * void *data, int write_fd, ap_context_t *p)
+ * Register an other_child -- a child which must be kept track of so
+ * that the program knows when it has dies or disappeared.
+ * arg 1) pid is the pid of the child.
+ * arg 2) maintenance is a function that is invoked with a reason and the
+ * data pointer passed here.
+ * arg 3) The data to pass to the maintenance function.
+ * arg 4) An fd that is probed for writing. If it is ever unwritable
+ * then the maintenance is invoked with reason OC_REASON_UNWRITABLE.
+ * arg 5) The context to use for allocating memory.
+ */
void ap_register_other_child(ap_proc_t *pid,
void (*maintenance) (int reason, void *),
void *data, int write_fd, ap_context_t *p);
+
+/* ***APRDOC********************************************************
+ * void ap_unregister_other_child(void *data)
+ * Stop watching the specified process.
+ * arg 1) The data to pass to the maintenance function. This is
+ * used to find the process to unregister.
+ * NOTE: 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.
+ */
void ap_unregister_other_children(void *data);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_reap_other_child(ap_proc_t *piod)
+ * Check on the specified process. If it is gone, call the
+ * maintenance function.
+ * arg 1) The process to check.
+ */
ap_status_t ap_reap_other_child(ap_proc_t *pid);
+
+/* ***APRDOC********************************************************
+ * void ap_check_other_child(void)
+ * Loop through all registered other_children and call the
+ * appropriate maintenance function when necessary.
+ */
void ap_check_other_child(void);
+/* ***APRDOC********************************************************
+ * ap_status_t ap_kill(ap_proc_t *proc, int sig)
+ * Terminate a process.
+ * arg 1) The process to terminate.
+ * arg 2) How to kill the process.
+ */
ap_status_t ap_kill(ap_proc_t *proc, int sig);
#ifdef __cplusplus
}
diff --git a/include/apr_time.h b/include/apr_time.h
index 0233d8646..271508cea 100644
--- a/include/apr_time.h
+++ b/include/apr_time.h
@@ -80,7 +80,10 @@ typedef ap_int64_t ap_time_t;
#define AP_USEC_PER_SEC (1000000LL)
#endif
-/* the time right now */
+/* ***APRDOC********************************************************
+ * ap_time_t ap_now(void)
+ * return the current time
+ */
ap_time_t ap_now(void);
/* a structure similar to ANSI struct tm with the following differences:
@@ -101,11 +104,37 @@ typedef struct {
ap_int32_t tm_gmtoff; /* seconds east of UTC */
} ap_exploded_time_t;
-/* convert an ANSI time_t to ap_time_t */
+/* ***APRDOC********************************************************
+ * ap_status_t ap_ansi_time_to_ap_time(ap_time_t *result, time_t input)
+ * convert an ansi time_t to an ap_time_t
+ * arg 1) the resulting ap_time_t
+ * arg 2) the time_t to convert
+ */
ap_status_t ap_ansi_time_to_ap_time(ap_time_t *result, time_t input);
+/* ***APRDOC********************************************************
+ * ap_status_t ap_explode_gmt(ap_exploded_time_t *result, ap_time_t input)
+ * convert a time to its human readable components in GMT timezone
+ * arg 1) the exploded time
+ * arg 2) the time to explode
+ */
ap_status_t ap_explode_gmt(ap_exploded_time_t *result, ap_time_t input);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input)
+ * convert a time to its human readable components in local timezone
+ * arg 1) the exploded time
+ * arg 2) the time to explode
+ */
ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input);
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_implode_time(ap_time_t *t, ap_exploded_time_t *xt)
+ * Convert time value from human readable format to number of seconds
+ * since epoch
+ * arg 1) the resulting imploded time
+ * arg 2) the input exploded time
+ */
ap_status_t ap_implode_time(ap_time_t *result, ap_exploded_time_t *input);
/* ap_rfc822_date formats dates in the RFC822
diff --git a/include/arch/unix/mmap.c b/include/arch/unix/mmap.c
index 05b3e2223..0c763a800 100644
--- a/include/arch/unix/mmap.c
+++ b/include/arch/unix/mmap.c
@@ -76,15 +76,6 @@ ap_status_t mmap_cleanup(void *themmap)
return errno;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset)
- * Create a new mmap'ed file out of an existing APR file.
- * arg 1) The newly created mmap'ed file.
- * arg 2) The file turn into an mmap.
- * arg 3) The offset into the file to start the data pointer at.
- * arg 4) The size of the file
- * arg 5) The context to use when creating the mmap.
- */
ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset,
ap_size_t size, ap_context_t *cont)
{
@@ -112,11 +103,6 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset,
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_mmap_delete(ap_mmap_t *mmap)
- * Remove a mmap'ed.
- * arg 1) The mmap'ed file.
- */
ap_status_t ap_mmap_delete(ap_mmap_t *mmap)
{
ap_status_t rv;
diff --git a/locks/unix/locks.c b/locks/unix/locks.c
index 67872ef84..b545e22da 100644
--- a/locks/unix/locks.c
+++ b/locks/unix/locks.c
@@ -55,27 +55,6 @@
#include "locks.h"
#include "apr_portable.h"
-/* ***APRDOC********************************************************
- * ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type,
- * ap_lockscope_e scope, char *fname,
- * ap_context_t *cont)
- * Create a new instance of a lock structure.
- * arg 1) The newly created lock structure.
- * arg 2) The type of lock to create, one of:
- * APR_MUTEX
- * APR_READWRITE
- * arg 3) The scope of the 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 4) 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 5) The context to operate on.
- * NOTE: APR_CROSS_PROCESS may lock both processes and threads, but it is
- * only guaranteed to lock processes.
- */
ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type,
ap_lockscope_e scope, char *fname,
ap_context_t *cont)
@@ -119,11 +98,6 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type,
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_lock(ap_lock_t *lock)
- * Lock a protected region.
- * arg 1) The lock to set.
- */
ap_status_t ap_lock(ap_lock_t *lock)
{
ap_status_t stat;
@@ -144,11 +118,6 @@ ap_status_t ap_lock(ap_lock_t *lock)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_unlock(ap_lock_t *lock)
- * Unlock a protected region.
- * arg 1) The lock to reset.
- */
ap_status_t ap_unlock(ap_lock_t *lock)
{
ap_status_t stat;
@@ -170,13 +139,6 @@ ap_status_t ap_unlock(ap_lock_t *lock)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_destroy_lock(ap_lock_t *lock)
- * 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(ap_lock_t *lock)
{
ap_status_t stat;
@@ -197,21 +159,6 @@ ap_status_t ap_destroy_lock(ap_lock_t *lock)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_child_init_lock(ap_lock_t **lock, char *fname,
- * ap_context_t *cont)
- * Re-open a lock in a child process.
- * arg 1) The newly re-opened lock structure.
- * 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 3) The context to operate on.
- * 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_lock_t **lock, char *fname, ap_context_t *cont)
{
ap_status_t stat;
@@ -223,13 +170,6 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, char *fname, ap_context_t *cont
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_lockdata(ap_lock_t *lock, char *key, void *data)
- * Return the context associated with the current lock.
- * arg 1) The currently open lock.
- * arg 2) The key to use when retreiving data associated with this lock
- * arg 3) The user data associated with the lock.
- */
ap_status_t ap_get_lockdata(ap_lock_t *lock, char *key, void *data)
{
if (lock != NULL) {
@@ -241,15 +181,6 @@ ap_status_t ap_get_lockdata(ap_lock_t *lock, char *key, void *data)
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, char *key,
- ap_status_t (*cleanup) (void *))
- * Return the context associated with the current lock.
- * arg 1) The currently open lock.
- * arg 2) The user data to associate with the lock.
- * arg 3) The key to use when associating data with this lock
- * arg 4) The cleanup to use when the lock is destroyed.
- */
ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, char *key,
ap_status_t (*cleanup) (void *))
{
@@ -262,12 +193,6 @@ ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, char *key,
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock)
- * onvert the lock from os specific type to apr type
- * arg 1) The os specific lock we are converting to.
- * arg 2) The apr lock to convert.
- */
ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock)
{
if (lock == NULL) {
@@ -283,14 +208,6 @@ ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *,
- * ap_context_t *cont)
- * onvert the lock from os specific type to apr type
- * arg 1) The apr lock we are converting to.
- * arg 2) The os specific lock to convert.
- * arg 3) The context to use if it is needed.
- */
ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *thelock,
ap_context_t *cont)
{
diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c
index ab7dbeac9..518efdbf2 100644
--- a/misc/unix/getopt.c
+++ b/misc/unix/getopt.c
@@ -41,25 +41,6 @@ char *ap_optarg = ""; /* argument associated with option */
#define EMSG ""
-/* ***APRDOC********************************************************
- * ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv,
- * const char *ostr, ap_int32_t *rv, ap_context_t *cont)
- * Parse the command line options passed to the program.
- * arg 1) The number of arguments passed to ap_getopt to parse
- * arg 2) The array of command line options to parse
- * arg 3) A string of characters that are acceptable options to the program.
- * characters followed by ":" are required to have an option
- * associated
- * arg 4) The next option found. There are four potential values for
- * this variable on exit. They are:
- * APR_EOF -- No more options to parse
- * APR_BADCH -- Found a bad option character
- * APR_BADARG -- Missing parameter for the found option
- * Other -- The next option found.
- * arg 5) The context to operate on.
- * NOTE: Arguments 2 and 3 are most commonly argc and argv from
- * main(argc, argv)
- */
ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, ap_int32_t *rv, ap_context_t *cont)
{
char *p;
diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c
index aa838f8be..5a8af09f2 100644
--- a/misc/unix/otherchild.c
+++ b/misc/unix/otherchild.c
@@ -61,20 +61,6 @@
static ap_other_child_rec_t *other_children = NULL;
-/* ***APRDOC********************************************************
- * void ap_register_other_child(ap_proc_t *pid,
- * void (*maintenance) (int reason, void *data),
- * void *data, int write_fd, ap_context_t *p)
- * Register an other_child -- a child which must be kept track of so
- * that the program knows when it has dies or disappeared.
- * arg 1) pid is the pid of the child.
- * arg 2) maintenance is a function that is invoked with a reason and the
- * data pointer passed here.
- * arg 3) The data to pass to the maintenance function.
- * arg 4) An fd that is probed for writing. If it is ever unwritable
- * then the maintenance is invoked with reason OC_REASON_UNWRITABLE.
- * arg 5) The context to use for allocating memory.
- */
API_EXPORT(void) ap_register_other_child(ap_proc_t *pid,
void (*maintenance) (int reason, void *),
void *data, int write_fd, ap_context_t *p)
@@ -90,16 +76,6 @@ API_EXPORT(void) ap_register_other_child(ap_proc_t *pid,
other_children = ocr;
}
-/* ***APRDOC********************************************************
- * void ap_unregister_other_child(void *data)
- * Stop watching the specified process.
- * arg 1) The data to pass to the maintenance function. This is
- * used to find the process to unregister.
- * NOTE: 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.
- */
API_EXPORT(void) ap_unregister_other_child(void *data)
{
ap_other_child_rec_t **pocr, *nocr;
@@ -165,12 +141,6 @@ static void probe_writable_fds(void)
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_reap_other_child(ap_proc_t *piod)
- * Check on the specified process. If it is gone, call the
- * maintenance function.
- * arg 1) The process to check.
- */
API_EXPORT(ap_status_t) ap_reap_other_child(ap_proc_t *pid)
{
ap_other_child_rec_t *ocr, *nocr;
@@ -187,11 +157,6 @@ API_EXPORT(ap_status_t) ap_reap_other_child(ap_proc_t *pid)
return APR_CHILD_NOTDONE;
}
-/* ***APRDOC********************************************************
- * void ap_check_other_child(void)
- * Loop through all registered other_children and call the
- * appropriate maintenance function when necessary.
- */
API_EXPORT(void) ap_check_other_child(void)
{
ap_other_child_rec_t *ocr, *nocr;
diff --git a/misc/unix/start.c b/misc/unix/start.c
index 11cf7b1fe..f8e0e4637 100644
--- a/misc/unix/start.c
+++ b/misc/unix/start.c
@@ -59,15 +59,6 @@
#include "../../locks/beos/locks.h"
#endif
-/* ***APRDOC********************************************************
- * ap_status_t ap_create_context(ap_context_t **newcont, ap_context_t *cont)
- * Create a new context.
- * arg 1) The context we have just created.
- * arg 2) The parent context. If this is NULL, the new context is a root
- * context. If it is non-NULL, the new context will inherit all
- * of it's parent context's attributes, except the ap_context_t will be a
- * sub-pool.
- */
ap_status_t ap_create_context(ap_context_t **newcont, ap_context_t *cont)
{
ap_context_t *new;
@@ -94,35 +85,12 @@ ap_status_t ap_create_context(ap_context_t **newcont, ap_context_t *cont)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_destroy_context(ap_context_t *cont)
- * Free the context and all of it's child contexts'.
- * arg 1) The context to free.
- */
ap_status_t ap_destroy_context(ap_context_t *cont)
{
ap_destroy_pool(cont);
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_set_userdata(void *data, char *key,
- * ap_status_t (*cleanup) (void *),
- * ap_context_t *cont)
- * Set the data associated with the current context.
- * arg 1) The user data associated with the context.
- * arg 2) The key to use for association
- * arg 3) The cleanup program to use to cleanup the data;
- * arg 4) The current context.
- * NOTE: The data to be attached to the context should have the same
- * life span as the context it is being attached to.
- *
- * Users of APR must take EXTREME care when choosing a key to
- * use for their data. It is possible to accidentally overwrite
- * 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.
- */
ap_status_t ap_set_userdata(void *data, char *key,
ap_status_t (*cleanup) (void *),
ap_context_t *cont)
@@ -155,13 +123,6 @@ ap_status_t ap_set_userdata(void *data, char *key,
return APR_ENOCONT;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_userdata(void **data, char *key, ap_context_t *cont)
- * Return the data associated with the current context.
- * arg 1) The key for the data to retrieve
- * arg 2) The user data associated with the context.
- * arg 3) The current context.
- */
ap_status_t ap_get_userdata(void **data, char *key, ap_context_t *cont)
{
datastruct *dptr = NULL;
@@ -184,11 +145,6 @@ ap_status_t ap_get_userdata(void **data, char *key, ap_context_t *cont)
return APR_ENOCONT;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_initialize(void)
- * Setup any APR internal data structures. This MUST be the first
- * function called for any APR program.
- */
ap_status_t ap_initialize(void)
{
ap_status_t status;
@@ -199,28 +155,11 @@ ap_status_t ap_initialize(void)
return status;
}
-/* ***APRDOC*******************************************************
- * void ap_terminate(void)
- * Tear down any APR internal data structures which aren't
- * torn down automatically. An APR program must call this
- * function at termination once it has stopped using APR
- * services.
- */
void ap_terminate(void)
{
ap_term_alloc();
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_set_abort(int (*apr_abort)(int retcode), ap_context_t *cont)
- * Set the APR_ABORT function.
- * NOTE: This is in for backwards compatability. If the program using
- * APR wants APR to exit on a memory allocation error, then this
- * function should be called to set the function to use in order
- * to actually exit the program. If this function is not called,
- * then APR will return an error and expect the calling program to
- * deal with the error accordingly.
- */
ap_status_t ap_set_abort(int (*apr_abort)(int retcode), ap_context_t *cont)
{
if (cont == NULL) {
diff --git a/misc/win32/getopt.c b/misc/win32/getopt.c
index 5a97d126b..1fcf3664f 100644
--- a/misc/win32/getopt.c
+++ b/misc/win32/getopt.c
@@ -44,25 +44,6 @@ char *ap_optarg = ""; /* argument associated with option */
#define EMSG ""
-/* ***APRDOC********************************************************
- * ap_status_t ap_getopt(ap_context_t *, ap_int32_t, char *const *,
- * const char *, ap_int32_t)
- * Parse the command line options passed to the program.
- * arg 1) The context to operate on.
- * arg 2) The number of arguments passed to ap_getopt to parse
- * arg 3) The array of command line options to parse
- * arg 4) A string of characters that are acceptable options to the program.
- * characters followed by ":" are required to have an option
- * associated
- * arg 5) The next option found. There are four potential values for
- * this variable on exit. They are:
- * APR_EOF -- No more options to parse
- * APR_BADCH -- Found a bad option character
- * APR_BADARG -- Missing parameter for the found option
- * Other -- The next option found.
- * NOTE: Arguments 2 and 3 are most commonly argc and argv from
- * main(argc, argv)
- */
ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, ap_int32_t *rv, ap_context_t *cont)
{
char *p;
diff --git a/mmap/unix/common.c b/mmap/unix/common.c
index 3a6e80401..34eb8fe92 100644
--- a/mmap/unix/common.c
+++ b/mmap/unix/common.c
@@ -69,13 +69,6 @@
#if HAVE_MMAP
-/* ***APRDOC********************************************************
- * ap_status_t ap_mmap_offset(void **addr, ap_mmap_t *mmap, ap_offset_t offset)
- * Move the pointer into the mmap'ed file to the specified offset.
- * arg 1) The pointer to the offset specified.
- * arg 2) The mmap'ed file.
- * arg 3) The offset to move to.
- */
ap_status_t ap_mmap_offset(void **addr, ap_mmap_t *mmap, ap_off_t offset)
{
if (offset < 0 || offset > mmap->size)
diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c
index 05b3e2223..0c763a800 100644
--- a/mmap/unix/mmap.c
+++ b/mmap/unix/mmap.c
@@ -76,15 +76,6 @@ ap_status_t mmap_cleanup(void *themmap)
return errno;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset)
- * Create a new mmap'ed file out of an existing APR file.
- * arg 1) The newly created mmap'ed file.
- * arg 2) The file turn into an mmap.
- * arg 3) The offset into the file to start the data pointer at.
- * arg 4) The size of the file
- * arg 5) The context to use when creating the mmap.
- */
ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset,
ap_size_t size, ap_context_t *cont)
{
@@ -112,11 +103,6 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset,
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_mmap_delete(ap_mmap_t *mmap)
- * Remove a mmap'ed.
- * arg 1) The mmap'ed file.
- */
ap_status_t ap_mmap_delete(ap_mmap_t *mmap)
{
ap_status_t rv;
diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c
index 270a841be..b0f67d608 100644
--- a/network_io/unix/poll.c
+++ b/network_io/unix/poll.c
@@ -56,14 +56,6 @@
#ifdef HAVE_POLL /* We can just use poll to do our socket polling. */
-/* ***APRDOC********************************************************
- * ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num,
- * ap_context_t *cont)
- * Setup the memory required for poll to operate properly.
- * arg 1) The poll structure to be used.
- * arg 2) The number of socket descriptors to be polled.
- * arg 3) The context to operate on.
- */
ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_context_t *cont)
{
(*new) = (ap_pollfd_t *)ap_palloc(cont, sizeof(ap_pollfd_t));
@@ -119,17 +111,6 @@ ap_int16_t get_revent(ap_int16_t event)
return rv;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock,
- * ap_int16_t event)
- * Add a socket to the poll structure.
- * arg 1) The poll structure we will be using.
- * arg 2) The socket to add to the current poll structure.
- * arg 3) The events to look for when we do the poll. One of:
- * APR_POLLIN -- signal if read will not block
- * APR_POLLPRI -- signal if prioirty data is availble to be read
- * APR_POLLOUT -- signal if write will not block
- */
ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset,
ap_socket_t *sock, ap_int16_t event)
{
@@ -147,19 +128,6 @@ ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset,
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds,
- * ap_int32_t timeout)
- * Poll the sockets in the poll structure. This is a blocking call,
- * and it will not return until either a socket has been signalled, or
- * the timeout has expired.
- * arg 1) The poll structure we will be using.
- * arg 2) The number of sockets we are polling.
- * arg 3) The amount of time in seconds to wait. This is a maximum, not
- * a minimum. If a socket is signalled, we will wake up before this
- * time. A negative number means wait until a socket is signalled.
- * NOTE: The number of sockets signalled is returned in the second argument.
- */
ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, ap_int32_t timeout)
{
int i;
@@ -191,21 +159,6 @@ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, ap_int32_t timeout)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_revents(ap_int_16_t *event, ap_socket_t *sock,
- * ap_pollfd_t *aprset)
- * Get the return events for the specified socket.
- * arg 1) The returned events for the socket. One of:
- * APR_POLLIN -- Data is available to be read
- * APR_POLLPRI -- Prioirty data is availble to be read
- * APR_POLLOUT -- Write will succeed
- * APR_POLLERR -- An error occurred on the socket
- * APR_POLLHUP -- The connection has been terminated
- * APR_POLLNVAL -- This is an invalid socket to poll on.
- * Socket not open.
- * arg 2) The socket we wish to get information about.
- * arg 3) The poll structure we will be using.
- */
ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *aprset)
{
int i = 0;
@@ -220,17 +173,6 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock,
- * ap_int16_t events)
- * Add a socket to the poll structure.
- * arg 1) The poll structure we will be using.
- * arg 2) The socket to remove from the current poll structure.
- * arg 3) The events to stop looking for during the poll. One of:
- * APR_POLLIN -- signal if read will not block
- * APR_POLLPRI -- signal if prioirty data is availble to be read
- * APR_POLLOUT -- signal if write will not block
- */
ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset,
ap_socket_t *sock, ap_int16_t events)
{
@@ -251,15 +193,6 @@ ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset,
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events)
- * Remove all sockets from the poll structure.
- * arg 1) The poll structure we will be using.
- * arg 2) The events to clear from all sockets. One of:
- * APR_POLLIN -- signal if read will not block
- * APR_POLLPRI -- signal if prioirty data is availble to be read
- * APR_POLLOUT -- signal if write will not block
- */
ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events)
{
int i = 0;
@@ -420,13 +353,6 @@ ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t event)
#endif
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data)
- * Return the context associated with the current poll.
- * arg 1) The currently open pollfd.
- * arg 2) The key to use for retreiving data associated with a poll struct.
- * arg 3) The user data associated with the pollfd.
- */
ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data)
{
if (pollfd != NULL) {
@@ -438,14 +364,6 @@ ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data)
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char *key,
- ap_status_t (*cleanup) (void *))
- * Return the context associated with the current poll.
- * arg 1) The currently open pollfd.
- * arg 2) The user data to associate with the pollfd.
-
- */
ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char *key,
ap_status_t (*cleanup) (void *))
{
diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c
index c44dfa753..0b6b1241b 100644
--- a/network_io/unix/sendrecv.c
+++ b/network_io/unix/sendrecv.c
@@ -94,16 +94,6 @@ static ap_status_t wait_for_io_or_timeout(ap_socket_t *sock, int for_read)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len)
- * Send data over a network.
- * arg 1) The socket to send the data over.
- * arg 2) The buffer which contains the data to be sent.
- * arg 3) The maximum number of bytes to send
- * NOTE: This functions acts like a blocking write by default. To change
- * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option.
- * The number of bytes actually sent is stored in argument 3.
- */
ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len)
{
ssize_t rv;
@@ -134,16 +124,6 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len)
- * Read data from a network.
- * arg 1) The socket to read the data from.
- * arg 2) The buffer to store the data in.
- * arg 3) The maximum number of bytes to read
- * NOTE: This functions acts like a blocking write by default. To change
- * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option.
- * The number of bytes actually sent is stored in argument 3.
- */
ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len)
{
ssize_t rv;
@@ -174,18 +154,6 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec,
- ap_int32_t nvec, ap_int32_t *len)
- * Send multiple packets of data over a network.
- * arg 1) The socket to send the data over.
- * arg 2) The array of iovec structs containing the data to send
- * arg 3) The number of iovec structs in the array
- * arg 4) Receives the number of bytes actually written
- * NOTE: This functions acts like a blocking write by default. To change
- * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option.
- * The number of bytes actually sent is stored in argument 3.
- */
ap_status_t ap_sendv(ap_socket_t * sock, const struct iovec *vec,
ap_int32_t nvec, ap_int32_t *len)
{
@@ -218,21 +186,6 @@ ap_status_t ap_sendv(ap_socket_t * sock, const struct iovec *vec,
}
#if defined(HAVE_SENDFILE)
-/* ***APRDOC********************************************************
- * ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, ap_hdtr_t *hdtr,
- * ap_off_t *offset, ap_size_t *len, ap_int32_t flags)
- * Send a file from an open file descriptor to a socket, along with
- * optional headers and trailers
- * arg 1) The socket to which we're writing
- * arg 2) The open file from which to read
- * arg 3) A structure containing the headers and trailers to send
- * arg 4) Offset into the file where we should begin writing
- * arg 5) Number of bytes to send
- * arg 6) OS-specific flags to pass to sendfile()
- * NOTE: This functions acts like a blocking write by default. To change
- * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option.
- * The number of bytes actually sent is stored in argument 5.
- */
/* TODO: Verify that all platforms handle the fd the same way
* (i.e. not moving current file pointer)
diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
index 909044617..a95fa8f03 100644
--- a/network_io/unix/sockaddr.c
+++ b/network_io/unix/sockaddr.c
@@ -54,15 +54,6 @@
#include "networkio.h"
-/* ***APRDOC********************************************************
- * ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port)
- * Assocaite a local port with a socket.
- * arg 1) The socket to set
- * arg 2) The local port this socket will be dealing with.
- * NOTE: This does not bind the two together, it is just telling apr
- * that this socket is going to use this port if possible. If
- * the port is already used, we won't find out about it here.
- */
ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port)
{
sock->local_addr->sin_port = htons((short)port);
@@ -71,14 +62,6 @@ ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port)
-/* ***APRDOC********************************************************
- * ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port)
- * Assocaite a remote port with a socket.
- * arg 1) The socket to enquire about.
- * arg 2) The local port this socket will be dealing with.
- * NOTE: This does not make a connection to the remote port, it is just
- * telling apr which port ap_connect() should attempt to connect to.
- */
ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port)
{
sock->remote_addr->sin_port = htons((short)port);
@@ -87,12 +70,6 @@ ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port)
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock)
- * Return the local port with a socket.
- * arg 1) The local port this socket is associated with.
- * arg 2) The socket to enquire about.
- */
ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock)
{
*port = ntohs(sock->local_addr->sin_port);
@@ -101,12 +78,6 @@ ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock)
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock)
- * Return the remote port associated with a socket.
- * arg 1) The remote port this socket is associated with.
- * arg 2) The socket to enquire about.
- */
ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock)
{
*port = ntohs(sock->remote_addr->sin_port);
@@ -115,15 +86,6 @@ ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock)
-/* ***APRDOC********************************************************
- * ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, cont char *addr)
- * Assocaite a local socket addr with an apr socket.
- * arg 1) The socket to use
- * arg 2) The IP address to attach to the socket.
- * Use APR_ANYADDR to use any IP addr on the machine.
- * NOTE: This does not bind the two together, it is just telling apr
- * that this socket is going to use this address if possible.
- */
ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr)
{
u_long ipaddr;
@@ -145,14 +107,6 @@ ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr)
-/* ***APRDOC********************************************************
- * ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, cont char *addr)
- * Assocaite a remote socket addr with an apr socket.
- * arg 1) The socket to use
- * arg 2) The IP address to attach to the socket.
- * NOTE: This does not make a connection to the remote address, it is just
- * telling apr which address ap_connect() should attempt to connect to.
- */
ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr)
{
u_long ipaddr;
@@ -174,12 +128,6 @@ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr)
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock)
- * Return the local IP address associated with an apr socket.
- * arg 1) The local IP address associated with the socket.
- * arg 2) The socket to use
- */
ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock)
{
*addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr));
@@ -188,12 +136,6 @@ ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock)
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock)
- * Return the remote IP address associated with an apr socket.
- * arg 1) The remote IP address associated with the socket.
- * arg 2) The socket to use
- */
ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock)
{
*addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr));
@@ -203,13 +145,6 @@ ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock)
#if HAVE_NETINET_IN_H
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_local_name(struct sockaddr_in **name,
- * const ap_socket_t *sock)
- * Return the local socket name as a BSD style struct sockaddr_in.
- * arg 1) The local name associated with the socket.
- * arg 2) The socket to use
- */
ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock)
{
*name = sock->local_addr;
@@ -218,13 +153,6 @@ ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_remote_name(struct sockaddr_in **name,
- * const ap_socket_t *sock)
- * Return the remote socket name as a BSD style struct sockaddr_in.
- * arg 1) The remote name associated with the socket.
- * arg 2) The socket to use
- */
ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *sock)
{
*name = sock->remote_addr;
diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c
index 51c59e446..685780b87 100644
--- a/network_io/unix/sockets.c
+++ b/network_io/unix/sockets.c
@@ -67,12 +67,6 @@ static ap_status_t socket_cleanup(void *sock)
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_context_t *cont)
- * Create a socket for tcp communication.
- * arg 1) The new socket that has been setup.
- * arg 2) The context to use
- */
ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_context_t *cont)
{
(*new) = (ap_socket_t *)ap_palloc(cont, sizeof(ap_socket_t));
@@ -106,17 +100,6 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_context_t *cont)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how)
- * Shutdown either reading, writing, or both sides of a tcp socket.
- * arg 1) The socket to close
- * arg 2) How to shutdown the socket. One of:
- * APR_SHUTDOWN_READ -- no longer allow read requests
- * APR_SHUTDOWN_WRITE -- no longer allow write requests
- * APR_SHUTDOWN_READWRITE -- no longer allow read or write requests
- * NOTE: This does not actually close the socket descriptor, it just
- * controls which calls are still valid on the socket.
- */
ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how)
{
if (shutdown(thesocket->socketdes, how) == 0) {
@@ -127,24 +110,12 @@ ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how)
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_close_socket(ap_socket_t *thesocket)
- * Close a tcp socket.
- * arg 1) The socket to close
- */
ap_status_t ap_close_socket(ap_socket_t *thesocket)
{
ap_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup);
return socket_cleanup(thesocket);
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_bind(ap_socket_t *sock)
- * Bind the socket to it's assocaited port
- * arg 1) The socket to bind
- * NOTE: This is where we will find out if there is any other process
- * using the selected port.
- */
ap_status_t ap_bind(ap_socket_t *sock)
{
if (bind(sock->socketdes, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1)
@@ -153,14 +124,6 @@ ap_status_t ap_bind(ap_socket_t *sock)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog)
- * Listen to a bound socketi for connections.
- * arg 1) The socket to listen on
- * arg 2) The number of outstanding connections allowed in the sockets
- * listen queue. If this value is less than zero, the listen
- * queue size is set to zero.
- */
ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog)
{
if (listen(sock->socketdes, backlog) == -1)
@@ -169,16 +132,6 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock,
- ap_context_t *connection_context)
- * Accept a new connection request
- * arg 1) A copy of the socket that is connected to the socket that
- * made the connection request. This is the socket which should
- * be used for all future communication.
- * arg 2) The socket we are listening on.
- * arg 3) The context for the new socket.
- */
ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, ap_context_t *connection_context)
{
(*new) = (ap_socket_t *)ap_palloc(connection_context,
@@ -212,15 +165,6 @@ ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, ap_context_t *
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_connect(ap_socket_t *sock, char *hostname)
- * Issue a connection request to a socket either on the same machine
- * or a different one.
- * arg 1) The socket we wish to use for our side of the connection
- * arg 2) The hostname of the machine we wish to connect to. If NULL,
- * APR assumes that the sockaddr_in in the apr_socket is completely
- * filled out.
- */
ap_status_t ap_connect(ap_socket_t *sock, char *hostname)
{
struct hostent *hp;
@@ -254,12 +198,6 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname)
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *sock)
- * Return the context associated with the current socket.
- * arg 1) The currently open socket.
- * arg 2) The user data associated with the socket.
- */
ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *sock)
{
if (sock != NULL) {
@@ -271,15 +209,6 @@ ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *sock)
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, char *key,
- ap_status_t (*cleanup) (void *))
- * Set the context associated with the current socket.
- * arg 1) The currently open socket.
- * arg 2) The user data to associate with the socket.
- * arg 3) The key to associate with the data.
- * arg 4) The cleanup to call when the socket is destroyed.
- */
ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, char *key,
ap_status_t (*cleanup) (void *))
{
@@ -292,12 +221,6 @@ ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, char *key,
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock)
- * Convert the socket from an apr type to an OS specific socket
- * arg 1) The socket to convert.
- * arg 2) The os specifc equivelant of the apr socket..
- */
ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock)
{
if (sock == NULL) {
@@ -307,14 +230,6 @@ ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_socket_t *thesock,
- * ap_context_t *cont)
- * Convert a socket from the os specific type to the apr type
- * arg 1) The context to use.
- * arg 2) The socket to convert to.
- * arg 3) The socket we are converting to an apr type.
- */
ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock,
ap_context_t *cont)
{
diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c
index ff73b5539..eb7a0d2af 100644
--- a/network_io/unix/sockopt.c
+++ b/network_io/unix/sockopt.c
@@ -96,24 +96,6 @@ static ap_status_t sononblock(int sd)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on)
- * Setup socket options for the specified socket
- * arg 1) The socket to set up.
- * arg 2) The option we would like to configure. One of:
- * APR_SO_DEBUG -- turn on debugging information
- * APR_SO_KEEPALIVE -- keep connections active
- * APR_SO_LINGER -- lingers on close if data is present
- * APR_SO_NONBLOCK -- Turns blocking on/off for socket
- * APR_SO_REUSEADDR -- The rules used in validating addresses
- * supplied to bind should allow reuse
- * of local addresses.
- * APR_SO_TIMEOUT -- Set the timeout value in seconds.
- * values < 0 mean wait forever. 0 means
- * don't wait at all.
- * APR_SO_SNDBUF -- Set the SendBufferSize
- * arg 3) Are we turning the option on or off.
- */
ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on)
{
int one;
@@ -171,14 +153,6 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_context_t *cont)
- * Get name of the current machine
- * arg 1) A buffer to store the hostname in.
- * arg 2) The maximum length of the hostname that can be stored in the
- * buffer provided.
- * arg 3) The context to use.
- */
ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_context_t *cont)
{
if (gethostname(buf, len) == -1)
@@ -187,12 +161,6 @@ ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_context_t *cont)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock)
- * Get name of the machine we are currently connected to.
- * arg 1) A buffer to store the hostname in.
- * arg 2) The socket to examine.
- */
ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock)
{
struct hostent *hptr;
diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c
index c75532c1a..7010539fb 100644
--- a/network_io/win32/sockaddr.c
+++ b/network_io/win32/sockaddr.c
@@ -59,15 +59,6 @@
#include <string.h>
-/* ***APRDOC********************************************************
- * ap_status_t ap_set_local_port(ap_socket_t *socket, ap_uint32_t port)
- * Assocaite a local port with a socket.
- * arg 1) The socket to set
- * arg 2) The local port this socket will be dealing with.
- * NOTE: This does not bind the two together, it is just telling apr
- * that this socket is going to use this port if possible. If
- * the port is already used, we won't find out about it here.
- */
ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port)
{
sock->local_addr->sin_port = htons((short)port);
@@ -76,14 +67,6 @@ ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port)
-/* ***APRDOC********************************************************
- * ap_status_t ap_set_remote_port(ap_socket_t *socket, ap_uint32_t port)
- * Assocaite a remote port with a socket.
- * arg 1) The socket to enquire about.
- * arg 2) The local port this socket will be dealing with.
- * NOTE: This does not make a connection to the remote port, it is just
- * telling apr which port ap_connect() should attempt to connect to.
- */
ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port)
{
sock->remote_addr->sin_port = htons((short)port);
@@ -92,12 +75,6 @@ ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port)
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *socket)
- * Return the local port with a socket.
- * arg 1) The local port this socket is associated with.
- * arg 2) The socket to enquire about.
- */
ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock)
{
*port = ntohs(sock->local_addr->sin_port);
@@ -106,12 +83,6 @@ ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock)
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *socket)
- * Return the remote port associated with a socket.
- * arg 1) The remote port this socket is associated with.
- * arg 2) The socket to enquire about.
- */
ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock)
{
*port = ntohs(sock->remote_addr->sin_port);
@@ -120,15 +91,6 @@ ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock)
-/* ***APRDOC********************************************************
- * ap_status_t ap_set_local_ipaddr(ap_socket_t *socket, cont char *addr)
- * Assocaite a local socket addr with an apr socket.
- * arg 1) The socket to use
- * arg 2) The IP address to attach to the socket.
- * Use APR_ANYADDR to use any IP addr on the machine.
- * NOTE: This does not bind the two together, it is just telling apr
- * that this socket is going to use this address if possible.
- */
ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr)
{
u_long ipaddr;
@@ -148,14 +110,6 @@ ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_set_remote_ipaddr(ap_socket_t *socket, cont char *addr)
- * Assocaite a remote socket addr with an apr socket.
- * arg 1) The socket to use
- * arg 2) The IP address to attach to the socket.
- * NOTE: This does not make a connection to the remote address, it is just
- * telling apr which address ap_connect() should attempt to connect to.
- */
ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr)
{
u_long ipaddr;
@@ -175,12 +129,6 @@ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *socket)
- * Return the local IP address associated with an apr socket.
- * arg 1) The local IP address associated with the socket.
- * arg 2) The socket to use
- */
ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock)
{
*addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr));
@@ -189,12 +137,6 @@ ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock)
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *socket)
- * Return the remote IP address associated with an apr socket.
- * arg 1) The remote IP address associated with the socket.
- * arg 2) The socket to use
- */
ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock)
{
*addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr));
@@ -202,12 +144,6 @@ ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock)
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *socket)
- * Return the local socket name as a BSD style struct sockaddr_in.
- * arg 1) The local name associated with the socket.
- * arg 2) The socket to use
- */
ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock)
{
*name = sock->local_addr;
@@ -216,12 +152,6 @@ ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *socket)
- * Return the remote socket name as a BSD style struct sockaddr_in.
- * arg 1) The remote name associated with the socket.
- * arg 2) The socket to use
- */
ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *sock)
{
*name = sock->remote_addr;
diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c
index 7d2c905c3..48b6088df 100644
--- a/shmem/unix/shmem.c
+++ b/shmem/unix/shmem.c
@@ -61,15 +61,6 @@ struct shmem_t {
MM *mm;
};
-/* ***APRDOC********************************************************
- * ap_status_t ap_shm_init(ap_shmem_t *m, ap_size_t reqsize, char *file)
- * Create a pool of shared memory for use later.
- * arg 1) The shared memory block.
- * arg 2) The size of the shared memory pool.
- * arg 3) The file to use for the shared memory on platforms that
- * require it.
- * arg 4) The context to use
- */
ap_status_t ap_shm_init(struct shmem_t **m, ap_size_t reqsize, const char *file, ap_context_t *cont)
{
MM *newmm = mm_create(reqsize, file);
@@ -81,23 +72,12 @@ ap_status_t ap_shm_init(struct shmem_t **m, ap_size_t reqsize, const char *file,
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_shm_destroy(ap_shmem_t *m)
- * Destroy the shared memory block.
- * arg 1) The shared memory block to destroy.
- */
ap_status_t ap_shm_destroy(struct shmem_t *m)
{
mm_destroy(m->mm);
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_shm_malloc(ap_shmem_t *c, ap_size_t reqsize)
- * allocate memory from the block of shared memory.
- * arg 1) The shared memory block to destroy.
- * arg 2) How much memory to allocate
- */
void *ap_shm_malloc(struct shmem_t *c, ap_size_t reqsize)
{
if (c->mm == NULL) {
@@ -106,13 +86,6 @@ void *ap_shm_malloc(struct shmem_t *c, ap_size_t reqsize)
return mm_malloc(c->mm, reqsize);
}
-/* ***APRDOC********************************************************
- * void *ap_shm_calloc(ap_shmem_t *shared, ap_size_t size)
- * allocate memory from the block of shared memory and initialize it
- * to zero.
- * arg 1) The shared memory block to destroy.
- * arg 2) How much memory to allocate
- */
void *ap_shm_calloc(struct shmem_t *shared, ap_size_t size)
{
if (shared == NULL) {
@@ -121,30 +94,12 @@ void *ap_shm_calloc(struct shmem_t *shared, ap_size_t size)
return mm_calloc(shared->mm, 1, size);
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_shm_free(ap_shmem_t *shared, void *entity)
- * free shared memory previously allocated.
- * arg 1) The shared memory block to destroy.
- */
ap_status_t ap_shm_free(struct shmem_t *shared, void *entity)
{
mm_free(shared->mm, entity);
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name)
- * Get the name of the shared memory segment if not using
- * anonymous shared memory.
- * arg 1) The shared memory block to destroy.
- * arg 2) The name of the shared memory block, NULL if anonymous
- * shared memory.
- * return) APR_USES_ANONYMOUS_SHM if we are using anonymous shared
- * memory. APR_USES_FILEBASED_SHM if our shared memory is
- * 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.
- */
ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name)
{
#if APR_USES_ANONYMOUS_SHM
@@ -160,18 +115,6 @@ ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name)
#endif
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_set_shm_name(ap_shmem_t *c, ap_shm_name_t *name)
- * Set the name of the shared memory segment if not using
- * anonymous shared memory. This is to allow processes to open
- * shared memory created by another process.
- * arg 1) The shared memory block to destroy.
- * arg 2) The name of the shared memory block, NULL if anonymous
- * shared memory.
- * 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.
- */
ap_status_t ap_set_shm_name(ap_shmem_t *c, ap_shm_name_t *name)
{
#if APR_USES_ANONYMOUS_SHM
@@ -186,13 +129,6 @@ ap_status_t ap_set_shm_name(ap_shmem_t *c, ap_shm_name_t *name)
#endif
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_open_shmem(ap_shmem_t *c)
- * Open the shared memory block in a child process.
- * arg 1) The shared memory block to open in the child.
- * return) This should be called after ap_set_shm_name. The ap_shmem_t
- * variable must refer to the memory segment to open.
- */
ap_status_t ap_open_shmem(struct shmem_t *c)
{
#if APR_USES_ANONYMOUS_SHM
@@ -210,13 +146,6 @@ ap_status_t ap_open_shmem(struct shmem_t *c)
#endif
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_shm_avail(ap_shmem_t *c, ap_size_t *size)
- * Determine how much memory is available in the specified shared
- * memory block
- * arg 1) The shared memory block to open in the child.
- * arg 2) The amount of space available in the shared memory block.
- */
ap_status_t ap_shm_avail(struct shmem_t *c, ap_size_t *size)
{
*size = mm_available(c);
diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
index 8f81b1242..5c3e9cc8f 100644
--- a/threadproc/unix/proc.c
+++ b/threadproc/unix/proc.c
@@ -55,12 +55,6 @@
#include "threadproc.h"
#include "apr_portable.h"
-/* ***APRDOC********************************************************
- * ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_context_t *cont)
- * Create and initialize a new procattr variable
- * arg 1) The newly created procattr.
- * arg 2) The context to use
- */
ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_context_t *cont)
{
(*new) = (ap_procattr_t *)ap_palloc(cont,
@@ -82,16 +76,6 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_context_t *cont)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in,
- * ap_int32_t *out, ap_int32_t err)
- * Determine if any of stdin, stdout, or stderr should be linked
- * to pipes when starting a child process.
- * arg 1) The procattr we care about.
- * arg 2) Should stdin be a pipe bnack to the parent?
- * arg 3) Should stdout be a pipe bnack to the parent?
- * arg 4) Should stderr be a pipe bnack to the parent?
- */
ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in,
ap_int32_t out, ap_int32_t err)
{
@@ -145,20 +129,6 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in,
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_setprocattr_childin(ap_procattr_t *attr, ap_file_t *child_in,
- * ap_file_t *parent_in)
- * Set the child_in and/or parent_in values to existing ap_file_t
- * values. 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 mutiple
- * process invocations - such as a log file. You can save some
- * extra function calls by not creating your own pipe since this
- * creates one in the process space for you.
- * arg 1) The procattr we care about.
- * arg 2) ap_file_t value to use as child_in. Must be a valid file.
- * arg 3) ap_file_t value to use as parent_in. Must be a valid file.
- */
ap_status_t ap_setprocattr_childin(ap_procattr_t *attr, ap_file_t *child_in,
ap_file_t *parent_in)
{
@@ -175,19 +145,6 @@ ap_status_t ap_setprocattr_childin(ap_procattr_t *attr, ap_file_t *child_in,
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_setprocattr_childout(ap_procattr_t *attr,
- * ap_file_t *child_out,
- * ap_file_t *parent_out)
- * Set the child_out and parent_out values to existing ap_file_t
- * values. 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 mutiple
- * process invocations - such as a log file.
- * arg 1) The procattr we care about.
- * arg 2) ap_file_t value to use as child_out. Must be a valid file.
- * arg 3) ap_file_t value to use as parent_out. Must be a valid file.
- */
ap_status_t ap_setprocattr_childout(ap_procattr_t *attr, ap_file_t *child_out,
ap_file_t *parent_out)
{
@@ -204,19 +161,6 @@ ap_status_t ap_setprocattr_childout(ap_procattr_t *attr, ap_file_t *child_out,
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_setprocattr_childerr(ap_procattr_t *attr,
- * ap_file_t *child_err,
- * ap_file_t *parent_err)
- * Set the child_err and parent_err values to existing ap_file_t
- * values. 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 mutiple
- * process invocations - such as a log file.
- * arg 1) The procattr we care about.
- * arg 2) ap_file_t value to use as child_err. Must be a valid file.
- * arg 3) ap_file_t value to use as parent_err. Must be a valid file.
- */
ap_status_t ap_setprocattr_childerr(ap_procattr_t *attr, ap_file_t *child_err,
ap_file_t *parent_err)
{
@@ -233,14 +177,6 @@ ap_status_t ap_setprocattr_childerr(ap_procattr_t *attr, ap_file_t *child_err,
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, constchar *dir)
- * Set which directory the child process should start executing in.
- * arg 1) The procattr we care about.
- * arg 2) Which dir to start in. By default, this is the same dir as
- * the parent currently resides in, when the createprocess call
- * is made.
- */
ap_status_t ap_setprocattr_dir(ap_procattr_t *attr,
const char *dir)
{
@@ -251,14 +187,6 @@ ap_status_t ap_setprocattr_dir(ap_procattr_t *attr,
return APR_ENOMEM;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr, ap_cmdtype_e cmd)
- * Set what type of command the child process will call.
- * arg 1) The procattr we care about.
- * arg 2) The type of command. One of:
- * APR_SHELLCMD -- Shell script
- * APR_PROGRAM -- Executable program (default)
- */
ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr,
ap_cmdtype_e cmd)
{
@@ -266,25 +194,12 @@ ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr,
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach)
- * Determine if the chlid should start in detached state.
- * arg 1) The procattr we care about.
- * arg 2) Should the child start in detached state? Default is no.
- */
ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach)
{
attr->detached = detach;
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_fork(ap_proc_t **proc, ap_context_t *cont)
- * This is currently the only non-portable call in APR. This executes
- * a standard unix fork.
- * arg 1) The resulting process handle.
- * arg 2) The context to use.
- */
ap_status_t ap_fork(ap_proc_t **proc, ap_context_t *cont)
{
int pid;
@@ -304,21 +219,6 @@ ap_status_t ap_fork(ap_proc_t **proc, ap_context_t *cont)
return APR_INPARENT;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_create_process(ap_proc_t **new, const char *progname,
- * char *const args[], char **env,
- * ap_procattr_t *attr, ap_context_t *cont)
- * Create a new process and execute a new program within that process.
- * arg 1) The resulting process handle.
- * arg 2) The program to run
- * arg 3) the arguments to pass to the new program. The first one should
- * be the program name.
- * arg 4) The new environment ap_table_t for the new process. This should be a
- * list of NULL-terminated strings.
- * arg 5) the procattr we should use to determine how to create the new
- * process
- * arg 6) The context to use.
- */
ap_status_t ap_create_process(ap_proc_t **new, const char *progname,
char *const args[], char **env,
ap_procattr_t *attr, ap_context_t *cont)
@@ -411,55 +311,24 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname,
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_childin(ap_file_t **new, ap_proc_t *proc)
- * Get the file handle that is assocaited with a child's stdin.
- * arg 1) The returned file handle.
- * arg 2) The process handle that corresponds to the desired child process
- */
ap_status_t ap_get_childin(ap_file_t **new, ap_proc_t *proc)
{
(*new) = proc->attr->parent_in;
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_childout(ap_file_t **new, ap_proc_t *proc)
- * Get the file handle that is assocaited with a child's stdout.
- * arg 1) The returned file handle.
- * arg 2) The process handle that corresponds to the desired child process
- */
ap_status_t ap_get_childout(ap_file_t **new, ap_proc_t *proc)
{
(*new) = proc->attr->parent_out;
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_childerr(ap_file_t **new, ap_proc_t *proc)
- * Get the file handle that is assocaited with a child's stderr.
- * arg 1) The returned file handle.
- * arg 2) The process handle that corresponds to the desired child process
- */
ap_status_t ap_get_childerr(ap_file_t **new, ap_proc_t *proc)
{
(*new) = proc->attr->parent_err;
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how waithow)
- * Wait for a child process to die
- * arg 1) The process handle that corresponds to the desired child process
- * arg 2) How should we wait. One of:
- * APR_WAIT -- block until the child process dies.
- * APR_NOWAIT -- return immediately regardless of if the
- * child is dead or not.
- * NOTE: The childs status is in the return code to this process. It is
- * one of:
- * APR_CHILD_DONE -- child is no longer running.
- * APR_CHILD_NOTDONE -- child is still running.
- */
ap_status_t ap_wait_proc(ap_proc_t *proc,
ap_wait_how_e waithow)
{
@@ -484,12 +353,6 @@ ap_status_t ap_wait_proc(ap_proc_t *proc,
return errno;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc)
- * convert the proc from os specific type to apr type.
- * arg 1) The os specific proc we are converting to
- * arg 2) The apr proc we are converting
- */
ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc)
{
if (proc == NULL) {
@@ -499,14 +362,6 @@ ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_put_os_proc(ap_proc_t *proc, ap_os_proc_t *theproc,
- * ap_context_t *cont)
- * convert the proc from os specific type to apr type.
- * arg 1) The apr proc we are converting to.
- * arg 2) The os specific proc to convert
- * arg 3) The context to use if it is needed.
- */
ap_status_t ap_put_os_proc(ap_proc_t **proc, ap_os_proc_t *theproc,
ap_context_t *cont)
{
diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c
index a4ac1b642..d1bff1f09 100644
--- a/threadproc/unix/procsup.c
+++ b/threadproc/unix/procsup.c
@@ -54,12 +54,6 @@
#include "threadproc.h"
-/* ***APRDOC********************************************************
- * ap_status_t ap_detach(ap_proc_t **new, ap_context_t *cont)
- * Detach the process from the controlling terminal.
- * arg 1) The new process handler
- * arg 2) The context to use if it is needed.
- */
ap_status_t ap_detach(ap_proc_t **new, ap_context_t *cont)
{
int x;
@@ -124,13 +118,6 @@ ap_status_t ap_detach(ap_proc_t **new, ap_context_t *cont)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_procdata(char *key, void *data, ap_proc_t *proc)
- * Return the context associated with the current proc.
- * arg 1) The key associated with the data to retreive.
- * arg 2) The user data associated with the proc.
- * arg 3) The currently open proc.
- */
ap_status_t ap_get_procdata(char *key, void *data, ap_proc_t *proc)
{
if (proc != NULL) {
@@ -142,15 +129,6 @@ ap_status_t ap_get_procdata(char *key, void *data, ap_proc_t *proc)
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_set_procdata(void *data, char *key,
- * ap_status_t (*cleanup) (void *), ap_proc_t *proc)
- * Return the context associated with the current proc.
- * arg 2) The user data to associate with the file.
- * arg 3) The key to use for assocaiteing data with the file.
- * arg 4) The cleanup routine to use when the file is destroyed.
- * arg 1) The current process.
-*/
ap_status_t ap_set_procdata(void *data, char *key,
ap_status_t (*cleanup) (void *),
ap_proc_t *proc)
diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c
index bd4a6c0de..d31edd324 100644
--- a/threadproc/unix/signals.c
+++ b/threadproc/unix/signals.c
@@ -58,12 +58,6 @@
#include "../beos/threadproc.h"
#endif
-/* ***APRDOC********************************************************
- * ap_status_t ap_kill(ap_proc_t *proc, int sig)
- * Terminate a process.
- * arg 1) The process to terminate.
- * arg 2) How to kill the process.
- */
ap_status_t ap_kill(ap_proc_t *proc, int sig)
{
if (kill(proc->pid, sig) == -1) {
diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c
index f62b925de..99f3ab1cf 100644
--- a/threadproc/unix/thread.c
+++ b/threadproc/unix/thread.c
@@ -58,12 +58,6 @@
#if APR_HAS_THREADS
#ifdef HAVE_PTHREAD_H
-/* ***APRDOC********************************************************
- * ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_context_t *cont)
- * Create and initialize a new threadattr variable
- * arg 1) The newly created threadattr.
- * arg 2) The context to use
- */
ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_context_t *cont)
{
ap_status_t stat;
@@ -86,12 +80,6 @@ ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_context_t *cont)
return stat;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on)
- * Set if newly created threads should be created in detach mode.
- * arg 1) The threadattr to affect
- * arg 2) Thread detach state on or off
- */
ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on)
{
ap_status_t stat;
@@ -103,11 +91,6 @@ ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on)
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr)
- * Get the detach mode for this threadattr.
- * arg 1) The threadattr to reference
- */
ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr)
{
int state;
@@ -118,17 +101,6 @@ ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr)
return APR_NOTDETACH;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr,
- * ap_thread_start_t func, void *data,
- * ap_context_t *cont)
- * Create a new thread of execution
- * arg 1) The newly created thread handle.
- * arg 2) The threadattr to use to determine how to create the thread
- * arg 3) The function to start the new thread in
- * arg 4) Any data to be passed to the starting function
- * arg 5) The context to use
- */
ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr,
ap_thread_start_t func, void *data,
ap_context_t *cont)
@@ -168,12 +140,6 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr,
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval)
- * stop the current thread
- * arg 1) The thread to stop
- * arg 2) The return value to pass back to any thread that cares
- */
ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval)
{
ap_destroy_pool(thd->cntxt);
@@ -181,12 +147,6 @@ ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd)
- * block until the desired thread stops executing.
- * arg 1) The return value from the dead thread.
- * arg 2) The thread to join
- */
ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd)
{
ap_status_t stat;
@@ -199,11 +159,6 @@ ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd)
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_thread_detach(ap_thread_t *thd)
- * detach a thread
- * arg 1) The thread to detach
- */
ap_status_t ap_thread_detach(ap_thread_t *thd)
{
ap_status_t stat;
@@ -216,13 +171,6 @@ ap_status_t ap_thread_detach(ap_thread_t *thd)
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_threaddata(void **data, char *key, ap_thread_t *thread)
- * Return the context associated with the current thread.
- * arg 1) The user data associated with the thread.
- * arg 2) The key to associate with the data
- * arg 3) The currently open thread.
- */
ap_status_t ap_get_threaddata(void **data, char *key, ap_thread_t *thread)
{
if (thread != NULL) {
@@ -234,16 +182,6 @@ ap_status_t ap_get_threaddata(void **data, char *key, ap_thread_t *thread)
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_set_threaddata(void *data, char *key,
- ap_status_t (*cleanup) (void *),
- ap_thread_t *thread)
- * Return the context associated with the current thread.
- * arg 1) The user data to associate with the thread.
- * arg 2) The key to use for associating the data with the tread
- * arg 3) The cleanup routine to use when the thread is destroyed.
- * arg 4) The currently open thread.
- */
ap_status_t ap_set_threaddata(void *data, char *key,
ap_status_t (*cleanup) (void *),
ap_thread_t *thread)
@@ -257,12 +195,6 @@ ap_status_t ap_set_threaddata(void *data, char *key,
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_os_thread(ap_thread_t *thethd, ap_os_thread_t *thd)
- * convert the thread to os specific type from apr type.
- * arg 1) The apr thread to convert
- * arg 2) The os specific thread we are converting to
- */
ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, ap_thread_t *thd)
{
if (thd == NULL) {
@@ -272,14 +204,6 @@ ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, ap_thread_t *thd)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_put_os_thread(ap_thread_t *thd, ap_os_thread_t *thethd,
- * ap_context_t *cont)
- * convert the thread from os specific type to apr type.
- * arg 1) The apr thread we are converting to.
- * arg 2) The os specific thread to convert
- * arg 3) The context to use if it is needed.
- */
ap_status_t ap_put_os_thread(ap_thread_t **thd, ap_os_thread_t *thethd,
ap_context_t *cont)
{
diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c
index 232ab2f89..e57cb8424 100644
--- a/threadproc/unix/threadpriv.c
+++ b/threadproc/unix/threadpriv.c
@@ -58,15 +58,6 @@
#if APR_HAS_THREADS
#ifdef HAVE_PTHREAD_H
-/* ***APRDOC********************************************************
- * ap_status_t ap_create_thread_private(ap_threadkey_t **key,
- * void (*dest)(void *),
- * ap_context_t *cont)
- * Create and initialize a new thread private address space
- * arg 1) The thread private handle.
- * arg 2) The destructor to use when freeing the private memory.
- * arg 3) The context to use
- */
ap_status_t ap_create_thread_private(ap_threadkey_t **key,
void (*dest)(void *), ap_context_t *cont)
{
@@ -85,24 +76,12 @@ ap_status_t ap_create_thread_private(ap_threadkey_t **key,
return stat;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key)
- * Get a pointer to the thread private memory
- * arg 1) The data stored in private memory
- * arg 2) The handle for the desired thread private memory
- */
ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key)
{
(*new) = pthread_getspecific(key->key);
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key)
- * Set the data to be stored in thread private memory
- * arg 1) The data to be stored in private memory
- * arg 2) The handle for the desired thread private memory
- */
ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key)
{
ap_status_t stat;
@@ -114,11 +93,6 @@ ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key)
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_delete_thread_private(ap_threadkey_t *key)
- * Free the thread private memory
- * arg 1) The handle for the desired thread private memory
- */
ap_status_t ap_delete_thread_private(ap_threadkey_t *key)
{
ap_status_t stat;
@@ -128,14 +102,6 @@ ap_status_t ap_delete_thread_private(ap_threadkey_t *key)
return stat;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_threadkeydata(void **data, char *key,
- * ap_threadkey_t *threadkey)
- * Return the context associated with the current threadkey.
- * arg 1) The user data associated with the threadkey.
- * arg 2) The key associated with the data
- * arg 3) The currently open threadkey.
- */
ap_status_t ap_get_threadkeydata(void **data, char *key, ap_threadkey_t *threadkey)
{
if (threadkey != NULL) {
@@ -147,16 +113,6 @@ ap_status_t ap_get_threadkeydata(void **data, char *key, ap_threadkey_t *threadk
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_set_threadkeydata(void *data, char *key,
- ap_status_t (*cleanup) (void *),
- ap_threadkey_t *threadkey)
- * Return the context associated with the current threadkey.
- * arg 1) The data to set.
- * arg 1) The key to associate with the data.
- * arg 2) The user data to associate with the threadkey.
- * arg 1) The currently open threadkey.
- */
ap_status_t ap_set_threadkeydata(void *data,
char *key, ap_status_t (*cleanup) (void *),
ap_threadkey_t *threadkey)
@@ -170,13 +126,6 @@ ap_status_t ap_set_threadkeydata(void *data,
}
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_os_threadkey(ap_threadkey_t *thekey, ap_os_threadkey_t *key)
- * convert the thread private memory key to os specific type
- * from an apr type.
- * arg 1) The apr handle we are converting from.
- * arg 2) The os specific handle we are converting to.
- */
ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key)
{
if (key == NULL) {
@@ -186,14 +135,6 @@ ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_put_os_threadkey(ap_threadkey_t *key, ap_os_threadkey_t *thekey,
- * ap_context_t *cont)
- * convert the thread private memory key from os specific type to apr type.
- * arg 1) The apr handle we are converting to.
- * arg 2) The os specific handle to convert
- * arg 3) The context to use if it is needed.
- */
ap_status_t ap_put_os_threadkey(ap_threadkey_t **key,
ap_os_threadkey_t *thekey, ap_context_t *cont)
{
diff --git a/time/unix/time.c b/time/unix/time.c
index 3499cde88..4ac606e85 100644
--- a/time/unix/time.c
+++ b/time/unix/time.c
@@ -55,12 +55,6 @@
#include "atime.h"
#include "apr_portable.h"
-/* ***APRDOC********************************************************
- * ap_status_t ap_ansi_time_to_ap_time(ap_time_t *result, time_t input)
- * convert an ansi time_t to an ap_time_t
- * arg 1) the resulting ap_time_t
- * arg 2) the time_t to convert
- */
ap_status_t ap_ansi_time_to_ap_time(ap_time_t *result, time_t input)
{
*result = (ap_time_t)input * AP_USEC_PER_SEC;
@@ -68,10 +62,6 @@ ap_status_t ap_ansi_time_to_ap_time(ap_time_t *result, time_t input)
}
-/* ***APRDOC********************************************************
- * ap_time_t ap_now(void)
- * return the current time
- */
ap_time_t ap_now(void)
{
struct timeval tv;
@@ -94,12 +84,6 @@ static void tm_to_exp(ap_exploded_time_t *xt, struct tm *tm)
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_explode_gmt(ap_exploded_time_t *result, ap_time_t input)
- * convert a time to its human readable components in GMT timezone
- * arg 1) the exploded time
- * arg 2) the time to explode
- */
ap_status_t ap_explode_gmt(ap_exploded_time_t *result, ap_time_t input)
{
time_t t = input / AP_USEC_PER_SEC;
@@ -119,12 +103,6 @@ ap_status_t ap_explode_gmt(ap_exploded_time_t *result, ap_time_t input)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input)
- * convert a time to its human readable components in local timezone
- * arg 1) the exploded time
- * arg 2) the time to explode
- */
ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input)
{
#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
@@ -182,13 +160,6 @@ ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input)
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_implode_time(ap_time_t *t, ap_exploded_time_t *xt)
- * Convert time value from human readable format to number of seconds
- * since epoch
- * arg 1) the resulting imploded time
- * arg 2) the input exploded time
- */
ap_status_t ap_implode_time(ap_time_t *t, ap_exploded_time_t *xt)
{
int year;
@@ -223,12 +194,6 @@ ap_status_t ap_implode_time(ap_time_t *t, ap_exploded_time_t *xt)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **ostime, ap_time_t *aprtime)
- * Get the imploded time in the platforms native format.
- * arg 1) the native time format
- * arg 2) the time to convert
- */
ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **ostime, ap_time_t *aprtime)
{
(*ostime)->tv_usec = *aprtime % AP_USEC_PER_SEC;
@@ -236,12 +201,6 @@ ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **ostime, ap_time_t *aprtime)
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **ostime, ap_exploded_time_t *aprtime)
- * Get the exploded time in the platforms native format.
- * arg 1) the native time format
- * arg 2) the time to convert
- */
ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **ostime, ap_exploded_time_t *aprtime)
{
(*ostime)->tm_sec = aprtime->tm_sec;
@@ -256,13 +215,6 @@ ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **ostime, ap_exploded_time_t *ap
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_put_os_imp_time(ap_time_t *aprtime, ap_os_imp_time_t **ostime, ap_context_t, *cont)
- * Put the imploded time in the APR format.
- * arg 1) the APR time format
- * arg 2) the time to convert
- * arg 3) the context to use if necessary
- */
ap_status_t ap_put_os_imp_time(ap_time_t *aprtime, ap_os_imp_time_t **ostime,
ap_context_t *cont)
{
@@ -270,13 +222,6 @@ ap_status_t ap_put_os_imp_time(ap_time_t *aprtime, ap_os_imp_time_t **ostime,
return APR_SUCCESS;
}
-/* ***APRDOC********************************************************
- * ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime, ap_os_exp_time_t **ostime, ap_context_t, *cont)
- * Put the exploded time in the APR format.
- * arg 1) the APR time format
- * arg 2) the time to convert
- * arg 3) the context to use if necessary
- */
ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime,
ap_os_exp_time_t **ostime, ap_context_t *cont)
{