cvs commit: apache-2.0/src/lib/apr/time/win32 time.c

2000-02-01 Thread stoddard
stoddard00/01/31 16:08:26

  Modified:src/lib/apr/time/win32 time.c
  Log:
  Make some of the APR to Windows time conversion routines available to other
  APR functions.
  
  Revision  ChangesPath
  1.7   +3 -5  apache-2.0/src/lib/apr/time/win32/time.c
  
  Index: time.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/time/win32/time.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- time.c2000/01/17 23:17:37 1.6
  +++ time.c2000/02/01 00:08:25 1.7
  @@ -67,7 +67,7 @@
*/
   #define AP_DELTA_EPOCH_IN_USEC   116444736;
   
  -static void FileTimeToAprTime(ap_time_t *result, FILETIME *input)
  +void FileTimeToAprTime(ap_time_t *result, FILETIME *input)
   {
   /* Convert FILETIME one 64 bit number so we can work with it. */
   *result = input-dwHighDateTime;
  @@ -75,13 +75,11 @@
   *result |= input-dwLowDateTime;
   *result /= 10;/* Convert from 100 nano-sec periods to micro-seconds. 
*/
   *result -= AP_DELTA_EPOCH_IN_USEC;  /* Convert from Windows epoch to 
Unix epoch */
  -//printf(FileTimeToAprTime: aprtime - %I64d\n, *result);
   return;
   }
  -static void AprTimeToFileTime(LPFILETIME pft, ap_time_t t)
  +void AprTimeToFileTime(LPFILETIME pft, ap_time_t t)
   {
   LONGLONG ll;
  -//printf(AprTimeToFileTime: aprtime - %I64d\n, t);
   t += AP_DELTA_EPOCH_IN_USEC;
   ll = t * 10;
   pft-dwLowDateTime = (DWORD)ll;
  @@ -89,7 +87,7 @@
   return;
   }
   
  -static void SystemTimeToAprExpTime(ap_exploded_time_t *xt, SYSTEMTIME *tm)
  +void SystemTimeToAprExpTime(ap_exploded_time_t *xt, SYSTEMTIME *tm)
   {
   xt-tm_usec = tm-wMilliseconds * 1000;
   xt-tm_sec  = tm-wSecond;
  
  
  


cvs commit: apache-2.0/src/lib/apr/time/win32 time.c

2000-01-17 Thread stoddard
stoddard00/01/16 20:42:31

  Modified:src/lib/apr aprlib.def
   src/lib/apr/time/win32 time.c
  Log:
  Reimplement Win32 time functions to the new spec.
  
  Revision  ChangesPath
  1.8   +42 -29apache-2.0/src/lib/apr/aprlib.def
  
  Index: aprlib.def
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/aprlib.def,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- aprlib.def1999/12/15 01:53:27 1.7
  +++ aprlib.def2000/01/17 04:42:20 1.8
  @@ -15,11 +15,12 @@
ap_dir_entry_mtime   @8
ap_dir_entry_ftype   @9
ap_get_dir_filename   @10
  - ap_get_filename   @11
  - ap_get_filesize   @12
  - ap_get_fileatime   @13
  - ap_get_filectime   @14
  - ap_get_filemtime   @15
  +;ap_get_filename   @11
  + ap_stat   @11
  +;ap_get_filesize   @12
  +;ap_get_fileatime   @13
  +;ap_get_filectime   @14
  +;ap_get_filemtime   @15
ap_dupfile   @16
ap_getfileinfo   @17
ap_open   @18
  @@ -41,7 +42,7 @@
ap_flush @34
ap_fprintf   @35
ap_eof   @36
  - ap_get_filetype @37
  +;ap_get_filetype @37
ap_writev @38
; locks
ap_create_lock   @39
  @@ -132,29 +133,41 @@
ap_optopt   @124 DATA
ap_optreset   @125 DATA
ap_optarg   @126 DATA
  - ap_make_time   @127
  - ap_current_time   @128
  - ap_explode_time   @129
  - ap_implode_time   @130
  - ap_get_curtime   @131
  - ap_get_sec   @132
  - ap_get_min   @133
  - ap_get_hour   @134
  - ap_get_mday   @135
  - ap_get_mon   @136
  - ap_get_year   @137
  - ap_get_wday   @138
  - ap_set_sec   @139
  - ap_set_min   @140
  - ap_set_hour   @141
  - ap_set_mday   @142
  - ap_set_mon   @143
  - ap_set_year   @144
  - ap_set_wday   @145
  - ap_get_timedata   @146
  - ap_set_timedata   @147
  - ap_get_os_time   @148
  - ap_timediff   @149
  +;ap_make_time   @127
  + ap_ansi_time_to_ap_time @127
  +;ap_current_time   @128
  + ap_now@128
  +;ap_explode_time   @129
  + ap_explode_gmt@129
  +;ap_implode_time   @130
  + ap_explode_localtime @130
  +;ap_get_curtime   @131
  + ap_implode_time  @131
  +;ap_get_sec   @132
  + ap_get_os_imp_time  @132
  +;ap_get_min   @133
  + ap_get_os_exp_time  @133
  +;ap_get_hour   @134
  + ap_put_os_imp_time  @134
  +;ap_get_mday   @135
  + ap_put_os_exp_time  @135
  +;ap_get_mon   @136
  + ap_ctime @136
  +;ap_get_year   @137
  + ap_rfc822_date  @137
  +;ap_get_wday   @138
  + ap_strftime   @138
  +;ap_set_sec   @139
  +;ap_set_min   @140
  +;ap_set_hour   @141
  +;ap_set_mday   @142
  +;ap_set_mon   @143
  +;ap_set_year   @144
  +;ap_set_wday   @145
  +;ap_get_timedata   @146
  +;ap_set_timedata   @147
  +;ap_get_os_time   @148
  +;ap_timediff   @149
ap_MD5Final   @150
ap_MD5Init   @151
ap_MD5Update   @152
  
  
  
  1.5   +119 -62   apache-2.0/src/lib/apr/time/win32/time.c
  
  Index: time.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/time/win32/time.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- time.c1999/12/09 21:01:05 1.4
  +++ time.c2000/01/17 04:42:27 1.5
  @@ -60,98 +60,155 @@
   #include time.h
   #include errno.h
   #include string.h
  +#include winbase.h
   
  -ap_status_t ap_make_time(struct atime_t **new, ap_context_t *cont)
  +/* Number of micro-seconds between the beginning of the Windows epoch
  + * (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970) 
  + */
  +#define AP_DELTA_EPOCH_IN_USEC   116444736;
  +
  +static void FileTimeToAprTime(ap_time_t *result, FILETIME *input)
  +{
  +/* Convert FILETIME one 64 bit number so we can work with it. */
  +*result = input-dwHighDateTime;
  +*result = (*result)  32;
  +*result |= input-dwLowDateTime;
  +*result /= 10;/* Convert from 100 nano-sec periods to micro-seconds. 
*/
  +*result -= AP_DELTA_EPOCH_IN_USEC;  /* Convert from Windows epoch to 
Unix epoch */
  +//printf(FileTimeToAprTime: aprtime - %I64d\n, *result);
  +return;
  +}
  +static void AprTimeToFileTime(LPFILETIME pft, ap_time_t t)
   {
  -(*new) = (struct atime_t *)ap_palloc(cont, sizeof(struct atime_t));
  +LONGLONG ll;
  +//printf(AprTimeToFileTime: aprtime - %I64d\n, t);
  +t += AP_DELTA_EPOCH_IN_USEC;
  +ll = t * 10;
  +pft-dwLowDateTime = (DWORD)ll;
  +pft-dwHighDateTime = (DWORD) (ll  32);
  +return;
  +}
   
  -if ((*new) == NULL) {
  -return APR_ENOMEM;
  -}
  +static void SystemTimeToAprExpTime(ap_exploded_time_t *xt, 

cvs commit: apache-2.0/src/lib/apr/time/win32 time.c

2000-01-17 Thread stoddard
stoddard00/01/17 15:17:39

  Modified:src/lib/apr/time/win32 time.c
  Log:
  Humm, ULONGLONG does not appear to be recognised by VC++ 5.0
  
  Revision  ChangesPath
  1.6   +1 -1  apache-2.0/src/lib/apr/time/win32/time.c
  
  Index: time.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/time/win32/time.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- time.c2000/01/17 04:42:27 1.5
  +++ time.c2000/01/17 23:17:37 1.6
  @@ -114,7 +114,7 @@
   /* Return micro-seconds since the Unix epoch (jan. 1, 1970) */
   ap_time_t ap_now(void)
   {
  -ULONGLONG aprtime = 0;
  +LONGLONG aprtime = 0;
   FILETIME time;
   GetSystemTimeAsFileTime(time);
   FileTimeToAprTime(aprtime, time);