You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by ia...@apache.org on 2002/03/06 18:50:02 UTC

cvs commit: apr/time/win32 time.c timestr.c

ianh        02/03/06 09:50:02

  Modified:    .        CHANGES
               file_io/netware filestat.c
               file_io/unix filestat.c
               include  apr_compat.h apr_portable.h apr_time.h
               test     testtime.c
               time/unix time.c timestr.c
               time/win32 time.c timestr.c
  Log:
  patches for apr to rename apr_ansi_time_to_apr_time and
  apr_exploded_time_t.
  
  Submitted by:	 Thom May <th...@planetarytramp.org>
  Reviewed by:	Ian Holsman
  
  Revision  Changes    Path
  1.233     +4 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.232
  retrieving revision 1.233
  diff -u -r1.232 -r1.233
  --- CHANGES	6 Mar 2002 03:23:23 -0000	1.232
  +++ CHANGES	6 Mar 2002 17:50:01 -0000	1.233
  @@ -1,4 +1,8 @@
   Changes with APR b1
  +  *) renames: apr_ansi_time_to_apr_time becomes apr_time_ansi_put
  +     ap_exploded_time_t becomes apr_time_exp_t
  +     [Thom May <th...@planetarytramp.net>]
  +
     *) Add the APR_FILE_NOCLEANUP flag to apr_file_open().
        Adding the flag will prevent the file from being closed 
        when the pool passed in on apr_file_open() is destroyed.
  
  
  
  1.4       +3 -3      apr/file_io/netware/filestat.c
  
  Index: filestat.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/netware/filestat.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- filestat.c	5 Mar 2002 22:08:39 -0000	1.3
  +++ filestat.c	6 Mar 2002 17:50:01 -0000	1.4
  @@ -95,9 +95,9 @@
       finfo->inode = info->st_ino;
       finfo->device = info->st_dev;
       finfo->nlink = info->st_nlink;
  -    apr_ansi_time_to_apr_time(&finfo->atime, info->st_atime);
  -    apr_ansi_time_to_apr_time(&finfo->mtime, info->st_mtime);
  -    apr_ansi_time_to_apr_time(&finfo->ctime, info->st_ctime);
  +    apr_time_ansi_put(&finfo->atime, info->st_atime);
  +    apr_time_ansi_put(&finfo->mtime, info->st_mtime);
  +    apr_time_ansi_put(&finfo->ctime, info->st_ctime);
       /* ### needs to be revisited  
        * if (wanted & APR_FINFO_CSIZE) {
        *   finfo->csize = info->st_blocks * 512;
  
  
  
  1.52      +3 -3      apr/file_io/unix/filestat.c
  
  Index: filestat.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/unix/filestat.c,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- filestat.c	22 Feb 2002 20:04:21 -0000	1.51
  +++ filestat.c	6 Mar 2002 17:50:02 -0000	1.52
  @@ -94,9 +94,9 @@
       finfo->inode = info->st_ino;
       finfo->device = info->st_dev;
       finfo->nlink = info->st_nlink;
  -    apr_ansi_time_to_apr_time(&finfo->atime, info->st_atime);
  -    apr_ansi_time_to_apr_time(&finfo->mtime, info->st_mtime);
  -    apr_ansi_time_to_apr_time(&finfo->ctime, info->st_ctime);
  +    apr_time_ansi_put(&finfo->atime, info->st_atime);
  +    apr_time_ansi_put(&finfo->mtime, info->st_mtime);
  +    apr_time_ansi_put(&finfo->ctime, info->st_ctime);
       /* ### needs to be revisited  
        * if (wanted & APR_FINFO_CSIZE) {
        *   finfo->csize = info->st_blocks * 512;
  
  
  
  1.11      +2 -2      apr/include/apr_compat.h
  
  Index: apr_compat.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_compat.h,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- apr_compat.h	16 Sep 2001 21:11:11 -0000	1.10
  +++ apr_compat.h	6 Mar 2002 17:50:02 -0000	1.11
  @@ -60,8 +60,8 @@
   #define ap_day_snames apr_day_snames
   /** @deprecated @see apr_pool_destroy */
   #define ap_destroy_pool apr_pool_destroy
  -/** @deprecated @see apr_exploded_time_t */
  -#define ap_exploded_time_t apr_exploded_time_t
  +/** @deprecated @see apr_time_exp_t */
  +#define ap_exploded_time_t apr_time_exp_t
   /** @deprecated @see apr_fnmatch */
   #define ap_fnmatch apr_fnmatch
   /** @deprecated @see apr_getopt */
  
  
  
  1.74      +2 -2      apr/include/apr_portable.h
  
  Index: apr_portable.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_portable.h,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- apr_portable.h	25 Jan 2002 07:12:37 -0000	1.73
  +++ apr_portable.h	6 Mar 2002 17:50:02 -0000	1.74
  @@ -276,7 +276,7 @@
    * @param aprtime the time to convert
    */
   APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime,
  -                                 apr_exploded_time_t *aprtime);
  +                                 apr_time_exp_t *aprtime);
   
   /**
    * Get the imploded time in the platforms native format.
  @@ -433,7 +433,7 @@
    * @param ostime the time to convert
    * @param cont the pool to use if necessary
    */
  -APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_exploded_time_t *aprtime,
  +APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime,
                                                 apr_os_exp_time_t **ostime,
                                                 apr_pool_t *cont); 
   
  
  
  
  1.44      +9 -9      apr/include/apr_time.h
  
  Index: apr_time.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_time.h,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- apr_time.h	15 Feb 2002 21:15:44 -0000	1.43
  +++ apr_time.h	6 Mar 2002 17:50:02 -0000	1.44
  @@ -106,9 +106,9 @@
    *  - tm_usec isn't an ANSI field
    *  - tm_gmtoff isn't an ANSI field (it's a bsdism)
    */
  -typedef struct apr_exploded_time_t apr_exploded_time_t;
  +typedef struct apr_time_exp_t apr_time_exp_t;
   
  -struct apr_exploded_time_t {
  +struct apr_time_exp_t {
       /** microseconds past tm_sec */
       apr_int32_t tm_usec;
       /** (0-61) seconds past tm_min */
  @@ -138,7 +138,7 @@
    * @param result the resulting apr_time_t
    * @param input the time_t to convert
    */
  -APR_DECLARE(apr_status_t) apr_ansi_time_to_apr_time(apr_time_t *result, 
  +APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result, 
                                                       time_t input);
   
   /**
  @@ -149,7 +149,7 @@
    * @param offs the number of seconds offset to apply
    * @param zone the zone description
    */
  -APR_DECLARE(apr_status_t) apr_explode_time(apr_exploded_time_t *result,
  +APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result,
                                              apr_time_t input,
                                              apr_int32_t offs);
   
  @@ -158,7 +158,7 @@
    * @param result the exploded time
    * @param input the time to explode
    */
  -APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result, 
  +APR_DECLARE(apr_status_t) apr_explode_gmt(apr_time_exp_t *result, 
                                             apr_time_t input);
   
   /**
  @@ -166,7 +166,7 @@
    * @param result the exploded time
    * @param input the time to explode
    */
  -APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, 
  +APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, 
                                                   apr_time_t input);
   
   /**
  @@ -176,7 +176,7 @@
    * @param input the input exploded time
    */
   APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *result, 
  -                                           apr_exploded_time_t *input);
  +                                           apr_time_exp_t *input);
   
   /**
    * Convert time value from human readable format to a numeric apr_time_t that
  @@ -185,7 +185,7 @@
    * @param input the input exploded time
    */
   APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *result, 
  -                                          apr_exploded_time_t *input);
  +                                          apr_time_exp_t *input);
   
   /**
    * Sleep for the specified number of micro-seconds.
  @@ -230,7 +230,7 @@
    */
   APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, 
                                          apr_size_t max, const char *format, 
  -                                       apr_exploded_time_t *tm);
  +                                       apr_time_exp_t *tm);
   
   #ifdef __cplusplus
   }
  
  
  
  1.27      +1 -1      apr/test/testtime.c
  
  Index: testtime.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testtime.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- testtime.c	31 Aug 2001 06:07:34 -0000	1.26
  +++ testtime.c	6 Mar 2002 17:50:02 -0000	1.27
  @@ -65,7 +65,7 @@
   int main(void)
   {
       apr_time_t now;
  -    apr_exploded_time_t xt, xt2;
  +    apr_time_exp_t xt, xt2;
       apr_time_t imp;
       apr_pool_t *p;
       char *str, *str2;
  
  
  
  1.61      +9 -9      apr/time/unix/time.c
  
  Index: time.c
  ===================================================================
  RCS file: /home/cvs/apr/time/unix/time.c,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- time.c	5 Mar 2002 19:43:35 -0000	1.60
  +++ time.c	6 Mar 2002 17:50:02 -0000	1.61
  @@ -100,7 +100,7 @@
   #endif
   }
   
  -APR_DECLARE(apr_status_t) apr_ansi_time_to_apr_time(apr_time_t *result, 
  +APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result, 
                                                       time_t input)
   {
       *result = (apr_time_t)input * APR_USEC_PER_SEC;
  @@ -115,7 +115,7 @@
       return tv.tv_sec * APR_USEC_PER_SEC + tv.tv_usec;
   }
   
  -static void explode_time(apr_exploded_time_t *xt, apr_time_t t,
  +static void explode_time(apr_time_exp_t *xt, apr_time_t t,
                            apr_int32_t offset, int use_localtime)
   {
       struct tm tm;
  @@ -146,7 +146,7 @@
       xt->tm_gmtoff = get_offset(&tm);
   }
   
  -APR_DECLARE(apr_status_t) apr_explode_time(apr_exploded_time_t *result, apr_time_t input,
  +APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, apr_time_t input,
                                 apr_int32_t offs)
   {
       explode_time(result, input, offs, 0);
  @@ -154,12 +154,12 @@
       return APR_SUCCESS;
   }
   
  -APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input)
  +APR_DECLARE(apr_status_t) apr_explode_gmt(apr_time_exp_t *result, apr_time_t input)
   {
       return apr_explode_time(result, input, 0);
   }
   
  -APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input)
  +APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, apr_time_t input)
   {
   #if defined(__EMX__)
       /* EMX gcc (OS/2) has a timezone global we can use */
  @@ -170,7 +170,7 @@
   #endif /* __EMX__ */
   }
   
  -APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt)
  +APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *t, apr_time_exp_t *xt)
   {
       int year;
       time_t days;
  @@ -201,7 +201,7 @@
       return APR_SUCCESS;
   }
   
  -APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, apr_exploded_time_t *xt)
  +APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, apr_time_exp_t *xt)
   {
       apr_status_t status = apr_implode_time(t, xt);
       if (status == APR_SUCCESS)
  @@ -218,7 +218,7 @@
   }
   
   APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, 
  -                                              apr_exploded_time_t *aprtime)
  +                                              apr_time_exp_t *aprtime)
   {
       (*ostime)->tm_sec  = aprtime->tm_sec;
       (*ostime)->tm_min  = aprtime->tm_min;
  @@ -244,7 +244,7 @@
       return APR_SUCCESS;
   }
   
  -APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_exploded_time_t *aprtime,
  +APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime,
                                                 apr_os_exp_time_t **ostime, apr_pool_t *cont)
   {
       aprtime->tm_sec = (*ostime)->tm_sec;
  
  
  
  1.24      +3 -3      apr/time/unix/timestr.c
  
  Index: timestr.c
  ===================================================================
  RCS file: /home/cvs/apr/time/unix/timestr.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- timestr.c	12 Apr 2001 22:44:42 -0000	1.23
  +++ timestr.c	6 Mar 2002 17:50:02 -0000	1.24
  @@ -79,7 +79,7 @@
   
   apr_status_t apr_rfc822_date(char *date_str, apr_time_t t)
   {
  -    apr_exploded_time_t xt;
  +    apr_time_exp_t xt;
       const char *s;
       int real_year;
   
  @@ -127,7 +127,7 @@
   
   apr_status_t apr_ctime(char *date_str, apr_time_t t)
   {
  -    apr_exploded_time_t xt;
  +    apr_time_exp_t xt;
       const char *s;
       int real_year;
   
  @@ -168,7 +168,7 @@
   }
   
   apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, 
  -                        const char *format, apr_exploded_time_t *xt)
  +                        const char *format, apr_time_exp_t *xt)
   {
       struct tm tm;
       memset(&tm, 0, sizeof tm);
  
  
  
  1.27      +9 -9      apr/time/win32/time.c
  
  Index: time.c
  ===================================================================
  RCS file: /home/cvs/apr/time/win32/time.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- time.c	12 Feb 2002 21:59:01 -0000	1.26
  +++ time.c	6 Mar 2002 17:50:02 -0000	1.27
  @@ -71,7 +71,7 @@
    */
   #define IsLeapYear(y) ((!(y % 4)) ? (((!(y % 400)) && (y % 100)) ? 1 : 0) : 0)
   
  -static void SystemTimeToAprExpTime(apr_exploded_time_t *xt, SYSTEMTIME *tm, BOOL lt)
  +static void SystemTimeToAprExpTime(apr_time_exp_t *xt, SYSTEMTIME *tm, BOOL lt)
   {
       TIME_ZONE_INFORMATION tz;
       DWORD rc;
  @@ -123,7 +123,7 @@
       return;
   }
   
  -APR_DECLARE(apr_status_t) apr_ansi_time_to_apr_time(apr_time_t *result, 
  +APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result, 
                                                       time_t input)
   {
       *result = (apr_time_t) input * APR_USEC_PER_SEC;
  @@ -146,7 +146,7 @@
       return aprtime; 
   }
   
  -APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result,
  +APR_DECLARE(apr_status_t) apr_explode_gmt(apr_time_exp_t *result,
                                             apr_time_t input)
   {
       FILETIME ft;
  @@ -158,7 +158,7 @@
       return APR_SUCCESS;
   }
   
  -APR_DECLARE(apr_status_t) apr_explode_time(apr_exploded_time_t *result, 
  +APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, 
                                              apr_time_t input, apr_int32_t offs)
   {
       FILETIME ft;
  @@ -171,7 +171,7 @@
       return APR_SUCCESS;
   }
   
  -APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result,
  +APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result,
                                                   apr_time_t input)
   {
       SYSTEMTIME st;
  @@ -186,7 +186,7 @@
   }
   
   APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *t,
  -                                           apr_exploded_time_t *xt)
  +                                           apr_time_exp_t *xt)
   {
       int year;
       time_t days;
  @@ -221,7 +221,7 @@
   }
   
   APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t,
  -                                          apr_exploded_time_t *xt)
  +                                          apr_time_exp_t *xt)
   {
       apr_status_t status = apr_implode_time(t, xt);
       if (status == APR_SUCCESS)
  @@ -238,7 +238,7 @@
   }
   
   APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, 
  -                                              apr_exploded_time_t *aprexptime)
  +                                              apr_time_exp_t *aprexptime)
   {
       (*ostime)->wYear = aprexptime->tm_year + 1900;
       (*ostime)->wMonth = aprexptime->tm_mon + 1;
  @@ -261,7 +261,7 @@
       return APR_SUCCESS;
   }
   
  -APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_exploded_time_t *aprtime,
  +APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime,
                                                 apr_os_exp_time_t **ostime,
                                                 apr_pool_t *cont)
   {
  
  
  
  1.16      +3 -3      apr/time/win32/timestr.c
  
  Index: timestr.c
  ===================================================================
  RCS file: /home/cvs/apr/time/win32/timestr.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- timestr.c	29 Jan 2002 06:50:50 -0000	1.15
  +++ timestr.c	6 Mar 2002 17:50:02 -0000	1.16
  @@ -67,7 +67,7 @@
   
   APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t)
   {
  -    apr_exploded_time_t xt;
  +    apr_time_exp_t xt;
       const char *s;
       int real_year;
   
  @@ -115,7 +115,7 @@
   
   APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t)
   {
  -    apr_exploded_time_t xt;
  +    apr_time_exp_t xt;
       const char *s;
       int real_year;
   
  @@ -220,7 +220,7 @@
   
   APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize,
                                          apr_size_t max, const char *format,
  -                                       apr_exploded_time_t *xt)
  +                                       apr_time_exp_t *xt)
   {
       struct tm tm;
       memset(&tm, 0, sizeof tm);