rbb 99/06/22 09:57:42
Modified: apr/locks/unix locks.c
apr/network_io/unix poll.c sockets.c
apr/threadproc/unix procsup.c thread.c threadpriv.c
apr/time/unix access.c
include apr_errno.h apr_lock.h apr_network_io.h
apr_thread_proc.h apr_time.h
Log:
The rest of the functions needed to allow APR users to access the data field
of each APR type.
Revision Changes Path
1.10 +35 -0 apache-apr/apr/locks/unix/locks.c
Index: locks.c
===================================================================
RCS file: /home/cvs/apache-apr/apr/locks/unix/locks.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- locks.c 1999/06/22 14:56:29 1.9
+++ locks.c 1999/06/22 16:57:29 1.10
@@ -142,3 +142,38 @@
return APR_SUCCESS;
}
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_lockdata(ap_lock_t *, void *)
+ * Return the context associated with the current lock.
+ * arg 1) The currently open lock.
+ * arg 2) The user data associated with the lock.
+ */
+ap_status_t ap_get_lockdata(struct lock_t *lock, void *data)
+{
+ if (lock != NULL) {
+ return ap_get_userdata(lock->cntxt, &data);
+ }
+ else {
+ data = NULL;
+ return APR_ENOLOCK;
+ }
+}
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_lockdata(ap_lock_t *, 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.
+ */
+ap_status_t ap_set_lockdata(struct lock_t *lock, void *data)
+{
+ if (lock != NULL) {
+ return ap_set_userdata(lock->cntxt, data);
+ }
+ else {
+ data = NULL;
+ return APR_ENOLOCK;
+ }
+}
+
+
1.14 +36 -0 apache-apr/apr/network_io/unix/poll.c
Index: poll.c
===================================================================
RCS file: /home/cvs/apache-apr/apr/network_io/unix/poll.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- poll.c 1999/06/16 11:15:59 1.13
+++ poll.c 1999/06/22 16:57:30 1.14
@@ -291,3 +291,39 @@
}
#endif
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_polldata(ap_pollfd_t *, void *)
+ * Return the context associated with the current poll.
+ * arg 1) The currently open pollfd.
+ * arg 2) The user data associated with the pollfd.
+ */
+ap_status_t ap_get_polldata(struct pollfd_t *pollfd, void *data)
+{
+ if (pollfd != NULL) {
+ return ap_get_userdata(pollfd->cntxt, &data);
+ }
+ else {
+ data = NULL;
+ return APR_ENOFILE;
+ }
+}
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_polldata(ap_pollfd_t *, 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(struct pollfd_t *pollfd, void *data)
+{
+ if (pollfd != NULL) {
+ return ap_set_userdata(pollfd->cntxt, data);
+ }
+ else {
+ data = NULL;
+ return APR_ENOFILE;
+ }
+}
+
+
1.20 +35 -0 apache-apr/apr/network_io/unix/sockets.c
Index: sockets.c
===================================================================
RCS file: /home/cvs/apache-apr/apr/network_io/unix/sockets.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- sockets.c 1999/06/02 18:44:53 1.19
+++ sockets.c 1999/06/22 16:57:31 1.20
@@ -207,3 +207,38 @@
}
}
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_socketdata(ap_socket_t *, void *)
+ * 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(struct socket_t *socket, void *data)
+{
+ if (socket != NULL) {
+ return ap_get_userdata(socket->cntxt, &data);
+ }
+ else {
+ data = NULL;
+ return APR_ENOSOCKET;
+ }
+}
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_socketdata(ap_socket_t *, void *)
+ * Return the context associated with the current socket.
+ * arg 1) The currently open socket.
+ * arg 2) The user data to associate with the socket.
+ */
+ap_status_t ap_set_socketdata(struct socket_t *socket, void *data)
+{
+ if (socket != NULL) {
+ return ap_set_userdata(socket->cntxt, data);
+ }
+ else {
+ data = NULL;
+ return APR_ENOSOCKET;
+ }
+}
+
+
1.2 +33 -0 apache-apr/apr/threadproc/unix/procsup.c
Index: procsup.c
===================================================================
RCS file: /home/cvs/apache-apr/apr/threadproc/unix/procsup.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- procsup.c 1999/06/17 15:05:22 1.1
+++ procsup.c 1999/06/22 16:57:33 1.2
@@ -124,4 +124,37 @@
}
}
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_procdata(ap_proc_t *, void *)
+ * Return the context associated with the current proc.
+ * arg 1) The currently open proc.
+ * arg 2) The user data associated with the proc.
+ */
+ap_status_t ap_get_procdata(struct proc_t *proc, void *data)
+{
+ if (proc != NULL) {
+ return ap_get_userdata(proc->cntxt, &data);
+ }
+ else {
+ data = NULL;
+ return APR_ENOPROC;
+ }
+}
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_procdata(ap_proc_t *, void *)
+ * Return the context associated with the current proc.
+ * arg 1) The currently open proc.
+ * arg 2) The user data to associate with the proc.
+*/
+ap_status_t ap_set_procdata(struct proc_t *proc, void *data)
+{
+ if (proc != NULL) {
+ return ap_set_userdata(proc->cntxt, data);
+ }
+ else {
+ data = NULL;
+ return APR_ENOPROC;
+ }
+}
1.9 +33 -0 apache-apr/apr/threadproc/unix/thread.c
Index: thread.c
===================================================================
RCS file: /home/cvs/apache-apr/apr/threadproc/unix/thread.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- thread.c 1999/06/02 18:45:01 1.8
+++ thread.c 1999/06/22 16:57:34 1.9
@@ -170,4 +170,37 @@
}
}
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_threaddata(ap_thread_t *, void *)
+ * Return the context associated with the current thread.
+ * arg 1) The currently open thread.
+ * arg 2) The user data associated with the thread.
+ */
+ap_status_t ap_get_threaddata(struct thread_t *thread, void *data)
+{
+ if (thread != NULL) {
+ return ap_get_userdata(thread->cntxt, &data);
+ }
+ else {
+ data = NULL;
+ return APR_ENOTHREAD;
+ }
+}
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_threaddata(ap_thread_t *, void *)
+ * Return the context associated with the current thread.
+ * arg 1) The currently open thread.
+ * arg 2) The user data to associate with the thread.
+ */
+ap_status_t ap_set_threaddata(struct thread_t *thread, void *data)
+{
+ if (thread != NULL) {
+ return ap_set_userdata(thread->cntxt, data);
+ }
+ else {
+ data = NULL;
+ return APR_ENOTHREAD;
+ }
+}
1.7 +34 -0 apache-apr/apr/threadproc/unix/threadpriv.c
Index: threadpriv.c
===================================================================
RCS file: /home/cvs/apache-apr/apr/threadproc/unix/threadpriv.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- threadpriv.c 1999/06/02 18:45:01 1.6
+++ threadpriv.c 1999/06/22 16:57:34 1.7
@@ -102,3 +102,37 @@
return stat;
}
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_threadkeydata(ap_threadkey_t *, void *)
+ * Return the context associated with the current threadkey.
+ * arg 1) The currently open threadkey.
+ * arg 2) The user data associated with the threadkey.
+ */
+ap_status_t ap_get_threadkeydata(struct threadkey_t *threadkey, void *data)
+{
+ if (threadkey != NULL) {
+ return ap_get_userdata(threadkey->cntxt, &data);
+ }
+ else {
+ data = NULL;
+ return APR_ENOTHDKEY;
+ }
+}
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_threadkeydata(ap_threadkey_t *, void *)
+ * Return the context associated with the current threadkey.
+ * arg 1) The currently open threadkey.
+ * arg 2) The user data to associate with the threadkey.
+ */
+ap_status_t ap_set_threadkeydata(struct threadkey_t *threadkey, void *data)
+{
+ if (threadkey != NULL) {
+ return ap_set_userdata(threadkey->cntxt, data);
+ }
+ else {
+ data = NULL;
+ return APR_ENOTHDKEY;
+ }
+}
+
1.6 +33 -0 apache-apr/apr/time/unix/access.c
Index: access.c
===================================================================
RCS file: /home/cvs/apache-apr/apr/time/unix/access.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- access.c 1999/06/02 18:45:04 1.5
+++ access.c 1999/06/22 16:57:37 1.6
@@ -244,4 +244,37 @@
return APR_SUCCESS;
}
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_timedata(ap_time_t *, void *)
+ * Return the context associated with the current atime.
+ * arg 1) The currently open atime.
+ * arg 2) The user data associated with the atime.
+ */
+ap_status_t ap_get_timedata(struct atime_t *atime, void *data)
+{
+ if (atime != NULL) {
+ return ap_get_userdata(atime->cntxt, &data);
+ }
+ else {
+ data = NULL;
+ return APR_ENOTIME;
+ }
+}
+
+/* ***APRDOC********************************************************
+ * ap_status_t ap_set_timedata(ap_time_t *, void *)
+ * Return the context associated with the current atime.
+ * arg 1) The currently open atime.
+ * arg 2) The user data to associate with the atime.
+ */
+ap_status_t ap_set_timedata(struct atime_t *atime, void *data)
+{
+ if (atime != NULL) {
+ return ap_set_userdata(atime->cntxt, data);
+ }
+ else {
+ data = NULL;
+ return APR_ENOTIME;
+ }
+}
1.20 +5 -0 apache-apr/include/apr_errno.h
Index: apr_errno.h
===================================================================
RCS file: /home/cvs/apache-apr/include/apr_errno.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- apr_errno.h 1999/06/17 15:05:24 1.19
+++ apr_errno.h 1999/06/22 16:57:38 1.20
@@ -391,6 +391,11 @@
#define APR_ENOPROC 4006
#define APR_ENOTIME 4007
#define APR_ENODIR 4008
+#define APR_ENOLOCK 4009
+#define APR_ENOPOLL 4010
+#define APR_ENOSOCKET 4011
+#define APR_ENOTHREAD 4012
+#define APR_ENOTHDKEY 4013
/* APR STATUS VALUES */
#define APR_INCHILD 5001
1.5 +3 -0 apache-apr/include/apr_lock.h
Index: apr_lock.h
===================================================================
RCS file: /home/cvs/apache-apr/include/apr_lock.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- apr_lock.h 1999/06/18 19:11:18 1.4
+++ apr_lock.h 1999/06/22 16:57:38 1.5
@@ -74,6 +74,9 @@
ap_status_t ap_destroy_lock(ap_lock_t *);
ap_status_t ap_child_init_lock(ap_context_t *, char *, ap_lock_t **);
+ap_status_t ap_get_lockdata(ap_lock_t *, void *);
+ap_status_t ap_set_lockdata(ap_lock_t *, void *);
+
#ifdef __cplusplus
}
#endif
1.25 +4 -0 apache-apr/include/apr_network_io.h
Index: apr_network_io.h
===================================================================
RCS file: /home/cvs/apache-apr/include/apr_network_io.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- apr_network_io.h 1999/06/14 19:26:37 1.24
+++ apr_network_io.h 1999/06/22 16:57:38 1.25
@@ -109,6 +109,8 @@
ap_status_t ap_get_remote_hostname(ap_socket_t *, char **);
ap_status_t ap_gethostname(ap_context_t *, char *, int);
+ap_status_t ap_get_socketdata(ap_socket_t *, void *);
+ap_status_t ap_set_socketdata(ap_socket_t *, void *);
ap_status_t ap_send(ap_socket_t *, const char *, ap_ssize_t *, time_t);
ap_status_t ap_recv(ap_socket_t *, char *, ap_ssize_t *, time_t);
@@ -120,6 +122,8 @@
ap_status_t ap_poll(ap_pollfd_t *, ap_int32_t *, ap_int32_t);
ap_status_t ap_add_poll_socket(ap_pollfd_t *, ap_socket_t *, ap_int16_t);
ap_status_t ap_get_revents(ap_pollfd_t *, ap_socket_t *, ap_int16_t *);
+ap_status_t ap_get_polldata(ap_pollfd_t *, void *);
+ap_status_t ap_set_polldata(ap_pollfd_t *, void *);
/* accessor functions */
1.16 +6 -0 apache-apr/include/apr_thread_proc.h
Index: apr_thread_proc.h
===================================================================
RCS file: /home/cvs/apache-apr/include/apr_thread_proc.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- apr_thread_proc.h 1999/06/18 19:11:18 1.15
+++ apr_thread_proc.h 1999/06/22 16:57:38 1.16
@@ -95,12 +95,16 @@
ap_status_t ap_cancel_thread(ap_thread_t *);
ap_status_t ap_setcanceltype(ap_context_t *, ap_int32_t);
ap_status_t ap_setcancelstate(ap_context_t *, ap_int32_t);
+ap_status_t ap_get_threaddata(ap_thread_t *, void *);
+ap_status_t ap_set_threaddata(ap_thread_t *, void *);
ap_status_t ap_create_thread_private(ap_context_t *, void (*dest)(void *),
ap_key_t **);
ap_status_t ap_get_thread_private(ap_key_t *, void **);
ap_status_t ap_set_thread_private(ap_key_t *, void *);
ap_status_t ap_delete_thread_private(ap_key_t *);
+ap_status_t ap_get_threadkeydata(ap_key_t *, void *);
+ap_status_t ap_set_threadkeydata(ap_key_t *, void *);
/* Process Function definitions */
ap_status_t ap_createprocattr_init(ap_context_t *, ap_procattr_t **);
@@ -109,6 +113,8 @@
ap_status_t ap_setprocattr_dir(ap_procattr_t *, char *);
ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *, ap_cmdtype_e);
ap_status_t ap_setprocattr_detach(ap_procattr_t *, ap_int32_t);
+ap_status_t ap_get_procdata(ap_proc_t *, void *);
+ap_status_t ap_set_procdata(ap_proc_t *, void *);
ap_status_t ap_get_childin(ap_proc_t *, ap_file_t **);
ap_status_t ap_get_childout(ap_proc_t *, ap_file_t **);
1.4 +3 -0 apache-apr/include/apr_time.h
Index: apr_time.h
===================================================================
RCS file: /home/cvs/apache-apr/include/apr_time.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- apr_time.h 1999/05/25 17:04:10 1.3
+++ apr_time.h 1999/06/22 16:57:38 1.4
@@ -92,6 +92,9 @@
ap_status_t ap_set_year(ap_time_t *, ap_int32_t);
ap_status_t ap_set_wday(ap_time_t *, ap_int32_t);
+ap_status_t ap_get_timedata(ap_time_t *, void *);
+ap_status_t ap_set_timedata(ap_time_t *, void *);
+
#ifdef __cplusplus
}
#endif