Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/initdb/initdb.c4
-rw-r--r--src/bin/pg_config/pg_config.c4
-rw-r--r--src/bin/pg_controldata/pg_controldata.c4
-rw-r--r--src/bin/pg_ctl/pg_ctl.c3
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.c6
-rw-r--r--src/bin/pg_dump/pg_dump.c4
-rw-r--r--src/bin/pg_dump/pg_dumpall.c3
-rw-r--r--src/bin/pg_dump/pg_restore.c3
-rw-r--r--src/bin/pg_resetxlog/pg_resetxlog.c4
-rw-r--r--src/bin/psql/command.c60
-rw-r--r--src/bin/psql/common.c20
-rw-r--r--src/bin/psql/copy.c4
-rw-r--r--src/bin/psql/describe.c4
-rw-r--r--src/bin/psql/help.c8
-rw-r--r--src/bin/psql/large_obj.c6
-rw-r--r--src/bin/psql/mainloop.c4
-rw-r--r--src/bin/psql/print.c35
-rw-r--r--src/bin/psql/startup.c27
-rw-r--r--src/bin/scripts/common.c6
-rw-r--r--src/bin/scripts/common.h2
20 files changed, 97 insertions, 114 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 9077d84ddc8..5d8338f5ac4 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -39,7 +39,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD.
*
- * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.74 2005/01/28 00:34:32 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.75 2005/02/22 04:38:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -65,8 +65,6 @@ int optreset;
#endif
-#define _(x) gettext((x))
-
/* version string we expect back from postgres */
#define PG_VERSIONSTR "postgres (PostgreSQL) " PG_VERSION "\n"
diff --git a/src/bin/pg_config/pg_config.c b/src/bin/pg_config/pg_config.c
index d13927eafd4..28baf2262d0 100644
--- a/src/bin/pg_config/pg_config.c
+++ b/src/bin/pg_config/pg_config.c
@@ -17,7 +17,7 @@
*
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/pg_config/pg_config.c,v 1.10 2004/12/31 22:03:03 pgsql Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_config/pg_config.c,v 1.11 2005/02/22 04:38:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -26,8 +26,6 @@
#include "port.h"
#include <stdio.h>
-#define _(x) gettext((x))
-
static const char *progname;
static void
diff --git a/src/bin/pg_controldata/pg_controldata.c b/src/bin/pg_controldata/pg_controldata.c
index e8b9c8b677b..3615655dc42 100644
--- a/src/bin/pg_controldata/pg_controldata.c
+++ b/src/bin/pg_controldata/pg_controldata.c
@@ -6,7 +6,7 @@
* copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001;
* licence: BSD
*
- * $PostgreSQL: pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.20 2004/09/23 00:47:44 neilc Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.21 2005/02/22 04:39:00 momjian Exp $
*/
#include "postgres.h"
@@ -17,8 +17,6 @@
#include "catalog/pg_control.h"
-#define _(x) gettext((x))
-
static void
usage(const char *progname)
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c
index 1d20f0c5596..8564bd76e91 100644
--- a/src/bin/pg_ctl/pg_ctl.c
+++ b/src/bin/pg_ctl/pg_ctl.c
@@ -4,7 +4,7 @@
*
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.53 2004/12/31 22:03:05 pgsql Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.54 2005/02/22 04:39:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -35,7 +35,6 @@ int optreset;
/* PID can be negative for standalone backend */
typedef long pgpid_t;
-#define _(x) gettext((x))
#define WHITESPACE "\f\n\r\t\v" /* as defined by isspace() */
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index f0086118270..2e60684f048 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.104 2005/01/26 19:44:43 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.105 2005/02/22 04:39:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1187,10 +1187,10 @@ static void
_write_msg(const char *modulename, const char *fmt, va_list ap)
{
if (modulename)
- fprintf(stderr, "%s: [%s] ", progname, gettext(modulename));
+ fprintf(stderr, "%s: [%s] ", progname, _(modulename));
else
fprintf(stderr, "%s: ", progname);
- vfprintf(stderr, gettext(fmt), ap);
+ vfprintf(stderr, _(fmt), ap);
}
void
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index ce9a5b0d160..e2fb805d59e 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -12,7 +12,7 @@
* by PostgreSQL
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.402 2005/01/26 21:24:12 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.403 2005/02/22 04:39:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -61,8 +61,6 @@ int optreset;
#include "pg_backup_archiver.h"
#include "dumputils.h"
-#define _(x) gettext((x))
-
extern char *optarg;
extern int optind,
opterr;
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index a85843a32db..c1c3ac66611 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
*
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.57 2004/12/31 22:03:09 pgsql Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.58 2005/02/22 04:39:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -34,7 +34,6 @@ int optreset;
#include "pg_backup.h"
#include "pqexpbuffer.h"
-#define _(x) gettext((x))
/* version string we expect back from postgres */
#define PG_VERSIONSTR "pg_dump (PostgreSQL) " PG_VERSION "\n"
diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c
index d74d1b344ed..9d2a16d4675 100644
--- a/src/bin/pg_dump/pg_restore.c
+++ b/src/bin/pg_dump/pg_restore.c
@@ -34,7 +34,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_restore.c,v 1.68 2004/12/03 18:48:19 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_restore.c,v 1.69 2005/02/22 04:39:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -65,7 +65,6 @@ int optreset;
#include <locale.h>
#endif
-#define _(x) gettext((x))
/* Forward decls */
static void usage(const char *progname);
diff --git a/src/bin/pg_resetxlog/pg_resetxlog.c b/src/bin/pg_resetxlog/pg_resetxlog.c
index 91a411632b3..31e1442984f 100644
--- a/src/bin/pg_resetxlog/pg_resetxlog.c
+++ b/src/bin/pg_resetxlog/pg_resetxlog.c
@@ -23,7 +23,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.28 2004/12/31 22:03:11 pgsql Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.29 2005/02/22 04:40:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -48,8 +48,6 @@
extern int optind;
extern char *optarg;
-#define _(x) gettext((x))
-
char XLogDir[MAXPGPATH]; /* not static, see xlog_internal.h */
static char ControlFilePath[MAXPGPATH];
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 4edacb28852..fb918bdc058 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.139 2005/01/01 05:43:08 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.140 2005/02/22 04:40:51 momjian Exp $
*/
#include "postgres_fe.h"
#include "command.h"
@@ -121,7 +121,7 @@ HandleSlashCmds(PsqlScanState scan_state,
if (status == CMD_UNKNOWN)
{
if (pset.cur_cmd_interactive)
- fprintf(stderr, gettext("Invalid command \\%s. Try \\? for help.\n"), cmd);
+ fprintf(stderr, _("Invalid command \\%s. Try \\? for help.\n"), cmd);
else
psql_error("invalid command \\%s\n", cmd);
status = CMD_ERROR;
@@ -609,7 +609,7 @@ exec_command(const char *cmd,
if (query_buf && query_buf->len > 0)
puts(query_buf->data);
else if (!quiet)
- puts(gettext("Query buffer is empty."));
+ puts(_("Query buffer is empty."));
fflush(stdout);
}
@@ -643,7 +643,7 @@ exec_command(const char *cmd,
resetPQExpBuffer(query_buf);
psql_scan_reset(scan_state);
if (!quiet)
- puts(gettext("Query buffer reset (cleared)."));
+ puts(_("Query buffer reset (cleared)."));
}
/* \s save history in a file or show it on the screen */
@@ -657,7 +657,7 @@ exec_command(const char *cmd,
success = saveHistory(fname ? fname : "/dev/tty");
if (success && !quiet && fname)
- printf(gettext("Wrote history to file \"%s\".\n"), fname);
+ printf(_("Wrote history to file \"%s\".\n"), fname);
if (!fname)
putchar('\n');
free(fname);
@@ -739,9 +739,9 @@ exec_command(const char *cmd,
if (!quiet)
{
if (pset.timing)
- puts(gettext("Timing is on."));
+ puts(_("Timing is on."));
else
- puts(gettext("Timing is off."));
+ puts(_("Timing is off."));
}
}
@@ -970,7 +970,7 @@ do_connect(const char *new_dbname, const char *new_user)
PQfinish(pset.db);
if (oldconn)
{
- fputs(gettext("Previous connection kept\n"), stderr);
+ fputs(_("Previous connection kept\n"), stderr);
pset.db = oldconn;
}
else
@@ -994,12 +994,12 @@ do_connect(const char *new_dbname, const char *new_user)
if (!QUIET())
{
if (userparam != new_user) /* no new user */
- printf(gettext("You are now connected to database \"%s\".\n"), dbparam);
+ printf(_("You are now connected to database \"%s\".\n"), dbparam);
else if (dbparam != new_dbname) /* no new db */
- printf(gettext("You are now connected as new user \"%s\".\n"), new_user);
+ printf(_("You are now connected as new user \"%s\".\n"), new_user);
else
/* both new */
- printf(gettext("You are now connected to database \"%s\" as user \"%s\".\n"),
+ printf(_("You are now connected to database \"%s\" as user \"%s\".\n"),
PQdb(pset.db), PQuser(pset.db));
}
@@ -1388,7 +1388,7 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
}
if (!quiet)
- printf(gettext("Output format is %s.\n"), _align2string(popt->topt.format));
+ printf(_("Output format is %s.\n"), _align2string(popt->topt.format));
}
/* set border style/width */
@@ -1398,7 +1398,7 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
popt->topt.border = atoi(value);
if (!quiet)
- printf(gettext("Border style is %d.\n"), popt->topt.border);
+ printf(_("Border style is %d.\n"), popt->topt.border);
}
/* set expanded/vertical mode */
@@ -1407,8 +1407,8 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
popt->topt.expanded = !popt->topt.expanded;
if (!quiet)
printf(popt->topt.expanded
- ? gettext("Expanded display is on.\n")
- : gettext("Expanded display is off.\n"));
+ ? _("Expanded display is on.\n")
+ : _("Expanded display is off.\n"));
}
/* null display */
@@ -1420,7 +1420,7 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
popt->nullPrint = pg_strdup(value);
}
if (!quiet)
- printf(gettext("Null display is \"%s\".\n"), popt->nullPrint ? popt->nullPrint : "");
+ printf(_("Null display is \"%s\".\n"), popt->nullPrint ? popt->nullPrint : "");
}
/* field separator for unaligned text */
@@ -1432,7 +1432,7 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
popt->topt.fieldSep = pg_strdup(value);
}
if (!quiet)
- printf(gettext("Field separator is \"%s\".\n"), popt->topt.fieldSep);
+ printf(_("Field separator is \"%s\".\n"), popt->topt.fieldSep);
}
/* record separator for unaligned text */
@@ -1446,9 +1446,9 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
if (!quiet)
{
if (strcmp(popt->topt.recordSep, "\n") == 0)
- printf(gettext("Record separator is <newline>."));
+ printf(_("Record separator is <newline>."));
else
- printf(gettext("Record separator is \"%s\".\n"), popt->topt.recordSep);
+ printf(_("Record separator is \"%s\".\n"), popt->topt.recordSep);
}
}
@@ -1459,9 +1459,9 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
if (!quiet)
{
if (popt->topt.tuples_only)
- puts(gettext("Showing only tuples."));
+ puts(_("Showing only tuples."));
else
- puts(gettext("Tuples only is off."));
+ puts(_("Tuples only is off."));
}
}
@@ -1477,9 +1477,9 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
if (!quiet)
{
if (popt->title)
- printf(gettext("Title is \"%s\".\n"), popt->title);
+ printf(_("Title is \"%s\".\n"), popt->title);
else
- printf(gettext("Title is unset.\n"));
+ printf(_("Title is unset.\n"));
}
}
@@ -1495,9 +1495,9 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
if (!quiet)
{
if (popt->topt.tableAttr)
- printf(gettext("Table attribute is \"%s\".\n"), popt->topt.tableAttr);
+ printf(_("Table attribute is \"%s\".\n"), popt->topt.tableAttr);
else
- printf(gettext("Table attributes unset.\n"));
+ printf(_("Table attributes unset.\n"));
}
}
@@ -1513,11 +1513,11 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
if (!quiet)
{
if (popt->topt.pager == 1)
- puts(gettext("Pager is used for long output."));
+ puts(_("Pager is used for long output."));
else if (popt->topt.pager == 2)
- puts(gettext("Pager is always used."));
+ puts(_("Pager is always used."));
else
- puts(gettext("Pager usage is off."));
+ puts(_("Pager usage is off."));
}
}
@@ -1528,9 +1528,9 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
if (!quiet)
{
if (popt->default_footer)
- puts(gettext("Default footer is on."));
+ puts(_("Default footer is on."));
else
- puts(gettext("Default footer is off."));
+ puts(_("Default footer is off."));
}
}
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 1c26eb6b84e..6d03a4ae5a1 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.95 2005/01/01 05:43:08 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.96 2005/02/22 04:40:52 momjian Exp $
*/
#include "postgres_fe.h"
#include "common.h"
@@ -75,7 +75,7 @@ pg_strdup(const char *string)
if (!string)
{
- fprintf(stderr, gettext("%s: xstrdup: cannot duplicate null pointer (internal error)\n"),
+ fprintf(stderr, _("%s: xstrdup: cannot duplicate null pointer (internal error)\n"),
pset.progname);
exit(EXIT_FAILURE);
}
@@ -200,7 +200,7 @@ psql_error(const char *fmt,...)
if (pset.inputfile)
fprintf(stderr, "%s:%s:%u: ", pset.progname, pset.inputfile, pset.lineno);
va_start(ap, fmt);
- vfprintf(stderr, gettext(fmt), ap);
+ vfprintf(stderr, _(fmt), ap);
va_end(ap);
}
@@ -357,19 +357,19 @@ CheckConnection(void)
exit(EXIT_BADCONN);
}
- fputs(gettext("The connection to the server was lost. Attempting reset: "), stderr);
+ fputs(_("The connection to the server was lost. Attempting reset: "), stderr);
PQreset(pset.db);
OK = ConnectionUp();
if (!OK)
{
- fputs(gettext("Failed.\n"), stderr);
+ fputs(_("Failed.\n"), stderr);
PQfinish(pset.db);
pset.db = NULL;
ResetCancelConn();
UnsyncVariables();
}
else
- fputs(gettext("Succeeded.\n"), stderr);
+ fputs(_("Succeeded.\n"), stderr);
}
return OK;
@@ -604,7 +604,7 @@ ReportSyntaxErrorPosition(const PGresult *result, const char *query)
wquery[qidx[iend]] = '\0';
/* Begin building the finished message. */
- printfPQExpBuffer(&msg, gettext("LINE %d: "), loc_line);
+ printfPQExpBuffer(&msg, _("LINE %d: "), loc_line);
if (beg_trunc)
appendPQExpBufferStr(&msg, "...");
@@ -768,7 +768,7 @@ PrintNotifications(void)
while ((notify = PQnotifies(pset.db)))
{
- fprintf(pset.queryFout, gettext("Asynchronous notification \"%s\" received from server process with PID %d.\n"),
+ fprintf(pset.queryFout, _("Asynchronous notification \"%s\" received from server process with PID %d.\n"),
notify->relname, notify->be_pid);
fflush(pset.queryFout);
PQfreemem(notify);
@@ -956,7 +956,7 @@ SendQuery(const char *query)
{
char buf[3];
- printf(gettext("***(Single step mode: verify command)*******************************************\n"
+ printf(_("***(Single step mode: verify command)*******************************************\n"
"%s\n"
"***(press return to proceed or enter x and return to cancel)********************\n"),
query);
@@ -1007,7 +1007,7 @@ SendQuery(const char *query)
/* Possible microtiming output */
if (OK && pset.timing)
- printf(gettext("Time: %.3f ms\n"), DIFF_MSEC(&after, &before));
+ printf(_("Time: %.3f ms\n"), DIFF_MSEC(&after, &before));
/* check for events that may occur during query execution */
diff --git a/src/bin/psql/copy.c b/src/bin/psql/copy.c
index 9b6d9144450..096f81aeb88 100644
--- a/src/bin/psql/copy.c
+++ b/src/bin/psql/copy.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/copy.c,v 1.55 2005/01/01 05:43:08 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/copy.c,v 1.56 2005/02/22 04:40:54 momjian Exp $
*/
#include "postgres_fe.h"
#include "copy.h"
@@ -665,7 +665,7 @@ handleCopyIn(PGconn *conn, FILE *copystream)
if (isatty(fileno(copystream)))
{
if (!QUIET())
- puts(gettext("Enter data to be copied followed by a newline.\n"
+ puts(_("Enter data to be copied followed by a newline.\n"
"End with a backslash and a period on a line by itself."));
prompt = get_prompt(PROMPT_COPY);
}
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 8bf21bcc7ca..07b7b9938bc 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.111 2005/01/01 05:43:08 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.112 2005/02/22 04:40:55 momjian Exp $
*/
#include "postgres_fe.h"
#include "describe.h"
@@ -28,8 +28,6 @@
#endif
-#define _(x) gettext((x))
-
static bool describeOneTableDetails(const char *schemaname,
const char *relationname,
const char *oid,
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index 1012de57d3f..8b3dbcf602e 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.100 2005/01/08 22:51:13 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.101 2005/02/22 04:40:55 momjian Exp $
*/
#include "postgres_fe.h"
#include "common.h"
@@ -31,8 +31,6 @@
#include "common.h"
#include "sql_help.h"
-#define _(x) gettext((x))
-
/*
* PLEASE:
* If you change something in this file, also make the same changes
@@ -346,8 +344,8 @@ helpSQL(const char *topic, unsigned short int pager)
"Description: %s\n"
"Syntax:\n%s\n\n"),
QL_HELP[i].cmd,
- gettext(QL_HELP[i].help),
- gettext(QL_HELP[i].syntax));
+ _(QL_HELP[i].help),
+ _(QL_HELP[i].syntax));
/* If we have an exact match, exit. Fixes \h SELECT */
if (pg_strcasecmp(topic, QL_HELP[i].cmd) == 0)
break;
diff --git a/src/bin/psql/large_obj.c b/src/bin/psql/large_obj.c
index 2b2a730f5b0..624ccd0be6d 100644
--- a/src/bin/psql/large_obj.c
+++ b/src/bin/psql/large_obj.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/large_obj.c,v 1.35 2005/01/01 05:43:08 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/large_obj.c,v 1.36 2005/02/22 04:40:55 momjian Exp $
*/
#include "postgres_fe.h"
#include "large_obj.h"
@@ -253,7 +253,7 @@ do_lo_list(void)
" pg_catalog.obj_description(loid, 'pg_largeobject') as \"%s\"\n"
"FROM (SELECT DISTINCT loid FROM pg_catalog.pg_largeobject) x\n"
"ORDER BY 1",
- gettext("Description"));
+ _("Description"));
res = PSQLexec(buf, false);
if (!res)
@@ -261,7 +261,7 @@ do_lo_list(void)
myopt.topt.tuples_only = false;
myopt.nullPrint = NULL;
- myopt.title = gettext("Large objects");
+ myopt.title = _("Large objects");
printQuery(res, &myopt, pset.queryFout);
diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c
index 109f23192f8..fad71c1120b 100644
--- a/src/bin/psql/mainloop.c
+++ b/src/bin/psql/mainloop.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.66 2005/01/01 05:43:08 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.67 2005/02/22 04:40:55 momjian Exp $
*/
#include "postgres_fe.h"
#include "mainloop.h"
@@ -172,7 +172,7 @@ MainLoop(FILE *source)
if (count_eof < GetVariableNum(pset.vars, "IGNOREEOF", 0, 10, false))
{
if (!QUIET())
- printf(gettext("Use \"\\q\" to leave %s.\n"), pset.progname);
+ printf(_("Use \"\\q\" to leave %s.\n"), pset.progname);
continue;
}
diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c
index abf6864943b..1321e99582b 100644
--- a/src/bin/psql/print.c
+++ b/src/bin/psql/print.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.54 2005/01/01 05:43:08 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.55 2005/02/22 04:40:57 momjian Exp $
*/
#include "postgres_fe.h"
#include "common.h"
@@ -29,6 +29,7 @@
#include "mbprint.h"
+
/*************************/
/* Unaligned text */
/*************************/
@@ -227,14 +228,14 @@ print_aligned_text(const char *title, const char *const * headers,
widths = calloc(col_count, sizeof(*widths));
if (!widths)
{
- fprintf(stderr, gettext("out of memory\n"));
+ fprintf(stderr, _("out of memory\n"));
exit(EXIT_FAILURE);
}
head_w = calloc(col_count, sizeof(*head_w));
if (!head_w)
{
- fprintf(stderr, gettext("out of memory\n"));
+ fprintf(stderr, _("out of memory\n"));
exit(EXIT_FAILURE);
}
}
@@ -253,7 +254,7 @@ print_aligned_text(const char *title, const char *const * headers,
cell_w = calloc(cell_count, sizeof(*cell_w));
if (!cell_w)
{
- fprintf(stderr, gettext("out of memory\n"));
+ fprintf(stderr, _("out of memory\n"));
exit(EXIT_FAILURE);
}
}
@@ -425,7 +426,7 @@ print_aligned_vertical(const char *title, const char *const * headers,
if (cells[0] == NULL)
{
- puts(gettext("(No rows)\n"));
+ puts(_("(No rows)\n"));
return;
}
@@ -437,7 +438,7 @@ print_aligned_vertical(const char *title, const char *const * headers,
head_w = calloc(col_count, sizeof(*head_w));
if (!head_w)
{
- fprintf(stderr, gettext("out of memory\n"));
+ fprintf(stderr, _("out of memory\n"));
exit(EXIT_FAILURE);
}
}
@@ -461,7 +462,7 @@ print_aligned_vertical(const char *title, const char *const * headers,
cell_w = calloc(cell_count, sizeof(*cell_w));
if (!cell_w)
{
- fprintf(stderr, gettext("out of memory\n"));
+ fprintf(stderr, _("out of memory\n"));
exit(EXIT_FAILURE);
}
}
@@ -485,7 +486,7 @@ print_aligned_vertical(const char *title, const char *const * headers,
divider = malloc(hwidth + dwidth + 10);
if (!divider)
{
- fprintf(stderr, gettext("out of memory\n"));
+ fprintf(stderr, _("out of memory\n"));
exit(EXIT_FAILURE);
}
divider[0] = '\0';
@@ -514,7 +515,7 @@ print_aligned_vertical(const char *title, const char *const * headers,
if (!record_str)
{
- fprintf(stderr, gettext("out of memory\n"));
+ fprintf(stderr, _("out of memory\n"));
exit(EXIT_FAILURE);
}
@@ -532,7 +533,7 @@ print_aligned_vertical(const char *title, const char *const * headers,
if (!div_copy)
{
- fprintf(stderr, gettext("out of memory\n"));
+ fprintf(stderr, _("out of memory\n"));
exit(EXIT_FAILURE);
}
@@ -1153,7 +1154,7 @@ printQuery(const PGresult *result, const printQueryOpt *opt, FILE *fout)
headers = calloc(nfields + 1, sizeof(*headers));
if (!headers)
{
- fprintf(stderr, gettext("out of memory\n"));
+ fprintf(stderr, _("out of memory\n"));
exit(EXIT_FAILURE);
}
@@ -1165,7 +1166,7 @@ printQuery(const PGresult *result, const printQueryOpt *opt, FILE *fout)
cells = calloc(ncells + 1, sizeof(*cells));
if (!cells)
{
- fprintf(stderr, gettext("out of memory\n"));
+ fprintf(stderr, _("out of memory\n"));
exit(EXIT_FAILURE);
}
@@ -1186,20 +1187,20 @@ printQuery(const PGresult *result, const printQueryOpt *opt, FILE *fout)
footers = calloc(2, sizeof(*footers));
if (!footers)
{
- fprintf(stderr, gettext("out of memory\n"));
+ fprintf(stderr, _("out of memory\n"));
exit(EXIT_FAILURE);
}
footers[0] = malloc(100);
if (!footers[0])
{
- fprintf(stderr, gettext("out of memory\n"));
+ fprintf(stderr, _("out of memory\n"));
exit(EXIT_FAILURE);
}
if (PQntuples(result) == 1)
- snprintf(footers[0], 100, gettext("(1 row)"));
+ snprintf(footers[0], 100, _("(1 row)"));
else
- snprintf(footers[0], 100, gettext("(%d rows)"), PQntuples(result));
+ snprintf(footers[0], 100, _("(%d rows)"), PQntuples(result));
}
else
footers = NULL;
@@ -1208,7 +1209,7 @@ printQuery(const PGresult *result, const printQueryOpt *opt, FILE *fout)
align = calloc(nfields + 1, sizeof(*align));
if (!align)
{
- fprintf(stderr, gettext("out of memory\n"));
+ fprintf(stderr, _("out of memory\n"));
exit(EXIT_FAILURE);
}
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 9aa51150c3e..b3bb9a8f650 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.112 2005/01/17 10:00:05 petere Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.113 2005/02/22 04:40:58 momjian Exp $
*/
#include "postgres_fe.h"
@@ -38,6 +38,7 @@ int optreset;
#include "mb/pg_wchar.h"
+
/*
* Global psql options
*/
@@ -135,7 +136,7 @@ main(int argc, char *argv[])
pset.vars = CreateVariableSpace();
if (!pset.vars)
{
- fprintf(stderr, gettext("%s: out of memory\n"), pset.progname);
+ fprintf(stderr, _("%s: out of memory\n"), pset.progname);
exit(EXIT_FAILURE);
}
pset.popt.topt.format = PRINT_ALIGNED;
@@ -290,7 +291,7 @@ main(int argc, char *argv[])
if (!QUIET() && !pset.notty)
{
- printf(gettext("Welcome to %s %s, the PostgreSQL interactive terminal.\n\n"
+ printf(_("Welcome to %s %s, the PostgreSQL interactive terminal.\n\n"
"Type: \\copyright for distribution terms\n"
" \\h for help with SQL commands\n"
" \\? for help with psql commands\n"
@@ -444,7 +445,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
if (!result)
{
- fprintf(stderr, gettext("%s: couldn't set printing parameter \"%s\"\n"), pset.progname, value);
+ fprintf(stderr, _("%s: couldn't set printing parameter \"%s\"\n"), pset.progname, value);
exit(EXIT_FAILURE);
}
@@ -490,7 +491,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
{
if (!DeleteVariable(pset.vars, value))
{
- fprintf(stderr, gettext("%s: could not delete variable \"%s\"\n"),
+ fprintf(stderr, _("%s: could not delete variable \"%s\"\n"),
pset.progname, value);
exit(EXIT_FAILURE);
}
@@ -500,7 +501,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
*equal_loc = '\0';
if (!SetVariable(pset.vars, value, equal_loc + 1))
{
- fprintf(stderr, gettext("%s: could not set variable \"%s\"\n"),
+ fprintf(stderr, _("%s: could not set variable \"%s\"\n"),
pset.progname, value);
exit(EXIT_FAILURE);
}
@@ -531,13 +532,13 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
/* unknown option reported by getopt */
else
{
- fprintf(stderr, gettext("Try \"%s --help\" for more information.\n"),
+ fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
pset.progname);
exit(EXIT_FAILURE);
}
break;
default:
- fprintf(stderr, gettext("Try \"%s --help\" for more information.\n"),
+ fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
pset.progname);
exit(EXIT_FAILURE);
break;
@@ -555,14 +556,14 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
else if (!options->username)
options->username = argv[optind];
else if (!QUIET())
- fprintf(stderr, gettext("%s: warning: extra command-line argument \"%s\" ignored\n"),
+ fprintf(stderr, _("%s: warning: extra command-line argument \"%s\" ignored\n"),
pset.progname, argv[optind]);
optind++;
}
if (used_old_u_option && !QUIET())
- fprintf(stderr, gettext("%s: Warning: The -u option is deprecated. Use -U.\n"), pset.progname);
+ fprintf(stderr, _("%s: Warning: The -u option is deprecated. Use -U.\n"), pset.progname);
}
@@ -624,7 +625,7 @@ showVersion(void)
puts("psql (PostgreSQL) " PG_VERSION);
#if defined(USE_READLINE)
- puts(gettext("contains support for command-line editing"));
+ puts(_("contains support for command-line editing"));
#endif
}
@@ -647,7 +648,7 @@ printSSLInfo(void)
return; /* no SSL */
SSL_get_cipher_bits(ssl, &sslbits);
- printf(gettext("SSL connection (cipher: %s, bits: %i)\n\n"),
+ printf(_("SSL connection (cipher: %s, bits: %i)\n\n"),
SSL_get_cipher(ssl), sslbits);
}
#endif
@@ -670,7 +671,7 @@ checkWin32Codepage(void)
concp = GetConsoleCP();
if (wincp != concp)
{
- printf(gettext("Warning: Console code page (%u) differs from Windows code page (%u)\n"
+ printf(_("Warning: Console code page (%u) differs from Windows code page (%u)\n"
" 8-bit characters may not work correctly. See psql reference\n"
" page \"Notes for Windows users\" for details.\n\n"),
concp, wincp);
diff --git a/src/bin/scripts/common.c b/src/bin/scripts/common.c
index c84617b3edf..4bffa5003f8 100644
--- a/src/bin/scripts/common.c
+++ b/src/bin/scripts/common.c
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.16 2005/01/08 22:51:14 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.17 2005/02/22 04:41:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -168,9 +168,9 @@ executeQuery(PGconn *conn, const char *query, const char *progname, bool echo)
int
check_yesno_response(const char *string)
{
- if (strcmp(string, gettext(PG_YESLETTER)) == 0)
+ if (strcmp(string, _(PG_YESLETTER)) == 0)
return 1;
- else if (strcmp(string, gettext(PG_NOLETTER)) == 0)
+ else if (strcmp(string, _(PG_NOLETTER)) == 0)
return 0;
else
return -1;
diff --git a/src/bin/scripts/common.h b/src/bin/scripts/common.h
index 04f8af4f0c2..46e2a610aaa 100644
--- a/src/bin/scripts/common.h
+++ b/src/bin/scripts/common.h
@@ -10,8 +10,6 @@ int optreset;
const char *get_user_name(const char *progname);
-#define _(x) gettext((x))
-
typedef void (*help_handler) (const char *);
void handle_help_version_opts(int argc, char *argv[], const char *fixed_progname, help_handler hlp);