diff options
Diffstat (limited to 'src/include')
33 files changed, 347 insertions, 115 deletions
diff --git a/src/include/access/gist.h b/src/include/access/gist.h index cfafacbc507..f30432979c2 100644 --- a/src/include/access/gist.h +++ b/src/include/access/gist.h @@ -12,6 +12,10 @@ #ifndef GIST_H #define GIST_H +#include <access/funcindex.h> +#include <access/itup.h> +#include <access/relscan.h> +#include <access/sdir.h> #include <storage/page.h> #include <storage/block.h> #include <utils/rel.h> @@ -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 0a4fe7f5546..9894e71b01b 100644 --- a/src/include/access/gistscan.h +++ b/src/include/access/gistscan.h @@ -11,10 +11,17 @@ */ #ifndef GISTSCAN_H +#include <access/relscan.h> #include <storage/off.h> #include <storage/block.h> #include <utils/rel.h> -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 d189f685b6c..7bf35ad768c 100644 --- a/src/include/access/giststrat.h +++ b/src/include/access/giststrat.h @@ -15,11 +15,9 @@ #include <access/strat.h> #include <utils/rel.h> -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 e408abd2635..34e2f64d9bb 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 a1780dc49a5..bcc974f18ee 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 <access/htup.h> #include <access/relscan.h> +#include <storage/block.h> +#include <utils/rel.h> /* ---------------------------------------------------------------- * 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 a421a79f8a6..4474790245b 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 <access/funcindex.h> +#include <access/itup.h> +#include <access/relscan.h> +#include <access/sdir.h> #include <access/skey.h> +#include <access/strat.h> #include <storage/block.h> #include <storage/off.h> @@ -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 f95cc68f075..154e18ee93c 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 fd2077d5eb5..fa0f35b7def 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 058fc44cc4a..2259c5e0839 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 2ae8c15f76f..7221da3344c 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 1469ff542f3..8ec81547f7f 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 d88cdae8526..5199165e355 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 4cc56c98744..8e18470f878 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 90bb582fbd4..aed1595b707 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 00000000000..c9123fdcf3e --- /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 bdc7f5a4dbf..79e18ff61b7 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 95de9f0f395..11cfa97019d 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 a4750ae2aa6..539ed200754 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 f0920b04d2b..af7a57d0d9a 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 72200cff481..c2563509bef 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 efc1ce2e1ac..87f8e00ba6e 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 02ba5627d82..057e91be6f5 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 bfe2974656e..47cbd225cbb 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 0e806a0b7bd..7aec9aa0390 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 cb07eec63d3..a64388c985b 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 e6e37af4cdb..97895015041 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 cabfa017739..39739fb6ebc 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 <storage/itemptr.h> #include <utils/geo-decls.h> +#include <utils/datetime.h> #include <utils/nabstime.h> #include <utils/rel.h> @@ -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 00000000000..d780bc60a1e --- /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 8968a65dec6..3673b2bd27f 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 570b30aad92..f263118c4b5 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 ed46c527cd9..eac11a76802 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 c5be8b93ca0..fe387fc52d8 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 0389578f04d..9b354c7c9e6 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 */ |