From aaeef4d17db9ded501fa02c9ca6c00f86258b171 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sun, 10 Nov 1996 03:06:38 +0000 Subject: [PATCH] All external function definitions now have prototypes that are checked. --- src/Makefile.global | 4 +- src/backend/access/common/heaptuple.c | 3 +- src/backend/access/common/heapvalid.c | 3 +- src/backend/access/common/indexvalid.c | 3 +- src/backend/access/common/printtup.c | 3 +- src/backend/access/gist/gist.c | 25 +--- src/backend/access/gist/gistscan.c | 1 + src/backend/access/hash/hashfunc.c | 4 +- src/backend/access/heap/stats.c | 4 +- src/backend/access/nbtree/nbtcompare.c | 3 +- src/backend/access/rtree/rtproc.c | 3 +- src/backend/access/transam/transam.c | 6 +- src/backend/access/transam/xact.c | 12 +- src/backend/access/transam/xid.c | 3 +- src/backend/catalog/catalog.c | 4 +- src/backend/catalog/heap.c | 32 +++--- src/backend/commands/copy.c | 3 +- src/backend/commands/define.c | 10 +- src/backend/commands/rename.c | 3 +- src/backend/commands/view.c | 3 +- src/backend/executor/execUtils.c | 4 +- src/backend/executor/nodeMergejoin.c | 4 +- src/backend/executor/nodeTee.c | 4 +- src/backend/lib/dllist.c | 4 +- src/backend/libpq/be-dumpdata.c | 10 +- src/backend/libpq/hba.c | 4 +- src/backend/nodes/equalfuncs.c | 5 +- src/backend/nodes/outfuncs.c | 4 +- src/backend/nodes/print.c | 4 +- src/backend/nodes/readfuncs.c | 4 +- src/backend/optimizer/path/allpaths.c | 6 +- src/backend/optimizer/util/joininfo.c | 3 +- src/backend/parser/analyze.c | 5 +- src/backend/parser/catalog_utils.c | 12 +- src/backend/parser/parser.c | 5 +- src/backend/postmaster/postmaster.c | 4 +- src/backend/rewrite/locks.c | 4 +- src/backend/rewrite/rewriteDefine.c | 3 +- src/backend/rewrite/rewriteManip.c | 3 +- src/backend/storage/buffer/freelist.c | 7 +- src/backend/storage/buffer/localbuf.c | 9 +- src/backend/storage/ipc/ipc.c | 6 +- src/backend/storage/ipc/s_lock.c | 10 +- src/backend/storage/ipc/shmem.c | 4 +- src/backend/storage/ipc/sinval.c | 4 +- src/backend/storage/large_object/inv_api.c | 7 +- src/backend/tcop/dest.c | 10 +- src/backend/tcop/postgres.c | 9 +- src/backend/tcop/pquery.c | 4 +- src/backend/utils/adt/acl.c | 4 +- src/backend/utils/adt/arrayutils.c | 4 +- src/backend/utils/adt/date.c | 4 +- src/backend/utils/adt/datetimes.c | 20 +--- src/backend/utils/adt/geo-selfuncs.c | 3 +- src/backend/utils/adt/like.c | 4 +- src/backend/utils/adt/varchar.c | 6 +- src/backend/utils/cache/fcache.c | 3 +- src/backend/utils/cache/relcache.c | 8 +- src/backend/utils/error/elog.c | 4 +- src/backend/utils/error/exc.c | 4 +- src/backend/utils/hash/dynahash.c | 8 +- src/backend/utils/mmgr/aset.c | 4 +- src/bin/pg_version/pg_version.c | 6 +- src/bin/psql/psql.c | 24 ++-- src/include/access/gist.h | 47 ++++++++ src/include/access/gistscan.h | 9 +- src/include/access/giststrat.h | 10 +- src/include/access/hash.h | 3 +- src/include/access/heapam.h | 10 +- src/include/access/rtree.h | 42 ++++++- src/include/access/transam.h | 6 +- src/include/access/xact.h | 11 +- src/include/catalog/heap.h | 6 +- src/include/commands/defrem.h | 3 +- src/include/executor/executor.h | 4 +- src/include/executor/nodeMergejoin.h | 6 +- src/include/lib/dllist.h | 4 +- src/include/libpq/libpq-be.h | 4 +- src/include/nodes/print.h | 34 ++++++ src/include/nodes/readfuncs.h | 4 +- src/include/parser/gramparse.h | 6 +- src/include/parser/parse_query.h | 4 +- src/include/storage/buf_internals.h | 8 +- src/include/storage/shmem.h | 4 +- src/include/storage/sinval.h | 4 +- src/include/storage/smgr.h | 4 +- src/include/tcop/dest.h | 10 +- src/include/tcop/pquery.h | 4 +- src/include/tcop/tcopprot.h | 12 +- src/include/utils/acl.h | 4 +- src/include/utils/builtins.h | 126 +++++++++++++++------ src/include/utils/datetime.h | 30 +++++ src/include/utils/elog.h | 4 +- src/include/utils/exc.h | 4 +- src/include/utils/fmgrtab.h | 3 +- src/include/utils/geo-decls.h | 24 ++-- src/include/utils/relcache.h | 8 +- src/interfaces/libpq/fe-connect.c | 7 +- src/interfaces/libpq/libpq-fe.h | 4 +- 99 files changed, 551 insertions(+), 322 deletions(-) create mode 100644 src/include/nodes/print.h create mode 100644 src/include/utils/datetime.h diff --git a/src/Makefile.global b/src/Makefile.global index c4eb88b1d6..80a1dad104 100644 --- a/src/Makefile.global +++ b/src/Makefile.global @@ -7,7 +7,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.57 1996/11/09 10:39:02 scrappy Exp $ +# $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.58 1996/11/10 02:56:33 momjian Exp $ # # NOTES # This is seen by any Makefiles that include mk/postgres.mk. To @@ -860,7 +860,7 @@ includedir= $(HEADERDIR) # Flags for CC and LD. (depend on COPT and PROFILE) # # PostgreSQL should *always* compile with -Wall -Werror enabled -CFLAGS+= -Wall #-Werror +CFLAGS+= -Wall -Wmissing-prototypes -Wmissing-declarations #-Werror # Globally pass debugging/optimization/profiling flags based # on the options selected above. diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c index f33a269736..b516e5beab 100644 --- a/src/backend/access/common/heaptuple.c +++ b/src/backend/access/common/heaptuple.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.15 1996/11/05 07:42:40 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.16 1996/11/10 02:56:41 momjian Exp $ * * NOTES * The old interface functions have been converted to macros @@ -19,6 +19,7 @@ #include +#include #include #include #include diff --git a/src/backend/access/common/heapvalid.c b/src/backend/access/common/heapvalid.c index f4aceefb34..fdf333092f 100644 --- a/src/backend/access/common/heapvalid.c +++ b/src/backend/access/common/heapvalid.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/common/Attic/heapvalid.c,v 1.11 1996/11/05 07:42:41 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/common/Attic/heapvalid.c,v 1.12 1996/11/10 02:56:47 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -16,6 +16,7 @@ #include #include +#include #include #include #include diff --git a/src/backend/access/common/indexvalid.c b/src/backend/access/common/indexvalid.c index 5314804d79..ae40807b84 100644 --- a/src/backend/access/common/indexvalid.c +++ b/src/backend/access/common/indexvalid.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.11 1996/11/05 07:42:43 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.12 1996/11/10 02:56:51 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -15,6 +15,7 @@ #include #include +#include #include #include #include diff --git a/src/backend/access/common/printtup.c b/src/backend/access/common/printtup.c index edfa771557..f536d8c751 100644 --- a/src/backend/access/common/printtup.c +++ b/src/backend/access/common/printtup.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.11 1996/11/05 07:42:44 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.12 1996/11/10 02:57:00 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -17,6 +17,7 @@ #include #include +#include #include #include #include diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c index fa29a96177..7fbf0ef07d 100644 --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -1190,9 +1190,6 @@ gistcentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr, Relation r, #ifdef GISTDEBUG -extern char *text_range_out(); -extern char *int_range_out(); - /* ** sloppy debugging support routine, requires recompilation with appropriate ** "out" method for the index keys. Could be fixed to find that info @@ -1236,7 +1233,7 @@ _gistdump(Relation r) datum = ((char *) itup); datum += sizeof(IndexTupleData); /* get out function for type of key, and out it! */ - itkey = (char *) int_range_out(datum); + itkey = (char *) int_range_out((INTRANGE *)datum); /* itkey = " unable to print"; */ printf("\t[%d] size %d heap <%d,%d> key:%s\n", offnum, IndexTupleSize(itup), itblkno, itoffno, itkey); @@ -1247,26 +1244,6 @@ _gistdump(Relation r) } } -#define TRLOWER(tr) (((tr)->bytes)) -#define TRUPPER(tr) (&((tr)->bytes[MAXALIGN(VARSIZE(TRLOWER(tr)))])) -typedef struct txtrange { - /* flag: NINF means that lower is negative infinity; PINF means that - ** upper is positive infinity. 0 means that both are numbers. - */ - int32 vl_len; - int32 flag; - char bytes[2]; -} TXTRANGE; - -typedef struct intrange { - int lower; - int upper; - /* flag: NINF means that lower is negative infinity; PINF means that - ** upper is positive infinity. 0 means that both are numbers. - */ - int flag; -} INTRANGE; - char *text_range_out(TXTRANGE *r) { char *result; diff --git a/src/backend/access/gist/gistscan.c b/src/backend/access/gist/gistscan.c index 0f3ce3b59d..a3f19d4ef6 100644 --- a/src/backend/access/gist/gistscan.c +++ b/src/backend/access/gist/gistscan.c @@ -13,6 +13,7 @@ #include #include +#include #include #include #include diff --git a/src/backend/access/hash/hashfunc.c b/src/backend/access/hash/hashfunc.c index b042ca3196..5862800b21 100644 --- a/src/backend/access/hash/hashfunc.c +++ b/src/backend/access/hash/hashfunc.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.2 1996/10/20 06:34:14 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.3 1996/11/10 02:57:40 momjian Exp $ * * NOTES * These functions are stored in pg_amproc. For each operator class @@ -18,6 +18,8 @@ #include "postgres.h" +#include "access/hash.h" + uint32 hashint2(int16 key) { return ((uint32) ~key); diff --git a/src/backend/access/heap/stats.c b/src/backend/access/heap/stats.c index 3035e9fba2..00dac5fabe 100644 --- a/src/backend/access/heap/stats.c +++ b/src/backend/access/heap/stats.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/heap/Attic/stats.c,v 1.8 1996/11/05 11:17:47 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/heap/Attic/stats.c,v 1.9 1996/11/10 02:58:11 momjian Exp $ * * NOTES * initam should be moved someplace else. @@ -324,7 +324,7 @@ PrintAndFreeHeapAccessStatistics(HeapAccessStatistics stats) * ---------------- */ void -initam() +initam(void) { /* ---------------- * initialize heap statistics. diff --git a/src/backend/access/nbtree/nbtcompare.c b/src/backend/access/nbtree/nbtcompare.c index 5b85054a1e..5429850d73 100644 --- a/src/backend/access/nbtree/nbtcompare.c +++ b/src/backend/access/nbtree/nbtcompare.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.5 1996/11/05 10:35:28 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.6 1996/11/10 02:58:37 momjian Exp $ * * NOTES * These functions are stored in pg_amproc. For each operator class @@ -24,6 +24,7 @@ #include +#include #include int32 diff --git a/src/backend/access/rtree/rtproc.c b/src/backend/access/rtree/rtproc.c index fdcb95ca1e..401ceca1c9 100644 --- a/src/backend/access/rtree/rtproc.c +++ b/src/backend/access/rtree/rtproc.c @@ -7,13 +7,14 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.4 1996/11/05 10:54:17 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.5 1996/11/10 02:58:53 momjian Exp $ * *------------------------------------------------------------------------- */ #include +#include #include #ifndef HAVE_MEMMOVE # include diff --git a/src/backend/access/transam/transam.c b/src/backend/access/transam/transam.c index b11af7486e..b85ee1ce13 100644 --- a/src/backend/access/transam/transam.c +++ b/src/backend/access/transam/transam.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.5 1996/11/05 11:12:28 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.6 1996/11/10 02:59:11 momjian Exp $ * * NOTES * This file contains the high level access-method interface to the @@ -96,7 +96,7 @@ extern bool BuildingBtree; * ---------------- */ int -RecoveryCheckingEnabled() +RecoveryCheckingEnabled(void) { return RecoveryCheckingEnableState; } @@ -453,7 +453,7 @@ TransRecover(Relation logRelation) * Initializes transaction logging. */ void -InitializeTransactionLog() +InitializeTransactionLog(void) { Relation logRelation; Relation timeRelation; diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index 008499fc3b..ff8908de09 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.4 1996/11/05 11:12:32 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.5 1996/11/10 02:59:16 momjian Exp $ * * NOTES * Transaction aborts can now occur two ways: @@ -218,7 +218,7 @@ bool AMI_OVERRIDE = false; static int TransactionFlushState = 1; int -TransactionFlushEnabled() +TransactionFlushEnabled(void) { return TransactionFlushState; } @@ -237,7 +237,7 @@ SetTransactionFlushEnabled(bool state) * -------------------------------- */ bool -IsTransactionState() +IsTransactionState(void) { TransactionState s = CurrentTransactionState; @@ -1113,7 +1113,7 @@ AbortCurrentTransaction() * -------------------------------- */ void -BeginTransactionBlock() +BeginTransactionBlock(void) { TransactionState s = CurrentTransactionState; @@ -1151,7 +1151,7 @@ BeginTransactionBlock() * -------------------------------- */ void -EndTransactionBlock() +EndTransactionBlock(void) { TransactionState s = CurrentTransactionState; @@ -1205,7 +1205,7 @@ EndTransactionBlock() * -------------------------------- */ void -AbortTransactionBlock() +AbortTransactionBlock(void) { TransactionState s = CurrentTransactionState; diff --git a/src/backend/access/transam/xid.c b/src/backend/access/transam/xid.c index 5d1293d66b..4c508b3899 100644 --- a/src/backend/access/transam/xid.c +++ b/src/backend/access/transam/xid.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/xid.c,v 1.4 1996/11/05 11:12:33 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/xid.c,v 1.5 1996/11/10 02:59:19 momjian Exp $ * * OLD COMMENTS * XXX WARNING @@ -23,6 +23,7 @@ #include #include +#include extern TransactionId NullTransactionId; extern TransactionId DisabledTransactionId; diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c index dfbda65ef4..b13a1d01f5 100644 --- a/src/backend/catalog/catalog.c +++ b/src/backend/catalog/catalog.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.4 1996/11/06 06:47:01 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.5 1996/11/10 02:59:21 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -37,6 +37,7 @@ relpath(char relname[]) return(relname); } +#ifdef NOT_USED /* * issystem - returns non-zero iff relname is a system catalog * @@ -56,6 +57,7 @@ issystem(char relname[]) else return FALSE; } +#endif /* * IsSystemRelationName -- diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 27704dc7f4..55afd48945 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.7 1996/11/08 00:59:10 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.8 1996/11/10 02:59:25 momjian Exp $ * * INTERFACE ROUTINES * heap_creatr() - Create an uncataloged heap relation @@ -26,27 +26,27 @@ */ #include -#include -#include -#include #include -#include -#include -#include +#include #include -#include -#include +#include +#include +#include #include -#include +#include +#include +#include +#include #include #include -#include -#include #include -#include -#include #include #include +#include +#include +#include +#include +#include #ifndef HAVE_MEMMOVE # include #else @@ -1342,7 +1342,7 @@ heap_destroyr(Relation rdesc) */ void -InitTempRelList() +InitTempRelList(void) { if (tempRels) { free(tempRels->rels); @@ -1402,7 +1402,7 @@ AddToTempRelList(Relation r) go through the tempRels list and destroy each of the relations */ void -DestroyTempRels() +DestroyTempRels(void) { int i; Relation rdesc; diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index 535386b362..258376ee8b 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -6,7 +6,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.15 1996/11/08 00:45:22 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.16 1996/11/10 02:59:34 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -33,6 +33,7 @@ #include #include #include +#include #define ISOCTAL(c) (((c) >= '0') && ((c) <= '7')) #define VALUE(c) ((c) - '0') diff --git a/src/backend/commands/define.c b/src/backend/commands/define.c index eae7873d0d..d3f1e3841a 100644 --- a/src/backend/commands/define.c +++ b/src/backend/commands/define.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.9 1996/11/08 20:45:16 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.10 1996/11/10 02:59:38 momjian Exp $ * * DESCRIPTION * The "DefineFoo" routines take the parse tree and pick out the @@ -59,7 +59,7 @@ static int defGetTypeLength(DefElem *def); #define DEFAULT_TYPDELIM ',' -void +static void case_translate_language_name(const char *input, char *output) { /*------------------------------------------------------------------------- Translate the input language name to lower case, except if it's C, @@ -77,7 +77,7 @@ case_translate_language_name(const char *input, char *output) { -void +static void compute_return_type(const Node *returnType, char **prorettype_p, bool *returnsSet_p) { /*--------------------------------------------------------------------------- @@ -98,7 +98,7 @@ compute_return_type(const Node *returnType, -void +static void compute_full_attributes(const List *parameters, int32 *byte_pct_p, int32 *perbyte_cpu_p, int32 *percall_cpu_p, int32 *outin_ratio_p, bool *canCache_p) { @@ -157,7 +157,7 @@ compute_full_attributes(const List *parameters, int32 *byte_pct_p, -void +static void interpret_AS_clause(const char languageName[], const char as[], char **prosrc_str_p, char **probin_str_p) { diff --git a/src/backend/commands/rename.c b/src/backend/commands/rename.c index c383ac3707..87f995a2d7 100644 --- a/src/backend/commands/rename.c +++ b/src/backend/commands/rename.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.3 1996/11/06 08:21:39 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.4 1996/11/10 02:59:42 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -21,6 +21,7 @@ #include #include #include +#include #include /* for EXEC_{FOR,BACK,FDEBUG,BDEBUG} */ #include #include diff --git a/src/backend/commands/view.c b/src/backend/commands/view.c index 0d0b7de1d0..e27d5e1597 100644 --- a/src/backend/commands/view.c +++ b/src/backend/commands/view.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.4 1996/11/06 08:21:43 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.5 1996/11/10 02:59:45 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -27,6 +27,7 @@ #include #include #include +#include /*--------------------------------------------------------------------- * DefineVirtualRelation diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c index 276bb632ae..bd1e7968c9 100644 --- a/src/backend/executor/execUtils.c +++ b/src/backend/executor/execUtils.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.4 1996/11/06 06:47:35 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.5 1996/11/10 02:59:49 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -81,7 +81,7 @@ extern int NIndexTupleProcessed; /* have to be defined in the access * ---------------------------------------------------------------- */ void -ResetTupleCount() +ResetTupleCount(void) { NTupleProcessed = 0; NTupleRetrieved = 0; diff --git a/src/backend/executor/nodeMergejoin.c b/src/backend/executor/nodeMergejoin.c index 5124d62ef6..29e349bda9 100644 --- a/src/backend/executor/nodeMergejoin.c +++ b/src/backend/executor/nodeMergejoin.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.4 1996/11/08 00:45:59 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.5 1996/11/10 02:59:54 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -201,7 +201,7 @@ MJFormOSortopI(List *qualList, Oid sortOp) * by "sortOp" and reversing the positions of the keys. * ---------------------------------------------------------------- */ -List * +static List * MJFormISortopO(List *qualList, Oid sortOp) { List *ISortopO; diff --git a/src/backend/executor/nodeTee.c b/src/backend/executor/nodeTee.c index 2ade8729f9..1ed017f5da 100644 --- a/src/backend/executor/nodeTee.c +++ b/src/backend/executor/nodeTee.c @@ -15,7 +15,7 @@ * ExecEndTee * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.4 1996/11/08 00:46:01 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.5 1996/11/10 03:00:08 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -210,7 +210,7 @@ ExecCountSlotsTee(Tee *node) because the left and right scans may be at different points * ---------------------------------------------------------------- */ -void +static void initTeeScanDescs(Tee* node) { TeeState *teeState; diff --git a/src/backend/lib/dllist.c b/src/backend/lib/dllist.c index 2e4ffea7dd..a0487edb87 100644 --- a/src/backend/lib/dllist.c +++ b/src/backend/lib/dllist.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/lib/dllist.c,v 1.3 1996/11/06 08:27:11 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/lib/dllist.c,v 1.4 1996/11/10 03:00:20 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -19,7 +19,7 @@ #include Dllist* -DLNewList() +DLNewList(void) { Dllist* l; diff --git a/src/backend/libpq/be-dumpdata.c b/src/backend/libpq/be-dumpdata.c index e595528b56..d5fb4a941d 100644 --- a/src/backend/libpq/be-dumpdata.c +++ b/src/backend/libpq/be-dumpdata.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-dumpdata.c,v 1.3 1996/11/06 08:48:24 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-dumpdata.c,v 1.4 1996/11/10 03:00:23 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -61,7 +61,7 @@ static Dllist *be_portalstack; * ---------------- */ void -be_portalinit() +be_portalinit(void) { be_portalstack = DLNewList(); } @@ -85,7 +85,7 @@ be_portalpush(PortalEntry *entry) * ---------------- */ PortalEntry * -be_portalpop() +be_portalpop(void) { PortalEntry *p; Dlelem* elt; @@ -105,7 +105,7 @@ be_portalpop() * ---------------- */ PortalEntry * -be_currentportal() +be_currentportal(void) { Dlelem* elt; elt = DLGetTail(be_portalstack); @@ -128,7 +128,7 @@ static Oid be_portaloid; static u_int be_portalcnt = 0; PortalEntry * -be_newportal() +be_newportal(void) { PortalEntry *entry; char buf[PortalNameLength]; diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c index 7172dd31a0..409fe12fa8 100644 --- a/src/backend/libpq/hba.c +++ b/src/backend/libpq/hba.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.10 1996/11/06 08:48:27 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.11 1996/11/10 03:00:26 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -59,7 +59,7 @@ enum Userauth {Trust, Ident}; /* Some standard C libraries, including GNU, have an isblank() function. Others, including Solaris, do not. So we have our own. */ -bool +static bool isblank(const char c) { return(c == ' ' || c == 9 /* tab */); } diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c index 57226d5302..06be41dea5 100644 --- a/src/backend/nodes/equalfuncs.c +++ b/src/backend/nodes/equalfuncs.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.3 1996/11/08 05:56:39 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.4 1996/11/10 03:00:34 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -87,7 +87,8 @@ _equalExpr(Expr *a, Expr *b) return (true); } -bool _equalIter(Iter *a, Iter *b) +static bool +_equalIter(Iter *a, Iter *b) { return (equal(a->iterexpr, b->iterexpr)); } diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index aa9f3fdbab..e99aeb6a49 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.2 1996/11/08 05:56:43 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.3 1996/11/10 03:00:44 momjian Exp $ * * NOTES * Every (plan) node in POSTGRES has an associated "out" routine which @@ -52,7 +52,7 @@ static void _outNode(StringInfo str, void *obj); * _outIntList - * converts a List of integers */ -void +static void _outIntList(StringInfo str, List *list) { List *l; diff --git a/src/backend/nodes/print.c b/src/backend/nodes/print.c index 2bd39dd4fd..fd65f8b21a 100644 --- a/src/backend/nodes/print.c +++ b/src/backend/nodes/print.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.2 1996/11/06 08:54:17 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.3 1996/11/10 03:00:49 momjian Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -24,6 +24,7 @@ #include "nodes/pg_list.h" #include "nodes/execnodes.h" #include "nodes/parsenodes.h" +#include "nodes/print.h" #include "parser/parsetree.h" #include "parser/catalog_utils.h" #include "access/heapam.h" @@ -377,3 +378,4 @@ print_plan (Plan* p, Query* parsetree) } + diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c index 692e14a84a..334f820dd0 100644 --- a/src/backend/nodes/readfuncs.c +++ b/src/backend/nodes/readfuncs.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.3 1996/11/08 05:56:49 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.4 1996/11/10 03:00:51 momjian Exp $ * * NOTES * Most of the read functions for plan nodes are tested. (In fact, they @@ -1788,7 +1788,7 @@ _readIter() * ---------------- */ Node * -parsePlanString() +parsePlanString(void) { char *token; int length; diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 9b0bca2a05..dd0083edfb 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.3 1996/11/08 05:56:52 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.4 1996/11/10 03:00:55 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -236,6 +236,7 @@ find_join_paths(Query *root, List *outer_rels, int levels_left) * *****************************************************************************/ +#ifdef OPTIMIZER_DEBUG static void print_joinclauses(Query *root, List *clauses) { @@ -250,7 +251,7 @@ print_joinclauses(Query *root, List *clauses) } } -void +static void print_path(Query *root, Path *path, int indent) { char *ptype = NULL; @@ -330,7 +331,6 @@ print_path(Query *root, Path *path, int indent) } } -#ifdef OPTIMIZER_DEBUG static void debug_print_rel(Query *root, Rel *rel) { diff --git a/src/backend/optimizer/util/joininfo.c b/src/backend/optimizer/util/joininfo.c index 85416db8b3..a4fd691375 100644 --- a/src/backend/optimizer/util/joininfo.c +++ b/src/backend/optimizer/util/joininfo.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/util/joininfo.c,v 1.1.1.1 1996/07/09 06:21:38 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/util/joininfo.c,v 1.2 1996/11/10 03:01:00 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -16,6 +16,7 @@ #include "nodes/relation.h" #include "optimizer/internal.h" +#include "optimizer/joininfo.h" #include "optimizer/var.h" #include "optimizer/clauses.h" diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index ead5d0a79a..b9c13dd7b9 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.13 1996/11/08 05:57:25 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.14 1996/11/10 03:01:10 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -89,7 +89,8 @@ static void parseCheckAggregates(ParseState *pstate, Query *qry); */ ParseState* -makeParseState() { +makeParseState(void) +{ ParseState *pstate; pstate = malloc(sizeof(ParseState)); diff --git a/src/backend/parser/catalog_utils.c b/src/backend/parser/catalog_utils.c index 00745e32c4..dcc754c12b 100644 --- a/src/backend/parser/catalog_utils.c +++ b/src/backend/parser/catalog_utils.c @@ -6,7 +6,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.8 1996/11/08 05:57:29 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.9 1996/11/10 03:01:23 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -83,10 +83,6 @@ static char *attnum_type[SPECIALS] = { #define MAXFARGS 8 /* max # args to a c or postquel function */ -static Oid **argtype_inherit(); -static Oid **genxprod(); - -static int findsupers(Oid relid, Oid **supervec); /* * This structure is used to explore the inheritance hierarchy above * nodes in the type tree in order to disambiguate among polymorphic @@ -108,6 +104,10 @@ typedef struct _CandidateList { struct _CandidateList *next; } *CandidateList; +static Oid **argtype_inherit(int nargs, Oid *oid_array); +static Oid **genxprod(InhPaths *arginh, int nargs); +static int findsupers(Oid relid, Oid **supervec); + /* check to see if a type id is valid, * returns true if it is. By using this call before calling * get_id_type or get_id_typname, more meaningful error messages @@ -241,7 +241,7 @@ tbyvalue(Type t) } /* given a type, return its typetype ('c' for 'c'atalog types) */ -char +static char typetypetype(Type t) { TypeTupleForm typ; diff --git a/src/backend/parser/parser.c b/src/backend/parser/parser.c index a39793bc69..51d11ef89b 100644 --- a/src/backend/parser/parser.c +++ b/src/backend/parser/parser.c @@ -6,7 +6,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.8 1996/11/10 02:23:15 bryanh Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.9 1996/11/10 03:01:30 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -118,7 +118,6 @@ fixupsets(Query *parse) return; define_sets(parse); } -#endif #ifdef SETS_FIXED /* Recursively find all of the Consts in the parsetree. Some of @@ -175,8 +174,8 @@ define_sets(Node *clause) define_sets(get_leftop (clause)); define_sets(get_rightop (clause)); } -#endif } +#endif #define PSIZE(PTR) (*((int32 *)(PTR) - 1)) Node * diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 269e643ee3..b9f5ca1ad4 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.22 1996/11/10 02:24:12 bryanh Exp $ + * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.23 1996/11/10 03:01:41 momjian Exp $ * * NOTES * @@ -982,7 +982,7 @@ BackendStartup(StartupInfo *packet, /* client's startup packet */ * If you don't like that, well, we *used* to pass the whole option string * as ONE argument to execl(), which was even less intelligent... */ -void +static void split_opts(char **argv, int *argcp, char *s) { int i = *argcp; diff --git a/src/backend/rewrite/locks.c b/src/backend/rewrite/locks.c index a45457f61d..3171d2c845 100644 --- a/src/backend/rewrite/locks.c +++ b/src/backend/rewrite/locks.c @@ -6,7 +6,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/rewrite/Attic/locks.c,v 1.1.1.1 1996/07/09 06:21:51 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/rewrite/Attic/locks.c,v 1.2 1996/11/10 03:01:50 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -26,7 +26,7 @@ * if we find at least one such match, we return true * otherwise, we return false */ -bool +static bool nodeThisLockWasTriggered(Node *node, int varno, AttrNumber attnum) { if (node==NULL) diff --git a/src/backend/rewrite/rewriteDefine.c b/src/backend/rewrite/rewriteDefine.c index 36026a5358..a7b6ebbc79 100644 --- a/src/backend/rewrite/rewriteDefine.c +++ b/src/backend/rewrite/rewriteDefine.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.1.1.1 1996/07/09 06:21:51 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.2 1996/11/10 03:01:55 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -25,6 +25,7 @@ #include "nodes/parsenodes.h" #include "parser/catalog_utils.h" #include "rewrite/locks.h" +#include "rewrite/rewriteDefine.h" #include "rewrite/rewriteRemove.h" #include "rewrite/rewriteSupport.h" #include "tcop/tcopprot.h" diff --git a/src/backend/rewrite/rewriteManip.c b/src/backend/rewrite/rewriteManip.c index d6ef58614d..01fad29f77 100644 --- a/src/backend/rewrite/rewriteManip.c +++ b/src/backend/rewrite/rewriteManip.c @@ -6,7 +6,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.3 1996/11/06 06:48:44 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.4 1996/11/10 03:02:04 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -21,6 +21,7 @@ #include "utils/lsyscache.h" #include "utils/builtins.h" #include "rewrite/rewriteHandler.h" +#include "rewrite/rewriteManip.h" #include "rewrite/rewriteSupport.h" #include "rewrite/locks.h" diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index 747d551ed0..7e1d5d7654 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/buffer/freelist.c,v 1.2 1996/11/03 04:57:02 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/buffer/freelist.c,v 1.3 1996/11/10 03:02:16 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -257,11 +257,12 @@ DBG_FreeListCheck(int nfree) } } +#ifdef NOT_USED /* * PrintBufferFreeList - * prints the buffer free list, for debugging */ -void +static void PrintBufferFreeList() { BufferDesc *buf; @@ -285,3 +286,5 @@ PrintBufferFreeList() buf = &(BufferDescriptors[buf->freeNext]); } } + +#endif diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c index b79f23ecd7..30943e68b3 100644 --- a/src/backend/storage/buffer/localbuf.c +++ b/src/backend/storage/buffer/localbuf.c @@ -15,7 +15,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.3 1996/11/08 05:58:16 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.4 1996/11/10 03:02:18 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -38,6 +38,7 @@ #include "storage/spin.h" #include "storage/smgr.h" #include "storage/lmgr.h" +#include "storage/buf_internals.h" #include "miscadmin.h" #include "utils/builtins.h" #include "utils/hsearch.h" @@ -205,7 +206,7 @@ FlushLocalBuffer(Buffer buffer) * buffer until we need it. */ void -InitLocalBuffer() +InitLocalBuffer(void) { int i; @@ -241,7 +242,7 @@ InitLocalBuffer() * we will not need these buffers again. */ void -LocalBufferSync() +LocalBufferSync(void) { int i; @@ -269,7 +270,7 @@ LocalBufferSync() } void -ResetLocalBufferPool() +ResetLocalBufferPool(void) { int i; diff --git a/src/backend/storage/ipc/ipc.c b/src/backend/storage/ipc/ipc.c index c512cbef1a..9f74d848c4 100644 --- a/src/backend/storage/ipc/ipc.c +++ b/src/backend/storage/ipc/ipc.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.8 1996/11/08 05:58:30 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.9 1996/11/10 03:02:21 momjian Exp $ * * NOTES * @@ -66,7 +66,7 @@ static struct ONEXIT { } onexit_list[ MAX_ON_EXITS ]; static int onexit_index; -static void IpcConfigTip(); +static void IpcConfigTip(void); typedef struct _PrivateMemStruct { int id; @@ -725,7 +725,7 @@ LockIsFree(int lockid) #endif /* HAS_TEST_AND_SET */ static void -IpcConfigTip() +IpcConfigTip(void) { fprintf(stderr,"This type of error is usually caused by improper\n"); fprintf(stderr,"shared memory or System V IPC semaphore configuration.\n"); diff --git a/src/backend/storage/ipc/s_lock.c b/src/backend/storage/ipc/s_lock.c index 3c8f8c14eb..76e4ea7cc6 100644 --- a/src/backend/storage/ipc/s_lock.c +++ b/src/backend/storage/ipc/s_lock.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.7 1996/11/06 06:49:04 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.8 1996/11/10 03:02:26 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -48,6 +48,8 @@ #if defined(HAS_TEST_AND_SET) +extern int tas(slock_t *lock); + #if defined (next) /* * NEXTSTEP (mach) @@ -163,9 +165,7 @@ S_LOCK_FREE(slock_t *lock) #if defined(i386_solaris) || \ defined(sparc_solaris) - /* for xxxxx_solaris, this is defined in port/.../tas.s */ -extern int tas(slock_t *lock); void S_LOCK(slock_t *lock) @@ -227,9 +227,6 @@ S_INIT_LOCK(slock_t *lock) #if defined(hpux) -/* defined in port/.../tas.s */ -extern int tas(slock_t *lock); - /* * a "set" slock_t has a single word cleared. a "clear" slock_t has * all words set to non-zero. @@ -389,6 +386,7 @@ S_INIT_LOCK(unsigned char *addr) defined(bsdi_2_1) || \ defined(linux) + int tas(slock_t *m) { diff --git a/src/backend/storage/ipc/shmem.c b/src/backend/storage/ipc/shmem.c index 42a5ba3863..4a3ad33e9b 100644 --- a/src/backend/storage/ipc/shmem.c +++ b/src/backend/storage/ipc/shmem.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.5 1996/11/08 20:45:51 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.6 1996/11/10 03:02:27 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -98,7 +98,7 @@ static HTAB *BindingTable = NULL; * ---------------------- */ void -ShmemBindingTabReset() +ShmemBindingTabReset(void) { BindingTable = (HTAB *)NULL; } diff --git a/src/backend/storage/ipc/sinval.c b/src/backend/storage/ipc/sinval.c index 8ea1643049..bd4079efd6 100644 --- a/src/backend/storage/ipc/sinval.c +++ b/src/backend/storage/ipc/sinval.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.4 1996/11/06 06:49:09 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.5 1996/11/10 03:02:30 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -75,7 +75,7 @@ AttachSharedInvalidationState(IPCKey key) } void -InitSharedInvalidationState() +InitSharedInvalidationState(void) { SpinAcquire(SInvalLock); if (!SIBackendInit(shmInvalBuffer)) diff --git a/src/backend/storage/large_object/inv_api.c b/src/backend/storage/large_object/inv_api.c index bde4c41b34..bb64999601 100644 --- a/src/backend/storage/large_object/inv_api.c +++ b/src/backend/storage/large_object/inv_api.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.5 1996/11/08 05:58:41 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.6 1996/11/10 03:02:36 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -61,8 +61,9 @@ #define IMINBLK 512 /* non-export function prototypes */ -static HeapTuple inv_fetchtup(); -static HeapTuple inv_newtuple(); +static HeapTuple inv_newtuple(LargeObjectDesc *obj_desc, Buffer buffer, + Page page, char *dbuf, int nwrite); +static HeapTuple inv_fetchtup(LargeObjectDesc *obj_desc, Buffer *bufP); static int inv_wrnew(LargeObjectDesc *obj_desc, char *buf, int nbytes); static int inv_wrold(LargeObjectDesc *obj_desc, char *dbuf, int nbytes, HeapTuple htup, Buffer buffer); diff --git a/src/backend/tcop/dest.c b/src/backend/tcop/dest.c index ed95cfb623..82e847812e 100644 --- a/src/backend/tcop/dest.c +++ b/src/backend/tcop/dest.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/dest.c,v 1.2 1996/11/03 06:52:31 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/dest.c,v 1.3 1996/11/10 03:02:42 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -135,7 +135,7 @@ EndCommand(char *commandTag, CommandDest dest) * */ void -SendCopyBegin() +SendCopyBegin(void) { pq_putnchar("B", 1); /* pq_putint(0, 4); */ @@ -143,7 +143,7 @@ SendCopyBegin() } void -ReceiveCopyBegin() +ReceiveCopyBegin(void) { pq_putnchar("D", 1); /* pq_putint(0, 4); */ @@ -316,7 +316,7 @@ BeginCommand(char *pname, static Oid AppendOid; void -ResetAppendOid() +ResetAppendOid(void) { AppendOid = InvalidOid; } @@ -345,7 +345,7 @@ UpdateAppendOid(Oid newoid) } Oid -GetAppendOid() +GetAppendOid(void) { if (AppendOid == MULTI_TUPLE_APPEND) return InvalidOid; diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index c146dcd971..2f9ae7bfd5 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.16 1996/11/10 02:25:15 bryanh Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.17 1996/11/10 03:02:50 momjian Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -54,6 +54,7 @@ #include "tcop/tcopprot.h" /* where declarations for this file go */ #include "optimizer/planner.h" +#include "tcop/tcopprot.h" #include "tcop/tcopdebug.h" #include "executor/execdebug.h" @@ -1256,7 +1257,7 @@ PostgresMain(int argc, char *argv[]) */ if (IsUnderPostmaster == false) { puts("\nPOSTGRES backend interactive interface"); - puts("$Revision: 1.16 $ $Date: 1996/11/10 02:25:15 $"); + puts("$Revision: 1.17 $ $Date: 1996/11/10 03:02:50 $"); } /* ---------------- @@ -1464,7 +1465,7 @@ struct rusage Save_r; struct timeval Save_t; void -ResetUsage() +ResetUsage(void) { struct timezone tz; getrusage(RUSAGE_SELF, &Save_r); @@ -1474,7 +1475,7 @@ ResetUsage() } void -ShowUsage() +ShowUsage(void) { struct timeval user, sys; struct timeval elapse_t; diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c index e36ef730fe..6e7713ced1 100644 --- a/src/backend/tcop/pquery.c +++ b/src/backend/tcop/pquery.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.4 1996/11/08 05:59:34 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.5 1996/11/10 03:02:54 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -65,7 +65,7 @@ CreateQueryDesc(Query *parsetree, * ---------------------------------------------------------------- */ EState * -CreateExecutorState() +CreateExecutorState(void) { EState *state; extern int NBuffers; diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c index e6494ea134..0556083ff1 100644 --- a/src/backend/utils/adt/acl.c +++ b/src/backend/utils/adt/acl.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.5 1996/11/06 10:30:36 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.6 1996/11/10 03:03:00 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -325,7 +325,7 @@ aclownerdefault(AclId ownerid) } Acl * -acldefault() +acldefault(void) { Acl *acl; AclItem *aip; diff --git a/src/backend/utils/adt/arrayutils.c b/src/backend/utils/adt/arrayutils.c index 5f175df031..fce0b0ddd5 100644 --- a/src/backend/utils/adt/arrayutils.c +++ b/src/backend/utils/adt/arrayutils.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayutils.c,v 1.2 1996/11/06 06:49:41 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayutils.c,v 1.3 1996/11/10 03:03:03 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -16,6 +16,8 @@ #include "postgres.h" +#include "utils/array.h" + int GetOffset(int n, int dim[], int lb[], int indx[]) { diff --git a/src/backend/utils/adt/date.c b/src/backend/utils/adt/date.c index 20a3aeeddb..80dbae8dd0 100644 --- a/src/backend/utils/adt/date.c +++ b/src/backend/utils/adt/date.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.3 1996/11/06 10:30:44 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.4 1996/11/10 03:03:05 momjian Exp $ * * NOTES * This code is actually (almost) unused. @@ -852,7 +852,7 @@ static int istinterval(char *i_string, * time with precision up to microsecs.) - ay 3/95 */ text * -timeofday() +timeofday(void) { #ifndef WIN32 diff --git a/src/backend/utils/adt/datetimes.c b/src/backend/utils/adt/datetimes.c index 06f2e373d7..f38b2c1171 100644 --- a/src/backend/utils/adt/datetimes.c +++ b/src/backend/utils/adt/datetimes.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/datetimes.c,v 1.5 1996/11/06 06:49:45 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/datetimes.c,v 1.6 1996/11/10 03:03:10 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -15,22 +15,8 @@ #include #include -#include - -/* these things look like structs, but we pass them by value so be careful - For example, passing an int -> DateADT is not portable! */ -typedef struct DateADT { - char day; - char month; - short year; -} DateADT; - -typedef struct TimeADT { - short hr; - short min; - float sec; -} TimeADT; - +#include +#include static int day_tab[2][12] = { {31,28,31,30,31,30,31,31,30,31,30,31}, diff --git a/src/backend/utils/adt/geo-selfuncs.c b/src/backend/utils/adt/geo-selfuncs.c index a816e738f5..77454064cd 100644 --- a/src/backend/utils/adt/geo-selfuncs.c +++ b/src/backend/utils/adt/geo-selfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/geo-selfuncs.c,v 1.1.1.1 1996/07/09 06:22:04 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/geo-selfuncs.c,v 1.2 1996/11/10 03:03:13 momjian Exp $ * * XXX These are totally bogus. * @@ -19,6 +19,7 @@ #include "access/attnum.h" #include "utils/geo-decls.h" /* where function declarations go */ #include "utils/palloc.h" +#include "utils/builtins.h" float64 areasel(Oid opid, diff --git a/src/backend/utils/adt/like.c b/src/backend/utils/adt/like.c index 127d59a281..2e279317b9 100644 --- a/src/backend/utils/adt/like.c +++ b/src/backend/utils/adt/like.c @@ -22,8 +22,6 @@ #include "utils/palloc.h" #include "utils/builtins.h" /* where the function declarations go */ -int like(char *text, char *p); - /* * interface routines called by the function manager */ @@ -142,7 +140,7 @@ bool textnlike(struct varlena *s, struct varlena *p) } -/* $Revision: 1.3 $ +/* $Revision: 1.4 $ ** "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. diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/varchar.c index 5c5531882e..4a86ced5a0 100644 --- a/src/backend/utils/adt/varchar.c +++ b/src/backend/utils/adt/varchar.c @@ -1,20 +1,20 @@ /*------------------------------------------------------------------------- * - * char.c-- + * varchar.c-- * Functions for the built-in type char() and varchar(). * * Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.5 1996/11/06 06:50:06 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.6 1996/11/10 03:03:20 momjian Exp $ * *------------------------------------------------------------------------- */ #include /* for sprintf() */ #include #include "postgres.h" -#include "utils/palloc.h" +#include "utils/builtins.h" /* * CHAR() and VARCHAR() types are part of the ANSI SQL standard. CHAR() diff --git a/src/backend/utils/cache/fcache.c b/src/backend/utils/cache/fcache.c index f4c5ef3e90..1d86364abd 100644 --- a/src/backend/utils/cache/fcache.c +++ b/src/backend/utils/cache/fcache.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.3 1996/11/06 10:31:22 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.4 1996/11/10 03:03:22 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -26,6 +26,7 @@ #include "parser/parsetree.h" /* for getrelname() */ #include "utils/builtins.h" #include "utils/fcache.h" +#include "utils/fcache2.h" #include "nodes/primnodes.h" #include "nodes/execnodes.h" #ifndef HAVE_MEMMOVE diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index b72cc02cf5..6918cada21 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.4 1996/11/06 10:31:27 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.5 1996/11/10 03:03:26 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1447,7 +1447,7 @@ RelationPurgeLocalRelation(bool xactCommitted) #define INITRELCACHESIZE 400 void -RelationInitialize() +RelationInitialize(void) { MemoryContext oldcxt; HASHCTL ctl; @@ -1536,7 +1536,7 @@ RelationInitialize() #define Num_indices_bootstrap 3 void -init_irels() +init_irels(void) { Size len; int nread; @@ -1676,7 +1676,7 @@ init_irels() } void -write_irels() +write_irels(void) { int len; int nwritten; diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c index fca7ee329f..f35c5d7d8d 100644 --- a/src/backend/utils/error/elog.c +++ b/src/backend/utils/error/elog.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.9 1996/11/08 05:59:57 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.10 1996/11/10 03:03:28 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -196,7 +196,7 @@ elog(int lev, const char *fmt, ... ) #ifndef PG_STANDALONE int -DebugFileOpen() +DebugFileOpen(void) { int fd, istty; diff --git a/src/backend/utils/error/exc.c b/src/backend/utils/error/exc.c index 59ec7b0086..3cc3f01f50 100644 --- a/src/backend/utils/error/exc.c +++ b/src/backend/utils/error/exc.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/exc.c,v 1.5 1996/11/03 06:53:26 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/exc.c,v 1.6 1996/11/10 03:03:31 momjian Exp $ * * NOTE * XXX this code needs improvement--check for state violations and @@ -135,7 +135,7 @@ ExcPrint(Exception *excP, } ExcProc * -ExcGetUnCaught() +ExcGetUnCaught(void) { return (ExcUnCaughtP); } diff --git a/src/backend/utils/hash/dynahash.c b/src/backend/utils/hash/dynahash.c index af835d279a..f2cab230cf 100644 --- a/src/backend/utils/hash/dynahash.c +++ b/src/backend/utils/hash/dynahash.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.5 1996/11/08 20:46:07 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.6 1996/11/10 03:03:36 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -122,9 +122,9 @@ DynaHashFree(Pointer ptr) * ---------------- */ -static int expand_table(); -static int hdefault(); -static int init_htab(); +static int expand_table(HTAB *hashp); +static int hdefault(HTAB *hashp); +static int init_htab(HTAB *hashp, int nelem); /* diff --git a/src/backend/utils/mmgr/aset.c b/src/backend/utils/mmgr/aset.c index 5e6b409483..4190823206 100644 --- a/src/backend/utils/mmgr/aset.c +++ b/src/backend/utils/mmgr/aset.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.3 1996/11/08 06:00:48 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.4 1996/11/10 03:03:45 momjian Exp $ * * NOTE * XXX This is a preliminary implementation which lacks fail-fast @@ -128,6 +128,7 @@ AllocSetReset(AllocSet set) } } +#ifdef NOT_USED void AllocSetReset_debug(char *file, int line, AllocSet set) { @@ -139,6 +140,7 @@ AllocSetReset_debug(char *file, int line, AllocSet set) AllocSetFree(set, pointer); } } +#endif /* * AllocSetContains -- diff --git a/src/bin/pg_version/pg_version.c b/src/bin/pg_version/pg_version.c index e09cd3c8e6..3212182ae3 100644 --- a/src/bin/pg_version/pg_version.c +++ b/src/bin/pg_version/pg_version.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_version/Attic/pg_version.c,v 1.4 1996/11/08 06:01:17 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_version/Attic/pg_version.c,v 1.5 1996/11/10 03:04:02 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -30,9 +30,13 @@ main(int argc, char **argv) return(0); } +void elog(void); /* make compiler happy */ + void elog(void) {} +int GetDataHome(void); /* make compiler happy */ + int GetDataHome(void) { diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c index 1d0f5883ca..a7544dc2d9 100644 --- a/src/bin/psql/psql.c +++ b/src/bin/psql/psql.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.26 1996/11/08 20:46:19 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.27 1996/11/10 03:04:12 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -124,7 +124,7 @@ usage(char *progname) * print out usage for the backslash commands */ -char *on(bool f) +static char *on(bool f) { return f? "on": "off"; } @@ -159,7 +159,7 @@ slashUsage(PsqlSettings *ps) fprintf(stderr,"\t \\! [] -- shell escape or command\n"); } -PGresult * +static PGresult * PSQLexec(PsqlSettings *ps, char *query) { PGresult *res = PQexec(ps->db, query); @@ -554,7 +554,7 @@ SendQuery(bool *success_p, PsqlSettings *settings, const char *query, -void +static void editFile(char *fname) { char *editorName; @@ -573,7 +573,7 @@ editFile(char *fname) free(sys); } -bool +static bool toggle(PsqlSettings *settings, bool *sw, char *msg) { *sw= !*sw; @@ -584,7 +584,7 @@ toggle(PsqlSettings *settings, bool *sw, char *msg) -void +static void unescape(char *dest, const char *source) { /*----------------------------------------------------------------------------- Return as the string the value of string with escape @@ -633,7 +633,7 @@ unescape(char *dest, const char *source) { -void +static void parse_slash_copy(const char *args, char *table, const int table_len, char *file, const int file_len, bool *from_p, bool *error_p) { @@ -695,7 +695,7 @@ parse_slash_copy(const char *args, char *table, const int table_len, -void +static void do_copy(const char *args, PsqlSettings *settings) { /*--------------------------------------------------------------------------- Execute a \copy command (frontend copy). We have to open a file, then @@ -755,7 +755,7 @@ do_copy(const char *args, PsqlSettings *settings) { } -void +static void do_connect(const char *new_dbname, PsqlSettings *settings) { char *dbname=PQdb(settings->db); @@ -788,7 +788,7 @@ do_connect(const char *new_dbname, PsqlSettings *settings) { } -void +static void do_edit(const char *filename_arg, char *query, int *retcode_p) { int fd; @@ -853,7 +853,7 @@ do_edit(const char *filename_arg, char *query, int *retcode_p) { -void +static void do_help(const char *topic) { if (!topic) { @@ -907,7 +907,7 @@ do_help(const char *topic) { -void +static void do_shell(const char *command) { if (!command) { diff --git a/src/include/access/gist.h b/src/include/access/gist.h index cfafacbc50..f30432979c 100644 --- a/src/include/access/gist.h +++ b/src/include/access/gist.h @@ -12,6 +12,10 @@ #ifndef GIST_H #define GIST_H +#include +#include +#include +#include #include #include #include @@ -142,6 +146,38 @@ typedef struct GISTENTRY { {(e).pred = pr; (e).rel = r; (e).page = pg; (e).offset = o; (e).bytes = b; (e).leafkey = l;} /* defined in gist.c */ +#define TRLOWER(tr) (((tr)->bytes)) +#define TRUPPER(tr) (&((tr)->bytes[MAXALIGN(VARSIZE(TRLOWER(tr)))])) + +typedef struct txtrange { + /* flag: NINF means that lower is negative infinity; PINF means that + ** upper is positive infinity. 0 means that both are numbers. + */ + int32 vl_len; + int32 flag; + char bytes[2]; +} TXTRANGE; + +typedef struct intrange { + int lower; + int upper; + /* flag: NINF means that lower is negative infinity; PINF means that + ** upper is positive infinity. 0 means that both are numbers. + */ + int flag; +} INTRANGE; + +extern void gistbuild(Relation heap, + Relation index, int natts, + AttrNumber *attnum, IndexStrategy istrat, + uint16 pint, Datum *params, + FuncIndexInfo *finfo, + PredInfo *predInfo); +extern InsertIndexResult gistinsert(Relation r, Datum *datum, + char *nulls,ItemPointer ht_ctid); +extern void _gistdump(Relation r); +extern char *text_range_out(TXTRANGE *r); +extern char *int_range_out(INTRANGE *r); extern void gistfreestack(GISTSTACK *s); extern void initGISTstate(GISTSTATE *giststate, Relation index); extern void gistdentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr, @@ -149,4 +185,15 @@ extern void gistdentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr, extern void gistcentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr, Relation r, Page pg, OffsetNumber o, int b, bool l) ; extern StrategyNumber RelationGetGISTStrategy(Relation, AttrNumber, RegProcedure); + +/* gistget.c */ +extern RetrieveIndexResult gistgettuple(IndexScanDesc s, ScanDirection dir); +extern bool gistindex_keytest(IndexTuple tuple, TupleDesc tupdesc, + int scanKeySize, ScanKey key, GISTSTATE *giststate, + Relation r, Page p, OffsetNumber offset); + +/* giststrat.c */ +extern bool RelationInvokeGISTStrategy(Relation r, AttrNumber attnum, + StrategyNumber s, Datum left, Datum right); + #endif /* GIST_H */ diff --git a/src/include/access/gistscan.h b/src/include/access/gistscan.h index 0a4fe7f554..9894e71b01 100644 --- a/src/include/access/gistscan.h +++ b/src/include/access/gistscan.h @@ -11,10 +11,17 @@ */ #ifndef GISTSCAN_H +#include #include #include #include -void gistadjscans(Relation r, int op, BlockNumber blkno, OffsetNumber offnum); +extern IndexScanDesc gistbeginscan(Relation r, bool fromEnd, + uint16 nkeys, ScanKey key); +extern void gistrescan(IndexScanDesc s, bool fromEnd, ScanKey key); +extern void gistmarkpos(IndexScanDesc s); +extern void gistrestrpos(IndexScanDesc s); +extern void gistendscan(IndexScanDesc s); +extern void gistadjscans(Relation r, int op, BlockNumber blkno, OffsetNumber offnum); #endif /* GISTSCAN_H */ diff --git a/src/include/access/giststrat.h b/src/include/access/giststrat.h index d189f685b6..7bf35ad768 100644 --- a/src/include/access/giststrat.h +++ b/src/include/access/giststrat.h @@ -15,11 +15,9 @@ #include #include -StrategyNumber -RelationGetGISTStrategy(Relation r, AttrNumber attnum, RegProcedure proc); - -bool -RelationInvokeGISTStrategy(Relation r, AttrNumber attnum, StrategyNumber s, - Datum left, Datum right); +extern StrategyNumber RelationGetGISTStrategy(Relation r, + AttrNumber attnum, RegProcedure proc); +extern bool RelationInvokeGISTStrategy(Relation r, AttrNumber attnum, + StrategyNumber s, Datum left, Datum right); #endif /* GISTSTRAT_H */ diff --git a/src/include/access/hash.h b/src/include/access/hash.h index e408abd263..34e2f64d9b 100644 --- a/src/include/access/hash.h +++ b/src/include/access/hash.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: hash.h,v 1.3 1996/11/05 10:37:02 scrappy Exp $ + * $Id: hash.h,v 1.4 1996/11/10 03:04:36 momjian Exp $ * * NOTES * modeled after Margo Seltzer's hash implementation for unix. @@ -277,6 +277,7 @@ extern uint32 hashchar4(uint32 intkey); extern uint32 hashchar8(char *key); extern uint32 hashchar16(char *key); extern uint32 hashtext(struct varlena *key); +extern uint32 hashname(NameData *n); /* private routines */ diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index a1780dc49a..bcc974f18e 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -6,14 +6,17 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: heapam.h,v 1.5 1996/11/05 07:22:50 scrappy Exp $ + * $Id: heapam.h,v 1.6 1996/11/10 03:04:37 momjian Exp $ * *------------------------------------------------------------------------- */ #ifndef HEAPAM_H #define HEAPAM_H +#include #include +#include +#include /* ---------------------------------------------------------------- * heap access method statistics @@ -134,4 +137,9 @@ extern void PrintHeapAccessStatistics(HeapAccessStatistics stats); extern void PrintAndFreeHeapAccessStatistics(HeapAccessStatistics stats); extern void initam(void); +/* hio.c */ +extern void RelationPutHeapTuple(Relation relation, BlockNumber blockIndex, + HeapTuple tuple); +extern void RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple); + #endif /* HEAPAM_H */ diff --git a/src/include/access/rtree.h b/src/include/access/rtree.h index a421a79f8a..4474790245 100644 --- a/src/include/access/rtree.h +++ b/src/include/access/rtree.h @@ -6,14 +6,19 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: rtree.h,v 1.2 1996/11/05 08:18:14 scrappy Exp $ + * $Id: rtree.h,v 1.3 1996/11/10 03:04:39 momjian Exp $ * *------------------------------------------------------------------------- */ #ifndef RTREE_H #define RTREE_H +#include +#include +#include +#include #include +#include #include #include @@ -99,4 +104,39 @@ typedef RTreeScanOpaqueData *RTreeScanOpaque; /* defined in rtree.c */ extern void freestack(RTSTACK *s); +/* rget.c */ +extern RetrieveIndexResult rtgettuple(IndexScanDesc s, ScanDirection dir); + +/* + * RTree code. + * Defined in access/index-rtree/ + */ +extern InsertIndexResult rtinsert(Relation r, Datum *datum, char *nulls, + ItemPointer ht_ctid); +extern char *rtdelete(Relation r, ItemPointer tid); + +extern RetrieveIndexResult rtgettuple(IndexScanDesc s, ScanDirection dir); +extern IndexScanDesc rtbeginscan(Relation r, bool fromEnd, uint16 nkeys, + ScanKey key); + +extern void rtendscan(IndexScanDesc s); +extern void rtmarkpos(IndexScanDesc s); +extern void rtrestrpos(IndexScanDesc s); +extern void rtrescan(IndexScanDesc s, bool fromEnd, ScanKey key); +extern void rtbuild(Relation heap, Relation index, int natts, + AttrNumber *attnum, IndexStrategy istrat, uint16 pcount, + Datum *params, FuncIndexInfo *finfo, PredInfo *predInfo); +extern void _rtdump(Relation r); + +/* rtscan.c */ +extern void rtadjscans(Relation r, int op, BlockNumber blkno, + OffsetNumber offnum); +/* rtstrat.h */ +extern StrategyNumber RelationGetRTStrategy(Relation r, + AttrNumber attnum, RegProcedure proc); +extern bool RelationInvokeRTStrategy(Relation r, AttrNumber attnum, + StrategyNumber s, Datum left, Datum right); +extern RegProcedure RTMapOperator(Relation r, AttrNumber attnum, + RegProcedure proc); + #endif /* RTREE_H */ diff --git a/src/include/access/transam.h b/src/include/access/transam.h index f95cc68f07..154e18ee93 100644 --- a/src/include/access/transam.h +++ b/src/include/access/transam.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: transam.h,v 1.4 1996/11/05 07:07:22 scrappy Exp $ + * $Id: transam.h,v 1.5 1996/11/10 03:04:41 momjian Exp $ * * NOTES * Transaction System Version 101 now support proper oid @@ -140,14 +140,14 @@ typedef VariableRelationContentsData *VariableRelationContents; /* * prototypes for functions in transam/transam.c */ -extern int RecoveryCheckingEnabled(); +extern int RecoveryCheckingEnabled(void); extern void SetRecoveryCheckingEnabled(bool state); extern bool TransactionLogTest(TransactionId transactionId, XidStatus status); extern void TransactionLogUpdate(TransactionId transactionId, XidStatus status); extern AbsoluteTime TransactionIdGetCommitTime(TransactionId transactionId); extern void TransRecover(Relation logRelation); -extern void InitializeTransactionLog(); +extern void InitializeTransactionLog(void); extern bool TransactionIdDidCommit(TransactionId transactionId); extern bool TransactionIdDidAbort(TransactionId transactionId); extern bool TransactionIdIsInProgress(TransactionId transactionId); diff --git a/src/include/access/xact.h b/src/include/access/xact.h index fd2077d5eb..fa0f35b7de 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: xact.h,v 1.3 1996/11/05 07:15:58 scrappy Exp $ + * $Id: xact.h,v 1.4 1996/11/10 03:04:42 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -55,7 +55,7 @@ typedef TransactionStateData *TransactionState; * extern definitions * ---------------- */ -extern int TransactionFlushEnabled(); +extern int TransactionFlushEnabled(void); extern void SetTransactionFlushEnabled(bool state); extern bool IsTransactionState(void); @@ -90,12 +90,15 @@ extern void AbortCurrentTransaction(void); extern void BeginTransactionBlock(void); extern void EndTransactionBlock(void); extern void AbortTransactionBlock(void); -extern bool IsTransactionBlock(); -extern void UserAbortTransactionBlock(); +extern bool IsTransactionBlock(void); +extern void UserAbortTransactionBlock(void); extern TransactionId DisabledTransactionId; /* defined in xid.c */ +extern TransactionId xidin(char *representation); +extern char *xidout(TransactionId transactionId); +extern bool xideq(TransactionId xid1, TransactionId xid2); extern bool TransactionIdIsValid(TransactionId transactionId); extern void StoreInvalidTransactionId(TransactionId *destination); extern void TransactionIdStore(TransactionId transactionId, diff --git a/src/include/catalog/heap.h b/src/include/catalog/heap.h index 058fc44cc4..2259c5e083 100644 --- a/src/include/catalog/heap.h +++ b/src/include/catalog/heap.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: heap.h,v 1.2 1996/11/05 11:23:43 scrappy Exp $ + * $Id: heap.h,v 1.3 1996/11/10 03:04:44 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -36,9 +36,9 @@ extern void DeletePgTypeTuple(Relation rdesc); extern void heap_destroy(char relname[]); extern void heap_destroyr(Relation r); -extern void InitTempRelList(); +extern void InitTempRelList(void); extern void AddToTempRelList(Relation r); extern void RemoveFromTempRelList(Relation r); -extern void DestroyTempRels(); +extern void DestroyTempRels(void); #endif /* HEAP_H */ diff --git a/src/include/commands/defrem.h b/src/include/commands/defrem.h index 2ae8c15f76..7221da3344 100644 --- a/src/include/commands/defrem.h +++ b/src/include/commands/defrem.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: defrem.h,v 1.4 1996/11/10 02:27:15 bryanh Exp $ + * $Id: defrem.h,v 1.5 1996/11/10 03:04:49 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -37,6 +37,7 @@ extern void CreateFunction(ProcedureStmt *stmt, CommandDest dest); extern void DefineOperator(char *name, List *parameters); extern void DefineAggregate(char *name, List *parameters); extern void DefineType(char *name, List *parameters); +extern void CreateFunction(ProcedureStmt *stmt, CommandDest dest); /* * prototypes in remove.c diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h index 1469ff542f..8ec81547f7 100644 --- a/src/include/executor/executor.h +++ b/src/include/executor/executor.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: executor.h,v 1.4 1996/11/05 08:18:34 scrappy Exp $ + * $Id: executor.h,v 1.5 1996/11/10 03:04:59 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -142,7 +142,7 @@ extern TupleDesc ExecTypeFromTL(List *targetList); /* * prototypes from functions in execTuples.c */ -extern void ResetTupleCount(); +extern void ResetTupleCount(void); extern void DisplayTupleCount(FILE *statfp); extern void ExecAssignNodeBaseInfo(EState *estate, CommonState *basenode, Plan *parent); diff --git a/src/include/executor/nodeMergejoin.h b/src/include/executor/nodeMergejoin.h index d88cdae852..5199165e35 100644 --- a/src/include/executor/nodeMergejoin.h +++ b/src/include/executor/nodeMergejoin.h @@ -6,17 +6,13 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: nodeMergejoin.h,v 1.1 1996/08/28 07:22:22 scrappy Exp $ + * $Id: nodeMergejoin.h,v 1.2 1996/11/10 03:05:09 momjian Exp $ * *------------------------------------------------------------------------- */ #ifndef NODEMERGEJOIN_H #define NODEMERGEJOIN_H -#if 0 /* aren't these static? */ -extern List MJFormOSortopI(List qualList, Oid sortOp); -extern List MJFormISortopO(List qualList, Oid sortOp); -#endif extern bool MergeCompare(List *eqQual, List *compareQual, ExprContext *econtext); extern void ExecMergeTupleDumpInner(ExprContext *econtext); diff --git a/src/include/lib/dllist.h b/src/include/lib/dllist.h index 4cc56c9874..8e18470f87 100644 --- a/src/include/lib/dllist.h +++ b/src/include/lib/dllist.h @@ -26,7 +26,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: dllist.h,v 1.2 1996/10/31 09:48:40 scrappy Exp $ + * $Id: dllist.h,v 1.3 1996/11/10 03:05:16 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -50,7 +50,7 @@ typedef struct Dllist { Dlelem *dll_tail; } Dllist; -extern Dllist* DLNewList(); /* initialize a new list */ +extern Dllist* DLNewList(void); /* initialize a new list */ extern void DLFreeList(Dllist*); /* free up a list and all the nodes in it*/ extern Dlelem* DLNewElem(void* val); extern void DLFreeElem(Dlelem*); diff --git a/src/include/libpq/libpq-be.h b/src/include/libpq/libpq-be.h index 90bb582fbd..aed1595b70 100644 --- a/src/include/libpq/libpq-be.h +++ b/src/include/libpq/libpq-be.h @@ -7,7 +7,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: libpq-be.h,v 1.2 1996/11/06 08:07:45 scrappy Exp $ + * $Id: libpq-be.h,v 1.3 1996/11/10 03:05:18 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -33,7 +33,7 @@ extern void be_portalinit(void); extern void be_portalpush(PortalEntry *entry); extern PortalEntry *be_portalpop(void); -extern PortalEntry *be_currentportal(); +extern PortalEntry *be_currentportal(void); extern PortalEntry *be_newportal(void); extern void be_typeinit(PortalEntry *entry, TupleDesc attrs, int natts); diff --git a/src/include/nodes/print.h b/src/include/nodes/print.h new file mode 100644 index 0000000000..c9123fdcf3 --- /dev/null +++ b/src/include/nodes/print.h @@ -0,0 +1,34 @@ +/*------------------------------------------------------------------------- + * + * execnodes.h-- + * definitions for executor state nodes + * + * + * Copyright (c) 1994, Regents of the University of California + * + * $Id: print.h,v 1.1 1996/11/10 03:05:23 momjian Exp $ + * + *------------------------------------------------------------------------- + */ +#ifndef PRINT_H +#define PRINT_H + +#include "nodes/nodes.h" +#include "nodes/plannodes.h" +#include "nodes/parsenodes.h" +#include "nodes/relation.h" +#include "executor/tuptable.h" + +extern void print(void *obj); +extern void pprint(void *obj); +extern void print_rt(List *rtable); +extern void print_expr(Node *expr, List *rtable); +extern void print_keys(List *keys, List *rtable); +extern void print_tl(List *tlist, List *rtable); +extern void print_slot(TupleTableSlot *slot); +extern char* plannode_type (Plan* p); +extern void print_plan_recursive (Plan* p, Query *parsetree, + int indentLevel, char* label); +extern void print_plan (Plan* p, Query* parsetree); + +#endif /* PRINT_H */ diff --git a/src/include/nodes/readfuncs.h b/src/include/nodes/readfuncs.h index bdc7f5a4db..79e18ff61b 100644 --- a/src/include/nodes/readfuncs.h +++ b/src/include/nodes/readfuncs.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: readfuncs.h,v 1.1 1996/08/28 01:57:47 scrappy Exp $ + * $Id: readfuncs.h,v 1.2 1996/11/10 03:05:30 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -22,6 +22,6 @@ extern void *nodeRead(bool read_car_only); /* * prototypes for functions in readfuncs.c */ -extern Node *parsePlanString(); +extern Node *parsePlanString(void); #endif /* READFUNCS_H */ diff --git a/src/include/parser/gramparse.h b/src/include/parser/gramparse.h index 95de9f0f39..11cfa97019 100644 --- a/src/include/parser/gramparse.h +++ b/src/include/parser/gramparse.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: gramparse.h,v 1.1 1996/11/08 20:46:26 momjian Exp $ + * $Id: gramparse.h,v 1.2 1996/11/10 03:05:41 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -15,10 +15,10 @@ #define GRAMPARSE_H /* include once only */ /* from scan.l */ -extern void init_io(); +extern void init_io(void); /* from gram.y */ extern void parser_init(Oid *typev, int nargs); -extern int yyparse(); +extern int yyparse(void); #endif /* GRAMPARSE_H */ diff --git a/src/include/parser/parse_query.h b/src/include/parser/parse_query.h index a4750ae2aa..539ed20075 100644 --- a/src/include/parser/parse_query.h +++ b/src/include/parser/parse_query.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: parse_query.h,v 1.5 1996/11/04 12:12:50 scrappy Exp $ + * $Id: parse_query.h,v 1.6 1996/11/10 03:05:45 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -66,7 +66,7 @@ extern int NumLevels; #endif Oid exprType(Node *expr); -ParseState* makeParseState(); +ParseState* makeParseState(void); QueryTreeList *parse_analyze(List *querytree_list); /* define in parse_query.c, used in gram.y */ diff --git a/src/include/storage/buf_internals.h b/src/include/storage/buf_internals.h index f0920b04d2..af7a57d0d9 100644 --- a/src/include/storage/buf_internals.h +++ b/src/include/storage/buf_internals.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: buf_internals.h,v 1.5 1996/11/05 06:10:53 scrappy Exp $ + * $Id: buf_internals.h,v 1.6 1996/11/10 03:05:53 momjian Exp $ * * NOTE * If BUFFERPAGE0 is defined, then 0 will be used as a @@ -230,8 +230,8 @@ extern BufferDesc *LocalBufferAlloc(Relation reln, BlockNumber blockNum, bool *foundPtr); extern int WriteLocalBuffer(Buffer buffer, bool release); extern int FlushLocalBuffer(Buffer buffer); -extern void InitLocalBuffer(); -extern void LocalBufferSync(); -extern void ResetLocalBufferPool(); +extern void InitLocalBuffer(void); +extern void LocalBufferSync(void); +extern void ResetLocalBufferPool(void); #endif /* BUFMGR_INTERNALS_H */ diff --git a/src/include/storage/shmem.h b/src/include/storage/shmem.h index 72200cff48..c2563509be 100644 --- a/src/include/storage/shmem.h +++ b/src/include/storage/shmem.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: shmem.h,v 1.2 1996/11/05 06:11:04 scrappy Exp $ + * $Id: shmem.h,v 1.3 1996/11/10 03:05:56 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -57,7 +57,7 @@ typedef struct SHM_QUEUE { } SHM_QUEUE; /* shmem.c */ -extern void ShmemBindingTabReset(); +extern void ShmemBindingTabReset(void); extern void ShmemCreate(unsigned int key, unsigned int size); extern int InitShmem(unsigned int key, unsigned int size); extern long *ShmemAlloc(unsigned long size); diff --git a/src/include/storage/sinval.h b/src/include/storage/sinval.h index efc1ce2e1a..87f8e00ba6 100644 --- a/src/include/storage/sinval.h +++ b/src/include/storage/sinval.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: sinval.h,v 1.3 1996/11/05 06:11:05 scrappy Exp $ + * $Id: sinval.h,v 1.4 1996/11/10 03:06:00 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -20,7 +20,7 @@ extern SPINLOCK SInvalLock; extern void CreateSharedInvalidationState(IPCKey key); extern void AttachSharedInvalidationState(IPCKey key); -extern void InitSharedInvalidationState(); +extern void InitSharedInvalidationState(void); extern void RegisterSharedInvalid(int cacheId, Index hashIndex, ItemPointer pointer); extern void InvalidateSharedInvalid(void (*invalFunction)(), diff --git a/src/include/storage/smgr.h b/src/include/storage/smgr.h index 02ba5627d8..057e91be6f 100644 --- a/src/include/storage/smgr.h +++ b/src/include/storage/smgr.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: smgr.h,v 1.4 1996/11/08 20:46:33 momjian Exp $ + * $Id: smgr.h,v 1.5 1996/11/10 03:06:05 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -85,5 +85,7 @@ extern int MMShmemSize(void); /* smgrtype.c */ extern char *smgrout(int2 i); extern int2 smgrin(char *s); +extern bool smgreq(int2 a, int2 b); +extern bool smgrne(int2 a, int2 b); #endif /* SMGR_H */ diff --git a/src/include/tcop/dest.h b/src/include/tcop/dest.h index bfe2974656..47cbd225cb 100644 --- a/src/include/tcop/dest.h +++ b/src/include/tcop/dest.h @@ -26,7 +26,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: dest.h,v 1.3 1996/11/04 12:07:00 scrappy Exp $ + * $Id: dest.h,v 1.4 1996/11/10 03:06:08 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -64,14 +64,14 @@ typedef struct AttrInfo { extern void donothing(List *tuple, List *attrdesc); extern void (*DestToFunction(CommandDest dest))(); extern void EndCommand(char *commandTag, CommandDest dest); -extern void SendCopyBegin(); -extern void ReceiveCopyBegin(); +extern void SendCopyBegin(void); +extern void ReceiveCopyBegin(void); extern void NullCommand(CommandDest dest); extern void BeginCommand(char *pname, int operation, TupleDesc attinfo, bool isIntoRel, bool isIntoPortal, char *tag, CommandDest dest); -extern void ResetAppendOid(); +extern void ResetAppendOid(void); extern void UpdateAppendOid(Oid newoid); -extern Oid GetAppendOid(); +extern Oid GetAppendOid(void); #endif /* DEST_H */ diff --git a/src/include/tcop/pquery.h b/src/include/tcop/pquery.h index 0e806a0b7b..7aec9aa039 100644 --- a/src/include/tcop/pquery.h +++ b/src/include/tcop/pquery.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pquery.h,v 1.2 1996/11/04 12:07:01 scrappy Exp $ + * $Id: pquery.h,v 1.3 1996/11/10 03:06:09 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -20,7 +20,7 @@ extern QueryDesc *CreateQueryDesc(Query *parsetree, Plan *plantree, CommandDest dest); */ -extern EState *CreateExecutorState(); +extern EState *CreateExecutorState(void); extern void ProcessPortal(char *portalName, Query *parseTree, diff --git a/src/include/tcop/tcopprot.h b/src/include/tcop/tcopprot.h index cb07eec63d..a64388c985 100644 --- a/src/include/tcop/tcopprot.h +++ b/src/include/tcop/tcopprot.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: tcopprot.h,v 1.2 1996/11/04 12:07:04 scrappy Exp $ + * $Id: tcopprot.h,v 1.3 1996/11/10 03:06:11 momjian Exp $ * * OLD COMMENTS * This file was created so that other c files could get the two @@ -29,11 +29,11 @@ extern void pg_eval_dest(char *query_string, char **argv, Oid *typev, int nargs, CommandDest dest); #endif /* BOOTSTRAP_HEADER */ -extern void handle_warn(); -extern void quickdie(); -extern void die(); +extern void handle_warn(SIGNAL_ARGS); +extern void quickdie(SIGNAL_ARGS); +extern void die(SIGNAL_ARGS); extern int PostgresMain(int argc, char *argv[]); -extern void ResetUsage(); -extern void ShowUsage(); +extern void ResetUsage(void); +extern void ShowUsage(void); #endif /* tcopprotIncluded */ diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h index e6e37af4cd..9789501504 100644 --- a/src/include/utils/acl.h +++ b/src/include/utils/acl.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: acl.h,v 1.3 1996/11/04 07:18:36 scrappy Exp $ + * $Id: acl.h,v 1.4 1996/11/10 03:06:14 momjian Exp $ * * NOTES * For backward-compatability purposes we have to allow there @@ -126,7 +126,7 @@ typedef ArrayType IdList; */ extern char *aclparse(char *s, AclItem *aip, unsigned *modechg); extern Acl *aclownerdefault(AclId ownerid); -extern Acl *acldefault(); +extern Acl *acldefault(void); extern Acl *aclinsert3(Acl *old_acl, AclItem *mod_aip, unsigned modechg); extern char* aclmakepriv(char* old_privlist, char new_priv); diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index cabfa01773..39739fb6eb 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: builtins.h,v 1.6 1996/11/04 11:51:14 scrappy Exp $ + * $Id: builtins.h,v 1.7 1996/11/10 03:06:18 momjian Exp $ * * NOTES * This should normally only be included by fmgr.h. @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -183,41 +184,30 @@ extern int atof1(char *str, double *val); * Per-opclass comparison functions for new btrees. These are * stored in pg_amproc and defined in nbtree/ */ -extern int32 btint2cmp(); -extern int32 btint4cmp(); -extern int32 btint24cmp(); -extern int32 btint42cmp(); -extern int32 btfloat4cmp(); -extern int32 btfloat8cmp(); -extern int32 btoidcmp(); -extern int32 btabstimecmp(); -extern int32 btcharcmp(); -extern int32 btchar16cmp(); -extern int32 bttextcmp(); - -/* - * RTree code. - * Defined in access/index-rtree/ - */ -extern char *rtinsert(); -extern char *rtdelete(); -extern char *rtgettuple(); -extern char *rtbeginscan(); -extern void rtendscan(); -extern void rtreebuild(); -extern void rtmarkpos(); -extern void rtrestrpos(); -extern void rtrescan(); -extern void rtbuild(); +extern int32 btint2cmp(int16 a, int16 b); +extern int32 btint4cmp(int32 a, int32 b); +extern int32 btint24cmp(int16 a, int32 b); +extern int32 btint42cmp(int32 a, int16 b); +extern int32 btfloat4cmp(float32 a, float32 b); +extern int32 btfloat8cmp(float64 a, float64 b); +extern int32 btoidcmp(Oid a, Oid b); +extern int32 btabstimecmp(AbsoluteTime a, AbsoluteTime b); +extern int32 btcharcmp(char a, char b); +extern int32 btchar2cmp(uint16 a, uint16 b); +extern int32 btchar4cmp(uint32 a, uint32 b); +extern int32 btchar8cmp(char *a, char *b); +extern int32 btchar16cmp(char *a, char *b); +extern int32 btnamecmp(NameData *a, NameData *b); +extern int32 bttextcmp(struct varlena *a, struct varlena *b); /* support routines for the rtree access method, by opclass */ -extern BOX *rt_box_union(); -extern BOX *rt_box_inter(); -extern float *rt_box_size(); -extern float *rt_bigbox_size(); -extern float *rt_poly_size(); -extern POLYGON *rt_poly_union(); -extern POLYGON *rt_poly_inter(); +extern BOX *rt_box_union(BOX *a,BOX *b); +extern BOX *rt_box_inter(BOX *a, BOX *b); +extern void rt_box_size(BOX *a, float *size); +extern void rt_bigbox_size(BOX *a,float *size); +extern void rt_poly_size(POLYGON *a, float *size); +extern POLYGON *rt_poly_union(POLYGON *a, POLYGON *b); +extern POLYGON *rt_poly_inter(POLYGON *a, POLYGON *b); /* projection utilities */ /* extern char *GetAttributeByName(); @@ -259,6 +249,7 @@ extern int32 intervalov(TimeInterval i1, TimeInterval i2); extern AbsoluteTime intervalstart(TimeInterval i); extern AbsoluteTime intervalend(TimeInterval i); extern int isreltime(char *timestring, int *sign, long *quantity, int *unitnr); +extern text *timeofday(void); /* dt.c */ extern int32 dtin(char *datetime); @@ -338,6 +329,8 @@ extern long float84ge(float64 arg1, float32 arg2); /* misc.c */ extern bool NullValue(Datum value, bool *isNull); extern bool NonNullValue(Datum value, bool *isNull); +extern bool oidrand(Oid o, int32 X); +extern bool oidsrand(int32 X); extern int32 userfntest(int i); /* not_in.c */ @@ -353,6 +346,8 @@ extern char *oidout(Oid o); extern int32 oideq(Oid arg1, Oid arg2); extern int32 oidne(Oid arg1, Oid arg2); extern int32 oid8eq(Oid arg1[], Oid arg2[]); +extern bool oideqint4(Oid arg1, int32 arg2); +extern bool int4eqoid(int32 arg1, Oid arg2); /* regexp.c */ extern bool char2regexeq(uint16 arg1, struct varlena *p); @@ -363,6 +358,8 @@ extern bool char8regexeq(char *s, struct varlena *p); extern bool char8regexne(char *s, struct varlena *p); extern bool char16regexeq(char *s, struct varlena *p); extern bool char16regexne(char *s, struct varlena *p); +extern bool nameregexeq(NameData *n, struct varlena *p); +extern bool nameregexne(NameData *s, struct varlena *p); extern bool textregexeq(struct varlena *s, struct varlena *p); extern bool textregexne(struct varlena *s, struct varlena *p); extern bool char2icregexeq(uint16 arg1, struct varlena *p); @@ -399,10 +396,33 @@ extern float64 hashsel(Oid operatorOid, Oid indrelid, AttrNumber attributeNumber extern float64 hashnpage(Oid operatorOid, Oid indrelid, AttrNumber attributeNumber, char *constValue, int32 constFlag, int32 nIndexKeys, Oid indexrelid); extern float64 rtsel(Oid operatorOid, Oid indrelid, AttrNumber attributeNumber, char *constValue, int32 constFlag, int32 nIndexKeys, Oid indexrelid); extern float64 rtnpage(Oid operatorOid, Oid indrelid, AttrNumber attributeNumber, char *constValue, int32 constFlag, int32 nIndexKeys, Oid indexrelid); +extern float64 gistsel(Oid operatorObjectId, Oid indrelid, AttrNumber attributeNumber, char *constValue, int32 constFlag, int32 nIndexKeys, Oid indexrelid); +extern float64 gistnpage(Oid operatorObjectId, Oid indrelid, AttrNumber attributeNumber, char *constValue, int32 constFlag, int32 nIndexKeys, Oid indexrelid); /* tid.c */ extern ItemPointer tidin(char *str); extern char *tidout(ItemPointer itemPtr); +/* varchar.c */ +extern char *bpcharin(char *s, int dummy, int typlen); +extern char *bpcharout(char *s); +extern char *varcharin(char *s, int dummy, int typlen); +extern char *varcharout(char *s); +extern int32 bpchareq(char *arg1, char *arg2); +extern int32 bpcharne(char *arg1, char *arg2); +extern int32 bpcharlt(char *arg1, char *arg2); +extern int32 bpcharle(char *arg1, char *arg2); +extern int32 bpchargt(char *arg1, char *arg2); +extern int32 bpcharge(char *arg1, char *arg2); +extern int32 bpcharcmp(char *arg1, char *arg2); +extern int32 varchareq(char *arg1, char *arg2); +extern int32 varcharne(char *arg1, char *arg2); +extern int32 varcharlt(char *arg1, char *arg2); +extern int32 varcharle(char *arg1, char *arg2); +extern int32 varchargt(char *arg1, char *arg2); +extern int32 varcharge(char *arg1, char *arg2); +extern int32 varcharcmp(char *arg1, char *arg2); +extern uint32 hashbpchar(struct varlena *key); +extern uint32 hashvarchar(struct varlena *key); /* varlena.c */ extern struct varlena *byteain(char *inputText); @@ -410,6 +430,8 @@ extern struct varlena *shove_bytes(unsigned char *stuff, int len); extern char *byteaout(struct varlena *vlena); extern struct varlena *textin(char *inputText); extern char *textout(struct varlena *vlena); +extern int textlen (text* t); +extern text *textcat(text* t1, text* t2); extern int32 texteq(struct varlena *arg1, struct varlena *arg2); extern int32 textne(struct varlena *arg1, struct varlena *arg2); extern int32 text_lt(struct varlena *arg1, struct varlena *arg2); @@ -422,6 +444,42 @@ extern int32 byteaGetBit(struct varlena *v, int32 n); extern struct varlena *byteaSetByte(struct varlena *v, int32 n, int32 newByte); extern struct varlena *byteaSetBit(struct varlena *v, int32 n, int32 newBit); +/* datetimes.c */ +extern int4 date_in(char *datestr); +extern char *date_out(int4 dateVal); +extern int date_eq(int4 dateVal1, int4 dateVal2); +extern int date_ne(int4 dateVal1, int4 dateVal2); +extern int date_lt(int4 dateVal1, int4 dateVal2); +extern int date_le(int4 dateVal1, int4 dateVal2); +extern int date_gt(int4 dateVal1, int4 dateVal2); +extern int date_ge(int4 dateVal1, int4 dateVal2); +extern int date_cmp(int4 dateVal1, int4 dateVal2); +extern char *time_in(char *timestr); +extern char *time_out(TimeADT *time); +extern int time_eq(TimeADT *time1, TimeADT *time2); +extern int time_ne(TimeADT *time1, TimeADT *time2); +extern int time_lt(TimeADT *time1, TimeADT *time2); +extern int time_le(TimeADT *time1, TimeADT *time2); +extern int time_gt(TimeADT *time1, TimeADT *time2); +extern int time_ge(TimeADT *time1, TimeADT *time2); +extern int time_cmp(TimeADT *time1, TimeADT *time2); +extern int32 int42reltime(int32 timevalue); + +/* like.c */ +extern bool char2like(uint16 arg1, struct varlena *p); +extern bool char2nlike(uint16 arg1, struct varlena *p); +extern bool char4like(uint32 arg1, struct varlena *p); +extern bool char4nlike(uint32 arg1, struct varlena *p); +extern bool char8like(char *s, struct varlena *p); +extern bool char8nlike(char *s, struct varlena *p); +extern bool char16like(char *s, struct varlena *p); +extern bool char16nlike(char *s, struct varlena *p); +extern bool namelike(NameData *n, struct varlena *p); +extern bool namenlike(NameData *s, struct varlena *p); +extern bool textlike(struct varlena *s, struct varlena *p); +extern bool textnlike(struct varlena *s, struct varlena *p); +extern int like(char *text, char *p); + /* acl.c */ #endif /* BUILTINS_H */ diff --git a/src/include/utils/datetime.h b/src/include/utils/datetime.h new file mode 100644 index 0000000000..d780bc60a1 --- /dev/null +++ b/src/include/utils/datetime.h @@ -0,0 +1,30 @@ +/*------------------------------------------------------------------------- + * + * datetime.h-- + * Definitions for the datetime + * + * + * Copyright (c) 1994, Regents of the University of California + * + * $Id: datetime.h,v 1.1 1996/11/10 03:06:21 momjian Exp $ + * + *------------------------------------------------------------------------- + */ +#ifndef DATETIME_H +#define DATETIME_H + +/* these things look like structs, but we pass them by value so be careful + For example, passing an int -> DateADT is not portable! */ +typedef struct DateADT { + char day; + char month; + short year; +} DateADT; + +typedef struct TimeADT { + short hr; + short min; + float sec; +} TimeADT; + +#endif /* DATETIME_H */ diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h index 8968a65dec..3673b2bd27 100644 --- a/src/include/utils/elog.h +++ b/src/include/utils/elog.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: elog.h,v 1.2 1996/11/06 10:15:25 scrappy Exp $ + * $Id: elog.h,v 1.3 1996/11/10 03:06:24 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -35,7 +35,7 @@ extern void elog(int lev, const char *fmt, ...); #ifndef PG_STANDALONE -int DebugFileOpen(); +int DebugFileOpen(void); #endif #endif /* ELOG_H */ diff --git a/src/include/utils/exc.h b/src/include/utils/exc.h index 570b30aad9..f263118c4b 100644 --- a/src/include/utils/exc.h +++ b/src/include/utils/exc.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: exc.h,v 1.3 1996/11/04 04:00:47 momjian Exp $ + * $Id: exc.h,v 1.4 1996/11/10 03:06:26 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -79,7 +79,7 @@ typedef void ExcProc(Exception*, ExcDetail, ExcData, ExcMessage); extern void EnableExceptionHandling(bool on); extern void ExcPrint(Exception *excP, ExcDetail detail, ExcData data, ExcMessage message); -extern ExcProc *ExcGetUnCaught(); +extern ExcProc *ExcGetUnCaught(void); extern ExcProc *ExcSetUnCaught(ExcProc *newP); extern void ExcUnCaught(Exception *excP, ExcDetail detail, ExcData data, ExcMessage message); diff --git a/src/include/utils/fmgrtab.h b/src/include/utils/fmgrtab.h index ed46c527cd..eac11a7680 100644 --- a/src/include/utils/fmgrtab.h +++ b/src/include/utils/fmgrtab.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: fmgrtab.h,v 1.3 1996/11/04 11:51:17 scrappy Exp $ + * $Id: fmgrtab.h,v 1.4 1996/11/10 03:06:27 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -23,5 +23,6 @@ typedef struct { extern FmgrCall *fmgr_isbuiltin(Oid id); extern func_ptr fmgr_lookupByName(char* name); +extern void load_file(char *filename); #endif /* FMGRTAB_H */ diff --git a/src/include/utils/geo-decls.h b/src/include/utils/geo-decls.h index c5be8b93ca..fe387fc52d 100644 --- a/src/include/utils/geo-decls.h +++ b/src/include/utils/geo-decls.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: geo-decls.h,v 1.3 1996/11/04 07:46:04 scrappy Exp $ + * $Id: geo-decls.h,v 1.4 1996/11/10 03:06:32 momjian Exp $ * * NOTE * These routines do *not* use the float types from adt/. @@ -18,6 +18,8 @@ #ifndef GEO_DECLS_H #define GEO_DECLS_H +#include "access/attnum.h" + /*#ifndef FmgrIncluded -- seems like always included. (it's FMgrIncluded) AY */ /*-------------------------------------------------------------------- @@ -234,13 +236,17 @@ extern long poly_contain(POLYGON *polya, POLYGON *polyb); extern long poly_contained(POLYGON *polya, POLYGON *polyb); /* geo-selfuncs.c */ -#if 0 /* FIX ME! */ -extern float64 areasel(Oid opid, Oid relid, AttrNumber attno, char *value, int32 flag); -extern float64 areajoinsel(Oid opid, Oid relid, AttrNumber attno, char *value, int32 flag); -extern float64 leftsel(Oid opid, Oid relid, AttrNumber attno, char *value, int32 flag); -extern float64 leftjoinsel(Oid opid, Oid relid, AttrNumber attno, char *value, int32 flag); -extern float64 contsel(Oid opid, Oid relid, AttrNumber attno, char *value, int32 flag); -extern float64 contjoinsel(Oid opid, Oid relid, AttrNumber attno, char *value, int32 flag); -#endif +extern float64 areasel(Oid opid, Oid relid, AttrNumber attno, + char *value, int32 flag); +extern float64 areajoinsel(Oid opid, Oid relid, AttrNumber attno, + char *value, int32 flag); +extern float64 leftsel(Oid opid, Oid relid, AttrNumber attno, + char *value, int32 flag); +extern float64 leftjoinsel(Oid opid, Oid relid, AttrNumber attno, + char *value, int32 flag); +extern float64 contsel(Oid opid, Oid relid, AttrNumber attno, + char *value, int32 flag); +extern float64 contjoinsel(Oid opid, Oid relid, AttrNumber attno, + char *value, int32 flag); #endif /* GEO_DECLS_H */ diff --git a/src/include/utils/relcache.h b/src/include/utils/relcache.h index 0389578f04..9b354c7c9e 100644 --- a/src/include/utils/relcache.h +++ b/src/include/utils/relcache.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: relcache.h,v 1.3 1996/11/04 11:51:26 scrappy Exp $ + * $Id: relcache.h,v 1.4 1996/11/10 03:06:33 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -36,9 +36,9 @@ extern void RelationCacheInvalidate(bool onlyFlushReferenceCountZero); extern void RelationRegisterRelation(Relation relation); extern void RelationPurgeLocalRelation(bool xactComitted); -extern void RelationInitialize(); -extern void init_irels(); -extern void write_irels(); +extern void RelationInitialize(void); +extern void init_irels(void); +extern void write_irels(void); #endif /* RELCACHE_H */ diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 05bc0a5df3..8e733d5956 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.16 1996/11/10 01:46:14 bryanh Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.17 1996/11/10 03:06:36 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -55,7 +56,7 @@ static void freePGconn(PGconn *conn); static void closePGconn(PGconn *conn); static int conninfo_parse(const char *conninfo, char *errorMessage); static char *conninfo_getval(char *keyword); -static void conninfo_free(); +static void conninfo_free(void); #define NOTIFYLIST_INITIAL_SIZE 10 #define NOTIFYLIST_GROWBY 10 @@ -236,7 +237,7 @@ PQconnectdb(const char *conninfo) * ---------------- */ PQconninfoOption* -PQconndefaults() +PQconndefaults(void) { char errorMessage[ERROR_MSG_LENGTH]; diff --git a/src/interfaces/libpq/libpq-fe.h b/src/interfaces/libpq/libpq-fe.h index bbf8021c59..193497ea7d 100644 --- a/src/interfaces/libpq/libpq-fe.h +++ b/src/interfaces/libpq/libpq-fe.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: libpq-fe.h,v 1.10 1996/11/09 10:39:54 scrappy Exp $ + * $Id: libpq-fe.h,v 1.11 1996/11/10 03:06:38 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -170,7 +170,7 @@ typedef struct _PQconninfoOption PQconninfoOption; /* === in fe-connect.c === */ /* make a new client connection to the backend */ extern PGconn* PQconnectdb(const char* conninfo); -extern PQconninfoOption *PQconndefaults(); +extern PQconninfoOption *PQconndefaults(void); extern PGconn* PQsetdb(const char* pghost, const char* pgport, const char* pgoptions, const char* pgtty, const char* dbName); /* close the current connection and free the PGconn data structure */ -- 2.40.0