88 *
99 *
1010 * IDENTIFICATION
11- * $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.155 2005/07/21 18:06:12 momjian Exp $
11+ * $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.156 2005/07/22 03:46:33 momjian Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
2828
2929static int DecodeNumber (int flen ,char * field ,bool haveTextMonth ,
3030int fmask ,int * tmask ,
31- struct pg_tm * tm ,fsec_t * fsec ,int * is2digits );
31+ struct pg_tm * tm ,fsec_t * fsec ,int * is2digits );
3232static int DecodeNumberField (int len ,char * str ,
3333int fmask ,int * tmask ,
34- struct pg_tm * tm ,fsec_t * fsec ,int * is2digits );
34+ struct pg_tm * tm ,fsec_t * fsec ,int * is2digits );
3535static int DecodeTime (char * str ,int fmask ,int * tmask ,
36- struct pg_tm * tm ,fsec_t * fsec );
36+ struct pg_tm * tm ,fsec_t * fsec );
3737static int DecodeTimezone (char * str ,int * tzp );
3838static int DecodePosixTimezone (char * str ,int * tzp );
3939static datetkn * datebsearch (char * key ,datetkn * base ,unsignedint nel );
40- static int DecodeDate (char * str ,int fmask ,int * tmask ,struct pg_tm * tm );
40+ static int DecodeDate (char * str ,int fmask ,int * tmask ,struct pg_tm * tm );
4141static void TrimTrailingZeros (char * str );
4242
4343
@@ -681,7 +681,7 @@ j2day(int date)
681681 * Get the transaction start time ("now()") broken down as a struct pg_tm.
682682 */
683683void
684- GetCurrentDateTime (struct pg_tm * tm )
684+ GetCurrentDateTime (struct pg_tm * tm )
685685{
686686int tz ;
687687fsec_t fsec ;
@@ -698,7 +698,7 @@ GetCurrentDateTime(struct pg_tm * tm)
698698 * including fractional seconds and timezone offset.
699699 */
700700void
701- GetCurrentTimeUsec (struct pg_tm * tm ,fsec_t * fsec ,int * tzp )
701+ GetCurrentTimeUsec (struct pg_tm * tm ,fsec_t * fsec ,int * tzp )
702702{
703703int tz ;
704704
@@ -969,7 +969,7 @@ ParseDateTime(const char *timestr, char *workbuf, size_t buflen,
969969 */
970970int
971971DecodeDateTime (char * * field ,int * ftype ,int nf ,
972- int * dtype ,struct pg_tm * tm ,fsec_t * fsec ,int * tzp )
972+ int * dtype ,struct pg_tm * tm ,fsec_t * fsec ,int * tzp )
973973{
974974int fmask = 0 ,
975975tmask ,
@@ -1632,7 +1632,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
16321632 * of mktime(), anyway.
16331633 */
16341634int
1635- DetermineLocalTimeZone (struct pg_tm * tm )
1635+ DetermineLocalTimeZone (struct pg_tm * tm )
16361636{
16371637int date ,
16381638sec ;
@@ -1760,7 +1760,7 @@ DetermineLocalTimeZone(struct pg_tm * tm)
17601760 */
17611761int
17621762DecodeTimeOnly (char * * field ,int * ftype ,int nf ,
1763- int * dtype ,struct pg_tm * tm ,fsec_t * fsec ,int * tzp )
1763+ int * dtype ,struct pg_tm * tm ,fsec_t * fsec ,int * tzp )
17641764{
17651765int fmask = 0 ,
17661766tmask ,
@@ -2296,7 +2296,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf,
22962296 * Insist on a complete set of fields.
22972297 */
22982298static int
2299- DecodeDate (char * str ,int fmask ,int * tmask ,struct pg_tm * tm )
2299+ DecodeDate (char * str ,int fmask ,int * tmask ,struct pg_tm * tm )
23002300{
23012301fsec_t fsec ;
23022302int nf = 0 ;
@@ -2454,7 +2454,7 @@ DecodeDate(char *str, int fmask, int *tmask, struct pg_tm * tm)
24542454 *can be used to represent time spans.
24552455 */
24562456static int
2457- DecodeTime (char * str ,int fmask ,int * tmask ,struct pg_tm * tm ,fsec_t * fsec )
2457+ DecodeTime (char * str ,int fmask ,int * tmask ,struct pg_tm * tm ,fsec_t * fsec )
24582458{
24592459char * cp ;
24602460
@@ -2518,7 +2518,7 @@ DecodeTime(char *str, int fmask, int *tmask, struct pg_tm * tm, fsec_t *fsec)
25182518 */
25192519static int
25202520DecodeNumber (int flen ,char * str ,bool haveTextMonth ,int fmask ,
2521- int * tmask ,struct pg_tm * tm ,fsec_t * fsec ,int * is2digits )
2521+ int * tmask ,struct pg_tm * tm ,fsec_t * fsec ,int * is2digits )
25222522{
25232523int val ;
25242524char * cp ;
@@ -2708,7 +2708,7 @@ DecodeNumber(int flen, char *str, bool haveTextMonth, int fmask,
27082708 */
27092709static int
27102710DecodeNumberField (int len ,char * str ,int fmask ,
2711- int * tmask ,struct pg_tm * tm ,fsec_t * fsec ,int * is2digits )
2711+ int * tmask ,struct pg_tm * tm ,fsec_t * fsec ,int * is2digits )
27122712{
27132713char * cp ;
27142714
@@ -2966,7 +2966,7 @@ DecodeSpecial(int field, char *lowtoken, int *val)
29662966 *preceding an hh:mm:ss field. - thomas 1998-04-30
29672967 */
29682968int
2969- DecodeInterval (char * * field ,int * ftype ,int nf ,int * dtype ,struct pg_tm * tm ,fsec_t * fsec )
2969+ DecodeInterval (char * * field ,int * ftype ,int nf ,int * dtype ,struct pg_tm * tm ,fsec_t * fsec )
29702970{
29712971int is_before = FALSE;
29722972char * cp ;
@@ -3420,7 +3420,7 @@ datebsearch(char *key, datetkn *base, unsigned int nel)
34203420 * Encode date as local time.
34213421 */
34223422int
3423- EncodeDateOnly (struct pg_tm * tm ,int style ,char * str )
3423+ EncodeDateOnly (struct pg_tm * tm ,int style ,char * str )
34243424{
34253425if (tm -> tm_mon < 1 || tm -> tm_mon > MONTHS_PER_YEAR )
34263426return -1 ;
@@ -3480,7 +3480,7 @@ EncodeDateOnly(struct pg_tm * tm, int style, char *str)
34803480 * Encode time fields only.
34813481 */
34823482int
3483- EncodeTimeOnly (struct pg_tm * tm ,fsec_t fsec ,int * tzp ,int style ,char * str )
3483+ EncodeTimeOnly (struct pg_tm * tm ,fsec_t fsec ,int * tzp ,int style ,char * str )
34843484{
34853485if (tm -> tm_hour < 0 || tm -> tm_hour > HOURS_PER_DAY )
34863486return -1 ;
@@ -3530,7 +3530,7 @@ EncodeTimeOnly(struct pg_tm * tm, fsec_t fsec, int *tzp, int style, char *str)
35303530 *European - dd/mm/yyyy
35313531 */
35323532int
3533- EncodeDateTime (struct pg_tm * tm ,fsec_t fsec ,int * tzp ,char * * tzn ,int style ,char * str )
3533+ EncodeDateTime (struct pg_tm * tm ,fsec_t fsec ,int * tzp ,char * * tzn ,int style ,char * str )
35343534{
35353535int day ,
35363536hour ,
@@ -3770,7 +3770,7 @@ EncodeDateTime(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int style,
37703770 * - thomas 1998-04-30
37713771 */
37723772int
3773- EncodeInterval (struct pg_tm * tm ,fsec_t fsec ,int style ,char * str )
3773+ EncodeInterval (struct pg_tm * tm ,fsec_t fsec ,int style ,char * str )
37743774{
37753775int is_before = FALSE;
37763776int is_nonzero = FALSE;