rbb 99/06/21 10:45:55
Modified: include apr_file_io.h apr_general.h
apr/file_io/unix fileacc.c
apr/misc/unix start.c
Log:
Adding functions to get to context stuff for File pointers. Functions
like this will be needed for each of the APR types.
Revision Changes Path
1.34 +1 -0 apache-apr/include/apr_file_io.h
Index: apr_file_io.h
===================================================================
RCS file: /home/cvs/apache-apr/include/apr_file_io.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- apr_file_io.h 1999/06/03 19:44:00 1.33
+++ apr_file_io.h 1999/06/21 17:45:53 1.34
@@ -130,6 +130,7 @@
/*accessor and general file_io functions. */
ap_status_t ap_get_filename(ap_file_t *, char **);
ap_status_t ap_get_dir_filename(ap_dir_t *, char **);
+ap_status_t ap_get_filecontext(ap_file_t *, ap_context_t **);
ap_status_t ap_dir_entry_size(ap_dir_t *, ap_ssize_t *);
ap_status_t ap_dir_entry_mtime(ap_dir_t *, time_t *);
1.18 +3 -1 apache-apr/include/apr_general.h
Index: apr_general.h
===================================================================
RCS file: /home/cvs/apache-apr/include/apr_general.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- apr_general.h 1999/06/15 17:43:38 1.17
+++ apr_general.h 1999/06/21 17:45:53 1.18
@@ -108,9 +108,11 @@
/* Context functions */
ap_status_t ap_create_context(ap_context_t *, void *, ap_context_t **);
-ap_status_t ap_set_signal_safe(ap_context_t *, ap_int16_t );
+ap_status_t ap_set_signal_safe(ap_context_t *, ap_int16_t);
ap_status_t ap_set_cancel_safe(ap_context_t *, ap_int16_t);
ap_status_t ap_exit(ap_context_t *);
+ap_status_t ap_set_userdata(ap_context_t *, void *);
+ap_status_t ap_get_userdata(ap_context_t *, void **);
#ifdef __cplusplus
}
1.13 +18 -0 apache-apr/apr/file_io/unix/fileacc.c
Index: fileacc.c
===================================================================
RCS file: /home/cvs/apache-apr/apr/file_io/unix/fileacc.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- fileacc.c 1999/06/02 18:44:33 1.12
+++ fileacc.c 1999/06/21 17:45:54 1.13
@@ -199,3 +199,21 @@
}
}
+/* ***APRDOC********************************************************
+ * ap_status_t ap_get_filecontext(ap_file_t *, struct context_t *)
+ * Return the context associated with the current file.
+ * arg 1) The currently open file.
+ * arg 2) The context associated with the file.
+ */
+ap_status_t ap_get_filecontext(struct file_t *file, struct context_t *cont)
+{
+ if (file != NULL) {
+ *cont = file->cntxt;
+ return APR_SUCCESS;
+ }
+ else {
+ cont = NULL;
+ return APR_ENOFILE;
+ }
+}
+
1.7 +18 -0 apache-apr/apr/misc/unix/start.c
Index: start.c
===================================================================
RCS file: /home/cvs/apache-apr/apr/misc/unix/start.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- start.c 1999/06/07 19:27:41 1.6
+++ start.c 1999/06/21 17:45:55 1.7
@@ -127,3 +127,21 @@
return APR_SUCCESS;
}
+ap_status_t ap_set_userdata(struct context_t *cont, void *data)
+{
+ if (cont) {
+ cont->prog_data = data;
+ return APR_SUCCESS;
+ }
+ return APR_ENOCONT;
+}
+
+ap_status_t ap_get_userdata(struct context_t *cont, void **data)
+{
+ if (cont) {
+ (*data) = cont->prog_data;
+ return APR_SUCCESS;
+ }
+ return APR_ENOCONT;
+}
+