1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-24 01:29:19 +03:00

Make functions static where possible, enclose unused functions in #ifdef NOT_USED.

This commit is contained in:
Bruce Momjian
1997-08-19 21:40:56 +00:00
parent b992e200b8
commit 1d8bbfd2e7
186 changed files with 1114 additions and 1048 deletions

View File

@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: genam.h,v 1.6 1997/01/10 09:36:29 vadim Exp $
* $Id: genam.h,v 1.7 1997/08/19 21:37:13 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -34,8 +34,6 @@ extern IndexScanDesc index_beginscan(Relation relation, bool scanFromEnd,
uint16 numberOfKeys, ScanKey key);
extern void index_rescan(IndexScanDesc scan, bool scanFromEnd, ScanKey key);
extern void index_endscan(IndexScanDesc scan);
extern void index_markpos(IndexScanDesc scan);
extern void index_restrpos(IndexScanDesc scan);
extern RetrieveIndexResult index_getnext(IndexScanDesc scan,
ScanDirection direction);
extern RegProcedure index_getprocid(Relation irel, AttrNumber attnum,
@@ -47,9 +45,6 @@ extern Datum GetIndexValue(HeapTuple tuple, TupleDesc hTupDesc,
/* in genam.c */
extern IndexScanDesc RelationGetIndexScan(Relation relation, bool scanFromEnd,
uint16 numberOfKeys, ScanKey key);
extern void IndexScanRestart(IndexScanDesc scan, bool scanFromEnd,
ScanKey key);
extern void IndexScanEnd(IndexScanDesc scan);
extern void IndexScanMarkPosition(IndexScanDesc scan);
extern void IndexScanRestorePosition(IndexScanDesc scan);

View File

@@ -183,24 +183,13 @@ extern void gistbuild(Relation heap,
extern InsertIndexResult gistinsert(Relation r, Datum *datum,
char *nulls,ItemPointer ht_ctid, Relation heapRel);
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,
Relation r, Page pg, OffsetNumber o, int b, bool l) ;
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 */

View File

@@ -17,7 +17,5 @@
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 */

View File

@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: hash.h,v 1.6 1997/01/10 09:36:32 vadim Exp $
* $Id: hash.h,v 1.7 1997/08/19 21:37:27 momjian Exp $
*
* NOTES
* modeled after Margo Seltzer's hash implementation for unix.
@@ -322,13 +322,6 @@ extern bool _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir,
Buffer metabuf);
/* hashstrat.c */
extern StrategyNumber _hash_getstrat(Relation rel, AttrNumber attno,
RegProcedure proc);
extern bool _hash_invokestrat(Relation rel, AttrNumber attno,
StrategyNumber strat, Datum left, Datum right);
/* hashutil.c */
extern ScanKey _hash_mkscankey(Relation rel, IndexTuple itup,
HashMetaPage metap);

View File

@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: heapam.h,v 1.6 1996/11/10 03:04:37 momjian Exp $
* $Id: heapam.h,v 1.7 1997/08/19 21:37:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -88,7 +88,6 @@ extern HeapAccessStatistics heap_access_stats; /* in stats.c */
/* heapam.c */
extern void doinsert(Relation relation, HeapTuple tup);
extern void SetHeapAccessMethodImmediateInvalidation(bool on);
extern Relation heap_open(Oid relationId);
extern Relation heap_openr(char *relationName);
@@ -115,14 +114,11 @@ extern void DataFill(char *data, TupleDesc tupleDesc,
extern int heap_attisnull(HeapTuple tup, int attnum);
extern int heap_sysattrlen(AttrNumber attno);
extern bool heap_sysattrbyval(AttrNumber attno);
extern char *heap_getsysattr(HeapTuple tup, Buffer b, int attnum);
extern char *fastgetattr(HeapTuple tup, int attnum,
TupleDesc att, bool *isnull);
extern char *heap_getattr(HeapTuple tup, Buffer b, int attnum,
TupleDesc att, bool *isnull);
extern HeapTuple heap_copytuple(HeapTuple tuple);
extern void heap_deformtuple(HeapTuple tuple, TupleDesc tdesc,
Datum values[], char nulls[]);
extern HeapTuple heap_formtuple(TupleDesc tupleDescriptor,
Datum value[], char nulls[]);
extern HeapTuple heap_modifytuple(HeapTuple tuple, Buffer buffer,
@@ -130,11 +126,7 @@ extern HeapTuple heap_modifytuple(HeapTuple tuple, Buffer buffer,
HeapTuple heap_addheader(uint32 natts, int structlen, char *structure);
/* in common/heap/stats.c */
extern void InitHeapAccessStatistics(void);
extern void ResetHeapAccessStatistics(void);
extern HeapAccessStatistics GetHeapAccessStatistics(void);
extern void PrintHeapAccessStatistics(HeapAccessStatistics stats);
extern void PrintAndFreeHeapAccessStatistics(HeapAccessStatistics stats);
extern void initam(void);
/* hio.c */

View File

@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: istrat.h,v 1.4 1996/11/05 10:37:04 scrappy Exp $
* $Id: istrat.h,v 1.5 1997/08/19 21:37:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -47,21 +47,12 @@
*/
#define IndexStrategyIsValid(s) PointerIsValid(s)
extern ScanKey StrategyMapGetScanKeyEntry(StrategyMap map,
StrategyNumber strategyNumber);
extern StrategyMap IndexStrategyGetStrategyMap(IndexStrategy indexStrategy,
StrategyNumber maxStrategyNum, AttrNumber attrNum);
extern Size
AttributeNumberGetIndexStrategySize(AttrNumber maxAttributeNumber,
StrategyNumber maxStrategyNumber);
extern bool StrategyOperatorIsValid(StrategyOperator operator,
StrategyNumber maxStrategy);
extern bool StrategyTermIsValid(StrategyTerm term,
StrategyNumber maxStrategy);
extern bool StrategyExpressionIsValid(StrategyExpression expression,
StrategyNumber maxStrategy);
extern bool StrategyEvaluationIsValid(StrategyEvaluation evaluation);
extern StrategyNumber RelationGetStrategy(Relation relation,
AttrNumber attributeNumber, StrategyEvaluation evaluation,
RegProcedure procedure);

View File

@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: itup.h,v 1.4 1996/11/05 07:20:09 scrappy Exp $
* $Id: itup.h,v 1.5 1997/08/19 21:37:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -88,8 +88,6 @@ typedef struct PredInfo {
/* indextuple.h */
extern IndexTuple index_formtuple(TupleDesc tupleDescriptor,
Datum value[], char null[]);
extern char *fastgetiattr(IndexTuple tup, int attnum,
TupleDesc att, bool *isnull);
extern Datum index_getattr(IndexTuple tuple, AttrNumber attNum,
TupleDesc tupDesc, bool *isNullOutP);
extern RetrieveIndexResult

View File

@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: nbtree.h,v 1.13 1997/05/30 18:40:02 vadim Exp $
* $Id: nbtree.h,v 1.14 1997/08/19 21:37:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -219,7 +219,6 @@ extern bool _bt_itemcmp(Relation rel, Size keysz, BTItem item1, BTItem item2,
* prototypes for functions in nbtpage.c
*/
extern void _bt_metapinit(Relation rel);
extern void _bt_checkmeta(Relation rel);
extern Buffer _bt_getroot(Relation rel, int access);
extern Buffer _bt_getbuf(Relation rel, BlockNumber blkno, int access);
extern void _bt_relbuf(Relation rel, Buffer buf, int access);
@@ -228,8 +227,6 @@ extern void _bt_wrtnorelbuf(Relation rel, Buffer buf);
extern void _bt_pageinit(Page page, Size size);
extern void _bt_metaproot(Relation rel, BlockNumber rootbknum, int level);
extern Buffer _bt_getstackbuf(Relation rel, BTStack stack, int access);
extern void _bt_setpagelock(Relation rel, BlockNumber blkno, int access);
extern void _bt_unsetpagelock(Relation rel, BlockNumber blkno, int access);
extern void _bt_pagedel(Relation rel, ItemPointer tid);
/*
@@ -274,7 +271,6 @@ extern OffsetNumber _bt_binsrch(Relation rel, Buffer buf, int keysz,
extern RetrieveIndexResult _bt_next(IndexScanDesc scan, ScanDirection dir);
extern RetrieveIndexResult _bt_first(IndexScanDesc scan, ScanDirection dir);
extern bool _bt_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir);
extern int _bt_compare(Relation rel, TupleDesc itupdesc, Page page, int keysz, ScanKey scankey, OffsetNumber offnum);
/*
* prototypes for functions in nbtstrat.c
@@ -291,8 +287,6 @@ extern ScanKey _bt_mkscankey(Relation rel, IndexTuple itup);
extern void _bt_freeskey(ScanKey skey);
extern void _bt_freestack(BTStack stack);
extern void _bt_orderkeys(Relation relation, BTScanOpaque so);
extern bool _bt_checkqual(IndexScanDesc scan, IndexTuple itup);
extern bool _bt_checkforkeys(IndexScanDesc scan, IndexTuple itup, Size keysz);
extern bool _bt_checkkeys (IndexScanDesc scan, IndexTuple tuple, Size *keysok);
extern BTItem _bt_formitem(IndexTuple itup);
@@ -300,13 +294,8 @@ extern BTItem _bt_formitem(IndexTuple itup);
* prototypes for functions in nbtsort.c
*/
extern void *_bt_spoolinit(Relation index, int ntapes, bool isunique);
extern void *_bt_pagestate(Relation index, int flags, int level, bool doupper);
extern BTItem _bt_minitem(Page opage, BlockNumber oblkno, int atend);
extern BTItem _bt_buildadd(Relation index, void *pstate, BTItem bti, int flags);
extern void _bt_uppershutdown(Relation index, BTPageState *state);
extern void _bt_spooldestroy(void *spool);
extern void _bt_spool(Relation index, BTItem btitem, void *spool);
extern void _bt_upperbuild(Relation index);
extern void _bt_leafbuild(Relation index, void *spool);
#endif /* NBTREE_H */

View File

@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: rtree.h,v 1.5 1997/01/10 09:36:34 vadim Exp $
* $Id: rtree.h,v 1.6 1997/08/19 21:37:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -132,10 +132,6 @@ extern void _rtdump(Relation r);
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);

View File

@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: transam.h,v 1.6 1996/11/27 07:30:28 vadim Exp $
* $Id: transam.h,v 1.7 1997/08/19 21:37:38 momjian Exp $
*
* NOTES
* Transaction System Version 101 now support proper oid
@@ -140,34 +140,17 @@ typedef VariableRelationContentsData *VariableRelationContents;
/*
* prototypes for functions in transam/transam.c
*/
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(void);
extern bool TransactionIdDidCommit(TransactionId transactionId);
extern bool TransactionIdDidAbort(TransactionId transactionId);
extern void TransactionIdCommit(TransactionId transactionId);
extern void TransactionIdAbort(TransactionId transactionId);
extern void TransactionIdSetInProgress(TransactionId transactionId);
/* in transam/transsup.c */
extern void AmiTransactionOverride(bool flag);
extern void TransComputeBlockNumber(Relation relation,
TransactionId transactionId, BlockNumber *blockNumberOutP);
extern XidStatus TransBlockGetLastTransactionIdStatus(Block tblock,
TransactionId baseXid, TransactionId *returnXidP);
extern XidStatus TransBlockGetXidStatus(Block tblock,
TransactionId transactionId);
extern void TransBlockSetXidStatus(Block tblock,
TransactionId transactionId, XidStatus xstatus);
extern AbsoluteTime TransBlockGetCommitTime(Block tblock,
TransactionId transactionId);
extern void TransBlockSetCommitTime(Block tblock,
TransactionId transactionId, AbsoluteTime commitTime);
extern XidStatus TransBlockNumberGetXidStatus(Relation relation,
BlockNumber blockNumber, TransactionId xid, bool *failP);
extern void TransBlockNumberSetXidStatus(Relation relation,
@@ -178,19 +161,11 @@ extern AbsoluteTime TransBlockNumberGetCommitTime(Relation relation,
extern void TransBlockNumberSetCommitTime(Relation relation,
BlockNumber blockNumber, TransactionId xid, AbsoluteTime xtime,
bool *failP);
extern void TransGetLastRecordedTransaction(Relation relation,
TransactionId xid, bool *failP);
/* in transam/varsup.c */
extern void VariableRelationGetNextXid(TransactionId *xidP);
extern void VariableRelationGetLastXid(TransactionId *xidP);
extern void VariableRelationPutNextXid(TransactionId xid);
extern void VariableRelationPutLastXid(TransactionId xid);
extern void VariableRelationGetNextOid(Oid *oid_return);
extern void VariableRelationPutNextOid(Oid *oidP);
extern void GetNewTransactionId(TransactionId *xid);
extern void UpdateLastCommittedXid(TransactionId xid);
extern void GetNewObjectIdBlock(Oid *oid_return, int oid_block_size);
extern void GetNewObjectId(Oid *oid_return);
extern void CheckMaxObjectId(Oid assigned_oid);

View File

@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: xact.h,v 1.4 1996/11/10 03:04:42 momjian Exp $
* $Id: xact.h,v 1.5 1997/08/19 21:37:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -66,30 +66,14 @@ extern CommandId GetCurrentCommandId(void);
extern AbsoluteTime GetCurrentTransactionStartTime(void);
extern bool TransactionIdIsCurrentTransactionId(TransactionId xid);
extern bool CommandIdIsCurrentCommandId(CommandId cid);
extern void ClearCommandIdCounterOverflowFlag(void);
extern void CommandCounterIncrement(void);
extern void InitializeTransactionSystem(void);
extern void AtStart_Cache(void);
extern void AtStart_Locks(void);
extern void AtStart_Memory(void);
extern void RecordTransactionCommit(void);
extern void AtCommit_Cache(void);
extern void AtCommit_Locks(void);
extern void AtCommit_Memory(void);
extern void RecordTransactionAbort(void);
extern void AtAbort_Cache(void);
extern void AtAbort_Locks(void);
extern void AtAbort_Memory(void);
extern void StartTransaction(void);
extern bool CurrentXactInProgress(void);
extern void CommitTransaction(void);
extern void AbortTransaction(void);
extern void StartTransactionCommand(void);
extern void CommitTransactionCommand(void);
extern void AbortCurrentTransaction(void);
extern void BeginTransactionBlock(void);
extern void EndTransactionBlock(void);
extern void AbortTransactionBlock(void);
extern bool IsTransactionBlock(void);
extern void UserAbortTransactionBlock(void);
@@ -105,7 +89,6 @@ extern void TransactionIdStore(TransactionId transactionId,
TransactionId *destination);
extern bool TransactionIdEquals(TransactionId id1, TransactionId id2);
extern bool TransactionIdIsLessThan(TransactionId id1, TransactionId id2);
extern void TransactionIdIncrement(TransactionId *transactionId);
extern void TransactionIdAdd(TransactionId *xid, int value);
#endif /* XACT_H */