#include "c.h"
-#include <stddef.h>
-#include <sys/types.h>
#include <limits.h>
-#include <stdlib.h>
#ifndef WIN32
#include <unistd.h>
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/fseeko.c,v 1.17 2004/12/31 22:03:53 pgsql Exp $
+ * $PostgreSQL: pgsql/src/port/fseeko.c,v 1.18 2005/07/28 04:03:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#ifdef bsdi
#include <pthread.h>
#endif
-#include <stdio.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#include <errno.h>
+
/*
* On BSD/OS and NetBSD, off_t and fpos_t are the same. Standards
* Copyright (c) 2003-2005, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/getaddrinfo.c,v 1.16 2005/01/01 20:44:33 tgl Exp $
+ * $PostgreSQL: pgsql/src/port/getaddrinfo.c,v 1.17 2005/07/28 04:03:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "c.h"
#ifndef WIN32_CLIENT_ONLY
-#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/gethostname.c,v 1.6 2004/12/31 22:03:53 pgsql Exp $
+ * $PostgreSQL: pgsql/src/port/gethostname.c,v 1.7 2005/07/28 04:03:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "c.h"
-#include <string.h>
-
#include <sys/utsname.h>
int
#include "c.h"
-
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95";
#endif /* LIBC_SCCS and not lint */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
int opterr = 1, /* if error message should be printed */
optind = 1, /* index into parent argv vector */
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $PostgreSQL: pgsql/src/port/getopt_long.c,v 1.3 2003/11/29 19:52:13 pgsql Exp $
+ * $PostgreSQL: pgsql/src/port/getopt_long.c,v 1.4 2005/07/28 04:03:14 tgl Exp $
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include "c.h"
#include "getopt_long.h"
+#ifndef HAVE_INT_OPTRESET
+int optreset;
+#endif
+
#define BADCH '?'
#define BADARG ':'
#define EMSG ""
+
int
getopt_long(int argc, char *const argv[],
const char *optstring,
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/getrusage.c,v 1.9 2005/05/16 05:52:13 neilc Exp $
+ * $PostgreSQL: pgsql/src/port/getrusage.c,v 1.10 2005/07/28 04:03:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h>
-#include <errno.h>
-
#include "c.h"
+
#include "rusagestub.h"
/* This code works on:
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/memcmp.c,v 1.7 2004/12/31 22:03:53 pgsql Exp $
+ * $PostgreSQL: pgsql/src/port/memcmp.c,v 1.8 2005/07/28 04:03:14 tgl Exp $
*
* This file was taken from NetBSD and is used by SunOS because memcmp
* on that platform does not properly compare negative bytes. The
* SUCH DAMAGE.
*/
-#include <string.h>
+#include "c.h"
+
/*
* Compare memory regions.
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/noblock.c,v 1.6 2005/03/25 00:34:31 tgl Exp $
+ * $PostgreSQL: pgsql/src/port/noblock.c,v 1.7 2005/07/28 04:03:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "c.h"
-#include <sys/types.h>
#include <fcntl.h>
+
bool
pg_set_noblock(int sock)
{
*
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/port/open.c,v 1.9 2005/03/24 04:36:20 momjian Exp $
+ * $PostgreSQL: pgsql/src/port/open.c,v 1.10 2005/07/28 04:03:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#ifdef WIN32
-#include <postgres.h>
+#include "c.h"
+
#include <windows.h>
#include <fcntl.h>
-#include <errno.h>
#include <assert.h>
int win32_open(const char *fileName, int fileFlags, ...);
* Add do ... while() macro fix
* Remove __inline, _DIAGASSERTs, __P
*
- * $PostgreSQL: pgsql/src/port/qsort.c,v 1.6 2005/05/25 21:40:43 momjian Exp $
+ * $PostgreSQL: pgsql/src/port/qsort.c,v 1.7 2005/07/28 04:03:14 tgl Exp $
*/
/* $NetBSD: qsort.c,v 1.13 2003/08/07 16:43:42 agc Exp $ */
* SUCH DAMAGE.
*/
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/types.h>
+#include "c.h"
static char *med3(char *, char *, char *,
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/random.c,v 1.5 2004/12/31 22:03:53 pgsql Exp $
+ * $PostgreSQL: pgsql/src/port/random.c,v 1.6 2005/07/28 04:03:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "c.h"
-#include <stdlib.h>
#include <math.h>
-#include <errno.h>
+
long
random()
* SUCH DAMAGE.
*/
-#include "postgres.h"
+#include "c.h"
#ifndef WIN32
#include <sys/ioctl.h>
* causing nasty effects.
**************************************************************/
-/*static char _id[] = "$PostgreSQL: pgsql/src/port/snprintf.c,v 1.27 2005/04/14 20:53:09 tgl Exp $";*/
+/*static char _id[] = "$PostgreSQL: pgsql/src/port/snprintf.c,v 1.28 2005/07/28 04:03:14 tgl Exp $";*/
static void dopr(char *buffer, const char *format, va_list args, char *end);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/srandom.c,v 1.5 2004/12/31 22:03:53 pgsql Exp $
+ * $PostgreSQL: pgsql/src/port/srandom.c,v 1.6 2005/07/28 04:03:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "c.h"
-#include <stdlib.h>
#include <math.h>
-#include <errno.h>
+
void
srandom(unsigned int seed)
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/strdup.c,v 1.6 2004/12/31 22:03:53 pgsql Exp $
+ * $PostgreSQL: pgsql/src/port/strdup.c,v 1.7 2005/07/28 04:03:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
-#include <string.h>
-#include <stdlib.h>
+#include "c.h"
+
#include "strdup.h"
+
char *
strdup(char const * string)
{
-/* $PostgreSQL: pgsql/src/port/strerror.c,v 1.4 2005/02/22 04:43:16 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/port/strerror.c,v 1.5 2005/07/28 04:03:14 tgl Exp $ */
/*
* strerror - map error number to descriptive string
* modified for ANSI by D'Arcy J.M. Cain
*/
-#include <string.h>
-#include <stdio.h>
-#include <errno.h>
+#include "c.h"
+
extern const char *const sys_errlist[];
extern int sys_nerr;
static char sccsid[] = "@(#)strtol.c 5.4 (Berkeley) 2/23/91";
#endif /* LIBC_SCCS and not lint */
+#include "c.h"
+
#include <limits.h>
#include <ctype.h>
-#include <errno.h>
-#include <stdlib.h>
+
#define const
static char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
+#include "c.h"
+
#include <limits.h>
#include <ctype.h>
-#include <errno.h>
-#include <stdlib.h>
+
/*
* Convert a string to an unsigned long integer.
*
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/port/thread.c,v 1.29 2004/12/31 22:03:53 pgsql Exp $
+ * $PostgreSQL: pgsql/src/port/thread.c,v 1.30 2005/07/28 04:03:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "c.h"
-#include <sys/types.h>
-#include <errno.h>
#ifdef WIN32_CLIENT_ONLY
#undef ERROR
#else
#include <pthread.h>
#endif
+
/*
* Threading sometimes requires specially-named versions of functions
* that return data in static buffers, like strerror_r() instead of