aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql')
-rw-r--r--src/bin/psql/psql.c34
-rw-r--r--src/bin/psql/stringutils.c11
-rw-r--r--src/bin/psql/stringutils.h4
3 files changed, 25 insertions, 24 deletions
diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c
index b8947606be5..f7d0245091a 100644
--- a/src/bin/psql/psql.c
+++ b/src/bin/psql/psql.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.83 1997/08/19 04:45:02 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.84 1997/08/19 21:36:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -88,18 +88,18 @@ static void prompt_for_password(char *username, char *password);
static char * make_connect_string(char *host, char *port, char *dbname,
char *username, char *password);
-char *gets_noreadline(char *prompt, FILE * source);
-char *gets_readline(char *prompt, FILE * source);
-char *gets_fromFile(char *prompt, FILE * source);
-int listAllDbs(PsqlSettings * settings);
-void
+static char *gets_noreadline(char *prompt, FILE * source);
+static char *gets_readline(char *prompt, FILE * source);
+static char *gets_fromFile(char *prompt, FILE * source);
+static int listAllDbs(PsqlSettings * settings);
+static void
SendQuery(bool * success_p, PsqlSettings * settings, const char *query,
const bool copy_in, const bool copy_out, FILE * copystream);
-int
+static int
HandleSlashCmds(PsqlSettings * settings,
char *line,
char *query);
-int MainLoop(PsqlSettings * settings, FILE * source);
+static int MainLoop(PsqlSettings * settings, FILE * source);
/* probably should move this into libpq */
void
PQprint(FILE * fp,
@@ -107,7 +107,7 @@ PQprint(FILE * fp,
PQprintOpt * po
);
-FILE *setFout(PsqlSettings * ps, char *fname);
+static FILE *setFout(PsqlSettings * ps, char *fname);
/*
* usage print out usage for command line arguments
@@ -226,7 +226,7 @@ PSQLexec(PsqlSettings * ps, char *query)
*
*/
-int
+static int
listAllDbs(PsqlSettings * ps)
{
PGresult *results;
@@ -495,7 +495,7 @@ typedef char *(*READ_ROUTINE) (char *prompt, FILE * source);
* gets_noreadline prompt source gets a line of input without calling
* readline, the source is ignored
*/
-char *
+static char *
gets_noreadline(char *prompt, FILE * source)
{
fputs(prompt, stdout);
@@ -507,7 +507,7 @@ gets_noreadline(char *prompt, FILE * source)
* gets_readline prompt source the routine to get input from GNU readline(),
* the source is ignored the prompt argument is used as the prompting string
*/
-char *
+static char *
gets_readline(char *prompt, FILE * source)
{
char *s;
@@ -529,7 +529,7 @@ gets_readline(char *prompt, FILE * source)
* the routine to read from a file, the prompt argument is ignored the source
* argument is a FILE *
*/
-char *
+static char *
gets_fromFile(char *prompt, FILE * source)
{
char *line;
@@ -557,7 +557,7 @@ gets_fromFile(char *prompt, FILE * source)
* SendQuery: send the query string to the backend return *success_p = 1 if
* the query executed successfully returns *success_p = 0 otherwise
*/
-void
+static void
SendQuery(bool * success_p, PsqlSettings * settings, const char *query,
const bool copy_in, const bool copy_out, FILE * copystream)
{
@@ -1120,7 +1120,7 @@ do_shell(const char *command)
* this line, continue building up query 2 - terminate processing of this
* query entirely, 3 - new query supplied by edit
*/
-int
+static int
HandleSlashCmds(PsqlSettings * settings,
char *line,
char *query)
@@ -1416,7 +1416,7 @@ HandleSlashCmds(PsqlSettings * settings,
* db_ptr must be initialized and set
*/
-int
+static int
MainLoop(PsqlSettings * settings, FILE * source)
{
char *line; /* line of input */
@@ -1901,7 +1901,7 @@ handleCopyIn(PGresult * res, const bool mustprompt, FILE * copystream)
* try to open fname and return a FILE *, if it fails, use stdout, instead
*/
-FILE *
+static FILE *
setFout(PsqlSettings * ps, char *fname)
{
if (ps->queryFout && ps->queryFout != stdout) {
diff --git a/src/bin/psql/stringutils.c b/src/bin/psql/stringutils.c
index 4f7a510784a..6237aa5e301 100644
--- a/src/bin/psql/stringutils.c
+++ b/src/bin/psql/stringutils.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.8 1997/02/13 08:31:57 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.9 1997/08/19 21:36:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -28,8 +28,8 @@
and both sides of a string */
/* MODIFIES the string passed in and returns the head of it */
-
-char *leftTrim(char *s)
+#ifdef NOT_USED
+static char *leftTrim(char *s)
{
char *s2 = s;
int shift=0;
@@ -45,6 +45,7 @@ char *leftTrim(char *s)
return s2;
}
+#endif
char *rightTrim(char *s)
{
@@ -59,11 +60,13 @@ char *rightTrim(char *s)
return s;
}
-char *doubleTrim(char *s)
+#ifdef NOT_USED
+static char *doubleTrim(char *s)
{
strcpy(s,leftTrim(rightTrim(s)));
return s;
}
+#endif
#ifdef STRINGUTILS_TEST
void testStringUtils()
diff --git a/src/bin/psql/stringutils.h b/src/bin/psql/stringutils.h
index 11da94449ea..c6f037ec716 100644
--- a/src/bin/psql/stringutils.h
+++ b/src/bin/psql/stringutils.h
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: stringutils.h,v 1.3 1996/11/26 03:20:08 bryanh Exp $
+ * $Id: stringutils.h,v 1.4 1997/08/19 21:36:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -27,9 +27,7 @@
/* removes whitespaces from the left, right and both sides of a string */
/* MODIFIES the string passed in and returns the head of it */
-extern char *leftTrim(char *s);
extern char *rightTrim(char *s);
-extern char *doubleTrim(char *s);
#ifdef STRINGUTILS_TEST
extern void testStringUtils();