cvs commit: apache-2.0/src/lib/apr/time/unix timestr.c
ben 00/01/22 17:13:48 Modified:src/lib/apr configure.in src/lib/apr/include apr_portable.h src/lib/apr/locks/unix crossproc.c locks.h src/lib/apr/time/unix timestr.c Log: Make interprocess mutexes actually choose, fix semaphore mutexes. Revision ChangesPath 1.46 +37 -38apache-2.0/src/lib/apr/configure.in Index: configure.in === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/configure.in,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- configure.in 2000/01/19 01:14:49 1.45 +++ configure.in 2000/01/23 01:13:44 1.46 @@ -161,43 +161,6 @@ AC_CHECK_DEFINE(LOCK_EX, sys/file.h) AC_CHECK_DEFINE(F_SETLK, fcntl.h) -dnl Checks for libraries. -AC_BEGIN_DECISION([lock implementation method]) -AC_IFALLYES(header:sys/file.h define:LOCK_EX, -AC_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()])) -AC_IFALLYES(header:sys/ipc.h header:sys/sem.h header:sys/file.h dnl -func:semget func:semctl, -AC_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) -AC_IFALLYES(header:fcntl.h define:F_SETLK, -AC_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) -AC_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl -custom:use_pthread_cross, -AC_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) -AC_DECISION_FORCE(USE_FCNTL_SERIALIZE) -AC_END_DECISION -AC_DEFINE_UNQUOTED($ac_decision) - -if test .$ac_decision = .USE_FLOCK_SERIALIZE; then -flockser=1 -else -flockser=0 -fi -if test .$ac_decision = .USE_SYSVSEM_SERIALIZE; then -sysvser=1 -else -sysvser=0 -fi -if test .$ac_decision = .USE_FCNTL_SERIALIZE; then -fcntlser=1 -else -fcntlser=0 -fi -if test .$ac_decision = .USE_PROC_PTHREAD_SERIALIZE; then -procpthreadser=1 -else -procpthreadser=0 -fi - ac_cv_define_READDIR_IS_THREAD_SAFE=no AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE)) @@ -322,7 +285,7 @@ ],[ union semun arg; semctl(0, 0, 0, arg); -], AC_DEFINE(HAVE_STRUCT_UNION_SEMUN) +], [AC_DEFINE(HAVE_STRUCT_UNION_SEMUN) union_semun=yes] msg=yes,dnl msg=no) AC_MSG_RESULT([$msg]) @@ -352,6 +315,42 @@ AC_SUBST(inet_network) AC_CHECK_FUNCS(gmtime_r localtime_r) + +dnl Checks for libraries. +AC_BEGIN_DECISION([lock implementation method]) +AC_IFALLYES(header:sys/file.h define:LOCK_EX, +AC_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()])) +AC_IFALLYES(header:fcntl.h define:F_SETLK, +AC_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) +AC_IFALLYES(custom:union_semun, +AC_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) +AC_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl +custom:use_pthread_cross, +AC_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) +dnl AC_DECISION_FORCE(USE_FCNTL_SERIALIZE) +AC_END_DECISION +AC_DEFINE_UNQUOTED($ac_decision) + +if test .$ac_decision = .USE_FLOCK_SERIALIZE; then +flockser=1 +else +flockser=0 +fi +if test .$ac_decision = .USE_SYSVSEM_SERIALIZE; then +sysvser=1 +else +sysvser=0 +fi +if test .$ac_decision = .USE_FCNTL_SERIALIZE; then +fcntlser=1 +else +fcntlser=0 +fi +if test .$ac_decision = .USE_PROC_PTHREAD_SERIALIZE; then +procpthreadser=1 +else +procpthreadser=0 +fi dnl Start building stuff from our information AC_SUBST(LDLIBS) 1.19 +3 -0 apache-2.0/src/lib/apr/include/apr_portable.h Index: apr_portable.h === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/include/apr_portable.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- apr_portable.h2000/01/09 20:58:22 1.18 +++ apr_portable.h2000/01/23 01:13:45 1.19 @@ -81,6 +81,9 @@ #if APR_HAVE_PTHREAD_H #include pthread.h #endif +#ifdef HAVE_STRUCT_UNION_SEMUN +#include sys/sem.h +#endif #ifdef WIN32 /* The primitives for Windows types */ 1.11 +7 -5 apache-2.0/src/lib/apr/locks/unix/crossproc.c Index: crossproc.c === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/locks/unix/crossproc.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- crossproc.c 1999/12/03 15:18:27 1.10 +++ crossproc.c 2000/01/23 01:13:46 1.11 @@ -56,12 +56,14 @@ #include locks.h #if defined (USE_SYSVSEM_SERIALIZE) -ap_status_t lock_cleanup(struct lock_t *lock) +ap_status_t lock_cleanup(void *lock_) { +struct lock_t *lock=lock_;
Re: cvs commit: apache-2.0/src/lib/apr/time/unix timestr.c
src/lib/apr/include apr_portable.h src/lib/apr/locks/unix crossproc.c locks.h src/lib/apr/time/unix timestr.c Log: Make interprocess mutexes actually choose, fix semaphore mutexes. What does this mean? Index: apr_portable.h === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/include/apr_portable.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- apr_portable.h 2000/01/09 20:58:22 1.18 +++ apr_portable.h 2000/01/23 01:13:45 1.19 @@ -81,6 +81,9 @@ #if APR_HAVE_PTHREAD_H #include pthread.h #endif +#ifdef HAVE_STRUCT_UNION_SEMUN +#include sys/sem.h +#endif This is bad. We cannot use HAVE_ macros in public header files, because they aren't namepsace protected. It really doesn't matter if we named them ourselves or if autoconf named them for us. Please change this to APR_HAVE_STRUCT_UNION_SEMUN. Ryan
Re: cvs commit: apache-2.0/src/lib/apr/time/unix timestr.c
[EMAIL PROTECTED] wrote: src/lib/apr/include apr_portable.h src/lib/apr/locks/unix crossproc.c locks.h src/lib/apr/time/unix timestr.c Log: Make interprocess mutexes actually choose, fix semaphore mutexes. What does this mean? It means don't force them to be always fcntl, i.e. actually use the choice instead of overriding it. Index: apr_portable.h === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/include/apr_portable.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- apr_portable.h 2000/01/09 20:58:22 1.18 +++ apr_portable.h 2000/01/23 01:13:45 1.19 @@ -81,6 +81,9 @@ #if APR_HAVE_PTHREAD_H #include pthread.h #endif +#ifdef HAVE_STRUCT_UNION_SEMUN +#include sys/sem.h +#endif This is bad. We cannot use HAVE_ macros in public header files, because they aren't namepsace protected. It really doesn't matter if we named them ourselves or if autoconf named them for us. Please change this to APR_HAVE_STRUCT_UNION_SEMUN. Sure, but I couldn't figure out where/how that happens/should happen. Cheers, Ben. -- SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm http://www.apache-ssl.org/ben.html Y19100 no-prize winner! http://www.ntk.net/index.cgi?back=2000/now0121.txt
Re: cvs commit: apache-2.0/src/lib/apr/time/unix timestr.c
On Sun, 23 Jan 2000, Ben Laurie wrote: [EMAIL PROTECTED] wrote: src/lib/apr/include apr_portable.h src/lib/apr/locks/unix crossproc.c locks.h src/lib/apr/time/unix timestr.c Log: Make interprocess mutexes actually choose, fix semaphore mutexes. What does this mean? It means don't force them to be always fcntl, i.e. actually use the choice instead of overriding it. Okay, I didn't realize we were overriding it. I just didn't understand the comment. Index: apr_portable.h === RCS file: /export/home/cvs/apache-2.0/src/lib/apr/include/apr_portable.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- apr_portable.h 2000/01/09 20:58:22 1.18 +++ apr_portable.h 2000/01/23 01:13:45 1.19 @@ -81,6 +81,9 @@ #if APR_HAVE_PTHREAD_H #include pthread.h #endif +#ifdef HAVE_STRUCT_UNION_SEMUN +#include sys/sem.h +#endif This is bad. We cannot use HAVE_ macros in public header files, because they aren't namepsace protected. It really doesn't matter if we named them ourselves or if autoconf named them for us. Please change this to APR_HAVE_STRUCT_UNION_SEMUN. Sure, but I couldn't figure out where/how that happens/should happen. Not a problem, I'll do it, and that will serve as an example of how to do this in the future. I won't get to it till tomorrow though.. Ryan Come to the first official Apache Software Foundation Conference!!! http://ApacheCon.Com/ ___ Ryan Bloom [EMAIL PROTECTED] 2121 Stonehenge Dr. Apt #3 Raleigh, NC 27615 Ryan Bloom -- thinker, adventurer, artist, writer, but mostly, friend. ---
cvs commit: apache-2.0/src/lib/apr/time/unix timestr.c
stoddard00/01/17 15:23:48 Modified:src/lib/apr/time/unix timestr.c Log: Initialize struct tm Submitted by: Paul Reder Revision ChangesPath 1.6 +1 -1 apache-2.0/src/lib/apr/time/unix/timestr.c Index: timestr.c === RCS file: /home/cvs/apache-2.0/src/lib/apr/time/unix/timestr.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- timestr.c 2000/01/09 05:18:21 1.5 +++ timestr.c 2000/01/17 23:23:46 1.6 @@ -159,7 +159,7 @@ const char *format, ap_exploded_time_t *xt) { struct tm tm; - +memset(tm, 0, sizeof(struct tm)); tm.tm_sec = xt-tm_sec; tm.tm_min = xt-tm_min; tm.tm_hour = xt-tm_hour;
cvs commit: apache-2.0/src/lib/apr/time/unix timestr.c
dgaudet 99/12/30 21:09:22 Modified:src/lib/apr/include apr_time.h src/lib/apr/time/unix timestr.c Log: retsize should be ap_size_t, not hardwired to 32 bits Revision ChangesPath 1.8 +1 -1 apache-2.0/src/lib/apr/include/apr_time.h Index: apr_time.h === RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_time.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- apr_time.h1999/12/30 18:31:27 1.7 +++ apr_time.h1999/12/31 05:09:20 1.8 @@ -77,7 +77,7 @@ ap_status_t ap_implode_time(ap_time_t *); ap_status_t ap_timestr(char **date_str, struct atime_t *t, ap_timetype_e type, ap_context_t *p); -ap_status_t ap_strftime(char *s, ap_int32_t *retsize, ap_size_t max, const char *format, ap_time_t *tm); +ap_status_t ap_strftime(char *s, ap_size_t *retsize, ap_size_t max, const char *format, ap_time_t *tm); /* accessor functions */ ap_status_t ap_get_curtime(ap_time_t *, ap_int64_t *); 1.4 +1 -1 apache-2.0/src/lib/apr/time/unix/timestr.c Index: timestr.c === RCS file: /home/cvs/apache-2.0/src/lib/apr/time/unix/timestr.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- timestr.c 1999/12/30 18:31:28 1.3 +++ timestr.c 1999/12/31 05:09:21 1.4 @@ -126,7 +126,7 @@ */ } -ap_status_t ap_strftime(char *s, ap_int32_t *retsize, ap_size_t max, +ap_status_t ap_strftime(char *s, ap_size_t *retsize, ap_size_t max, const char *format, struct atime_t *tm) { (*retsize) = strftime(s, max, format, tm-explodedtime);
cvs commit: apache-2.0/src/lib/apr/time/unix timestr.c Makefile.in access.c atime.h time.c
rbb 99/12/20 08:10:19 Modified:src/lib/apr/include apr.h.in apr_errno.h apr_time.h src/lib/apr/time/unix Makefile.in access.c atime.h time.c Added: src/lib/apr/time/unix timestr.c Log: A bunch more time functions for use in Apache. This is really the first cut at making the time library usable in an actual program. Revision ChangesPath 1.7 +1 -0 apache-2.0/src/lib/apr/include/apr.h.in Index: apr.h.in === RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr.h.in,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- apr.h.in 1999/12/06 18:19:33 1.6 +++ apr.h.in 1999/12/20 16:10:10 1.7 @@ -70,6 +70,7 @@ #define API_EXPORT(type) type #define API_EXPORT_NONSTD(type) type #define API_VAR_IMPORT extern +#define API_VAR_EXPORT #endif /* APR_H */ 1.12 +3 -0 apache-2.0/src/lib/apr/include/apr_errno.h Index: apr_errno.h === RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_errno.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- apr_errno.h 1999/12/09 21:00:20 1.11 +++ apr_errno.h 1999/12/20 16:10:11 1.12 @@ -124,6 +124,9 @@ #define APR_BADARG (APR_OS_START_STATUS + 13) #define APR_EOF(APR_OS_START_STATUS + 14) #define APR_NOTFOUND (APR_OS_START_STATUS + 15) +#define APR_LESS (APR_OS_START_STATUS + 16) +#define APR_EQUAL (APR_OS_START_STATUS + 17) +#define APR_MORE (APR_OS_START_STATUS + 18) /* A simple value to be used to initialze a status variable. */ #define APR_EINIT (APR_OS_START_STATUS + 16) 1.4 +8 -0 apache-2.0/src/lib/apr/include/apr_time.h Index: apr_time.h === RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_time.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- apr_time.h1999/10/04 16:36:55 1.3 +++ apr_time.h1999/12/20 16:10:11 1.4 @@ -67,12 +67,18 @@ typedef struct atime_t ap_time_t; +API_VAR_IMPORT const char ap_month_snames[12][4]; +API_VAR_IMPORT const char ap_day_snames[7][4]; + /* Function Definitions */ ap_status_t ap_make_time(ap_time_t **, ap_context_t *); ap_status_t ap_current_time(ap_time_t *); ap_status_t ap_explode_time(ap_time_t *, ap_timetype_e); ap_status_t ap_implode_time(ap_time_t *); +ap_status_t ap_gm_timestr_822(char **date_str, struct atime_t *t, ap_context_t *p); +ap_status_t ap_strftime(char *s, ap_size_t max, const char *format, ap_time_t *tm); + /* accessor functions */ ap_status_t ap_get_curtime(ap_time_t *, ap_int64_t *); ap_status_t ap_timediff(ap_time_t *, ap_time_t *, ap_int32_t *); @@ -85,6 +91,7 @@ ap_status_t ap_get_year(ap_time_t *, ap_int32_t *); ap_status_t ap_get_wday(ap_time_t *, ap_int32_t *); +ap_status_t ap_set_curtime(ap_time_t *, ap_int64_t); ap_status_t ap_set_sec(ap_time_t *, ap_int32_t); ap_status_t ap_set_min(ap_time_t *, ap_int32_t); ap_status_t ap_set_hour(ap_time_t *, ap_int32_t); @@ -92,6 +99,7 @@ ap_status_t ap_set_mon(ap_time_t *, ap_int32_t); 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_timecmp(ap_time_t *a, ap_time_t *b); ap_status_t ap_get_timedata(ap_time_t *, char *, void *); ap_status_t ap_set_timedata(ap_time_t *, void *, char *, 1.8 +11 -4 apache-2.0/src/lib/apr/time/unix/Makefile.in Index: Makefile.in === RCS file: /home/cvs/apache-2.0/src/lib/apr/time/unix/Makefile.in,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- Makefile.in 1999/12/19 18:10:05 1.7 +++ Makefile.in 1999/12/20 16:10:15 1.8 @@ -15,7 +15,8 @@ LIB=libtime.a OBJS=time.o \ - access.o + access.o \ + timestr.o .c.o: $(CC) $(CFLAGS) -c $(INCLUDES) $ @@ -53,10 +54,16 @@ access.o: access.c atime.h ../../include/apr_config.h \ ../../include/apr_time.h ../../include/apr_general.h \ ../../include/apr.h ../../include/apr_errno.h ../../include/apr_lib.h \ - ../../include/apr_file_io.h + ../../include/apr_file_io.h ../../include/apr_thread_proc.h time.o: time.c atime.h ../../include/apr_config.h \ ../../include/apr_time.h ../../include/apr_general.h \ ../../include/apr.h ../../include/apr_errno.h ../../include/apr_lib.h \ - ../../include/apr_file_io.h ../../include/apr_portable.h \ - ../../include/apr_thread_proc.h ../../include/apr_network_io.h \ +