Definition at line 57 of file pgsql2shp-cli.c.
58{
61
62 int ret, c, i;
63
64
65 if (argc == 1)
66 {
68 }
69
70
73
74 while ((c =
pgis_getopt(argc, argv,
"bf:h:du:p:P:g:rkm:")) != EOF)
75 {
76 switch (c)
77 {
78 case 'b':
80 break;
81 case 'f':
83 break;
84 case 'h':
86 break;
87 case 'd':
89 break;
90 case 'r':
93 break;
94 case 'u':
96 break;
97 case 'p':
99 break;
100 case 'P':
102 break;
103 case 'g':
105 break;
106 case 'm':
108 break;
109 case 'k':
111 break;
112 default:
114 }
115 }
116
117
118
120 {
123 }
124 else
125 {
127 }
128
129
130
131
133 {
134
137 {
139 }
140 else
141 {
142
144 char *chrptr = strchr(strptr, '.');
145
146
147 if (chrptr)
148 {
149 if ( chrptr == strptr )
150 {
151
153 exit(0);
154 }
155
156 *chrptr = '\0';
157
158 config->
schema = strdup(strptr);
159 config->
table = strdup(chrptr+1);
160 }
161 else
162 {
163 config->
table = strdup(strptr);
164 }
165 }
166 }
167 else
168 {
170 }
171
173
176 {
177 fprintf(stderr,
"%s\n", state->
message);
178 fflush(stderr);
179 exit(1);
180 }
181
182
184 {
185 fprintf(stderr,
_(
"WARNING: -d switch is useless when dumping from postgis-1.0.0+\n"));
186 fflush(stderr);
187 }
188
189
190 fprintf(stdout,
_(
"Initializing... \n"));
191 fflush(stdout);
192
195 {
196 fprintf(stderr,
"%s\n", state->
message);
197 fflush(stderr);
198
200 exit(1);
201 }
202
205 fprintf(stdout,
_(
"Dumping: "));
206 fflush(stdout);
207
209 {
210
212 {
213 fprintf(stdout, "X");
214 fflush(stdout);
215 }
216
219 {
220 fprintf(stderr,
"%s\n", state->
message);
221 fflush(stderr);
222
224 exit(1);
225 }
226 }
227
229 fflush(stdout);
230
233 {
234 fprintf(stderr,
"%s\n", state->
message);
235 fflush(stderr);
236
238 exit(1);
239 }
240
242
243 return 0;
244}
int pgis_getopt(int argc, char **argv, char *opts)
void set_dumper_config_defaults(SHPDUMPERCONFIG *config)
int ShpDumperGetRecordCount(SHPDUMPERSTATE *state)
void ShpDumperDestroy(SHPDUMPERSTATE *state)
int ShpDumperConnectDatabase(SHPDUMPERSTATE *state)
char * shapetypename(int num)
int ShpLoaderGenerateShapeRow(SHPDUMPERSTATE *state)
SHPDUMPERSTATE * ShpDumperCreate(SHPDUMPERCONFIG *config)
int ShpDumperCloseTable(SHPDUMPERSTATE *state)
int ShpDumperOpenTable(SHPDUMPERSTATE *state)
char * column_map_filename
SHPCONNECTIONCONFIG * conn
char message[SHPDUMPERMSGLEN]
References _, shp_dumper_config::binary, shp_dumper_config::column_map_filename, shp_dumper_state::config, shp_dumper_config::conn, shp_dumper_state::currow, shp_connection_state::database, shp_dumper_config::dswitchprovided, shp_dumper_config::fetchsize, shp_dumper_config::geo_col_name, shp_connection_state::host, shp_dumper_config::includegid, shp_dumper_config::keep_fieldname_case, malloc(), shp_dumper_state::message, shp_dumper_state::outshptype, shp_connection_state::password, pgis_getopt(), shp_dumper_state::pgis_major_version, pgis_optarg, pgis_optind, pgis_optopt, shp_connection_state::port, shp_dumper_config::schema, set_dumper_config_defaults(), shapetypename(), shp_dumper_config::shp_file, ShpDumperCloseTable(), ShpDumperConnectDatabase(), ShpDumperCreate(), ShpDumperDestroy(), SHPDUMPERERR, ShpDumperGetRecordCount(), SHPDUMPEROK, ShpDumperOpenTable(), ShpLoaderGenerateShapeRow(), shp_dumper_config::table, shp_dumper_config::unescapedattrs, usage(), shp_connection_state::username, and shp_dumper_config::usrquery.