PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches
shpcommon.h
Go to the documentation of this file.
1/**********************************************************************
2 *
3 * PostGIS - Spatial Types for PostgreSQL
4 * http://postgis.net
5 *
6 * Copyright (C) 2014 Sandro Santilli <strk@kbt.io>
7 * Copyright (C) 2010 Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU General Public Licence. See the COPYING file.
11 *
12 **********************************************************************/
13
14#ifndef SHPCOMMON_H
15#define SHPCOMMON_H
16
17/* For internationalization */
18#ifdef ENABLE_NLS
19#include <libintl.h>
20#include <locale.h>
21#define _(String) gettext(String)
22#define PACKAGE "shp2pgsql"
23#else
24#define _(String) String
25#endif
26
27
28
30{
31 /* PgSQL username to log in with */
32 char *username;
33
34 /* PgSQL password to log in with */
35 char *password;
36
37 /* PgSQL database to connect to */
38 char *database;
39
40 /* PgSQL port to connect to */
41 char *port;
42
43 /* PgSQL server to connect to */
44 char *host;
45
47
48/* External shared functions */
49char *escape_connection_string(char *str);
50
51/* Column map between pgsql and dbf */
52typedef struct colmap_t {
53
54 /* Column map pgfieldnames */
56
57 /* Column map dbffieldnames */
59
60 /* Number of entries within column map */
61 int size;
62
64
95int colmap_read(const char *fname, colmap *map, char *ebuf, size_t ebuflen);
96
97void colmap_init(colmap *map);
98
99void colmap_clean(colmap *map);
100
101const char *colmap_dbf_by_pg(colmap *map, const char *pgname);
102
103const char *colmap_pg_by_dbf(colmap *map, const char *dbfname);
104
105char *codepage2encoding(const char *cpg);
106char *encoding2codepage(const char *encoding);
107
108#endif
#define str(s)
char * encoding2codepage(const char *encoding)
Definition shpcommon.c:357
int colmap_read(const char *fname, colmap *map, char *ebuf, size_t ebuflen)
Read the content of filename into a symbol map.
Definition shpcommon.c:217
void colmap_init(colmap *map)
Definition shpcommon.c:163
struct shp_connection_state SHPCONNECTIONCONFIG
const char * colmap_dbf_by_pg(colmap *map, const char *pgname)
Definition shpcommon.c:189
char * codepage2encoding(const char *cpg)
Definition shpcommon.c:302
struct colmap_t colmap
void colmap_clean(colmap *map)
Definition shpcommon.c:171
const char * colmap_pg_by_dbf(colmap *map, const char *dbfname)
Definition shpcommon.c:203
char * escape_connection_string(char *str)
Escape strings that are to be used as part of a PostgreSQL connection string.
Definition shpcommon.c:113
char ** pgfieldnames
Definition shpcommon.h:55
int size
Definition shpcommon.h:61
char ** dbffieldnames
Definition shpcommon.h:58