|
5 | 5 | oktober 1996: merged sources of dbf2msql.c and dbf2pg.c |
6 | 6 | oktober 1997: removed msql support |
7 | 7 | */ |
8 | | -#defineHAVE_TERMIOS_H |
9 | | -#defineHAVE_ICONV_H |
| 8 | +#include"postgres_fe.h" |
| 9 | + |
| 10 | +#defineHAVE_ICONV_H/* should be somewhere else */ |
10 | 11 |
|
11 | | -#include<stdio.h> |
12 | 12 | #include<fcntl.h> |
13 | | -#include<stdlib.h> |
14 | 13 | #include<unistd.h> |
15 | | -#include<string.h> |
16 | 14 | #include<ctype.h> |
17 | 15 | #ifdefHAVE_TERMIOS_H |
18 | 16 | #include<termios.h> |
|
21 | 19 | #include<iconv.h> |
22 | 20 | #endif |
23 | 21 |
|
24 | | -#include<libpq-fe.h> |
| 22 | +#include"libpq-fe.h" |
25 | 23 | #include"dbf.h" |
26 | 24 |
|
27 | 25 | intverbose=0,upper=0,lower=0,create=0,fieldlow=0; |
28 | 26 | intdel=0; |
29 | 27 | unsignedintbegin=0,end=0; |
30 | 28 | unsignedintt_block=0; |
| 29 | + |
31 | 30 | #ifdefHAVE_ICONV_H |
32 | 31 | char*charset_from=NULL; |
33 | 32 | char*charset_to="ISO-8859-1"; |
@@ -158,12 +157,11 @@ int check_table(PGconn *conn, char *table) { |
158 | 157 | } |
159 | 158 |
|
160 | 159 | voidusage(void){ |
161 | | -printf("\ |
162 | | -dbf2pg |
163 | | -usage:dbf2pg [-u |-l] [-hhostname] [-W] [-Uusername] |
164 | | - [-Btransaction_size] [-Fcharset_from [-Tcharset_to]] |
165 | | - [-soldname=newname[,oldname=newname[...]]] [-ddbase] |
166 | | - [-ttable] [-c |-D] [-f] [-v[v]]dbf-file\n"); |
| 160 | +printf("dbf2pg\n" |
| 161 | +"usage: dbf2pg [-u | -l] [-h hostname] [-W] [-U username]\n" |
| 162 | +" [-B transaction_size] [-F charset_from [-T charset_to]]\n" |
| 163 | +" [-s oldname=newname[,oldname=newname[...]]] [-d dbase]\n" |
| 164 | +" [-t table] [-c | -D] [-f] [-v[v]] dbf-file\n"); |
167 | 165 | } |
168 | 166 |
|
169 | 167 | /* patch submitted by Jeffrey Y. Sue <jysue@aloha.net> */ |
|