35 char buff[2001], buf1[2001];
40 G_debug(3,
"dig_read_frmt_ascii()");
43 if (
G_getl2(buff, 2000, dascii)) {
46 if (!(ptr = strchr(buff,
':'))) {
47 G_warning(
_(
"Vector format not recognized: %s"), buff);
51 len =
G_strlcpy(buf1, buff,
sizeof(buf1));
52 if (len >=
sizeof(buf1)) {
56 buf1[ptr - buff] =
'\0';
76 G_warning(
_(
"Vector format not recognized: %s"), buff);
85 G_warning(
_(
"Vector format '%s' not supported"), ptr);
94 G_warning(
_(
"Vector format '%s' not supported"), ptr);
99 while (
G_getl2(buff, 2000, dascii)) {
102 if (!(ptr = strchr(buff,
':'))) {
103 G_warning(
_(
"Format definition is not correct: %s"), buff);
107 len =
G_strlcpy(buf1, buff,
sizeof(buf1));
108 if (len >=
sizeof(buf1)) {
112 buf1[ptr - buff] =
'\0';
168 G_debug(3,
"dig_write_frmt_ascii()");
170 G_fatal_error(
"Format not supported by dig_write_frmt_ascii()");
int G_getl2(char *, int, FILE *)
Gets a line of text from a file of any pedigree.
void G_zero(void *, int)
Zero out a buffer, buf, of length i.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
int int G_strcasecmp(const char *, const char *)
String compare ignoring case (upper or lower)
char * G_chop(char *)
Chop leading and trailing white spaces.
int G_debug(int, const char *,...) __attribute__((format(printf
char * G_store(const char *)
Copy string to allocated memory.
size_t G_strlcpy(char *, const char *, size_t)
Safe string copy function.
#define GV_FORMAT_POSTGIS
PostGIS format.
#define GV_FORMAT_OGR
OGR format.
#define GV_PG_FID_COLUMN
GRASS-PostGIS data provider - default fid column.
int dig_read_frmt_ascii(FILE *dascii, struct Format_info *finfo)
Read external vector format file.
int dig_write_frmt_ascii(FILE *dascii UNUSED, struct Format_info *finfo UNUSED, int format UNUSED)
#define UNUSED
A macro for an attribute, if attached to a variable, indicating that the variable is not used.