mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
Make functions static where possible, enclose unused functions in #ifdef NOT_USED.
This commit is contained in:
22
src/backend/utils/cache/catcache.c
vendored
22
src/backend/utils/cache/catcache.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.6 1996/12/04 03:06:09 bryanh Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.7 1997/08/19 21:34:58 momjian Exp $
|
||||
*
|
||||
* Notes:
|
||||
* XXX This needs to use exception.h to handle recovery when
|
||||
@ -34,6 +34,14 @@
|
||||
#include "catalog/pg_type.h" /* for OID of int28 type */
|
||||
#include "lib/dllist.h"
|
||||
|
||||
static void CatCacheRemoveCTup(CatCache *cache, Dlelem *e);
|
||||
static Index CatalogCacheComputeHashIndex(struct catcache *cacheInP);
|
||||
static Index CatalogCacheComputeTupleHashIndex(struct catcache *cacheInOutP,
|
||||
Relation relation, HeapTuple tuple);
|
||||
static void CatalogCacheInitializeCache(struct catcache *cache,
|
||||
Relation relation);
|
||||
static long comphash(long l, char *v);
|
||||
|
||||
/* ----------------
|
||||
* variables, macros and other stuff
|
||||
*
|
||||
@ -106,7 +114,7 @@ static long eqproc[] = {
|
||||
#define CatalogCacheInitializeCache_DEBUG2
|
||||
#endif
|
||||
|
||||
void
|
||||
static void
|
||||
CatalogCacheInitializeCache(struct catcache *cache,
|
||||
Relation relation)
|
||||
{
|
||||
@ -249,12 +257,14 @@ CatalogCacheInitializeCache(struct catcache *cache,
|
||||
* XXX temporary function
|
||||
* --------------------------------
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
void
|
||||
CatalogCacheSetId(CatCache *cacheInOutP, int id)
|
||||
{
|
||||
Assert(id == InvalidCatalogCacheId || id >= 0);
|
||||
cacheInOutP->id = id;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ----------------
|
||||
* comphash --
|
||||
@ -266,7 +276,7 @@ CatalogCacheSetId(CatCache *cacheInOutP, int id)
|
||||
* v is the attribute value ("Datum")
|
||||
* ----------------
|
||||
*/
|
||||
long
|
||||
static long
|
||||
comphash(long l, register char *v)
|
||||
{
|
||||
long i;
|
||||
@ -305,7 +315,7 @@ comphash(long l, register char *v)
|
||||
* CatalogCacheComputeHashIndex
|
||||
* --------------------------------
|
||||
*/
|
||||
Index
|
||||
static Index
|
||||
CatalogCacheComputeHashIndex(struct catcache *cacheInP)
|
||||
{
|
||||
Index hashIndex;
|
||||
@ -346,7 +356,7 @@ CatalogCacheComputeHashIndex(struct catcache *cacheInP)
|
||||
* CatalogCacheComputeTupleHashIndex
|
||||
* --------------------------------
|
||||
*/
|
||||
Index
|
||||
static Index
|
||||
CatalogCacheComputeTupleHashIndex(struct catcache *cacheInOutP,
|
||||
Relation relation,
|
||||
HeapTuple tuple)
|
||||
@ -410,7 +420,7 @@ CatalogCacheComputeTupleHashIndex(struct catcache *cacheInOutP,
|
||||
* CatCacheRemoveCTup
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
CatCacheRemoveCTup(CatCache *cache, Dlelem *elt)
|
||||
{
|
||||
CatCTup *ct;
|
||||
|
17
src/backend/utils/cache/inval.c
vendored
17
src/backend/utils/cache/inval.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.3 1996/11/08 05:59:55 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.4 1997/08/19 21:35:06 momjian Exp $
|
||||
*
|
||||
* Note - this code is real crufty...
|
||||
*
|
||||
@ -31,6 +31,13 @@
|
||||
#include "catalog/catname.h" /* XXX to support hacks below */
|
||||
#include "utils/syscache.h" /* XXX to support the hacks below */
|
||||
|
||||
static InvalidationEntry InvalidationEntryAllocate(uint16 size);
|
||||
static void LocalInvalidInvalidate(LocalInvalid invalid, void (*function)());
|
||||
static LocalInvalid LocalInvalidRegister(LocalInvalid invalid,
|
||||
InvalidationEntry entry);
|
||||
static void getmyrelids(void);
|
||||
|
||||
|
||||
/* ----------------
|
||||
* private invalidation structures
|
||||
* ----------------
|
||||
@ -83,7 +90,7 @@ Oid MyAMOPRelationId = InvalidOid;
|
||||
* Allocates an invalidation entry.
|
||||
* --------------------------------
|
||||
*/
|
||||
InvalidationEntry
|
||||
static InvalidationEntry
|
||||
InvalidationEntryAllocate(uint16 size)
|
||||
{
|
||||
InvalidationEntryData *entryDataP;
|
||||
@ -98,7 +105,7 @@ InvalidationEntryAllocate(uint16 size)
|
||||
* Returns a new local cache invalidation state containing a new entry.
|
||||
* --------------------------------
|
||||
*/
|
||||
LocalInvalid
|
||||
static LocalInvalid
|
||||
LocalInvalidRegister(LocalInvalid invalid,
|
||||
InvalidationEntry entry)
|
||||
{
|
||||
@ -116,7 +123,7 @@ LocalInvalidRegister(LocalInvalid invalid,
|
||||
* invalidation state.
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
LocalInvalidInvalidate(LocalInvalid invalid, void (*function)())
|
||||
{
|
||||
InvalidationEntryData *entryDataP;
|
||||
@ -230,7 +237,7 @@ RelationIdRegisterLocalInvalid(Oid relationId, Oid objectId)
|
||||
* getmyrelids
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
getmyrelids()
|
||||
{
|
||||
HeapTuple tuple;
|
||||
|
7
src/backend/utils/cache/lsyscache.c
vendored
7
src/backend/utils/cache/lsyscache.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.2 1996/10/31 05:55:32 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.3 1997/08/19 21:35:11 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Eventually, the index information should go through here, too.
|
||||
@ -434,6 +434,7 @@ get_typbyval(Oid typid)
|
||||
* not. Returns 1 if by value, 0 if by reference.
|
||||
*
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
char
|
||||
get_typalign(Oid typid)
|
||||
{
|
||||
@ -446,6 +447,7 @@ get_typalign(Oid typid)
|
||||
else
|
||||
return ('i');
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* get_typdefault -
|
||||
@ -469,6 +471,7 @@ get_typdefault(Oid typid)
|
||||
* It returns the null char if the cache lookup fails...
|
||||
*
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
char
|
||||
get_typtype(Oid typid)
|
||||
{
|
||||
@ -482,4 +485,4 @@ get_typtype(Oid typid)
|
||||
return('\0');
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
18
src/backend/utils/cache/relcache.c
vendored
18
src/backend/utils/cache/relcache.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.14 1997/08/19 04:44:21 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.15 1997/08/19 21:35:13 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -85,6 +85,12 @@
|
||||
#include "catalog/index.h"
|
||||
#include "fmgr.h"
|
||||
|
||||
static void RelationFlushRelation(Relation *relationPtr,
|
||||
bool onlyFlushReferenceCountZero);
|
||||
static Relation RelationNameCacheGetRelation(char *relationName);
|
||||
static void init_irels(void);
|
||||
static void write_irels(void);
|
||||
|
||||
/* ----------------
|
||||
* defines
|
||||
* ----------------
|
||||
@ -1075,7 +1081,7 @@ RelationIdCacheGetRelation(Oid relationId)
|
||||
* RelationNameCacheGetRelation
|
||||
* --------------------------------
|
||||
*/
|
||||
Relation
|
||||
static Relation
|
||||
RelationNameCacheGetRelation(char *relationName)
|
||||
{
|
||||
Relation rd;
|
||||
@ -1185,6 +1191,7 @@ RelationNameGetRelation(char *relationName)
|
||||
* old "getreldesc" interface.
|
||||
* ----------------
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
Relation
|
||||
getreldesc(char *relationName)
|
||||
{
|
||||
@ -1197,6 +1204,7 @@ getreldesc(char *relationName)
|
||||
|
||||
return RelationNameGetRelation(relationName);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* cache invalidation support routines
|
||||
@ -1221,7 +1229,7 @@ RelationClose(Relation relation)
|
||||
* anything anymore.
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
RelationFlushRelation(Relation *relationPtr,
|
||||
bool onlyFlushReferenceCountZero)
|
||||
{
|
||||
@ -1606,7 +1614,7 @@ RelationInitialize(void)
|
||||
/* pg_attnumind, pg_classnameind, pg_classoidind */
|
||||
#define Num_indices_bootstrap 3
|
||||
|
||||
void
|
||||
static void
|
||||
init_irels(void)
|
||||
{
|
||||
Size len;
|
||||
@ -1746,7 +1754,7 @@ init_irels(void)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
write_irels(void)
|
||||
{
|
||||
int len;
|
||||
|
Reference in New Issue
Block a user