mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
Used modified version of indent that understands over 100 typedefs.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.16 1997/09/08 20:57:16 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.17 1997/09/08 21:48:05 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -653,13 +653,14 @@ aclmakeuser(char *user_type, char *user)
|
||||
*/
|
||||
|
||||
ChangeACLStmt *
|
||||
makeAclStmt(char *privileges, List * rel_list, char *grantee,
|
||||
makeAclStmt(char *privileges, List *rel_list, char *grantee,
|
||||
char grant_or_revoke)
|
||||
{
|
||||
ChangeACLStmt *n = makeNode(ChangeACLStmt);
|
||||
char str[MAX_PARSE_BUFFER];
|
||||
|
||||
n->aclitem = (AclItem *) palloc(sizeof(AclItem));
|
||||
|
||||
/* the grantee string is "G <group_name>", "U <user_name>", or "ALL" */
|
||||
if (grantee[0] == 'G') /* group permissions */
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.18 1997/09/08 20:57:21 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.19 1997/09/08 21:48:09 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -51,7 +51,7 @@ _ReadArrayStr(char *arrayStr, int nitems, int ndim, int dim[],
|
||||
|
||||
#ifdef LOARRAY
|
||||
static char *
|
||||
_ReadLOArray(char *str, int *nbytes, int *fd, bool * chunkFlag,
|
||||
_ReadLOArray(char *str, int *nbytes, int *fd, bool *chunkFlag,
|
||||
int ndim, int dim[], int baseSize);
|
||||
|
||||
#endif
|
||||
@@ -60,7 +60,7 @@ _CopyArrayEls(char **values, char *p, int nitems, int typlen,
|
||||
char typalign, bool typbyval);
|
||||
static void
|
||||
system_cache_lookup(Oid element_type, bool input, int *typlen,
|
||||
bool * typbyval, char *typdelim, Oid * typelem, Oid * proc,
|
||||
bool *typbyval, char *typdelim, Oid *typelem, Oid *proc,
|
||||
char *typalign);
|
||||
static Datum _ArrayCast(char *value, bool byval, int len);
|
||||
|
||||
@@ -74,10 +74,10 @@ _ArrayRange(int st[], int endp[], int bsize, char *destPtr,
|
||||
static int _ArrayClipCount(int stI[], int endpI[], ArrayType *array);
|
||||
static void
|
||||
_LOArrayRange(int st[], int endp[], int bsize, int srcfd,
|
||||
int destfd, ArrayType *array, int isSrcLO, bool * isNull);
|
||||
int destfd, ArrayType *array, int isSrcLO, bool *isNull);
|
||||
static void
|
||||
_ReadArray(int st[], int endp[], int bsize, int srcfd, int destfd,
|
||||
ArrayType *array, int isDestLO, bool * isNull);
|
||||
ArrayType *array, int isDestLO, bool *isNull);
|
||||
static ArrayCastAndSet(char *src, bool typbyval, int typlen, char *dest);
|
||||
static SanityCheckInput(int ndim, int n, int dim[], int lb[], int indx[]);
|
||||
static int array_read(char *destptr, int eltsize, int nitems, char *srcptr);
|
||||
@@ -521,7 +521,7 @@ static char *
|
||||
_ReadLOArray(char *str,
|
||||
int *nbytes,
|
||||
int *fd,
|
||||
bool * chunkFlag,
|
||||
bool *chunkFlag,
|
||||
int ndim,
|
||||
int dim[],
|
||||
int baseSize)
|
||||
@@ -771,7 +771,7 @@ array_out(ArrayType *v, Oid element_type)
|
||||
*----------------------------------------------------------------------------
|
||||
*/
|
||||
char *
|
||||
array_dims(ArrayType *v, bool * isNull)
|
||||
array_dims(ArrayType *v, bool *isNull)
|
||||
{
|
||||
char *p,
|
||||
*save_p;
|
||||
@@ -816,7 +816,7 @@ array_ref(ArrayType *array,
|
||||
int reftype,
|
||||
int elmlen,
|
||||
int arraylen,
|
||||
bool * isNull)
|
||||
bool *isNull)
|
||||
{
|
||||
int i,
|
||||
ndim,
|
||||
@@ -937,7 +937,7 @@ array_clip(ArrayType *array,
|
||||
int lowerIndx[],
|
||||
int reftype,
|
||||
int len,
|
||||
bool * isNull)
|
||||
bool *isNull)
|
||||
{
|
||||
int i,
|
||||
ndim,
|
||||
@@ -1080,7 +1080,7 @@ array_set(ArrayType *array,
|
||||
int reftype,
|
||||
int elmlen,
|
||||
int arraylen,
|
||||
bool * isNull)
|
||||
bool *isNull)
|
||||
{
|
||||
int ndim,
|
||||
*dim,
|
||||
@@ -1215,7 +1215,7 @@ array_assgn(ArrayType *array,
|
||||
ArrayType *newArr,
|
||||
int reftype,
|
||||
int len,
|
||||
bool * isNull)
|
||||
bool *isNull)
|
||||
{
|
||||
int i,
|
||||
ndim,
|
||||
@@ -1301,10 +1301,10 @@ static void
|
||||
system_cache_lookup(Oid element_type,
|
||||
bool input,
|
||||
int *typlen,
|
||||
bool * typbyval,
|
||||
bool *typbyval,
|
||||
char *typdelim,
|
||||
Oid * typelem,
|
||||
Oid * proc,
|
||||
Oid *typelem,
|
||||
Oid *proc,
|
||||
char *typalign)
|
||||
{
|
||||
HeapTuple typeTuple;
|
||||
@@ -1343,12 +1343,12 @@ _ArrayCast(char *value, bool byval, int len)
|
||||
switch (len)
|
||||
{
|
||||
case 1:
|
||||
return ((Datum) * value);
|
||||
return ((Datum) *value);
|
||||
case 2:
|
||||
return ((Datum) * (int16 *) value);
|
||||
return ((Datum) *(int16 *) value);
|
||||
case 3:
|
||||
case 4:
|
||||
return ((Datum) * (int32 *) value);
|
||||
return ((Datum) *(int32 *) value);
|
||||
default:
|
||||
elog(WARN, "array_ref: byval and elt len > 4!");
|
||||
break;
|
||||
@@ -1570,7 +1570,7 @@ _LOArrayRange(int st[],
|
||||
int destfd,
|
||||
ArrayType *array,
|
||||
int isSrcLO,
|
||||
bool * isNull)
|
||||
bool *isNull)
|
||||
{
|
||||
int n,
|
||||
*dim,
|
||||
@@ -1624,7 +1624,7 @@ _ReadArray(int st[],
|
||||
int destfd,
|
||||
ArrayType *array,
|
||||
int isDestLO,
|
||||
bool * isNull)
|
||||
bool *isNull)
|
||||
{
|
||||
int n,
|
||||
*dim,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* workings can be found in the book "Software Solutions in C" by
|
||||
* Dale Schumacher, Academic Press, ISBN: 0-12-632360-7.
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.11 1997/09/08 02:30:27 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.12 1997/09/08 21:48:13 momjian Exp $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -165,7 +165,7 @@ cash_in(const char *str)
|
||||
* positive-valued amounts. - tgl 97/04/14
|
||||
*/
|
||||
const char *
|
||||
cash_out(Cash * value)
|
||||
cash_out(Cash *value)
|
||||
{
|
||||
char *result;
|
||||
char buf[CASH_BUFSZ];
|
||||
@@ -271,7 +271,7 @@ cash_out(Cash * value)
|
||||
|
||||
|
||||
bool
|
||||
cash_eq(Cash * c1, Cash * c2)
|
||||
cash_eq(Cash *c1, Cash *c2)
|
||||
{
|
||||
if (!PointerIsValid(c1) || !PointerIsValid(c2))
|
||||
return (FALSE);
|
||||
@@ -280,7 +280,7 @@ cash_eq(Cash * c1, Cash * c2)
|
||||
} /* cash_eq() */
|
||||
|
||||
bool
|
||||
cash_ne(Cash * c1, Cash * c2)
|
||||
cash_ne(Cash *c1, Cash *c2)
|
||||
{
|
||||
if (!PointerIsValid(c1) || !PointerIsValid(c2))
|
||||
return (FALSE);
|
||||
@@ -289,7 +289,7 @@ cash_ne(Cash * c1, Cash * c2)
|
||||
} /* cash_ne() */
|
||||
|
||||
bool
|
||||
cash_lt(Cash * c1, Cash * c2)
|
||||
cash_lt(Cash *c1, Cash *c2)
|
||||
{
|
||||
if (!PointerIsValid(c1) || !PointerIsValid(c2))
|
||||
return (FALSE);
|
||||
@@ -298,7 +298,7 @@ cash_lt(Cash * c1, Cash * c2)
|
||||
} /* cash_lt() */
|
||||
|
||||
bool
|
||||
cash_le(Cash * c1, Cash * c2)
|
||||
cash_le(Cash *c1, Cash *c2)
|
||||
{
|
||||
if (!PointerIsValid(c1) || !PointerIsValid(c2))
|
||||
return (FALSE);
|
||||
@@ -307,7 +307,7 @@ cash_le(Cash * c1, Cash * c2)
|
||||
} /* cash_le() */
|
||||
|
||||
bool
|
||||
cash_gt(Cash * c1, Cash * c2)
|
||||
cash_gt(Cash *c1, Cash *c2)
|
||||
{
|
||||
if (!PointerIsValid(c1) || !PointerIsValid(c2))
|
||||
return (FALSE);
|
||||
@@ -316,7 +316,7 @@ cash_gt(Cash * c1, Cash * c2)
|
||||
} /* cash_gt() */
|
||||
|
||||
bool
|
||||
cash_ge(Cash * c1, Cash * c2)
|
||||
cash_ge(Cash *c1, Cash *c2)
|
||||
{
|
||||
if (!PointerIsValid(c1) || !PointerIsValid(c2))
|
||||
return (FALSE);
|
||||
@@ -329,7 +329,7 @@ cash_ge(Cash * c1, Cash * c2)
|
||||
* Add two cash values.
|
||||
*/
|
||||
Cash *
|
||||
cash_pl(Cash * c1, Cash * c2)
|
||||
cash_pl(Cash *c1, Cash *c2)
|
||||
{
|
||||
Cash *result;
|
||||
|
||||
@@ -349,7 +349,7 @@ cash_pl(Cash * c1, Cash * c2)
|
||||
* Subtract two cash values.
|
||||
*/
|
||||
Cash *
|
||||
cash_mi(Cash * c1, Cash * c2)
|
||||
cash_mi(Cash *c1, Cash *c2)
|
||||
{
|
||||
Cash *result;
|
||||
|
||||
@@ -369,7 +369,7 @@ cash_mi(Cash * c1, Cash * c2)
|
||||
* Multiply cash by floating point number.
|
||||
*/
|
||||
Cash *
|
||||
cash_mul(Cash * c, float8 * f)
|
||||
cash_mul(Cash *c, float8 *f)
|
||||
{
|
||||
Cash *result;
|
||||
|
||||
@@ -392,7 +392,7 @@ cash_mul(Cash * c, float8 * f)
|
||||
* Round for now. - tgl 97/04/15
|
||||
*/
|
||||
Cash *
|
||||
cash_div(Cash * c, float8 * f)
|
||||
cash_div(Cash *c, float8 *f)
|
||||
{
|
||||
Cash *result;
|
||||
|
||||
@@ -415,7 +415,7 @@ cash_div(Cash * c, float8 * f)
|
||||
* Return larger of two cash values.
|
||||
*/
|
||||
Cash *
|
||||
cashlarger(Cash * c1, Cash * c2)
|
||||
cashlarger(Cash *c1, Cash *c2)
|
||||
{
|
||||
Cash *result;
|
||||
|
||||
@@ -435,7 +435,7 @@ cashlarger(Cash * c1, Cash * c2)
|
||||
* Return smaller of two cash values.
|
||||
*/
|
||||
Cash *
|
||||
cashsmaller(Cash * c1, Cash * c2)
|
||||
cashsmaller(Cash *c1, Cash *c2)
|
||||
{
|
||||
Cash *result;
|
||||
|
||||
@@ -456,7 +456,7 @@ cashsmaller(Cash * c1, Cash * c2)
|
||||
* Obviously way North American centric - sorry
|
||||
*/
|
||||
const char *
|
||||
cash_words_out(Cash * value)
|
||||
cash_words_out(Cash *value)
|
||||
{
|
||||
static char buf[128];
|
||||
char *p = buf;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/char.c,v 1.10 1997/09/08 20:57:22 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/char.c,v 1.11 1997/09/08 21:48:18 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -34,7 +34,7 @@ charin(char *ch)
|
||||
{
|
||||
if (ch == NULL)
|
||||
return ((int32) NULL);
|
||||
return ((int32) * ch);
|
||||
return ((int32) *ch);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/chunk.c,v 1.9 1997/09/08 20:57:24 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/chunk.c,v 1.10 1997/09/08 21:48:19 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -49,7 +49,7 @@ static int
|
||||
_FindBestChunk(int size, int dmax[], int dbest[], int dim,
|
||||
int A[MAXPAT][MAXDIM + 1], int N);
|
||||
static int get_next(int d[], int k, int C, int dmax[]);
|
||||
static void initialize_info(CHUNK_INFO * A, int ndim, int dim[], int chunk[]);
|
||||
static void initialize_info(CHUNK_INFO *A, int ndim, int dim[], int chunk[]);
|
||||
|
||||
#ifdef LOARRAY
|
||||
static void
|
||||
@@ -63,7 +63,7 @@ static int seek_and_read(int pos, int size, char buff[], int fp, int from);
|
||||
|
||||
#endif
|
||||
static int
|
||||
GetChunkSize(FILE * fd, int ndim, int dim[MAXDIM], int baseSize,
|
||||
GetChunkSize(FILE *fd, int ndim, int dim[MAXDIM], int baseSize,
|
||||
int d[MAXDIM]);
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
@@ -77,7 +77,7 @@ GetChunkSize(FILE * fd, int ndim, int dim[MAXDIM], int baseSize,
|
||||
*/
|
||||
char *
|
||||
_ChunkArray(int fd,
|
||||
FILE * afd,
|
||||
FILE *afd,
|
||||
int ndim,
|
||||
int dim[],
|
||||
int baseSize,
|
||||
@@ -130,7 +130,7 @@ _ChunkArray(int fd,
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
static int
|
||||
GetChunkSize(FILE * fd,
|
||||
GetChunkSize(FILE *fd,
|
||||
int ndim,
|
||||
int dim[MAXDIM],
|
||||
int baseSize,
|
||||
@@ -276,7 +276,7 @@ static char a_chunk[BLCKSZ + 4];/* 4 since a_chunk is in varlena format */
|
||||
#endif
|
||||
|
||||
static void
|
||||
initialize_info(CHUNK_INFO * A, int ndim, int dim[], int chunk[])
|
||||
initialize_info(CHUNK_INFO *A, int ndim, int dim[], int chunk[])
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -441,7 +441,7 @@ _ReadChunkArray(int st[],
|
||||
char *destfp,
|
||||
ArrayType *array,
|
||||
int isDestLO,
|
||||
bool * isNull)
|
||||
bool *isNull)
|
||||
{
|
||||
int i,
|
||||
j,
|
||||
@@ -638,7 +638,7 @@ _ReadChunkArray1El(int st[],
|
||||
int bsize,
|
||||
int fp,
|
||||
ArrayType *array,
|
||||
bool * isNull)
|
||||
bool *isNull)
|
||||
{
|
||||
int i,
|
||||
j,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.17 1997/09/08 20:57:26 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.18 1997/09/08 21:48:21 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* This code is actually (almost) unused.
|
||||
@@ -304,7 +304,7 @@ tintervalout(TimeInterval interval)
|
||||
*****************************************************************************/
|
||||
|
||||
RelativeTime
|
||||
timespan_reltime(TimeSpan * timespan)
|
||||
timespan_reltime(TimeSpan *timespan)
|
||||
{
|
||||
RelativeTime time;
|
||||
int year,
|
||||
@@ -1071,7 +1071,7 @@ timeofday(void)
|
||||
|
||||
gettimeofday(&tp, &tpz);
|
||||
strftime(templ, sizeof(templ), "%a %b %d %H:%M:%S.%%d %Y %Z",
|
||||
localtime((time_t *) & tp.tv_sec));
|
||||
localtime((time_t *) &tp.tv_sec));
|
||||
sprintf(buf, templ, tp.tv_usec);
|
||||
|
||||
len = VARHDRSZ + strlen(buf);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.15 1997/09/08 02:30:34 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.16 1997/09/08 21:48:22 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -268,7 +268,7 @@ date_datetime(DateADT dateVal)
|
||||
* Convert datetime to date data type.
|
||||
*/
|
||||
DateADT
|
||||
datetime_date(DateTime * datetime)
|
||||
datetime_date(DateTime *datetime)
|
||||
{
|
||||
DateADT result;
|
||||
struct tm tt,
|
||||
@@ -485,7 +485,7 @@ time_in(char *str)
|
||||
|
||||
|
||||
char *
|
||||
time_out(TimeADT * time)
|
||||
time_out(TimeADT *time)
|
||||
{
|
||||
char *result;
|
||||
struct tm tt,
|
||||
@@ -539,7 +539,7 @@ time_out(TimeADT * time)
|
||||
|
||||
|
||||
bool
|
||||
time_eq(TimeADT * time1, TimeADT * time2)
|
||||
time_eq(TimeADT *time1, TimeADT *time2)
|
||||
{
|
||||
if (!PointerIsValid(time1) || !PointerIsValid(time2))
|
||||
return (FALSE);
|
||||
@@ -548,7 +548,7 @@ time_eq(TimeADT * time1, TimeADT * time2)
|
||||
} /* time_eq() */
|
||||
|
||||
bool
|
||||
time_ne(TimeADT * time1, TimeADT * time2)
|
||||
time_ne(TimeADT *time1, TimeADT *time2)
|
||||
{
|
||||
if (!PointerIsValid(time1) || !PointerIsValid(time2))
|
||||
return (FALSE);
|
||||
@@ -557,7 +557,7 @@ time_ne(TimeADT * time1, TimeADT * time2)
|
||||
} /* time_eq() */
|
||||
|
||||
bool
|
||||
time_lt(TimeADT * time1, TimeADT * time2)
|
||||
time_lt(TimeADT *time1, TimeADT *time2)
|
||||
{
|
||||
if (!PointerIsValid(time1) || !PointerIsValid(time2))
|
||||
return (FALSE);
|
||||
@@ -566,7 +566,7 @@ time_lt(TimeADT * time1, TimeADT * time2)
|
||||
} /* time_eq() */
|
||||
|
||||
bool
|
||||
time_le(TimeADT * time1, TimeADT * time2)
|
||||
time_le(TimeADT *time1, TimeADT *time2)
|
||||
{
|
||||
if (!PointerIsValid(time1) || !PointerIsValid(time2))
|
||||
return (FALSE);
|
||||
@@ -575,7 +575,7 @@ time_le(TimeADT * time1, TimeADT * time2)
|
||||
} /* time_eq() */
|
||||
|
||||
bool
|
||||
time_gt(TimeADT * time1, TimeADT * time2)
|
||||
time_gt(TimeADT *time1, TimeADT *time2)
|
||||
{
|
||||
if (!PointerIsValid(time1) || !PointerIsValid(time2))
|
||||
return (FALSE);
|
||||
@@ -584,7 +584,7 @@ time_gt(TimeADT * time1, TimeADT * time2)
|
||||
} /* time_eq() */
|
||||
|
||||
bool
|
||||
time_ge(TimeADT * time1, TimeADT * time2)
|
||||
time_ge(TimeADT *time1, TimeADT *time2)
|
||||
{
|
||||
if (!PointerIsValid(time1) || !PointerIsValid(time2))
|
||||
return (FALSE);
|
||||
@@ -593,7 +593,7 @@ time_ge(TimeADT * time1, TimeADT * time2)
|
||||
} /* time_eq() */
|
||||
|
||||
int
|
||||
time_cmp(TimeADT * time1, TimeADT * time2)
|
||||
time_cmp(TimeADT *time1, TimeADT *time2)
|
||||
{
|
||||
return ((*time1 < *time2) ? -1 : (((*time1 > *time2) ? 1 : 0)));
|
||||
} /* time_cmp() */
|
||||
@@ -603,7 +603,7 @@ time_cmp(TimeADT * time1, TimeADT * time2)
|
||||
* Convert date and time to datetime data type.
|
||||
*/
|
||||
DateTime *
|
||||
datetime_datetime(DateADT date, TimeADT * time)
|
||||
datetime_datetime(DateADT date, TimeADT *time)
|
||||
{
|
||||
DateTime *result;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.39 1997/09/08 02:30:37 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.40 1997/09/08 21:48:23 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -45,12 +45,12 @@ DecodeTime(char *str, int fmask, int *tmask,
|
||||
static int DecodeTimezone(char *str, int *tzp);
|
||||
static int DecodeUnits(int field, char *lowtoken, int *val);
|
||||
static int EncodeSpecialDateTime(DateTime dt, char *str);
|
||||
static datetkn *datebsearch(char *key, datetkn * base, unsigned int nel);
|
||||
static datetkn *datebsearch(char *key, datetkn *base, unsigned int nel);
|
||||
static DateTime dt2local(DateTime dt, int timezone);
|
||||
static void dt2time(DateTime dt, int *hour, int *min, double *sec);
|
||||
static int j2day(int jd);
|
||||
static int timespan2tm(TimeSpan span, struct tm * tm, float8 * fsec);
|
||||
static int tm2timespan(struct tm * tm, double fsec, TimeSpan * span);
|
||||
static int timespan2tm(TimeSpan span, struct tm * tm, float8 *fsec);
|
||||
static int tm2timespan(struct tm * tm, double fsec, TimeSpan *span);
|
||||
|
||||
#define USE_DATE_CACHE 1
|
||||
#define ROUND_ALL 0
|
||||
@@ -162,7 +162,7 @@ datetime_in(char *str)
|
||||
* Convert a datetime to external form.
|
||||
*/
|
||||
char *
|
||||
datetime_out(DateTime * dt)
|
||||
datetime_out(DateTime *dt)
|
||||
{
|
||||
char *result;
|
||||
int tz;
|
||||
@@ -258,7 +258,7 @@ timespan_in(char *str)
|
||||
* Convert a time span to external form.
|
||||
*/
|
||||
char *
|
||||
timespan_out(TimeSpan * span)
|
||||
timespan_out(TimeSpan *span)
|
||||
{
|
||||
char *result;
|
||||
|
||||
@@ -289,7 +289,7 @@ timespan_out(TimeSpan * span)
|
||||
|
||||
|
||||
bool
|
||||
datetime_finite(DateTime * datetime)
|
||||
datetime_finite(DateTime *datetime)
|
||||
{
|
||||
if (!PointerIsValid(datetime))
|
||||
return FALSE;
|
||||
@@ -300,7 +300,7 @@ datetime_finite(DateTime * datetime)
|
||||
|
||||
#ifdef NOT_USED
|
||||
bool
|
||||
timespan_finite(TimeSpan * timespan)
|
||||
timespan_finite(TimeSpan *timespan)
|
||||
{
|
||||
if (!PointerIsValid(timespan))
|
||||
return FALSE;
|
||||
@@ -371,7 +371,7 @@ SetDateTime(DateTime dt)
|
||||
/* datetime_relop - is datetime1 relop datetime2
|
||||
*/
|
||||
bool
|
||||
datetime_eq(DateTime * datetime1, DateTime * datetime2)
|
||||
datetime_eq(DateTime *datetime1, DateTime *datetime2)
|
||||
{
|
||||
DateTime dt1,
|
||||
dt2;
|
||||
@@ -394,7 +394,7 @@ datetime_eq(DateTime * datetime1, DateTime * datetime2)
|
||||
} /* datetime_eq() */
|
||||
|
||||
bool
|
||||
datetime_ne(DateTime * datetime1, DateTime * datetime2)
|
||||
datetime_ne(DateTime *datetime1, DateTime *datetime2)
|
||||
{
|
||||
DateTime dt1,
|
||||
dt2;
|
||||
@@ -417,7 +417,7 @@ datetime_ne(DateTime * datetime1, DateTime * datetime2)
|
||||
} /* datetime_ne() */
|
||||
|
||||
bool
|
||||
datetime_lt(DateTime * datetime1, DateTime * datetime2)
|
||||
datetime_lt(DateTime *datetime1, DateTime *datetime2)
|
||||
{
|
||||
DateTime dt1,
|
||||
dt2;
|
||||
@@ -440,7 +440,7 @@ datetime_lt(DateTime * datetime1, DateTime * datetime2)
|
||||
} /* datetime_lt() */
|
||||
|
||||
bool
|
||||
datetime_gt(DateTime * datetime1, DateTime * datetime2)
|
||||
datetime_gt(DateTime *datetime1, DateTime *datetime2)
|
||||
{
|
||||
DateTime dt1,
|
||||
dt2;
|
||||
@@ -466,7 +466,7 @@ datetime_gt(DateTime * datetime1, DateTime * datetime2)
|
||||
} /* datetime_gt() */
|
||||
|
||||
bool
|
||||
datetime_le(DateTime * datetime1, DateTime * datetime2)
|
||||
datetime_le(DateTime *datetime1, DateTime *datetime2)
|
||||
{
|
||||
DateTime dt1,
|
||||
dt2;
|
||||
@@ -489,7 +489,7 @@ datetime_le(DateTime * datetime1, DateTime * datetime2)
|
||||
} /* datetime_le() */
|
||||
|
||||
bool
|
||||
datetime_ge(DateTime * datetime1, DateTime * datetime2)
|
||||
datetime_ge(DateTime *datetime1, DateTime *datetime2)
|
||||
{
|
||||
DateTime dt1,
|
||||
dt2;
|
||||
@@ -516,7 +516,7 @@ datetime_ge(DateTime * datetime1, DateTime * datetime2)
|
||||
* collate invalid datetime at the end
|
||||
*/
|
||||
int
|
||||
datetime_cmp(DateTime * datetime1, DateTime * datetime2)
|
||||
datetime_cmp(DateTime *datetime1, DateTime *datetime2)
|
||||
{
|
||||
DateTime dt1,
|
||||
dt2;
|
||||
@@ -552,7 +552,7 @@ datetime_cmp(DateTime * datetime1, DateTime * datetime2)
|
||||
/* timespan_relop - is timespan1 relop timespan2
|
||||
*/
|
||||
bool
|
||||
timespan_eq(TimeSpan * timespan1, TimeSpan * timespan2)
|
||||
timespan_eq(TimeSpan *timespan1, TimeSpan *timespan2)
|
||||
{
|
||||
if (!PointerIsValid(timespan1) || !PointerIsValid(timespan2))
|
||||
return FALSE;
|
||||
@@ -565,7 +565,7 @@ timespan_eq(TimeSpan * timespan1, TimeSpan * timespan2)
|
||||
} /* timespan_eq() */
|
||||
|
||||
bool
|
||||
timespan_ne(TimeSpan * timespan1, TimeSpan * timespan2)
|
||||
timespan_ne(TimeSpan *timespan1, TimeSpan *timespan2)
|
||||
{
|
||||
if (!PointerIsValid(timespan1) || !PointerIsValid(timespan2))
|
||||
return FALSE;
|
||||
@@ -578,7 +578,7 @@ timespan_ne(TimeSpan * timespan1, TimeSpan * timespan2)
|
||||
} /* timespan_ne() */
|
||||
|
||||
bool
|
||||
timespan_lt(TimeSpan * timespan1, TimeSpan * timespan2)
|
||||
timespan_lt(TimeSpan *timespan1, TimeSpan *timespan2)
|
||||
{
|
||||
double span1,
|
||||
span2;
|
||||
@@ -600,7 +600,7 @@ timespan_lt(TimeSpan * timespan1, TimeSpan * timespan2)
|
||||
} /* timespan_lt() */
|
||||
|
||||
bool
|
||||
timespan_gt(TimeSpan * timespan1, TimeSpan * timespan2)
|
||||
timespan_gt(TimeSpan *timespan1, TimeSpan *timespan2)
|
||||
{
|
||||
double span1,
|
||||
span2;
|
||||
@@ -622,7 +622,7 @@ timespan_gt(TimeSpan * timespan1, TimeSpan * timespan2)
|
||||
} /* timespan_gt() */
|
||||
|
||||
bool
|
||||
timespan_le(TimeSpan * timespan1, TimeSpan * timespan2)
|
||||
timespan_le(TimeSpan *timespan1, TimeSpan *timespan2)
|
||||
{
|
||||
double span1,
|
||||
span2;
|
||||
@@ -644,7 +644,7 @@ timespan_le(TimeSpan * timespan1, TimeSpan * timespan2)
|
||||
} /* timespan_le() */
|
||||
|
||||
bool
|
||||
timespan_ge(TimeSpan * timespan1, TimeSpan * timespan2)
|
||||
timespan_ge(TimeSpan *timespan1, TimeSpan *timespan2)
|
||||
{
|
||||
double span1,
|
||||
span2;
|
||||
@@ -669,7 +669,7 @@ timespan_ge(TimeSpan * timespan1, TimeSpan * timespan2)
|
||||
/* timespan_cmp - 3-state comparison for timespan
|
||||
*/
|
||||
int
|
||||
timespan_cmp(TimeSpan * timespan1, TimeSpan * timespan2)
|
||||
timespan_cmp(TimeSpan *timespan1, TimeSpan *timespan2)
|
||||
{
|
||||
double span1,
|
||||
span2;
|
||||
@@ -707,7 +707,7 @@ timespan_cmp(TimeSpan * timespan1, TimeSpan * timespan2)
|
||||
*---------------------------------------------------------*/
|
||||
|
||||
DateTime *
|
||||
datetime_smaller(DateTime * datetime1, DateTime * datetime2)
|
||||
datetime_smaller(DateTime *datetime1, DateTime *datetime2)
|
||||
{
|
||||
DateTime *result;
|
||||
|
||||
@@ -744,7 +744,7 @@ datetime_smaller(DateTime * datetime1, DateTime * datetime2)
|
||||
} /* datetime_smaller() */
|
||||
|
||||
DateTime *
|
||||
datetime_larger(DateTime * datetime1, DateTime * datetime2)
|
||||
datetime_larger(DateTime *datetime1, DateTime *datetime2)
|
||||
{
|
||||
DateTime *result;
|
||||
|
||||
@@ -782,7 +782,7 @@ datetime_larger(DateTime * datetime1, DateTime * datetime2)
|
||||
|
||||
|
||||
TimeSpan *
|
||||
datetime_mi(DateTime * datetime1, DateTime * datetime2)
|
||||
datetime_mi(DateTime *datetime1, DateTime *datetime2)
|
||||
{
|
||||
TimeSpan *result;
|
||||
|
||||
@@ -831,7 +831,7 @@ datetime_mi(DateTime * datetime1, DateTime * datetime2)
|
||||
* to the last day of month.
|
||||
*/
|
||||
DateTime *
|
||||
datetime_pl_span(DateTime * datetime, TimeSpan * span)
|
||||
datetime_pl_span(DateTime *datetime, TimeSpan *span)
|
||||
{
|
||||
DateTime *result;
|
||||
DateTime dt;
|
||||
@@ -925,7 +925,7 @@ datetime_pl_span(DateTime * datetime, TimeSpan * span)
|
||||
} /* datetime_pl_span() */
|
||||
|
||||
DateTime *
|
||||
datetime_mi_span(DateTime * datetime, TimeSpan * span)
|
||||
datetime_mi_span(DateTime *datetime, TimeSpan *span)
|
||||
{
|
||||
DateTime *result;
|
||||
TimeSpan tspan;
|
||||
@@ -943,7 +943,7 @@ datetime_mi_span(DateTime * datetime, TimeSpan * span)
|
||||
|
||||
|
||||
TimeSpan *
|
||||
timespan_um(TimeSpan * timespan)
|
||||
timespan_um(TimeSpan *timespan)
|
||||
{
|
||||
TimeSpan *result;
|
||||
|
||||
@@ -960,7 +960,7 @@ timespan_um(TimeSpan * timespan)
|
||||
|
||||
|
||||
TimeSpan *
|
||||
timespan_smaller(TimeSpan * timespan1, TimeSpan * timespan2)
|
||||
timespan_smaller(TimeSpan *timespan1, TimeSpan *timespan2)
|
||||
{
|
||||
TimeSpan *result;
|
||||
|
||||
@@ -1015,7 +1015,7 @@ timespan_smaller(TimeSpan * timespan1, TimeSpan * timespan2)
|
||||
} /* timespan_smaller() */
|
||||
|
||||
TimeSpan *
|
||||
timespan_larger(TimeSpan * timespan1, TimeSpan * timespan2)
|
||||
timespan_larger(TimeSpan *timespan1, TimeSpan *timespan2)
|
||||
{
|
||||
TimeSpan *result;
|
||||
|
||||
@@ -1071,7 +1071,7 @@ timespan_larger(TimeSpan * timespan1, TimeSpan * timespan2)
|
||||
|
||||
|
||||
TimeSpan *
|
||||
timespan_pl(TimeSpan * span1, TimeSpan * span2)
|
||||
timespan_pl(TimeSpan *span1, TimeSpan *span2)
|
||||
{
|
||||
TimeSpan *result;
|
||||
|
||||
@@ -1087,7 +1087,7 @@ timespan_pl(TimeSpan * span1, TimeSpan * span2)
|
||||
} /* timespan_pl() */
|
||||
|
||||
TimeSpan *
|
||||
timespan_mi(TimeSpan * span1, TimeSpan * span2)
|
||||
timespan_mi(TimeSpan *span1, TimeSpan *span2)
|
||||
{
|
||||
TimeSpan *result;
|
||||
|
||||
@@ -1103,7 +1103,7 @@ timespan_mi(TimeSpan * span1, TimeSpan * span2)
|
||||
} /* timespan_mi() */
|
||||
|
||||
TimeSpan *
|
||||
timespan_div(TimeSpan * span1, float8 * arg2)
|
||||
timespan_div(TimeSpan *span1, float8 *arg2)
|
||||
{
|
||||
TimeSpan *result;
|
||||
|
||||
@@ -1129,7 +1129,7 @@ timespan_div(TimeSpan * span1, float8 * arg2)
|
||||
* is done.
|
||||
*/
|
||||
TimeSpan *
|
||||
datetime_age(DateTime * datetime1, DateTime * datetime2)
|
||||
datetime_age(DateTime *datetime1, DateTime *datetime2)
|
||||
{
|
||||
TimeSpan *result;
|
||||
|
||||
@@ -1276,7 +1276,7 @@ datetime_age(DateTime * datetime1, DateTime * datetime2)
|
||||
* Convert datetime to text data type.
|
||||
*/
|
||||
text *
|
||||
datetime_text(DateTime * datetime)
|
||||
datetime_text(DateTime *datetime)
|
||||
{
|
||||
text *result;
|
||||
char *str;
|
||||
@@ -1309,7 +1309,7 @@ datetime_text(DateTime * datetime)
|
||||
* then call the standard input routine.
|
||||
*/
|
||||
DateTime *
|
||||
text_datetime(text * str)
|
||||
text_datetime(text *str)
|
||||
{
|
||||
DateTime *result;
|
||||
int i;
|
||||
@@ -1336,7 +1336,7 @@ text_datetime(text * str)
|
||||
* Convert timespan to text data type.
|
||||
*/
|
||||
text *
|
||||
timespan_text(TimeSpan * timespan)
|
||||
timespan_text(TimeSpan *timespan)
|
||||
{
|
||||
text *result;
|
||||
char *str;
|
||||
@@ -1370,7 +1370,7 @@ timespan_text(TimeSpan * timespan)
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
TimeSpan *
|
||||
text_timespan(text * str)
|
||||
text_timespan(text *str)
|
||||
{
|
||||
TimeSpan *result;
|
||||
int i;
|
||||
@@ -1398,7 +1398,7 @@ text_timespan(text * str)
|
||||
* Extract specified field from datetime.
|
||||
*/
|
||||
DateTime *
|
||||
datetime_trunc(text * units, DateTime * datetime)
|
||||
datetime_trunc(text *units, DateTime *datetime)
|
||||
{
|
||||
DateTime *result;
|
||||
|
||||
@@ -1546,7 +1546,7 @@ datetime_trunc(text * units, DateTime * datetime)
|
||||
* Extract specified field from timespan.
|
||||
*/
|
||||
TimeSpan *
|
||||
timespan_trunc(text * units, TimeSpan * timespan)
|
||||
timespan_trunc(text *units, TimeSpan *timespan)
|
||||
{
|
||||
TimeSpan *result;
|
||||
|
||||
@@ -1672,7 +1672,7 @@ timespan_trunc(text * units, TimeSpan * timespan)
|
||||
* Extract specified field from datetime.
|
||||
*/
|
||||
float64
|
||||
datetime_part(text * units, DateTime * datetime)
|
||||
datetime_part(text *units, DateTime *datetime)
|
||||
{
|
||||
float64 result;
|
||||
|
||||
@@ -1824,7 +1824,7 @@ datetime_part(text * units, DateTime * datetime)
|
||||
* Extract specified field from timespan.
|
||||
*/
|
||||
float64
|
||||
timespan_part(text * units, TimeSpan * timespan)
|
||||
timespan_part(text *units, TimeSpan *timespan)
|
||||
{
|
||||
float64 result;
|
||||
|
||||
@@ -1961,7 +1961,7 @@ timespan_part(text * units, TimeSpan * timespan)
|
||||
* Encode datetime type with specified time zone.
|
||||
*/
|
||||
text *
|
||||
datetime_zone(text * zone, DateTime * datetime)
|
||||
datetime_zone(text *zone, DateTime *datetime)
|
||||
{
|
||||
text *result;
|
||||
|
||||
@@ -2553,7 +2553,7 @@ datetime2tm(DateTime dt, int *tzp, struct tm * tm, double *fsec, char **tzn)
|
||||
* Also, month is one-based, _not_ zero-based.
|
||||
*/
|
||||
int
|
||||
tm2datetime(struct tm * tm, double fsec, int *tzp, DateTime * result)
|
||||
tm2datetime(struct tm * tm, double fsec, int *tzp, DateTime *result)
|
||||
{
|
||||
|
||||
double date,
|
||||
@@ -2581,7 +2581,7 @@ tm2datetime(struct tm * tm, double fsec, int *tzp, DateTime * result)
|
||||
* Convert a timespan data type to a tm structure.
|
||||
*/
|
||||
static int
|
||||
timespan2tm(TimeSpan span, struct tm * tm, float8 * fsec)
|
||||
timespan2tm(TimeSpan span, struct tm * tm, float8 *fsec)
|
||||
{
|
||||
double time;
|
||||
|
||||
@@ -2618,7 +2618,7 @@ timespan2tm(TimeSpan span, struct tm * tm, float8 * fsec)
|
||||
} /* timespan2tm() */
|
||||
|
||||
static int
|
||||
tm2timespan(struct tm * tm, double fsec, TimeSpan * span)
|
||||
tm2timespan(struct tm * tm, double fsec, TimeSpan *span)
|
||||
{
|
||||
span->month = ((tm->tm_year * 12) + tm->tm_mon);
|
||||
span->time = ((((((tm->tm_mday * 24) + tm->tm_hour) * 60) + tm->tm_min) * 60) + tm->tm_sec);
|
||||
@@ -3995,7 +3995,7 @@ DecodeUnits(int field, char *lowtoken, int *val)
|
||||
* is WAY faster than the generic bsearch().
|
||||
*/
|
||||
static datetkn *
|
||||
datebsearch(char *key, datetkn * base, unsigned int nel)
|
||||
datebsearch(char *key, datetkn *base, unsigned int nel)
|
||||
{
|
||||
register datetkn *last = base + nel - 1,
|
||||
*position;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.19 1997/09/08 02:30:41 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.20 1997/09/08 21:48:25 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -981,7 +981,7 @@ dtrunc(float64 arg1)
|
||||
if (*arg1 >= 0)
|
||||
*result = (float64data) floor(tmp);
|
||||
else
|
||||
*result = (float64data) - (floor(-tmp));
|
||||
*result = (float64data) -(floor(-tmp));
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.7 1997/09/08 20:57:32 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.8 1997/09/08 21:48:29 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -69,12 +69,12 @@ int2out(int16 sh)
|
||||
int16 *
|
||||
int28in(char *shs)
|
||||
{
|
||||
register int16(*result)[];
|
||||
register int16 (*result)[];
|
||||
int nums;
|
||||
|
||||
if (shs == NULL)
|
||||
return (NULL);
|
||||
result = (int16(*)[]) palloc(sizeof(int16[8]));
|
||||
result = (int16 (*)[]) palloc(sizeof(int16[8]));
|
||||
if ((nums = sscanf(shs, "%hd%hd%hd%hd%hd%hd%hd%hd",
|
||||
*result,
|
||||
*result + 1,
|
||||
@@ -96,7 +96,7 @@ int28in(char *shs)
|
||||
* int28out - converts internal form to "num num ..."
|
||||
*/
|
||||
char *
|
||||
int28out(int16(*shs)[])
|
||||
int28out(int16 (*shs)[])
|
||||
{
|
||||
register int num;
|
||||
register int16 *sp;
|
||||
@@ -389,7 +389,7 @@ int42ge(int32 arg1, int32 arg2)
|
||||
|
||||
|
||||
bool
|
||||
keyfirsteq(int16 * arg1, int16 arg2)
|
||||
keyfirsteq(int16 *arg1, int16 arg2)
|
||||
{
|
||||
return (*arg1 == arg2);
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ char16nlike(char *s, struct varlena * p)
|
||||
}
|
||||
|
||||
bool
|
||||
namelike(NameData * n, struct varlena * p)
|
||||
namelike(NameData *n, struct varlena * p)
|
||||
{
|
||||
if (!n)
|
||||
return FALSE;
|
||||
@@ -130,7 +130,7 @@ namelike(NameData * n, struct varlena * p)
|
||||
}
|
||||
|
||||
bool
|
||||
namenlike(NameData * s, struct varlena * p)
|
||||
namenlike(NameData *s, struct varlena * p)
|
||||
{
|
||||
return (!namelike(s, p));
|
||||
}
|
||||
@@ -150,7 +150,7 @@ textnlike(struct varlena * s, struct varlena * p)
|
||||
}
|
||||
|
||||
|
||||
/* $Revision: 1.8 $
|
||||
/* $Revision: 1.9 $
|
||||
** "like.c" A first attempt at a LIKE operator for Postgres95.
|
||||
**
|
||||
** Originally written by Rich $alz, mirror!rs, Wed Nov 26 19:03:17 EST 1986.
|
||||
@@ -189,7 +189,7 @@ DoMatch(register char *text, register char *p)
|
||||
{
|
||||
register int matched;
|
||||
|
||||
for (; *p; text++, p++)
|
||||
for (; *p; text ++, p++)
|
||||
{
|
||||
if (*text == '\0' && *p != '%')
|
||||
return LIKE_ABORT;
|
||||
@@ -200,7 +200,7 @@ DoMatch(register char *text, register char *p)
|
||||
p++;
|
||||
/* FALLTHROUGH */
|
||||
default:
|
||||
if (*text != *p)
|
||||
if (*text !=*p)
|
||||
return LIKE_FALSE;
|
||||
continue;
|
||||
case '_':
|
||||
@@ -214,7 +214,7 @@ DoMatch(register char *text, register char *p)
|
||||
/* Trailing percent matches everything. */
|
||||
return LIKE_TRUE;
|
||||
while (*text)
|
||||
if ((matched = DoMatch(text++, p)) != LIKE_FALSE)
|
||||
if ((matched = DoMatch(text ++, p)) != LIKE_FALSE)
|
||||
return matched;
|
||||
return LIKE_ABORT;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/misc.c,v 1.9 1997/09/08 02:30:48 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/misc.c,v 1.10 1997/09/08 21:48:31 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -25,7 +25,7 @@
|
||||
* Check if data is Null
|
||||
*/
|
||||
bool
|
||||
nullvalue(Datum value, bool * isNull)
|
||||
nullvalue(Datum value, bool *isNull)
|
||||
{
|
||||
if (*isNull)
|
||||
{
|
||||
@@ -40,7 +40,7 @@ nullvalue(Datum value, bool * isNull)
|
||||
* check if data is not Null *
|
||||
*--------------------------------------------------------------------- */
|
||||
bool
|
||||
nonnullvalue(Datum value, bool * isNull)
|
||||
nonnullvalue(Datum value, bool *isNull)
|
||||
{
|
||||
if (*isNull)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.33 1997/09/08 02:30:49 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.34 1997/09/08 21:48:32 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -132,11 +132,11 @@ abstime2tm(AbsoluteTime time, int *tzp, struct tm * tm, char *tzn)
|
||||
#ifdef USE_POSIX_TIME
|
||||
if (tzp != NULL)
|
||||
{
|
||||
tx = localtime((time_t *) & time);
|
||||
tx = localtime((time_t *) &time);
|
||||
}
|
||||
else
|
||||
{
|
||||
tx = gmtime((time_t *) & time);
|
||||
tx = gmtime((time_t *) &time);
|
||||
};
|
||||
#else
|
||||
#endif
|
||||
@@ -487,7 +487,7 @@ abstimege(AbsoluteTime t1, AbsoluteTime t2)
|
||||
* Convert datetime to abstime.
|
||||
*/
|
||||
AbsoluteTime
|
||||
datetime_abstime(DateTime * datetime)
|
||||
datetime_abstime(DateTime *datetime)
|
||||
{
|
||||
AbsoluteTime result;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.8 1997/09/08 02:30:50 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.9 1997/09/08 21:48:33 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -49,7 +49,7 @@ namein(char *s)
|
||||
* nameout - converts internal reprsentation to "..."
|
||||
*/
|
||||
char *
|
||||
nameout(NameData * s)
|
||||
nameout(NameData *s)
|
||||
{
|
||||
if (s == NULL)
|
||||
return "-";
|
||||
@@ -77,7 +77,7 @@ nameout(NameData * s)
|
||||
*
|
||||
*/
|
||||
bool
|
||||
nameeq(NameData * arg1, NameData * arg2)
|
||||
nameeq(NameData *arg1, NameData *arg2)
|
||||
{
|
||||
if (!arg1 || !arg2)
|
||||
return 0;
|
||||
@@ -86,7 +86,7 @@ nameeq(NameData * arg1, NameData * arg2)
|
||||
}
|
||||
|
||||
bool
|
||||
namene(NameData * arg1, NameData * arg2)
|
||||
namene(NameData *arg1, NameData *arg2)
|
||||
{
|
||||
if (arg1 == NULL || arg2 == NULL)
|
||||
return ((bool) 0);
|
||||
@@ -94,7 +94,7 @@ namene(NameData * arg1, NameData * arg2)
|
||||
}
|
||||
|
||||
bool
|
||||
namelt(NameData * arg1, NameData * arg2)
|
||||
namelt(NameData *arg1, NameData *arg2)
|
||||
{
|
||||
if (arg1 == NULL || arg2 == NULL)
|
||||
return ((bool) 0);
|
||||
@@ -102,7 +102,7 @@ namelt(NameData * arg1, NameData * arg2)
|
||||
}
|
||||
|
||||
bool
|
||||
namele(NameData * arg1, NameData * arg2)
|
||||
namele(NameData *arg1, NameData *arg2)
|
||||
{
|
||||
if (arg1 == NULL || arg2 == NULL)
|
||||
return ((bool) 0);
|
||||
@@ -110,7 +110,7 @@ namele(NameData * arg1, NameData * arg2)
|
||||
}
|
||||
|
||||
bool
|
||||
namegt(NameData * arg1, NameData * arg2)
|
||||
namegt(NameData *arg1, NameData *arg2)
|
||||
{
|
||||
if (arg1 == NULL || arg2 == NULL)
|
||||
return ((bool) 0);
|
||||
@@ -119,7 +119,7 @@ namegt(NameData * arg1, NameData * arg2)
|
||||
}
|
||||
|
||||
bool
|
||||
namege(NameData * arg1, NameData * arg2)
|
||||
namege(NameData *arg1, NameData *arg2)
|
||||
{
|
||||
if (arg1 == NULL || arg2 == NULL)
|
||||
return ((bool) 0);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.10 1997/09/08 02:30:54 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.11 1997/09/08 21:48:33 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -31,12 +31,12 @@
|
||||
Oid *
|
||||
oid8in(char *oidString)
|
||||
{
|
||||
register Oid(*result)[];
|
||||
register Oid (*result)[];
|
||||
int nums;
|
||||
|
||||
if (oidString == NULL)
|
||||
return (NULL);
|
||||
result = (Oid(*)[]) palloc(sizeof(Oid[8]));
|
||||
result = (Oid (*)[]) palloc(sizeof(Oid[8]));
|
||||
if ((nums = sscanf(oidString, "%d%d%d%d%d%d%d%d",
|
||||
&(*result)[0],
|
||||
&(*result)[1],
|
||||
@@ -58,7 +58,7 @@ oid8in(char *oidString)
|
||||
* oid8out - converts internal form to "num num ..."
|
||||
*/
|
||||
char *
|
||||
oid8out(Oid(*oidArray)[])
|
||||
oid8out(Oid (*oidArray)[])
|
||||
{
|
||||
register int num;
|
||||
register Oid *sp;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidint2.c,v 1.3 1997/09/08 02:30:54 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidint2.c,v 1.4 1997/09/08 21:48:34 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -60,8 +60,8 @@ bool
|
||||
oidint2lt(OidInt2 o1, OidInt2 o2)
|
||||
{
|
||||
return
|
||||
((bool) (o1->oi_oid < o2->oi_oid ||
|
||||
(o1->oi_oid == o2->oi_oid && o1->oi_int2 < o2->oi_int2)));
|
||||
((bool) (o1->oi_oid < o2->oi_oid ||
|
||||
(o1->oi_oid == o2->oi_oid && o1->oi_int2 < o2->oi_int2)));
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidint4.c,v 1.3 1997/09/08 02:30:55 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidint4.c,v 1.4 1997/09/08 21:48:35 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -60,8 +60,8 @@ bool
|
||||
oidint4lt(OidInt4 o1, OidInt4 o2)
|
||||
{
|
||||
return
|
||||
((bool) (o1->oi_oid < o2->oi_oid ||
|
||||
(o1->oi_oid == o2->oi_oid && o1->oi_int4 < o2->oi_int4)));
|
||||
((bool) (o1->oi_oid < o2->oi_oid ||
|
||||
(o1->oi_oid == o2->oi_oid && o1->oi_int4 < o2->oi_int4)));
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidname.c,v 1.6 1997/09/08 02:30:56 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidname.c,v 1.7 1997/09/08 21:48:37 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -61,32 +61,32 @@ bool
|
||||
oidnamelt(OidName o1, OidName o2)
|
||||
{
|
||||
return (bool)
|
||||
(o1->id < o2->id ||
|
||||
(o1->id == o2->id && namecmp(&o1->name, &o2->name) < 0));
|
||||
(o1->id < o2->id ||
|
||||
(o1->id == o2->id && namecmp(&o1->name, &o2->name) < 0));
|
||||
}
|
||||
|
||||
bool
|
||||
oidnamele(OidName o1, OidName o2)
|
||||
{
|
||||
return (bool)
|
||||
(o1->id < o2->id ||
|
||||
(o1->id == o2->id && namecmp(&o1->name, &o2->name) <= 0));
|
||||
(o1->id < o2->id ||
|
||||
(o1->id == o2->id && namecmp(&o1->name, &o2->name) <= 0));
|
||||
}
|
||||
|
||||
bool
|
||||
oidnameeq(OidName o1, OidName o2)
|
||||
{
|
||||
return (bool)
|
||||
(o1->id == o2->id &&
|
||||
(namecmp(&o1->name, &o2->name) == 0));
|
||||
(o1->id == o2->id &&
|
||||
(namecmp(&o1->name, &o2->name) == 0));
|
||||
}
|
||||
|
||||
bool
|
||||
oidnamene(OidName o1, OidName o2)
|
||||
{
|
||||
return (bool)
|
||||
(o1->id != o2->id ||
|
||||
(namecmp(&o1->name, &o2->name) != 0));
|
||||
(o1->id != o2->id ||
|
||||
(namecmp(&o1->name, &o2->name) != 0));
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Edmund Mergl <E.Mergl@bawue.de>
|
||||
*
|
||||
* $Id: oracle_compat.c,v 1.9 1997/09/08 02:30:57 momjian Exp $
|
||||
* $Id: oracle_compat.c,v 1.10 1997/09/08 21:48:39 momjian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -10,16 +10,16 @@
|
||||
#include "postgres.h"
|
||||
|
||||
|
||||
text *lower(text * string);
|
||||
text *upper(text * string);
|
||||
text *initcap(text * string);
|
||||
text *lpad(text * string1, int4 len, text * string2);
|
||||
text *rpad(text * string1, int4 len, text * string2);
|
||||
text *btrim(text * string, text * set);
|
||||
text *ltrim(text * string, text * set);
|
||||
text *rtrim(text * string, text * set);
|
||||
text *substr(text * string, int4 m, int4 n);
|
||||
text *translate(text * string, char from, char to);
|
||||
text *lower(text *string);
|
||||
text *upper(text *string);
|
||||
text *initcap(text *string);
|
||||
text *lpad(text *string1, int4 len, text *string2);
|
||||
text *rpad(text *string1, int4 len, text *string2);
|
||||
text *btrim(text *string, text *set);
|
||||
text *ltrim(text *string, text *set);
|
||||
text *rtrim(text *string, text *set);
|
||||
text *substr(text *string, int4 m, int4 n);
|
||||
text *translate(text *string, char from, char to);
|
||||
|
||||
|
||||
/********************************************************************
|
||||
@@ -37,7 +37,7 @@ text *translate(text * string, char from, char to);
|
||||
********************************************************************/
|
||||
|
||||
text *
|
||||
lower(text * string)
|
||||
lower(text *string)
|
||||
{
|
||||
text *ret;
|
||||
char *ptr,
|
||||
@@ -77,7 +77,7 @@ lower(text * string)
|
||||
********************************************************************/
|
||||
|
||||
text *
|
||||
upper(text * string)
|
||||
upper(text *string)
|
||||
{
|
||||
text *ret;
|
||||
char *ptr,
|
||||
@@ -119,7 +119,7 @@ upper(text * string)
|
||||
********************************************************************/
|
||||
|
||||
text *
|
||||
initcap(text * string)
|
||||
initcap(text *string)
|
||||
{
|
||||
text *ret;
|
||||
char *ptr,
|
||||
@@ -170,7 +170,7 @@ initcap(text * string)
|
||||
********************************************************************/
|
||||
|
||||
text *
|
||||
lpad(text * string1, int4 len, text * string2)
|
||||
lpad(text *string1, int4 len, text *string2)
|
||||
{
|
||||
text *ret;
|
||||
char *ptr1,
|
||||
@@ -226,7 +226,7 @@ lpad(text * string1, int4 len, text * string2)
|
||||
********************************************************************/
|
||||
|
||||
text *
|
||||
rpad(text * string1, int4 len, text * string2)
|
||||
rpad(text *string1, int4 len, text *string2)
|
||||
{
|
||||
text *ret;
|
||||
char *ptr1,
|
||||
@@ -282,7 +282,7 @@ rpad(text * string1, int4 len, text * string2)
|
||||
********************************************************************/
|
||||
|
||||
text *
|
||||
btrim(text * string, text * set)
|
||||
btrim(text *string, text *set)
|
||||
{
|
||||
text *ret;
|
||||
char *ptr,
|
||||
@@ -368,7 +368,7 @@ btrim(text * string, text * set)
|
||||
********************************************************************/
|
||||
|
||||
text *
|
||||
ltrim(text * string, text * set)
|
||||
ltrim(text *string, text *set)
|
||||
{
|
||||
text *ret;
|
||||
char *ptr,
|
||||
@@ -431,7 +431,7 @@ ltrim(text * string, text * set)
|
||||
********************************************************************/
|
||||
|
||||
text *
|
||||
rtrim(text * string, text * set)
|
||||
rtrim(text *string, text *set)
|
||||
{
|
||||
text *ret;
|
||||
char *ptr,
|
||||
@@ -503,7 +503,7 @@ rtrim(text * string, text * set)
|
||||
********************************************************************/
|
||||
|
||||
text *
|
||||
substr(text * string, int4 m, int4 n)
|
||||
substr(text *string, int4 m, int4 n)
|
||||
{
|
||||
text *ret;
|
||||
char *ptr,
|
||||
@@ -549,7 +549,7 @@ substr(text * string, int4 m, int4 n)
|
||||
********************************************************************/
|
||||
|
||||
text *
|
||||
translate(text * string, char from, char to)
|
||||
translate(text *string, char from, char to)
|
||||
{
|
||||
text *ret;
|
||||
char *ptr,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regexp.c,v 1.9 1997/09/08 02:30:58 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regexp.c,v 1.10 1997/09/08 21:48:40 momjian Exp $
|
||||
*
|
||||
* Alistair Crooks added the code for the regex caching
|
||||
* agc - cached the regular expressions used - there's a good chance
|
||||
@@ -256,7 +256,7 @@ char16regexne(char *s, struct varlena * p)
|
||||
}
|
||||
|
||||
bool
|
||||
nameregexeq(NameData * n, struct varlena * p)
|
||||
nameregexeq(NameData *n, struct varlena * p)
|
||||
{
|
||||
if (!n)
|
||||
return FALSE;
|
||||
@@ -264,7 +264,7 @@ nameregexeq(NameData * n, struct varlena * p)
|
||||
}
|
||||
|
||||
bool
|
||||
nameregexne(NameData * s, struct varlena * p)
|
||||
nameregexne(NameData *s, struct varlena * p)
|
||||
{
|
||||
return (!nameregexeq(s, p));
|
||||
}
|
||||
@@ -357,7 +357,7 @@ texticregexne(struct varlena * s, struct varlena * p)
|
||||
}
|
||||
|
||||
bool
|
||||
nameicregexeq(NameData * n, struct varlena * p)
|
||||
nameicregexeq(NameData *n, struct varlena * p)
|
||||
{
|
||||
if (!n)
|
||||
return FALSE;
|
||||
@@ -366,7 +366,7 @@ nameicregexeq(NameData * n, struct varlena * p)
|
||||
}
|
||||
|
||||
bool
|
||||
nameicregexne(NameData * s, struct varlena * p)
|
||||
nameicregexne(NameData *s, struct varlena * p)
|
||||
{
|
||||
return (!nameicregexeq(s, p));
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ timestamp_datetime(time_t timestamp)
|
||||
if (!PointerIsValid(result = PALLOCTYPE(DateTime)))
|
||||
elog(WARN, "Memory allocation failed, can't convert timestamp to datetime", NULL);
|
||||
|
||||
tm = localtime((time_t *) & timestamp);
|
||||
tm = localtime((time_t *) ×tamp);
|
||||
tm->tm_year += 1900;
|
||||
tm->tm_mon += 1;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.20 1997/09/08 02:31:06 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.21 1997/09/08 21:48:42 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -212,7 +212,7 @@ textout(struct varlena * vlena)
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
int
|
||||
textlen(text * t)
|
||||
textlen(text *t)
|
||||
{
|
||||
int i = 0;
|
||||
int max = VARSIZE(t) - VARHDRSZ;
|
||||
@@ -239,7 +239,7 @@ textlen(text * t)
|
||||
*/
|
||||
|
||||
text *
|
||||
textcat(text * t1, text * t2)
|
||||
textcat(text *t1, text *t2)
|
||||
{
|
||||
int len1,
|
||||
len2,
|
||||
@@ -281,7 +281,7 @@ textcat(text * t1, text * t2)
|
||||
*/
|
||||
|
||||
int32
|
||||
textpos(text * t1, text * t2)
|
||||
textpos(text *t1, text *t2)
|
||||
{
|
||||
int pos;
|
||||
int px,
|
||||
@@ -348,7 +348,7 @@ texteq(struct varlena * arg1, struct varlena * arg2)
|
||||
bool
|
||||
textne(struct varlena * arg1, struct varlena * arg2)
|
||||
{
|
||||
return ((bool) ! texteq(arg1, arg2));
|
||||
return ((bool) !texteq(arg1, arg2));
|
||||
}
|
||||
|
||||
/* text_lt()
|
||||
@@ -466,13 +466,13 @@ text_le(struct varlena * arg1, struct varlena * arg2)
|
||||
bool
|
||||
text_gt(struct varlena * arg1, struct varlena * arg2)
|
||||
{
|
||||
return ((bool) ! text_le(arg1, arg2));
|
||||
return ((bool) !text_le(arg1, arg2));
|
||||
}
|
||||
|
||||
bool
|
||||
text_ge(struct varlena * arg1, struct varlena * arg2)
|
||||
{
|
||||
return ((bool) ! text_lt(arg1, arg2));
|
||||
return ((bool) !text_lt(arg1, arg2));
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
|
||||
12
src/backend/utils/cache/catcache.c
vendored
12
src/backend/utils/cache/catcache.c
vendored
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.12 1997/09/08 02:31:09 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.13 1997/09/08 21:48:45 momjian Exp $
|
||||
*
|
||||
* Notes:
|
||||
* XXX This needs to use exception.h to handle recovery when
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "catalog/pg_type.h" /* for OID of int28 type */
|
||||
#include "lib/dllist.h"
|
||||
|
||||
static void CatCacheRemoveCTup(CatCache * cache, Dlelem * e);
|
||||
static void CatCacheRemoveCTup(CatCache *cache, Dlelem *e);
|
||||
static Index CatalogCacheComputeHashIndex(struct catcache * cacheInP);
|
||||
static Index
|
||||
CatalogCacheComputeTupleHashIndex(struct catcache * cacheInOutP,
|
||||
@@ -213,7 +213,7 @@ CatalogCacheInitializeCache(struct catcache * cache,
|
||||
EQPROC(tupdesc->attrs[cache->cc_key[i] - 1]->atttypid);
|
||||
|
||||
fmgr_info(cache->cc_skey[i].sk_procedure,
|
||||
(func_ptr *) & cache->cc_skey[i].sk_func,
|
||||
(func_ptr *) &cache->cc_skey[i].sk_func,
|
||||
(int *) &cache->cc_skey[i].sk_nargs);
|
||||
|
||||
CACHE5_elog(DEBUG, "CatalogCacheInit %16s %d %d %x",
|
||||
@@ -268,7 +268,7 @@ CatalogCacheInitializeCache(struct catcache * cache,
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
void
|
||||
CatalogCacheSetId(CatCache * cacheInOutP, int id)
|
||||
CatalogCacheSetId(CatCache *cacheInOutP, int id)
|
||||
{
|
||||
Assert(id == InvalidCatalogCacheId || id >= 0);
|
||||
cacheInOutP->id = id;
|
||||
@@ -439,7 +439,7 @@ CatalogCacheComputeTupleHashIndex(struct catcache * cacheInOutP,
|
||||
* --------------------------------
|
||||
*/
|
||||
static void
|
||||
CatCacheRemoveCTup(CatCache * cache, Dlelem * elt)
|
||||
CatCacheRemoveCTup(CatCache *cache, Dlelem *elt)
|
||||
{
|
||||
CatCTup *ct;
|
||||
CatCTup *other_ct;
|
||||
@@ -651,7 +651,7 @@ InitSysCache(char *relname,
|
||||
int id,
|
||||
int nkeys,
|
||||
int key[],
|
||||
HeapTuple(*iScanfuncP) ())
|
||||
HeapTuple (*iScanfuncP) ())
|
||||
{
|
||||
CatCache *cp;
|
||||
register int i;
|
||||
|
||||
16
src/backend/utils/cache/fcache.c
vendored
16
src/backend/utils/cache/fcache.c
vendored
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.6 1997/09/08 02:31:11 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.7 1997/09/08 21:48:49 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -35,12 +35,12 @@
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
static Oid GetDynamicFuncArgType(Var * arg, ExprContext * econtext);
|
||||
static Oid GetDynamicFuncArgType(Var *arg, ExprContext *econtext);
|
||||
static FunctionCachePtr
|
||||
init_fcache(Oid foid,
|
||||
bool use_syscache,
|
||||
List * argList,
|
||||
ExprContext * econtext);
|
||||
List *argList,
|
||||
ExprContext *econtext);
|
||||
|
||||
/*-----------------------------------------------------------------
|
||||
*
|
||||
@@ -56,7 +56,7 @@ init_fcache(Oid foid,
|
||||
(IsA(arg,Var) && ((Var*)arg)->varattno == InvalidAttrNumber)
|
||||
|
||||
static Oid
|
||||
GetDynamicFuncArgType(Var * arg, ExprContext * econtext)
|
||||
GetDynamicFuncArgType(Var *arg, ExprContext *econtext)
|
||||
{
|
||||
char *relname;
|
||||
int rtid;
|
||||
@@ -80,8 +80,8 @@ GetDynamicFuncArgType(Var * arg, ExprContext * econtext)
|
||||
static FunctionCachePtr
|
||||
init_fcache(Oid foid,
|
||||
bool use_syscache,
|
||||
List * argList,
|
||||
ExprContext * econtext)
|
||||
List *argList,
|
||||
ExprContext *econtext)
|
||||
{
|
||||
HeapTuple procedureTuple;
|
||||
HeapTuple typeTuple;
|
||||
@@ -291,7 +291,7 @@ init_fcache(Oid foid,
|
||||
}
|
||||
|
||||
void
|
||||
setFcache(Node * node, Oid foid, List * argList, ExprContext * econtext)
|
||||
setFcache(Node *node, Oid foid, List *argList, ExprContext *econtext)
|
||||
{
|
||||
Func *fnode;
|
||||
Oper *onode;
|
||||
|
||||
14
src/backend/utils/cache/inval.c
vendored
14
src/backend/utils/cache/inval.c
vendored
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.7 1997/09/08 20:57:39 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.8 1997/09/08 21:48:50 momjian Exp $
|
||||
*
|
||||
* Note - this code is real crufty...
|
||||
*
|
||||
@@ -48,13 +48,13 @@ typedef struct CatalogInvalidationData
|
||||
Index cacheId;
|
||||
Index hashIndex;
|
||||
ItemPointerData pointerData;
|
||||
} CatalogInvalidationData;
|
||||
} CatalogInvalidationData;
|
||||
|
||||
typedef struct RelationInvalidationData
|
||||
{
|
||||
Oid relationId;
|
||||
Oid objectId;
|
||||
} RelationInvalidationData;
|
||||
} RelationInvalidationData;
|
||||
|
||||
typedef union AnyInvalidation
|
||||
{
|
||||
@@ -66,7 +66,7 @@ typedef struct InvalidationMessageData
|
||||
{
|
||||
char kind;
|
||||
AnyInvalidation any;
|
||||
} InvalidationMessageData;
|
||||
} InvalidationMessageData;
|
||||
|
||||
typedef InvalidationMessageData *InvalidationMessage;
|
||||
|
||||
@@ -103,7 +103,7 @@ InvalidationEntryAllocate(uint16 size)
|
||||
entryDataP = (InvalidationEntryData *)
|
||||
malloc(sizeof(char *) + size); /* XXX alignment */
|
||||
entryDataP->nextP = NULL;
|
||||
return ((Pointer) & entryDataP->userData);
|
||||
return ((Pointer) &entryDataP->userData);
|
||||
}
|
||||
|
||||
/* --------------------------------
|
||||
@@ -137,11 +137,11 @@ LocalInvalidInvalidate(LocalInvalid invalid, void (*function) ())
|
||||
while (PointerIsValid(invalid))
|
||||
{
|
||||
entryDataP = (InvalidationEntryData *)
|
||||
& ((InvalidationUserData *) invalid)->dataP[-1];
|
||||
&((InvalidationUserData *) invalid)->dataP[-1];
|
||||
|
||||
if (PointerIsValid(function))
|
||||
{
|
||||
(*function) ((Pointer) & entryDataP->userData);
|
||||
(*function) ((Pointer) &entryDataP->userData);
|
||||
}
|
||||
|
||||
invalid = (Pointer) entryDataP->nextP;
|
||||
|
||||
4
src/backend/utils/cache/lsyscache.c
vendored
4
src/backend/utils/cache/lsyscache.c
vendored
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.5 1997/09/08 02:31:14 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.6 1997/09/08 21:48:51 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Eventually, the index information should go through here, too.
|
||||
@@ -216,7 +216,7 @@ get_opname(Oid opno)
|
||||
*
|
||||
*/
|
||||
bool
|
||||
op_mergesortable(Oid opno, Oid ltype, Oid rtype, Oid * leftOp, Oid * rightOp)
|
||||
op_mergesortable(Oid opno, Oid ltype, Oid rtype, Oid *leftOp, Oid *rightOp)
|
||||
{
|
||||
FormData_pg_operator optup;
|
||||
|
||||
|
||||
4
src/backend/utils/cache/rel.c
vendored
4
src/backend/utils/cache/rel.c
vendored
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/rel.c,v 1.2 1997/09/07 04:53:07 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/rel.c,v 1.3 1997/09/08 21:48:53 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -66,7 +66,7 @@ RelationGetIndexStrategy(Relation relation)
|
||||
void
|
||||
RelationSetIndexSupport(Relation relation,
|
||||
IndexStrategy strategy,
|
||||
RegProcedure * support)
|
||||
RegProcedure *support)
|
||||
{
|
||||
Assert(PointerIsValid(relation));
|
||||
Assert(IndexStrategyIsValid(strategy));
|
||||
|
||||
16
src/backend/utils/cache/relcache.c
vendored
16
src/backend/utils/cache/relcache.c
vendored
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.22 1997/09/08 02:31:16 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.23 1997/09/08 21:48:55 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -88,7 +88,7 @@
|
||||
#include "fmgr.h"
|
||||
|
||||
static void
|
||||
RelationFlushRelation(Relation * relationPtr,
|
||||
RelationFlushRelation(Relation *relationPtr,
|
||||
bool onlyFlushReferenceCountZero);
|
||||
static Relation RelationNameCacheGetRelation(char *relationName);
|
||||
static void init_irels(void);
|
||||
@@ -145,19 +145,19 @@ typedef struct RelationBuildDescInfo
|
||||
Oid info_id; /* relation object id */
|
||||
char *info_name; /* relation name */
|
||||
} i;
|
||||
} RelationBuildDescInfo;
|
||||
} RelationBuildDescInfo;
|
||||
|
||||
typedef struct relidcacheent
|
||||
{
|
||||
Oid reloid;
|
||||
Relation reldesc;
|
||||
} RelIdCacheEnt;
|
||||
} RelIdCacheEnt;
|
||||
|
||||
typedef struct relnamecacheent
|
||||
{
|
||||
NameData relname;
|
||||
Relation reldesc;
|
||||
} RelNameCacheEnt;
|
||||
} RelNameCacheEnt;
|
||||
|
||||
/* -----------------
|
||||
* macros to manipulate name cache and id cache
|
||||
@@ -251,7 +251,7 @@ formrdesc(char *relationName, u_int natts,
|
||||
FormData_pg_attribute att[]);
|
||||
|
||||
#if 0 /* See comments at line 1304 */
|
||||
static void RelationFlushIndexes(Relation * r, Oid accessMethodId);
|
||||
static void RelationFlushIndexes(Relation *r, Oid accessMethodId);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1329,7 +1329,7 @@ RelationClose(Relation relation)
|
||||
* --------------------------------
|
||||
*/
|
||||
static void
|
||||
RelationFlushRelation(Relation * relationPtr,
|
||||
RelationFlushRelation(Relation *relationPtr,
|
||||
bool onlyFlushReferenceCountZero)
|
||||
{
|
||||
MemoryContext oldcxt;
|
||||
@@ -1459,7 +1459,7 @@ RelationIdInvalidateRelationCacheByRelationId(Oid relationId)
|
||||
* --------------------------------
|
||||
*/
|
||||
static void
|
||||
RelationFlushIndexes(Relation * r,
|
||||
RelationFlushIndexes(Relation *r,
|
||||
Oid accessMethodId)
|
||||
{
|
||||
Relation relation = *r;
|
||||
|
||||
8
src/backend/utils/cache/syscache.c
vendored
8
src/backend/utils/cache/syscache.c
vendored
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.6 1997/09/08 02:31:21 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.7 1997/09/08 21:48:56 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* These routines allow the parser/planner/executor to perform
|
||||
@@ -57,7 +57,7 @@ extern bool AMI_OVERRIDE; /* XXX style */
|
||||
#include "utils/syscache.h"
|
||||
#include "catalog/indexing.h"
|
||||
|
||||
typedef HeapTuple(*ScanFunc) ();
|
||||
typedef HeapTuple (*ScanFunc) ();
|
||||
|
||||
/* ----------------
|
||||
* Warning: cacheinfo[] below is changed, then be sure and
|
||||
@@ -179,7 +179,7 @@ static struct cachedesc cacheinfo[] = {
|
||||
0,
|
||||
0,
|
||||
0},
|
||||
offsetof(TypeTupleFormData, typalign) + sizeof(char),
|
||||
offsetof(TypeTupleFormData, typalign) +sizeof(char),
|
||||
TypeNameIndex,
|
||||
TypeNameIndexScan},
|
||||
{TypeRelationName, /* TYPOID */
|
||||
@@ -383,7 +383,7 @@ InitCatalogCache()
|
||||
* XXX The tuple that is returned is NOT supposed to be pfree'd!
|
||||
*/
|
||||
HeapTuple
|
||||
SearchSysCacheTuple(int cacheId, /* cache selection code */
|
||||
SearchSysCacheTuple(int cacheId,/* cache selection code */
|
||||
Datum key1,
|
||||
Datum key2,
|
||||
Datum key3,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/error/assert.c,v 1.6 1997/09/08 02:31:25 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/error/assert.c,v 1.7 1997/09/08 21:48:58 momjian Exp $
|
||||
*
|
||||
* NOTE
|
||||
* This should eventually work with elog(), dlog(), etc.
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
int
|
||||
ExceptionalCondition(char *conditionName,
|
||||
Exception * exceptionP,
|
||||
Exception *exceptionP,
|
||||
char *detail,
|
||||
char *fileName,
|
||||
int lineNumber)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/exc.c,v 1.17 1997/09/08 02:31:29 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/exc.c,v 1.18 1997/09/08 21:49:00 momjian Exp $
|
||||
*
|
||||
* NOTE
|
||||
* XXX this code needs improvement--check for state violations and
|
||||
@@ -25,10 +25,10 @@
|
||||
#include "storage/ipc.h"
|
||||
|
||||
static void
|
||||
ExcUnCaught(Exception * excP, ExcDetail detail, ExcData data,
|
||||
ExcUnCaught(Exception *excP, ExcDetail detail, ExcData data,
|
||||
ExcMessage message);
|
||||
static void
|
||||
ExcPrint(Exception * excP, ExcDetail detail, ExcData data,
|
||||
ExcPrint(Exception *excP, ExcDetail detail, ExcData data,
|
||||
ExcMessage message);
|
||||
|
||||
/*
|
||||
@@ -98,7 +98,7 @@ EnableExceptionHandling(bool on)
|
||||
}
|
||||
|
||||
static void
|
||||
ExcPrint(Exception * excP,
|
||||
ExcPrint(Exception *excP,
|
||||
ExcDetail detail,
|
||||
ExcData data,
|
||||
ExcMessage message)
|
||||
@@ -151,7 +151,7 @@ ExcGetUnCaught(void)
|
||||
|
||||
#ifdef NOT_USED
|
||||
ExcProc *
|
||||
ExcSetUnCaught(ExcProc * newP)
|
||||
ExcSetUnCaught(ExcProc *newP)
|
||||
{
|
||||
ExcProc *oldP = ExcUnCaughtP;
|
||||
|
||||
@@ -163,7 +163,7 @@ ExcSetUnCaught(ExcProc * newP)
|
||||
#endif
|
||||
|
||||
static void
|
||||
ExcUnCaught(Exception * excP,
|
||||
ExcUnCaught(Exception *excP,
|
||||
ExcDetail detail,
|
||||
ExcData data,
|
||||
ExcMessage message)
|
||||
@@ -174,7 +174,7 @@ ExcUnCaught(Exception * excP,
|
||||
}
|
||||
|
||||
void
|
||||
ExcRaise(Exception * excP,
|
||||
ExcRaise(Exception *excP,
|
||||
ExcDetail detail,
|
||||
ExcData data,
|
||||
ExcMessage message)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/excabort.c,v 1.3 1997/09/07 04:53:18 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/excabort.c,v 1.4 1997/09/08 21:49:03 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "utils/exc.h" /* where function declarations go */
|
||||
|
||||
void
|
||||
ExcAbort(const Exception * excP,
|
||||
ExcAbort(const Exception *excP,
|
||||
ExcDetail detail,
|
||||
ExcData data,
|
||||
ExcMessage message)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.5 1997/09/08 02:31:37 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.6 1997/09/08 21:49:07 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -33,8 +33,8 @@ char *
|
||||
fmgr_c(func_ptr user_fn,
|
||||
Oid func_id,
|
||||
int n_arguments,
|
||||
FmgrValues * values,
|
||||
bool * isNull)
|
||||
FmgrValues *values,
|
||||
bool *isNull)
|
||||
{
|
||||
char *returnValue = (char *) NULL;
|
||||
|
||||
@@ -115,7 +115,7 @@ fmgr_c(func_ptr user_fn,
|
||||
}
|
||||
|
||||
void
|
||||
fmgr_info(Oid procedureId, func_ptr * function, int *nargs)
|
||||
fmgr_info(Oid procedureId, func_ptr *function, int *nargs)
|
||||
{
|
||||
func_ptr user_fn = NULL;
|
||||
FmgrCall *fcp;
|
||||
@@ -252,7 +252,7 @@ fmgr_ptr(func_ptr user_fn, Oid func_id,...)
|
||||
* to fmgr_c().
|
||||
*/
|
||||
char *
|
||||
fmgr_array_args(Oid procedureId, int nargs, char *args[], bool * isNull)
|
||||
fmgr_array_args(Oid procedureId, int nargs, char *args[], bool *isNull)
|
||||
{
|
||||
func_ptr user_fn;
|
||||
int true_arguments;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.9 1997/09/08 02:31:41 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.10 1997/09/08 21:49:13 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -66,10 +66,10 @@
|
||||
*/
|
||||
static long *DynaHashAlloc(unsigned int size);
|
||||
static void DynaHashFree(Pointer ptr);
|
||||
static uint32 call_hash(HTAB * hashp, char *k, int len);
|
||||
static SEG_OFFSET seg_alloc(HTAB * hashp);
|
||||
static int bucket_alloc(HTAB * hashp);
|
||||
static int dir_realloc(HTAB * hashp);
|
||||
static uint32 call_hash(HTAB *hashp, char *k, int len);
|
||||
static SEG_OFFSET seg_alloc(HTAB *hashp);
|
||||
static int bucket_alloc(HTAB *hashp);
|
||||
static int dir_realloc(HTAB *hashp);
|
||||
|
||||
typedef long *((*dhalloc_ptr) ());
|
||||
|
||||
@@ -122,9 +122,9 @@ DynaHashFree(Pointer ptr)
|
||||
* ----------------
|
||||
*/
|
||||
|
||||
static int expand_table(HTAB * hashp);
|
||||
static int hdefault(HTAB * hashp);
|
||||
static int init_htab(HTAB * hashp, int nelem);
|
||||
static int expand_table(HTAB *hashp);
|
||||
static int hdefault(HTAB *hashp);
|
||||
static int init_htab(HTAB *hashp, int nelem);
|
||||
|
||||
|
||||
/*
|
||||
@@ -155,7 +155,7 @@ static long hash_accesses,
|
||||
/************************** CREATE ROUTINES **********************/
|
||||
|
||||
HTAB *
|
||||
hash_create(int nelem, HASHCTL * info, int flags)
|
||||
hash_create(int nelem, HASHCTL *info, int flags)
|
||||
{
|
||||
register HHDR *hctl;
|
||||
HTAB *hashp;
|
||||
@@ -267,7 +267,7 @@ hash_create(int nelem, HASHCTL * info, int flags)
|
||||
Allocate and initialize an HTAB structure
|
||||
*/
|
||||
static int
|
||||
hdefault(HTAB * hashp)
|
||||
hdefault(HTAB *hashp)
|
||||
{
|
||||
HHDR *hctl;
|
||||
|
||||
@@ -300,7 +300,7 @@ hdefault(HTAB * hashp)
|
||||
|
||||
|
||||
static int
|
||||
init_htab(HTAB * hashp, int nelem)
|
||||
init_htab(HTAB *hashp, int nelem)
|
||||
{
|
||||
register SEG_OFFSET *segp;
|
||||
register int nbuckets;
|
||||
@@ -380,7 +380,7 @@ init_htab(HTAB * hashp, int nelem)
|
||||
/********************** DESTROY ROUTINES ************************/
|
||||
|
||||
void
|
||||
hash_destroy(HTAB * hashp)
|
||||
hash_destroy(HTAB *hashp)
|
||||
{
|
||||
/* cannot destroy a shared memory hash table */
|
||||
Assert(!hashp->segbase);
|
||||
@@ -419,7 +419,7 @@ hash_destroy(HTAB * hashp)
|
||||
}
|
||||
|
||||
void
|
||||
hash_stats(char *where, HTAB * hashp)
|
||||
hash_stats(char *where, HTAB *hashp)
|
||||
{
|
||||
#if HASH_STATISTICS
|
||||
|
||||
@@ -441,7 +441,7 @@ hash_stats(char *where, HTAB * hashp)
|
||||
/*******************************SEARCH ROUTINES *****************************/
|
||||
|
||||
static uint32
|
||||
call_hash(HTAB * hashp, char *k, int len)
|
||||
call_hash(HTAB *hashp, char *k, int len)
|
||||
{
|
||||
long hash_val,
|
||||
bucket;
|
||||
@@ -470,11 +470,11 @@ call_hash(HTAB * hashp, char *k, int len)
|
||||
* (FALSE if we entered one).
|
||||
*/
|
||||
long *
|
||||
hash_search(HTAB * hashp,
|
||||
hash_search(HTAB *hashp,
|
||||
char *keyPtr,
|
||||
HASHACTION action, /* HASH_FIND / HASH_ENTER / HASH_REMOVE
|
||||
* HASH_FIND_SAVE / HASH_REMOVE_SAVED */
|
||||
bool * foundPtr)
|
||||
bool *foundPtr)
|
||||
{
|
||||
uint32 bucket;
|
||||
long segment_num;
|
||||
@@ -654,7 +654,7 @@ hash_search(HTAB * hashp,
|
||||
*
|
||||
*/
|
||||
long *
|
||||
hash_seq(HTAB * hashp)
|
||||
hash_seq(HTAB *hashp)
|
||||
{
|
||||
static uint32 curBucket = 0;
|
||||
static BUCKET_INDEX curIndex;
|
||||
@@ -721,7 +721,7 @@ hash_seq(HTAB * hashp)
|
||||
|
||||
/********************************* UTILITIES ************************/
|
||||
static int
|
||||
expand_table(HTAB * hashp)
|
||||
expand_table(HTAB *hashp)
|
||||
{
|
||||
HHDR *hctl;
|
||||
SEGMENT old_seg,
|
||||
@@ -809,7 +809,7 @@ expand_table(HTAB * hashp)
|
||||
|
||||
|
||||
static int
|
||||
dir_realloc(HTAB * hashp)
|
||||
dir_realloc(HTAB *hashp)
|
||||
{
|
||||
register char *p;
|
||||
char **p_ptr;
|
||||
@@ -841,7 +841,7 @@ dir_realloc(HTAB * hashp)
|
||||
|
||||
|
||||
static SEG_OFFSET
|
||||
seg_alloc(HTAB * hashp)
|
||||
seg_alloc(HTAB *hashp)
|
||||
{
|
||||
SEGMENT segp;
|
||||
SEG_OFFSET segOffset;
|
||||
@@ -866,7 +866,7 @@ seg_alloc(HTAB * hashp)
|
||||
* allocate some new buckets and link them into the free list
|
||||
*/
|
||||
static int
|
||||
bucket_alloc(HTAB * hashp)
|
||||
bucket_alloc(HTAB *hashp)
|
||||
{
|
||||
int i;
|
||||
ELEMENT *tmpBucket;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.5 1997/09/08 02:32:10 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.6 1997/09/08 21:49:26 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -121,7 +121,7 @@ static struct GlobalMemory TopGlobalMemoryData = {
|
||||
* allocate something here, you are expected to clean it up when
|
||||
* appropriate.
|
||||
*/
|
||||
MemoryContext TopMemoryContext = (MemoryContext) & TopGlobalMemoryData;
|
||||
MemoryContext TopMemoryContext = (MemoryContext) &TopGlobalMemoryData;
|
||||
|
||||
|
||||
|
||||
@@ -367,7 +367,7 @@ MemoryContextSwitchTo(MemoryContext context)
|
||||
* BadArg if name is invalid.
|
||||
*/
|
||||
GlobalMemory
|
||||
CreateGlobalMemory(char *name) /* XXX MemoryContextName */
|
||||
CreateGlobalMemory(char *name) /* XXX MemoryContextName */
|
||||
{
|
||||
GlobalMemory context;
|
||||
MemoryContext savecxt;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/oset.c,v 1.5 1997/09/08 02:32:14 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/oset.c,v 1.6 1997/09/08 21:49:29 momjian Exp $
|
||||
*
|
||||
* NOTE
|
||||
* XXX This is a preliminary implementation which lacks fail-fast
|
||||
@@ -42,9 +42,9 @@ OrderedElemGetBase(OrderedElem elem)
|
||||
void
|
||||
OrderedSetInit(OrderedSet set, Offset offset)
|
||||
{
|
||||
set->head = (OrderedElem) & set->dummy;
|
||||
set->head = (OrderedElem) &set->dummy;
|
||||
set->dummy = NULL;
|
||||
set->tail = (OrderedElem) & set->head;
|
||||
set->tail = (OrderedElem) &set->head;
|
||||
set->offset = offset;
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ static void
|
||||
OrderedElemPushHead(OrderedElem elem)
|
||||
{
|
||||
elem->next = elem->set->head;
|
||||
elem->prev = (OrderedElem) & elem->set->head;
|
||||
elem->prev = (OrderedElem) &elem->set->head;
|
||||
elem->next->prev = elem;
|
||||
elem->prev->next = elem;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.7 1997/09/08 02:32:19 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.8 1997/09/08 21:49:31 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -91,7 +91,7 @@
|
||||
|
||||
#include "utils/portal.h"
|
||||
|
||||
static void CollectNamedPortals(Portal * portalP, int destroy);
|
||||
static void CollectNamedPortals(Portal *portalP, int destroy);
|
||||
static Portal PortalHeapMemoryGetPortal(PortalHeapMemory context);
|
||||
static PortalVariableMemory PortalHeapMemoryGetVariableMemory(PortalHeapMemory context);
|
||||
static void PortalResetHeapMemory(Portal portal);
|
||||
@@ -118,7 +118,7 @@ typedef struct portalhashent
|
||||
{
|
||||
char portalname[MAX_PORTALNAME_LEN];
|
||||
Portal portal;
|
||||
} PortalHashEnt;
|
||||
} PortalHashEnt;
|
||||
|
||||
#define PortalManagerEnabled (PortalManagerEnableCount >= 1)
|
||||
|
||||
@@ -174,7 +174,7 @@ typedef struct HeapMemoryBlockData
|
||||
{
|
||||
AllocSetData setData;
|
||||
FixedItemData itemData;
|
||||
} HeapMemoryBlockData;
|
||||
} HeapMemoryBlockData;
|
||||
|
||||
typedef HeapMemoryBlockData *HeapMemoryBlock;
|
||||
|
||||
@@ -379,14 +379,14 @@ CreateNewBlankPortal()
|
||||
/*
|
||||
* initialize portal variable context
|
||||
*/
|
||||
NodeSetTag((Node *) & portal->variable, T_PortalVariableMemory);
|
||||
NodeSetTag((Node *) &portal->variable, T_PortalVariableMemory);
|
||||
AllocSetInit(&portal->variable.setData, DynamicAllocMode, (Size) 0);
|
||||
portal->variable.method = &PortalVariableContextMethodsData;
|
||||
|
||||
/*
|
||||
* initialize portal heap context
|
||||
*/
|
||||
NodeSetTag((Node *) & portal->heap, T_PortalHeapMemory);
|
||||
NodeSetTag((Node *) &portal->heap, T_PortalHeapMemory);
|
||||
portal->heap.block = NULL;
|
||||
FixedStackInit(&portal->heap.stackData,
|
||||
offsetof(HeapMemoryBlockData, itemData));
|
||||
@@ -426,7 +426,7 @@ PortalNameIsSpecial(char *pname)
|
||||
* and screws up the sequential walk of the table). -mer 17 Aug 1992
|
||||
*/
|
||||
static void
|
||||
CollectNamedPortals(Portal * portalP, int destroy)
|
||||
CollectNamedPortals(Portal *portalP, int destroy)
|
||||
{
|
||||
static Portal *portalList = (Portal *) NULL;
|
||||
static int listIndex = 0;
|
||||
@@ -479,7 +479,7 @@ AtEOXact_portals()
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
static void
|
||||
PortalDump(Portal * thisP)
|
||||
PortalDump(Portal *thisP)
|
||||
{
|
||||
/* XXX state/argument checking here */
|
||||
|
||||
@@ -640,7 +640,7 @@ BlankPortalAssignName(char *name) /* XXX PortalName */
|
||||
*/
|
||||
length = 1 + strlen(name);
|
||||
portal->name = (char *)
|
||||
MemoryContextAlloc((MemoryContext) & portal->variable, length);
|
||||
MemoryContextAlloc((MemoryContext) &portal->variable, length);
|
||||
|
||||
strncpy(portal->name, name, length);
|
||||
|
||||
@@ -664,9 +664,9 @@ BlankPortalAssignName(char *name) /* XXX PortalName */
|
||||
*/
|
||||
void
|
||||
PortalSetQuery(Portal portal,
|
||||
QueryDesc * queryDesc,
|
||||
QueryDesc *queryDesc,
|
||||
TupleDesc attinfo,
|
||||
EState * state,
|
||||
EState *state,
|
||||
void (*cleanup) (Portal portal))
|
||||
{
|
||||
AssertState(PortalManagerEnabled);
|
||||
@@ -747,12 +747,12 @@ CreatePortal(char *name) /* XXX PortalName */
|
||||
MemoryContextAlloc((MemoryContext) PortalMemory, sizeof *portal);
|
||||
|
||||
/* initialize portal variable context */
|
||||
NodeSetTag((Node *) & portal->variable, T_PortalVariableMemory);
|
||||
NodeSetTag((Node *) &portal->variable, T_PortalVariableMemory);
|
||||
AllocSetInit(&portal->variable.setData, DynamicAllocMode, (Size) 0);
|
||||
portal->variable.method = &PortalVariableContextMethodsData;
|
||||
|
||||
/* initialize portal heap context */
|
||||
NodeSetTag((Node *) & portal->heap, T_PortalHeapMemory);
|
||||
NodeSetTag((Node *) &portal->heap, T_PortalHeapMemory);
|
||||
portal->heap.block = NULL;
|
||||
FixedStackInit(&portal->heap.stackData,
|
||||
offsetof(HeapMemoryBlockData, itemData));
|
||||
@@ -761,7 +761,7 @@ CreatePortal(char *name) /* XXX PortalName */
|
||||
/* initialize portal name */
|
||||
length = 1 + strlen(name);
|
||||
portal->name = (char *)
|
||||
MemoryContextAlloc((MemoryContext) & portal->variable, length);
|
||||
MemoryContextAlloc((MemoryContext) &portal->variable, length);
|
||||
strncpy(portal->name, name, length);
|
||||
|
||||
/* initialize portal query */
|
||||
@@ -786,7 +786,7 @@ CreatePortal(char *name) /* XXX PortalName */
|
||||
* BadArg if portal is invalid.
|
||||
*/
|
||||
void
|
||||
PortalDestroy(Portal * portalP)
|
||||
PortalDestroy(Portal *portalP)
|
||||
{
|
||||
Portal portal = *portalP;
|
||||
|
||||
@@ -802,7 +802,7 @@ PortalDestroy(Portal * portalP)
|
||||
(*portal->cleanup) (portal);
|
||||
|
||||
PortalResetHeapMemory(portal);
|
||||
MemoryContextFree((MemoryContext) & portal->variable,
|
||||
MemoryContextFree((MemoryContext) &portal->variable,
|
||||
(Pointer) portal->name);
|
||||
AllocSetReset(&portal->variable.setData); /* XXX log */
|
||||
|
||||
@@ -989,7 +989,7 @@ PortalVariableMemoryGetHeapMemory(PortalVariableMemory context)
|
||||
{
|
||||
return ((PortalHeapMemory) ((char *) context
|
||||
- offsetof(PortalD, variable)
|
||||
+ offsetof(PortalD, heap)));
|
||||
+offsetof(PortalD, heap)));
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1007,5 +1007,5 @@ PortalHeapMemoryGetVariableMemory(PortalHeapMemory context)
|
||||
{
|
||||
return ((PortalVariableMemory) ((char *) context
|
||||
- offsetof(PortalD, heap)
|
||||
+ offsetof(PortalD, variable)));
|
||||
+offsetof(PortalD, variable)));
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.20 1997/09/08 02:32:29 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.21 1997/09/08 21:49:33 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Sorts the first relation into the second relation.
|
||||
@@ -64,14 +64,14 @@
|
||||
#include "miscadmin.h"
|
||||
#include "storage/fd.h"
|
||||
|
||||
static bool createrun(Sort * node, FILE * file, bool * empty);
|
||||
static void destroytape(FILE * file);
|
||||
static void dumptuples(FILE * file, Sort * node);
|
||||
static bool createrun(Sort *node, FILE *file, bool *empty);
|
||||
static void destroytape(FILE *file);
|
||||
static void dumptuples(FILE *file, Sort *node);
|
||||
static FILE *gettape(void);
|
||||
static void initialrun(Sort * node, bool * empty);
|
||||
static void inittapes(Sort * node);
|
||||
static void merge(Sort * node, struct tape * dest);
|
||||
static FILE *mergeruns(Sort * node);
|
||||
static void initialrun(Sort *node, bool *empty);
|
||||
static void inittapes(Sort *node);
|
||||
static void merge(Sort *node, struct tape * dest);
|
||||
static FILE *mergeruns(Sort *node);
|
||||
static HeapTuple tuplecopy(HeapTuple tup);
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ static long shortzero = 0; /* used to delimit runs */
|
||||
* Allocates and initializes sort node's psort state.
|
||||
*/
|
||||
bool
|
||||
psort_begin(Sort * node, int nkeys, ScanKey key)
|
||||
psort_begin(Sort *node, int nkeys, ScanKey key)
|
||||
{
|
||||
bool empty; /* to answer: is child node empty? */
|
||||
|
||||
@@ -170,7 +170,7 @@ psort_begin(Sort * node, int nkeys, ScanKey key)
|
||||
* number of allocated tapes
|
||||
*/
|
||||
static void
|
||||
inittapes(Sort * node)
|
||||
inittapes(Sort *node)
|
||||
{
|
||||
register int i;
|
||||
register struct tape *tp;
|
||||
@@ -268,7 +268,7 @@ inittapes(Sort * node)
|
||||
* Also, perhaps allocate tapes when needed. Split into 2 funcs.
|
||||
*/
|
||||
static void
|
||||
initialrun(Sort * node, bool * empty)
|
||||
initialrun(Sort *node, bool *empty)
|
||||
{
|
||||
/* register struct tuple *tup; */
|
||||
register struct tape *tp;
|
||||
@@ -350,7 +350,7 @@ initialrun(Sort * node, bool * empty)
|
||||
* Tuples contains the tuples for the following run upon exit
|
||||
*/
|
||||
static bool
|
||||
createrun(Sort * node, FILE * file, bool * empty)
|
||||
createrun(Sort *node, FILE *file, bool *empty)
|
||||
{
|
||||
register HeapTuple lasttuple;
|
||||
register HeapTuple tup;
|
||||
@@ -437,7 +437,7 @@ createrun(Sort * node, FILE * file, bool * empty)
|
||||
/* if we did not see any tuples, mark empty */
|
||||
*empty = (cr_tuples > 0) ? false : true;
|
||||
|
||||
return ((bool) ! foundeor); /* XXX - works iff bool is {0,1} */
|
||||
return ((bool) !foundeor); /* XXX - works iff bool is {0,1} */
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -468,7 +468,7 @@ tuplecopy(HeapTuple tup)
|
||||
* file of tuples in order
|
||||
*/
|
||||
static FILE *
|
||||
mergeruns(Sort * node)
|
||||
mergeruns(Sort *node)
|
||||
{
|
||||
register struct tape *tp;
|
||||
|
||||
@@ -495,7 +495,7 @@ mergeruns(Sort * node)
|
||||
* (polyphase merge Alg.D(D5)--Knuth, Vol.3, p271)
|
||||
*/
|
||||
static void
|
||||
merge(Sort * node, struct tape * dest)
|
||||
merge(Sort *node, struct tape * dest)
|
||||
{
|
||||
register HeapTuple tup;
|
||||
register struct tape *lasttp; /* (TAPE[P]) */
|
||||
@@ -602,7 +602,7 @@ merge(Sort * node, struct tape * dest)
|
||||
* dumptuples - stores all the tuples in tree into file
|
||||
*/
|
||||
static void
|
||||
dumptuples(FILE * file, Sort * node)
|
||||
dumptuples(FILE *file, Sort *node)
|
||||
{
|
||||
register struct leftist *tp;
|
||||
register struct leftist *newp;
|
||||
@@ -648,7 +648,7 @@ dumptuples(FILE * file, Sort * node)
|
||||
* a NULL indicating the last tuple has been processed.
|
||||
*/
|
||||
HeapTuple
|
||||
psort_grabtuple(Sort * node)
|
||||
psort_grabtuple(Sort *node)
|
||||
{
|
||||
register HeapTuple tup;
|
||||
long tuplen;
|
||||
@@ -690,7 +690,7 @@ psort_grabtuple(Sort * node)
|
||||
* psort_markpos - saves current position in the merged sort file
|
||||
*/
|
||||
void
|
||||
psort_markpos(Sort * node)
|
||||
psort_markpos(Sort *node)
|
||||
{
|
||||
Assert(node != (Sort *) NULL);
|
||||
Assert(PS(node) != (Psortstate *) NULL);
|
||||
@@ -703,7 +703,7 @@ psort_markpos(Sort * node)
|
||||
* last saved position
|
||||
*/
|
||||
void
|
||||
psort_restorepos(Sort * node)
|
||||
psort_restorepos(Sort *node)
|
||||
{
|
||||
Assert(node != (Sort *) NULL);
|
||||
Assert(PS(node) != (Psortstate *) NULL);
|
||||
@@ -718,7 +718,7 @@ psort_restorepos(Sort * node)
|
||||
* called unless psort_grabtuple has returned a NULL.
|
||||
*/
|
||||
void
|
||||
psort_end(Sort * node)
|
||||
psort_end(Sort *node)
|
||||
{
|
||||
register struct tape *tp;
|
||||
|
||||
@@ -819,7 +819,7 @@ gettape()
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
static void
|
||||
resettape(FILE * file)
|
||||
resettape(FILE *file)
|
||||
{
|
||||
register struct tapelst *tp;
|
||||
register int fd;
|
||||
@@ -851,7 +851,7 @@ resettape(FILE * file)
|
||||
* Exits instead of returning status, if given invalid tape.
|
||||
*/
|
||||
static void
|
||||
destroytape(FILE * file)
|
||||
destroytape(FILE *file)
|
||||
{
|
||||
register struct tapelst *tp,
|
||||
*tq;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.6 1997/09/08 02:32:32 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.7 1997/09/08 21:49:37 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -58,12 +58,12 @@ typedef struct TimeQualData
|
||||
AbsoluteTime start;
|
||||
AbsoluteTime end;
|
||||
TimeQualMode mode;
|
||||
} TimeQualData;
|
||||
} TimeQualData;
|
||||
|
||||
typedef TimeQualData *InternalTimeQual;
|
||||
|
||||
static TimeQualData SelfTimeQualData;
|
||||
TimeQual SelfTimeQual = (Pointer) & SelfTimeQualData;
|
||||
TimeQual SelfTimeQual = (Pointer) &SelfTimeQualData;
|
||||
|
||||
extern bool PostgresIsInitialized;
|
||||
|
||||
@@ -172,7 +172,7 @@ TimeQualIsValid(TimeQual qual)
|
||||
}
|
||||
if (hasStartTime)
|
||||
{
|
||||
return ((bool) ! AbsoluteTimeIsBefore(
|
||||
return ((bool) !AbsoluteTimeIsBefore(
|
||||
((InternalTimeQual) qual)->end,
|
||||
((InternalTimeQual) qual)->start));
|
||||
}
|
||||
@@ -322,7 +322,7 @@ TimeQualIsSnapshot(TimeQual qual)
|
||||
return (false);
|
||||
}
|
||||
|
||||
return ((bool) ! !(((InternalTimeQual) qual)->mode & TimeQualAt));
|
||||
return ((bool) !!(((InternalTimeQual) qual)->mode & TimeQualAt));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -342,7 +342,7 @@ TimeQualIsRanged(TimeQual qual)
|
||||
return (false);
|
||||
}
|
||||
|
||||
return ((bool) ! (((InternalTimeQual) qual)->mode & TimeQualAt));
|
||||
return ((bool) !(((InternalTimeQual) qual)->mode & TimeQualAt));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -911,7 +911,7 @@ HeapTupleSatisfiesUpperUnboundedInternalTimeQual(HeapTuple tuple,
|
||||
|
||||
Assert(TransactionIdIsCurrentTransactionId((TransactionId) tuple->t_xmax));
|
||||
|
||||
return ((bool) ! CommandIdGEScanCommandId(tuple->t_cmax));
|
||||
return ((bool) !CommandIdGEScanCommandId(tuple->t_cmax));
|
||||
}
|
||||
|
||||
if (!TransactionIdDidCommit((TransactionId) tuple->t_xmin))
|
||||
|
||||
Reference in New Issue
Block a user