rbb         00/01/09 12:58:27

  Modified:    src/lib/apr/include apr_portable.h
               src/lib/apr/time/unix Makefile.in time.c
  Log:
  add the ap_get_os_*_time funcs after Dean's time re-write.
  
  Revision  Changes    Path
  1.18      +12 -6     apache-2.0/src/lib/apr/include/apr_portable.h
  
  Index: apr_portable.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_portable.h,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- apr_portable.h    1999/12/06 18:19:34     1.17
  +++ apr_portable.h    2000/01/09 20:58:22     1.18
  @@ -91,7 +91,8 @@
   typedef HANDLE                ap_os_thread_t;
   typedef PROCESS_INFORMATION   ap_os_proc_t;
   typedef DWORD                 ap_os_threadkey_t; 
  -typedef SYSTEMTIME            ap_os_time_t;
  +typedef FILETIME              ap_os_imp_time_t;
  +typedef SYSTEMTIME            ap_os_exp_time_t;
   
   #elif defined(OS2)
   #define INCL_DOS
  @@ -103,7 +104,8 @@
   typedef TID                   ap_os_thread_t;
   typedef PID                   ap_os_proc_t;
   typedef PULONG                ap_os_threadkey_t; 
  -typedef struct timeval        ap_os_time_t;
  +typedef struct timeval        ap_os_imp_time_t;
  +typedef struct tm             ap_os_exp_time_t;
   
   #elif defined(BEOS)
   #include <kernel/OS.h>
  @@ -124,7 +126,8 @@
   typedef thread_id             ap_os_thread_t;
   typedef thread_id             ap_os_proc_t;
   typedef int                   ap_os_threadkey_t;
  -typedef struct timeval        ap_os_time_t;
  +typedef struct timeval        ap_os_imp_time_t;
  +typedef struct tm             ap_os_exp_time_t;
   
   #else
   /* Any other OS should go above this one.  This is the lowest common
  @@ -173,7 +176,8 @@
   typedef pthread_key_t         ap_os_threadkey_t;
   #endif
   typedef pid_t                 ap_os_proc_t;
  -typedef struct timeval        ap_os_time_t;
  +typedef struct timeval        ap_os_imp_time_t;
  +typedef struct tm             ap_os_exp_time_t;
   #endif
   
   ap_status_t ap_get_os_file(ap_os_file_t *, ap_file_t *);     
  @@ -181,7 +185,8 @@
   ap_status_t ap_get_os_sock(ap_os_sock_t *, ap_socket_t *);
   ap_status_t ap_get_os_lock(ap_os_lock_t *, ap_lock_t *);     
   ap_status_t ap_get_os_proc(ap_os_proc_t *, ap_proc_t *);     
  -ap_status_t ap_get_os_time(ap_os_time_t **, ap_time_t *);     
  +ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **, ap_exploded_time_t *);   
  
  +ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **, ap_time_t *);     
   #if APR_HAS_THREADS
   ap_status_t ap_get_os_thread(ap_os_thread_t *, ap_thread_t *);
   ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *, ap_key_t *);
  @@ -192,7 +197,8 @@
   ap_status_t ap_put_os_sock(ap_socket_t **, ap_os_sock_t *, ap_context_t *);
   ap_status_t ap_put_os_lock(ap_lock_t **, ap_os_lock_t *, ap_context_t *); 
   ap_status_t ap_put_os_proc(ap_proc_t **, ap_os_proc_t *, ap_context_t *); 
  -ap_status_t ap_put_os_time(ap_time_t **, ap_os_time_t *, ap_context_t *); 
  +ap_status_t ap_put_os_imp_time(ap_time_t *, ap_os_imp_time_t **, 
ap_context_t *); 
  +ap_status_t ap_put_os_exp_time(ap_exploded_time_t *, ap_os_exp_time_t **, 
ap_context_t *); 
   #if APR_HAS_THREADS
   ap_status_t ap_put_os_thread(ap_thread_t **, ap_os_thread_t *, ap_context_t 
*);
   ap_status_t ap_put_os_threadkey(ap_key_t **, ap_os_threadkey_t *, 
ap_context_t *);
  
  
  
  1.11      +12 -12    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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Makefile.in       2000/01/09 05:18:21     1.10
  +++ Makefile.in       2000/01/09 20:58:24     1.11
  @@ -50,15 +50,15 @@
            && rm Makefile.new
   
   # DO NOT REMOVE
  -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_thread_proc.h \
  - ../../include/apr_portable.h ../../include/apr_network_io.h \
  - ../../include/apr_lock.h
  -timestr.o: timestr.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_thread_proc.h \
  - ../../include/apr_portable.h ../../include/apr_network_io.h \
  - ../../include/apr_lock.h
  +time.o: time.c atime.h $(INCDIR)/apr_config.h \
  + $(INCDIR)/apr_time.h $(INCDIR)/apr_general.h \
  + $(INCDIR)/apr.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_lib.h \
  + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_thread_proc.h \
  + $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \
  + $(INCDIR)/apr_lock.h
  +timestr.o: timestr.c atime.h $(INCDIR)/apr_config.h \
  + $(INCDIR)/apr_time.h $(INCDIR)/apr_general.h \
  + $(INCDIR)/apr.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_lib.h \
  + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_thread_proc.h \
  + $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \
  + $(INCDIR)/apr_lock.h
  
  
  
  1.17      +71 -0     apache-2.0/src/lib/apr/time/unix/time.c
  
  Index: time.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/time/unix/time.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- time.c    2000/01/09 05:18:21     1.16
  +++ time.c    2000/01/09 20:58:25     1.17
  @@ -223,3 +223,74 @@
       *t = days * AP_USEC_PER_SEC + xt->tm_usec;
       return APR_SUCCESS;
   }
  +
  +/* ***APRDOC********************************************************
  + * ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **, ap_time_t *)
  + *    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;
  +    (*ostime)->tv_sec = *aprtime / AP_USEC_PER_SEC;
  +    return APR_SUCCESS;
  +}
  +
  +/* ***APRDOC********************************************************
  + * ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **, ap_exploded_time_t *)
  + *    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;
  +    (*ostime)->tm_min  = aprtime->tm_min;
  +    (*ostime)->tm_hour = aprtime->tm_hour;
  +    (*ostime)->tm_mday = aprtime->tm_mday;
  +    (*ostime)->tm_mon  = aprtime->tm_mon;
  +    (*ostime)->tm_year = aprtime->tm_year;
  +    (*ostime)->tm_wday = aprtime->tm_wday;
  +    (*ostime)->tm_yday = aprtime->tm_yday;
  +    (*ostime)->tm_isdst = aprtime->tm_isdst;
  +    return APR_SUCCESS;
  +}
  +
  +/* ***APRDOC********************************************************
  + * ap_status_t ap_put_os_imp_time(ap_time_t *, ap_os_imp_time_t **, 
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)
  +{
  +    struct timeval tv;
  +    *aprtime = (*ostime)->tv_sec * AP_USEC_PER_SEC + (*ostime)->tv_usec;
  +    return APR_SUCCESS;
  +}
  +
  +/* ***APRDOC********************************************************
  + * ap_status_t ap_put_os_exp_time(ap_exploded_time_t *, ap_os_exp_time_t **, 
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)
  +{
  +    aprtime->tm_sec = (*ostime)->tm_sec;
  +    aprtime->tm_min = (*ostime)->tm_min;
  +    aprtime->tm_hour = (*ostime)->tm_hour;
  +    aprtime->tm_mday = (*ostime)->tm_mday;
  +    aprtime->tm_mon = (*ostime)->tm_mon;
  +    aprtime->tm_year = (*ostime)->tm_year;
  +    aprtime->tm_wday = (*ostime)->tm_wday;
  +    aprtime->tm_yday = (*ostime)->tm_yday;
  +    aprtime->tm_isdst = (*ostime)->tm_isdst;
  +    return APR_SUCCESS;
  +}
  +
  
  
  

Reply via email to