mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Make functions static where possible, enclose unused functions in #ifdef NOT_USED.
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/version.c,v 1.4 1997/08/12 20:15:13 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/version.c,v 1.5 1997/08/19 21:30:47 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* At the point the version is defined, 2 physical relations are created
|
||||
@ -35,9 +35,9 @@
|
||||
#define MAX_QUERY_LEN 1024
|
||||
|
||||
char rule_buf[MAX_QUERY_LEN];
|
||||
#ifdef NOT_USED
|
||||
static char attr_list[MAX_QUERY_LEN];
|
||||
|
||||
static void setAttrList(char *bname);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* problem: the version system assumes that the rules it declares will
|
||||
@ -82,6 +82,7 @@ static void setAttrList(char *bname);
|
||||
* DO NOT COMMIT THE XACT, just increase the Cid counter!
|
||||
* _sp.
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
static void
|
||||
eval_as_new_xact(char *query)
|
||||
{
|
||||
@ -92,10 +93,11 @@ eval_as_new_xact(char *query)
|
||||
CommandCounterIncrement();
|
||||
pg_eval(query, (char **) NULL, (Oid *) NULL, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Define a version.
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
void
|
||||
DefineVersion(char *name, char *fromRelname, char *date)
|
||||
{
|
||||
@ -130,11 +132,12 @@ DefineVersion(char *name, char *fromRelname, char *date)
|
||||
VersionReplace (name, saved_basename,saved_snapshot);
|
||||
VersionRetrieve (name, saved_basename, saved_snapshot);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Creates the deltas.
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
void
|
||||
VersionCreate(char *vname, char *bname)
|
||||
{
|
||||
@ -161,6 +164,7 @@ VersionCreate(char *vname, char *bname)
|
||||
sprintf (query_buf, "CREATE TABLE %s_del (DOID oid)", vname);
|
||||
eval_as_new_xact (query_buf);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@ -168,6 +172,7 @@ VersionCreate(char *vname, char *bname)
|
||||
* sets the global variable 'attr_list' with the list of attributes (names)
|
||||
* for that relation.
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
static void
|
||||
setAttrList(char *bname)
|
||||
{
|
||||
@ -203,13 +208,15 @@ setAttrList(char *bname)
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This routine defines the rule governing the append semantics of
|
||||
* versions. All tuples appended to a version gets appended to the
|
||||
* <vname>_added relation.
|
||||
*/
|
||||
void
|
||||
#ifdef NOT_USED
|
||||
static void
|
||||
VersionAppend(char *vname, char *bname)
|
||||
{
|
||||
sprintf(rule_buf,
|
||||
@ -218,7 +225,7 @@ VersionAppend(char *vname, char *bname)
|
||||
|
||||
eval_as_new_xact(rule_buf);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This routine defines the rule governing the retrieval semantics of
|
||||
@ -228,6 +235,7 @@ VersionAppend(char *vname, char *bname)
|
||||
* 2. Retrieve all tuples in the base relation which are not in
|
||||
* the <vname>_del relation.
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
void
|
||||
VersionRetrieve(char *vname, char *bname, char *snapshot)
|
||||
{
|
||||
@ -245,6 +253,7 @@ where _%s.oid !!= '%s_del.DOID'",
|
||||
/* printf("%s\n",rule_buf); */
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This routine defines the rules that govern the delete semantics of
|
||||
@ -257,6 +266,7 @@ where _%s.oid !!= '%s_del.DOID'",
|
||||
* then we have to mark that tuple as being deleted by adding
|
||||
* it to the <vname>_del relation.
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
void
|
||||
VersionDelete(char *vname, char *bname, char *snapshot)
|
||||
{
|
||||
@ -280,6 +290,7 @@ bname,bname,snapshot,bname);
|
||||
eval_as_new_xact(rule_buf);
|
||||
#endif /* OLD_REWRITE */
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This routine defines the rules that govern the update semantics
|
||||
@ -293,6 +304,7 @@ bname,bname,snapshot,bname);
|
||||
* adding the tuple to the <vname>_del relation.
|
||||
* 2.2 A copy of the tuple is appended to the <vname>_added relation
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
void
|
||||
VersionReplace(char *vname, char *bname, char *snapshot)
|
||||
{
|
||||
@ -332,3 +344,4 @@ vname,attr_list,bname,bname,snapshot,vname,bname);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.16 1997/08/12 22:52:15 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.17 1997/08/19 21:30:42 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -93,6 +93,9 @@ static Dllist *pendingNotifies = NULL;
|
||||
|
||||
static int AsyncExistsPendingNotify(char *);
|
||||
static void ClearPendingNotify(void);
|
||||
static void Async_NotifyFrontEnd(void);
|
||||
static void Async_Unlisten(char *relname, int pid);
|
||||
static void Async_UnlistenOnExit(int code, char *relname);
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------
|
||||
@ -478,7 +481,7 @@ Async_Listen(char *relname, int pid)
|
||||
*
|
||||
*--------------------------------------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
Async_Unlisten(char *relname, int pid)
|
||||
{
|
||||
Relation lDesc;
|
||||
@ -498,7 +501,7 @@ Async_Unlisten(char *relname, int pid)
|
||||
heap_close(lDesc);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
Async_UnlistenOnExit(int code, /* from exitpg */
|
||||
char *relname)
|
||||
{
|
||||
@ -529,7 +532,7 @@ Async_UnlistenOnExit(int code, /* from exitpg */
|
||||
*/
|
||||
GlobalMemory notifyContext = NULL;
|
||||
|
||||
void
|
||||
static void
|
||||
Async_NotifyFrontEnd()
|
||||
{
|
||||
extern CommandDest whereToSendOutput;
|
||||
|
@ -14,7 +14,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.12 1997/08/18 20:52:07 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.13 1997/08/19 21:30:45 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -49,6 +49,10 @@
|
||||
#include <utils/acl.h>
|
||||
#endif /* !NO_SECURITY */
|
||||
|
||||
static Relation copy_heap(Oid OIDOldHeap);
|
||||
static void copy_index(Oid OIDOldIndex, Oid OIDNewHeap);
|
||||
static void rebuildheap(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex);
|
||||
|
||||
/*
|
||||
* cluster
|
||||
*
|
||||
@ -178,7 +182,7 @@ cluster(char oldrelname[], char oldindexname[])
|
||||
StartTransactionCommand();
|
||||
}
|
||||
|
||||
Relation
|
||||
static Relation
|
||||
copy_heap(Oid OIDOldHeap)
|
||||
{
|
||||
char NewName[NAMEDATALEN];
|
||||
@ -219,7 +223,7 @@ copy_heap(Oid OIDOldHeap)
|
||||
return NewHeap;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
copy_index(Oid OIDOldIndex, Oid OIDNewHeap)
|
||||
{
|
||||
Relation OldIndex, NewHeap;
|
||||
@ -309,7 +313,7 @@ copy_index(Oid OIDOldIndex, Oid OIDNewHeap)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
static void
|
||||
rebuildheap(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex)
|
||||
{
|
||||
Relation LocalNewHeap, LocalOldHeap, LocalOldIndex;
|
||||
|
Reference in New Issue
Block a user