summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1997-08-19 21:40:56 +0000
committerBruce Momjian <bruce@momjian.us>1997-08-19 21:40:56 +0000
commit1d8bbfd2e7cfb72cbe4d5c5d4fa650a28dedac0b (patch)
tree8d3a5dac9207f22c3afb8afb563d54f88774deb3 /src/bin/pg_dump
parentb992e200b8872ecb6652ec85111995f8d4c5aee0 (diff)
downloadpostgresql-1d8bbfd2e7cfb72cbe4d5c5d4fa650a28dedac0b.tar.gz
Make functions static where possible, enclose unused functions in #ifdef NOT_USED.
Diffstat (limited to 'src/bin/pg_dump')
-rw-r--r--src/bin/pg_dump/common.c19
-rw-r--r--src/bin/pg_dump/pg_dump.c23
-rw-r--r--src/bin/pg_dump/pg_dump.h20
3 files changed, 31 insertions, 31 deletions
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c
index 1fdd848672..15729fe7b3 100644
--- a/src/bin/pg_dump/common.c
+++ b/src/bin/pg_dump/common.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.12 1997/06/02 02:51:49 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.13 1997/08/19 21:36:25 momjian Exp $
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
@@ -35,6 +35,15 @@
#include "pg_dump.h"
+static char** findParentsByOid(TableInfo* tbinfo, int numTables,
+ InhInfo* inhinfo, int numInherits,
+ const char *oid,
+ int *numParents);
+static int findTableByOid(TableInfo *tbinfo, int numTables, const char *oid);
+static void flagInhAttrs(TableInfo* tbinfo, int numTables,
+ InhInfo* inhinfo, int numInherits);
+static int strInArray(const char* pattern, char** arr, int arr_size);
+
/*
* findTypeByOid
* given an oid of a type, return its typename
@@ -95,7 +104,7 @@ findOprByOid(OprInfo *oprinfo, int numOprs, const char *oid)
* returns NULL if none
*/
-char**
+static char**
findParentsByOid(TableInfo* tblinfo, int numTables,
InhInfo* inhinfo, int numInherits, const char *oid,
int *numParentsPtr)
@@ -173,7 +182,7 @@ parseArgTypes(char **argtypes, const char* str)
*
*/
-int
+static int
strInArray(const char* pattern, char** arr, int arr_size)
{
int i;
@@ -316,7 +325,7 @@ dumpSchemaIdx(FILE *fout, int *numTablesPtr, const char *tablename,
* modifies tblinfo
*
*/
-void
+static void
flagInhAttrs(TableInfo* tblinfo, int numTables,
InhInfo* inhinfo, int numInherits)
{
@@ -373,7 +382,7 @@ findTableByName(TableInfo* tblinfo, int numTables, const char* relname)
* NOTE: should hash this, but just do linear search for now
*/
-int
+static int
findTableByOid(TableInfo* tblinfo, int numTables, const char* oid)
{
int i;
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index efd411d20d..6c32da2e71 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -21,7 +21,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.37 1997/08/19 04:44:38 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.38 1997/08/19 21:36:40 momjian Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
@@ -68,6 +68,13 @@
#include "pg_dump.h"
static void dumpSequence (FILE* fout, TableInfo tbinfo);
+static char *checkForQuote(const char* s);
+static void clearTableInfo(TableInfo*, int);
+static void dumpOneFunc(FILE* fout, FuncInfo* finfo, int i,
+ TypeInfo *tinfo, int numTypes);
+static int findLastBuiltinOid(void);
+static bool isViewRule(char *relname);
+static void setMaxOid(FILE *fout);
extern char *optarg;
extern int optind, opterr;
@@ -139,7 +146,7 @@ exit_nicely(PGconn* conn)
* Determine if the relation is a VIEW
*
*/
-bool
+static bool
isViewRule(char *relname)
{
PGresult *res;
@@ -776,7 +783,7 @@ clearFuncInfo (FuncInfo *fun, int numFuncs)
free(fun);
}
-void
+static void
clearTableInfo(TableInfo *tblinfo, int numTables)
{
int i,j;
@@ -1482,7 +1489,7 @@ dumpFuncs(FILE* fout, FuncInfo* finfo, int numFuncs,
*
*/
-void
+static void
dumpOneFunc(FILE* fout, FuncInfo* finfo, int i,
TypeInfo *tinfo, int numTypes)
{
@@ -1956,6 +1963,7 @@ dumpIndices(FILE* fout, IndInfo* indinfo, int numIndices,
* the attrmap passed in tells how to map the attributes copied in to the
* attributes copied out
*/
+#ifdef NOT_USED
void
dumpTuples(PGresult *res, FILE *fout, int* attrmap)
{
@@ -1998,13 +2006,14 @@ dumpTuples(PGresult *res, FILE *fout, int* attrmap)
free (outVals);
}
}
+#endif
/*
* setMaxOid -
* find the maximum oid and generate a COPY statement to set it
*/
-void
+static void
setMaxOid(FILE *fout)
{
PGresult *res;
@@ -2053,7 +2062,7 @@ setMaxOid(FILE *fout)
* this is probably not foolproof but comes close
*/
-int
+static int
findLastBuiltinOid(void)
{
PGresult* res;
@@ -2083,7 +2092,7 @@ findLastBuiltinOid(void)
* checkForQuote:
* checks a string for quote characters and quotes them
*/
-char*
+static char*
checkForQuote(const char* s)
{
char *r;
diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h
index a8df2db03e..a537a3ff6b 100644
--- a/src/bin/pg_dump/pg_dump.h
+++ b/src/bin/pg_dump/pg_dump.h
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_dump.h,v 1.18 1997/08/19 04:44:40 vadim Exp $
+ * $Id: pg_dump.h,v 1.19 1997/08/19 21:36:45 momjian Exp $
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
@@ -167,20 +167,11 @@ extern void dumpSchemaIdx(FILE* fout,
extern char* findTypeByOid(TypeInfo* tinfo, int numTypes, const char* oid);
extern char* findOprByOid(OprInfo *oprinfo, int numOprs, const char *oid);
extern int findFuncByName(FuncInfo* finfo, int numFuncs, const char* name);
-extern char** findParentsByOid(TableInfo* tbinfo, int numTables,
- InhInfo* inhinfo, int numInherits,
- const char *oid,
- int *numParents);
extern int findTableByName(TableInfo *tbinfo, int numTables, const char *relname);
-extern int findTableByOid(TableInfo *tbinfo, int numTables, const char *oid);
-extern void flagInhAttrs(TableInfo* tbinfo, int numTables,
- InhInfo* inhinfo, int numInherits);
extern void check_conn_and_db(void);
-extern int strInArray(const char* pattern, char** arr, int arr_size);
extern void parseArgTypes(char **argtypes, const char* str);
extern int isArchiveName(const char*);
-extern bool isViewRule(char *relname);
/*
* version specific routines
@@ -195,7 +186,6 @@ extern void clearInhInfo(InhInfo*, int);
extern void clearIndInfo(IndInfo*, int);
extern void clearOprInfo(OprInfo*, int);
extern void clearTypeInfo(TypeInfo*, int);
-extern void clearTableInfo(TableInfo*, int);
extern OprInfo* getOperators(int *numOperators);
extern TableInfo* getTables(int *numTables);
@@ -210,8 +200,6 @@ extern void dumpAggs(FILE* fout, AggInfo* agginfo, int numAggregates,
TypeInfo *tinfo, int numTypes);
extern void dumpOprs(FILE* fout, OprInfo* agginfo, int numOperators,
TypeInfo *tinfo, int numTypes);
-extern void dumpOneFunc(FILE* fout, FuncInfo* finfo, int i,
- TypeInfo *tinfo, int numTypes);
extern void dumpTables(FILE* fout, TableInfo* tbinfo, int numTables,
InhInfo *inhinfo, int numInherits,
TypeInfo *tinfo, int numTypes, const char *tablename,
@@ -219,12 +207,6 @@ extern void dumpTables(FILE* fout, TableInfo* tbinfo, int numTables,
extern void dumpIndices(FILE* fout, IndInfo* indinfo, int numIndices,
TableInfo* tbinfo, int numTables, const char *tablename);
-extern void dumpTuples(PGresult *res, FILE *fout, int *attrmap);
-extern void setMaxOid(FILE *fout);
-extern char* checkForQuote(const char* s);
-extern int findLastBuiltinOid(void);
-
-
/* largest query string size */
#define MAXQUERYLEN 5000