Commit d584db60 authored by Tom Lane's avatar Tom Lane

pgindent did a pretty awful job on the timezone code, particularly with

respect to doubly-starred comment blocks.  Do some manual cleanup.
parent 13f96c4b
/*
* This file is in the public domain, so clarified as of
* 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/timezone/ialloc.c,v 1.5 2004/05/21 20:59:10 tgl Exp $
*/
#include "postgres.h" #include "postgres.h"
#include "private.h" #include "private.h"
......
This diff is collapsed.
...@@ -2,17 +2,20 @@ ...@@ -2,17 +2,20 @@
#define PRIVATE_H #define PRIVATE_H
/* /*
** This file is in the public domain, so clarified as of * This file is in the public domain, so clarified as of
** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov). * 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
*/ *
* IDENTIFICATION
* $PostgreSQL: pgsql/src/timezone/private.h,v 1.8 2004/05/21 20:59:10 tgl Exp $
*/
/* /*
** This header is for use ONLY with the time conversion code. * This header is for use ONLY with the time conversion code.
** There is no guarantee that it will remain unchanged, * There is no guarantee that it will remain unchanged,
** or that it will remain at all. * or that it will remain at all.
** Do NOT copy it to any system include directory. * Do NOT copy it to any system include directory.
** Thank you! * Thank you!
*/ */
#include <limits.h> /* for CHAR_BIT */ #include <limits.h> /* for CHAR_BIT */
#include <sys/wait.h> /* for WIFEXITED and WEXITSTATUS */ #include <sys/wait.h> /* for WIFEXITED and WEXITSTATUS */
...@@ -32,28 +35,27 @@ ...@@ -32,28 +35,27 @@
#define is_digit(c) ((unsigned)(c) - '0' <= 9) #define is_digit(c) ((unsigned)(c) - '0' <= 9)
/* /*
** SunOS 4.1.1 headers lack EXIT_SUCCESS. * SunOS 4.1.1 headers lack EXIT_SUCCESS.
*/ */
#ifndef EXIT_SUCCESS #ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0 #define EXIT_SUCCESS 0
#endif /* !defined EXIT_SUCCESS */ #endif /* !defined EXIT_SUCCESS */
/* /*
** SunOS 4.1.1 headers lack EXIT_FAILURE. * SunOS 4.1.1 headers lack EXIT_FAILURE.
*/ */
#ifndef EXIT_FAILURE #ifndef EXIT_FAILURE
#define EXIT_FAILURE 1 #define EXIT_FAILURE 1
#endif /* !defined EXIT_FAILURE */ #endif /* !defined EXIT_FAILURE */
/* /*
** SunOS 4.1.1 libraries lack remove. * SunOS 4.1.1 libraries lack remove.
*/ */
#ifndef remove #ifndef remove
extern int unlink(const char *filename); extern int unlink(const char *filename);
#define remove unlink #define remove unlink
#endif /* !defined remove */ #endif /* !defined remove */
...@@ -92,11 +94,11 @@ extern char *scheck(const char *string, const char *format); ...@@ -92,11 +94,11 @@ extern char *scheck(const char *string, const char *format);
#ifndef INT_STRLEN_MAXIMUM #ifndef INT_STRLEN_MAXIMUM
/* /*
** 302 / 1000 is log10(2.0) rounded up. * 302 / 1000 is log10(2.0) rounded up.
** Subtract one for the sign bit if the type is signed; * Subtract one for the sign bit if the type is signed;
** add one for integer division truncation; * add one for integer division truncation;
** add one more for a minus sign if the type is signed. * add one more for a minus sign if the type is signed.
*/ */
#define INT_STRLEN_MAXIMUM(type) \ #define INT_STRLEN_MAXIMUM(type) \
((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + 1 + TYPE_SIGNED(type)) ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + 1 + TYPE_SIGNED(type))
#endif /* !defined INT_STRLEN_MAXIMUM */ #endif /* !defined INT_STRLEN_MAXIMUM */
...@@ -104,7 +106,7 @@ extern char *scheck(const char *string, const char *format); ...@@ -104,7 +106,7 @@ extern char *scheck(const char *string, const char *format);
#define _(msgid) (msgid) #define _(msgid) (msgid)
/* /*
** UNIX was a registered trademark of The Open Group in 2003. * UNIX was a registered trademark of The Open Group in 2003.
*/ */
#endif /* !defined PRIVATE_H */ #endif /* !defined PRIVATE_H */
/*
* This file is in the public domain, so clarified as of
* 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/timezone/scheck.c,v 1.5 2004/05/21 20:59:10 tgl Exp $
*/
#include "postgres.h" #include "postgres.h"
#include "private.h" #include "private.h"
......
This diff is collapsed.
#ifndef TZFILE_H #ifndef TZFILE_H
#define TZFILE_H #define TZFILE_H
/* /*
** This file is in the public domain, so clarified as of * This file is in the public domain, so clarified as of
** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov). * 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
*/ *
* IDENTIFICATION
* $PostgreSQL: pgsql/src/timezone/tzfile.h,v 1.5 2004/05/21 20:59:10 tgl Exp $
*/
/* /*
** This header is for use ONLY with the time conversion code. * This header is for use ONLY with the time conversion code.
** There is no guarantee that it will remain unchanged, * There is no guarantee that it will remain unchanged,
** or that it will remain at all. * or that it will remain at all.
** Do NOT copy it to any system include directory. * Do NOT copy it to any system include directory.
** Thank you! * Thank you!
*/ */
/* /*
** Information about time zone files. * Information about time zone files.
*/ */
#define TZDEFAULT "localtime" #define TZDEFAULT "localtime"
#define TZDEFRULES "posixrules" #define TZDEFRULES "posixrules"
/* /*
** Each file begins with. . . * Each file begins with. . .
*/ */
#define TZ_MAGIC "TZif" #define TZ_MAGIC "TZif"
...@@ -42,42 +44,43 @@ struct tzhead ...@@ -42,42 +44,43 @@ struct tzhead
char tzh_charcnt[4]; /* coded number of abbr. chars */ char tzh_charcnt[4]; /* coded number of abbr. chars */
}; };
/* /*----------
** . . .followed by. . . * . . .followed by. . .
** *
** tzh_timecnt (char [4])s coded transition times a la time(2) * tzh_timecnt (char [4])s coded transition times a la time(2)
** tzh_timecnt (unsigned char)s types of local time starting at above * tzh_timecnt (unsigned char)s types of local time starting at above
** tzh_typecnt repetitions of * tzh_typecnt repetitions of
** one (char [4]) coded UTC offset in seconds * one (char [4]) coded UTC offset in seconds
** one (unsigned char) used to set tm_isdst * one (unsigned char) used to set tm_isdst
** one (unsigned char) that's an abbreviation list index * one (unsigned char) that's an abbreviation list index
** tzh_charcnt (char)s '\0'-terminated zone abbreviations * tzh_charcnt (char)s '\0'-terminated zone abbreviations
** tzh_leapcnt repetitions of * tzh_leapcnt repetitions of
** one (char [4]) coded leap second transition times * one (char [4]) coded leap second transition times
** one (char [4]) total correction after above * one (char [4]) total correction after above
** tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition * tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition
** time is standard time, if FALSE, * time is standard time, if FALSE,
** transition time is wall clock time * transition time is wall clock time
** if absent, transition times are * if absent, transition times are
** assumed to be wall clock time * assumed to be wall clock time
** tzh_ttisgmtcnt (char)s indexed by type; if TRUE, transition * tzh_ttisgmtcnt (char)s indexed by type; if TRUE, transition
** time is UTC, if FALSE, * time is UTC, if FALSE,
** transition time is local time * transition time is local time
** if absent, transition times are * if absent, transition times are
** assumed to be local time * assumed to be local time
*/ *----------
*/
/* /*
** In the current implementation, "tzset()" refuses to deal with files that * In the current implementation, "tzset()" refuses to deal with files that
** exceed any of the limits below. * exceed any of the limits below.
*/ */
/* /*
** The TZ_MAX_TIMES value below is enough to handle a bit more than a * The TZ_MAX_TIMES value below is enough to handle a bit more than a
** year's worth of solar time (corrected daily to the nearest second) or * year's worth of solar time (corrected daily to the nearest second) or
** 138 years of Pacific Presidential Election time * 138 years of Pacific Presidential Election time
** (where there are three time zone transitions every fourth year). * (where there are three time zone transitions every fourth year).
*/ */
#define TZ_MAX_TIMES 370 #define TZ_MAX_TIMES 370
#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can #define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can
...@@ -127,9 +130,9 @@ struct tzhead ...@@ -127,9 +130,9 @@ struct tzhead
#define EPOCH_WDAY TM_THURSDAY #define EPOCH_WDAY TM_THURSDAY
/* /*
** Accurate only for the past couple of centuries; * Accurate only for the past couple of centuries;
** that will probably do. * that will probably do.
*/ */
#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) #define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment