提交 1e277911 编写于 作者: T Tom Lane

Fix some portability problems (get it to compile, at least, on HP's cc)

上级 394925b6
...@@ -5,14 +5,12 @@ ...@@ -5,14 +5,12 @@
oktober 1996: merged sources of dbf2msql.c and dbf2pg.c oktober 1996: merged sources of dbf2msql.c and dbf2pg.c
oktober 1997: removed msql support oktober 1997: removed msql support
*/ */
#define HAVE_TERMIOS_H #include "postgres_fe.h"
#define HAVE_ICONV_H
#define HAVE_ICONV_H /* should be somewhere else */
#include <stdio.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <string.h>
#include <ctype.h> #include <ctype.h>
#ifdef HAVE_TERMIOS_H #ifdef HAVE_TERMIOS_H
#include <termios.h> #include <termios.h>
...@@ -21,13 +19,14 @@ ...@@ -21,13 +19,14 @@
#include <iconv.h> #include <iconv.h>
#endif #endif
#include <libpq-fe.h> #include "libpq-fe.h"
#include "dbf.h" #include "dbf.h"
int verbose = 0, upper = 0, lower = 0, create = 0, fieldlow = 0; int verbose = 0, upper = 0, lower = 0, create = 0, fieldlow = 0;
int del = 0; int del = 0;
unsigned int begin = 0, end = 0; unsigned int begin = 0, end = 0;
unsigned int t_block = 0; unsigned int t_block = 0;
#ifdef HAVE_ICONV_H #ifdef HAVE_ICONV_H
char *charset_from=NULL; char *charset_from=NULL;
char *charset_to="ISO-8859-1"; char *charset_to="ISO-8859-1";
...@@ -158,12 +157,11 @@ int check_table(PGconn *conn, char *table) { ...@@ -158,12 +157,11 @@ int check_table(PGconn *conn, char *table) {
} }
void usage(void){ void usage(void){
printf("\ printf("dbf2pg\n"
dbf2pg "usage: dbf2pg [-u | -l] [-h hostname] [-W] [-U username]\n"
usage: dbf2pg [-u | -l] [-h hostname] [-W] [-U username] " [-B transaction_size] [-F charset_from [-T charset_to]]\n"
[-B transaction_size] [-F charset_from [-T charset_to]] " [-s oldname=newname[,oldname=newname[...]]] [-d dbase]\n"
[-s oldname=newname[,oldname=newname[...]]] [-d dbase] " [-t table] [-c | -D] [-f] [-v[v]] dbf-file\n");
[-t table] [-c | -D] [-f] [-v[v]] dbf-file\n");
} }
/* patch submitted by Jeffrey Y. Sue <jysue@aloha.net> */ /* patch submitted by Jeffrey Y. Sue <jysue@aloha.net> */
......
...@@ -111,7 +111,7 @@ dblink(PG_FUNCTION_ARGS) ...@@ -111,7 +111,7 @@ dblink(PG_FUNCTION_ARGS)
results->res = res; results->res = res;
res = NULL; res = NULL;
(dblink_results *) fcinfo->flinfo->fn_extra = results; fcinfo->flinfo->fn_extra = (void *) results;
results = NULL; results = NULL;
results = fcinfo->flinfo->fn_extra; results = fcinfo->flinfo->fn_extra;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册