diff options
| author | Bruce Momjian <bruce@momjian.us> | 1996-11-10 03:06:38 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 1996-11-10 03:06:38 +0000 |
| commit | aaeef4d17db9ded501fa02c9ca6c00f86258b171 (patch) | |
| tree | 7f27c0c7519886eda3b9ddd6fe1eb4a9d628dacb /src/include/access | |
| parent | bf5cbbf7895aa16b2e18dbe29462a4fd8baf4293 (diff) | |
| download | postgresql-aaeef4d17db9ded501fa02c9ca6c00f86258b171.tar.gz | |
All external function definitions now have prototypes that are checked.
Diffstat (limited to 'src/include/access')
| -rw-r--r-- | src/include/access/gist.h | 47 | ||||
| -rw-r--r-- | src/include/access/gistscan.h | 9 | ||||
| -rw-r--r-- | src/include/access/giststrat.h | 10 | ||||
| -rw-r--r-- | src/include/access/hash.h | 3 | ||||
| -rw-r--r-- | src/include/access/heapam.h | 10 | ||||
| -rw-r--r-- | src/include/access/rtree.h | 42 | ||||
| -rw-r--r-- | src/include/access/transam.h | 6 | ||||
| -rw-r--r-- | src/include/access/xact.h | 11 |
8 files changed, 121 insertions, 17 deletions
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 <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 0a4fe7f554..9894e71b01 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 d189f685b6..7bf35ad768 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 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 <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 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 <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 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, |
