diff options
author | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2000-01-09 20:58:25 +0000 |
---|---|---|
committer | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2000-01-09 20:58:25 +0000 |
commit | 8f1857909533ba9c90a33bdf2d743922ff35d62e (patch) | |
tree | 5192061351bb4d1ac4f9feb348488d8c86d136f0 /time | |
parent | c54673788efa5d1dfc6a98e144c5a5f72c7facd3 (diff) | |
download | libapr-8f1857909533ba9c90a33bdf2d743922ff35d62e.tar.gz |
add the ap_get_os_*_time funcs after Dean's time re-write.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@59580 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'time')
-rw-r--r-- | time/unix/Makefile.in | 24 | ||||
-rw-r--r-- | time/unix/time.c | 71 |
2 files changed, 83 insertions, 12 deletions
diff --git a/time/unix/Makefile.in b/time/unix/Makefile.in index 8e2a2cff2..9d77b4f2f 100644 --- a/time/unix/Makefile.in +++ b/time/unix/Makefile.in @@ -50,15 +50,15 @@ depend: && 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 diff --git a/time/unix/time.c b/time/unix/time.c index 2607b45fc..844d0e55a 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -223,3 +223,74 @@ ap_status_t ap_implode_time(ap_time_t *t, ap_exploded_time_t *xt) *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; +} + |