23 static char *misc_read_line(
const char *,
const char *,
const char *);
24 static void misc_write_line(
const char *,
const char *,
const char *);
39 return misc_read_line(
"units",
name, mapset);
52 misc_write_line(
"units",
name, str);
68 return misc_read_line(
"vertical_datum",
name, mapset);
81 misc_write_line(
"vertical_datum",
name, str);
97 return misc_read_line(
"semantic_label",
name, mapset);
131 misc_write_line(
"semantic_label",
name, str);
157 if (strlen(semantic_label) >=
GNAME_MAX) {
167 if (!((*s >=
'A' && *s <=
'Z') || (*s >=
'a' && *s <=
'z') ||
168 (*s >=
'0' && *s <=
'9') || *s ==
'_' || *s ==
'-')) {
169 G_warning(
_(
"Character '%c' not allowed in a semantic label."), *s);
189 static char *misc_read_line(
const char *elem,
const char *
name,
202 G_warning(
_(
"Unable to read <%s> for raster map <%s@%s>"), elem,
name,
206 if (
G_getl2(buff,
sizeof(buff) - 1, fp) == 0) {
213 _(
"Error closing <%s> metadata file for raster map <%s@%s>"), elem,
229 static void misc_write_line(
const char *elem,
const char *
name,
const char *str)
236 _(
"Unable to create <%s> metadata file for raster map <%s@%s>"),
241 fprintf(fp,
"%s\n", str);
245 _(
"Error closing <%s> metadata file for raster map <%s@%s>"),
int G_getl2(char *, int, FILE *)
Gets a line of text from a file of any pedigree.
FILE * G_fopen_old_misc(const char *, const char *, const char *, const char *)
open a database misc file for reading
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
int G_legal_filename(const char *)
Check for legal database file name.
FILE * G_fopen_new_misc(const char *, const char *, const char *)
open a new database misc file
const char * G_mapset(void)
Get current mapset name.
const char * G_find_file2_misc(const char *, const char *, const char *, const char *)
Searches for a misc file from the mapset search list or in a specified mapset. (look but don't touch)
char * G_store(const char *)
Copy string to allocated memory.