pgsql-hackers discussion of this date.
#ifdef HAVE_ICONV_H
#include <iconv.h>
#endif
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#endif
#include "libpq-fe.h"
#include "dbf.h"
char *query;
dbhead *dbh;
- while ((i = getopt(argc, argv, "DWflucvh:b:e:d:t:s:B:U:F:T:")) != EOF)
+ while ((i = getopt(argc, argv, "DWflucvh:b:e:d:t:s:B:U:F:T:")) != -1)
{
switch (i)
{
my_opts->remotepass = 0;
/* get opts */
- while ((c = getopt(argc, argv, "H:p:U:P:d:t:o:xh?")) != EOF)
+ while ((c = getopt(argc, argv, "H:p:U:P:d:t:o:xh?")) != -1)
{
switch (c)
{
/*
- * $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.13 2001/11/05 17:46:23 momjian Exp $
+ * $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.14 2002/01/10 01:11:45 tgl Exp $
*
* pgbench: a simple TPC-B like benchmark program for PostgreSQL
* written by Tatsuo Ishii
PGconn *con;
PGresult *res;
- while ((c = getopt(argc, argv, "ih:nvp:dc:t:s:U:P:CS")) != EOF)
+ while ((c = getopt(argc, argv, "ih:nvp:dc:t:s:U:P:CS")) != -1)
{
switch (c)
{
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.119 2001/10/25 05:49:22 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.120 2002/01/10 01:11:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* variable */
}
- while ((flag = getopt(argc, argv, "B:dD:Fo:px:")) != EOF)
+ while ((flag = getopt(argc, argv, "B:dD:Fo:px:")) != -1)
{
switch (flag)
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.263 2002/01/06 21:40:02 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.264 2002/01/10 01:11:45 tgl Exp $
*
* NOTES
*
* with the wrong argument. Death and destruction will occur.
*/
opterr = 1;
- while ((opt = getopt(argc, argv, "A:a:B:b:c:D:d:Fh:ik:lm:MN:no:p:Ss-:")) != EOF)
+ while ((opt = getopt(argc, argv, "A:a:B:b:c:D:d:Fh:ik:lm:MN:no:p:Ss-:")) != -1)
{
switch (opt)
{
optreset = 1; /* some systems need this too */
#endif
- while ((opt = getopt(argc, argv, "A:a:B:b:c:D:d:Fh:ik:lm:MN:no:p:Ss-:")) != EOF)
+ while ((opt = getopt(argc, argv, "A:a:B:b:c:D:d:Fh:ik:lm:MN:no:p:Ss-:")) != -1)
{
switch (opt)
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.244 2002/01/01 23:16:22 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.245 2002/01/10 01:11:45 tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
secure = true;
ctx = PGC_POSTMASTER;
- while ((flag = getopt(argc, argv, "A:B:c:CD:d:Eef:FiNOPo:p:S:st:v:W:x:-:")) != EOF)
+ while ((flag = getopt(argc, argv, "A:B:c:CD:d:Eef:FiNOPo:p:S:st:v:W:x:-:")) != -1)
switch (flag)
{
case 'A':
if (!IsUnderPostmaster)
{
puts("\nPOSTGRES backend interactive interface ");
- puts("$Revision: 1.244 $ $Date: 2002/01/01 23:16:22 $\n");
+ puts("$Revision: 1.245 $ $Date: 2002/01/10 01:11:45 $\n");
}
/*
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_restore.c,v 1.31 2001/11/26 23:10:36 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_restore.c,v 1.32 2002/01/10 01:11:45 tgl Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
*
#include <termios.h>
#endif
-/* FreeBSD 4.3 seems to put getopt in unistd.h */
#include <unistd.h>
#ifdef HAVE_GETOPT_H
}
#ifdef HAVE_GETOPT_LONG
- while ((c = getopt_long(argc, argv, "acCd:f:F:h:i:lL:NoOp:P:rRsS:t:T:uU:vWxX:", cmdopts, NULL)) != EOF)
+ while ((c = getopt_long(argc, argv, "acCd:f:F:h:i:lL:NoOp:P:rRsS:t:T:uU:vWxX:", cmdopts, NULL)) != -1)
#else
while ((c = getopt(argc, argv, "acCd:f:F:h:i:lL:NoOp:P:rRsS:t:T:uU:vWxX:")) != -1)
#endif
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.51 2001/10/28 06:26:11 momjian Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.52 2002/01/10 01:11:45 tgl Exp $ */
/* New main for ecpg, the PostgreSQL embedded SQL precompiler. */
/* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */
#include "postgres_fe.h"
#include <unistd.h>
-
#ifdef HAVE_GETOPT_H
-#include "getopt.h"
+#include <getopt.h>
#endif
extern int optind;
add_include_path("/usr/local/include");
add_include_path(".");
- while ((c = getopt(argc, argv, "vo:I:tD:d")) != EOF)
+ while ((c = getopt(argc, argv, "vo:I:tD:d")) != -1)
{
switch (c)
{