Add locale to pg_ctl.c.
* Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD.
*
- * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.33 2004/05/25 01:00:22 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.34 2004/06/01 02:53:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
static bool chklocale(const char *locale);
static void setlocales(void);
static void usage(const char *progname);
-static void init_nls(const char *argv0);
/*
printf(_("\nReport bugs to <pgsql-bugs@postgresql.org>.\n"));
}
-/*
- * Initialized NLS if enabled.
- */
-static void
-init_nls(const char *argv0)
-{
- set_pglocale(argv0, "initdb");
-}
-
-
int
main(int argc, char *argv[])
{
* environment */
char *subdirs[] =
{"global", "pg_xlog", "pg_clog", "base", "base/1"};
- init_nls(argv[0]);
progname = get_progname(argv[0]);
+ set_pglocale(argv[0], "initdb");
if (argc > 1)
{
*
* Portions Copyright (c) 2002-2003, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/scripts/clusterdb.c,v 1.7 2004/05/25 01:00:27 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/clusterdb.c,v 1.8 2004/06/01 02:54:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
char *table = NULL;
progname = get_progname(argv[0]);
- init_nls(argv[0]);
+ set_pglocale(argv[0], "pgscripts");
+
handle_help_version_opts(argc, argv, "clusterdb", help);
while ((c = getopt_long(argc, argv, "h:p:U:Weqd:at:", long_options, &optindex)) != -1)
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.8 2004/05/25 01:00:27 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.9 2004/06/01 02:54:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
}
-/*
- * Initialized NLS if enabled.
- */
-void
-init_nls(const char *argv0)
-{
- set_pglocale(argv0, "pgscripts");
-}
-
-
/*
* Provide strictly harmonized handling of --help and --version
* options.
const char *get_user_name(const char *progname);
#define _(x) gettext((x))
-void init_nls(const char *argv0);
typedef void (*help_handler) (const char *);
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/createdb.c,v 1.9 2004/05/25 01:00:27 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/createdb.c,v 1.10 2004/06/01 02:54:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
PGresult *result;
progname = get_progname(argv[0]);
- init_nls(argv[0]);
+ set_pglocale(argv[0], "pgscripts");
+
handle_help_version_opts(argc, argv, "createdb", help);
while ((c = getopt_long(argc, argv, "h:p:U:WeqO:D:T:E:", long_options, &optindex)) != -1)
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/createlang.c,v 1.10 2004/05/25 01:00:27 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/createlang.c,v 1.11 2004/06/01 02:54:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
PGresult *result;
progname = get_progname(argv[0]);
- init_nls(argv[0]);
+ set_pglocale(argv[0], "pgscripts");
+
handle_help_version_opts(argc, argv, "createlang", help);
while ((c = getopt_long(argc, argv, "lh:p:U:Wd:L:e", long_options, &optindex)) != -1)
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/createuser.c,v 1.11 2004/05/25 01:00:27 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/createuser.c,v 1.12 2004/06/01 02:54:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
PGresult *result;
progname = get_progname(argv[0]);
- init_nls(argv[0]);
+ set_pglocale(argv[0], "pgscripts");
+
handle_help_version_opts(argc, argv, "createuser", help);
while ((c = getopt_long(argc, argv, "h:p:U:WeqaAdDi:PEN", long_options, &optindex)) != -1)
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/dropdb.c,v 1.10 2004/05/25 01:00:27 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/dropdb.c,v 1.11 2004/06/01 02:54:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
PGresult *result;
progname = get_progname(argv[0]);
- init_nls(argv[0]);
+ set_pglocale(argv[0], "pgscripts");
+
handle_help_version_opts(argc, argv, "dropdb", help);
while ((c = getopt_long(argc, argv, "h:p:U:Weqi", long_options, &optindex)) != -1)
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/droplang.c,v 1.9 2004/05/25 01:00:27 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/droplang.c,v 1.10 2004/06/01 02:54:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
PGresult *result;
progname = get_progname(argv[0]);
- init_nls(argv[0]);
+ set_pglocale(argv[0], "pgscripts");
+
handle_help_version_opts(argc, argv, "droplang", help);
while ((c = getopt_long(argc, argv, "lh:p:U:Wd:e", long_options, &optindex)) != -1)
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/dropuser.c,v 1.9 2004/05/25 01:00:27 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/dropuser.c,v 1.10 2004/06/01 02:54:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
PGresult *result;
progname = get_progname(argv[0]);
- init_nls(argv[0]);
+ set_pglocale(argv[0], "pgscripts");
+
handle_help_version_opts(argc, argv, "dropuser", help);
while ((c = getopt_long(argc, argv, "h:p:U:Weqi", long_options, &optindex)) != -1)
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/vacuumdb.c,v 1.7 2004/05/25 01:00:27 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/vacuumdb.c,v 1.8 2004/06/01 02:54:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
bool verbose = false;
progname = get_progname(argv[0]);
- init_nls(argv[0]);
+ set_pglocale(argv[0], "pgscripts");
+
handle_help_version_opts(argc, argv, "vacuumdb", help);
while ((c = getopt_long(argc, argv, "h:p:U:Weqd:zat:fv", long_options, &optindex)) != -1)