24 static char *misc_read_line(
const char *,
const char *,
const char *);
25 static void misc_write_line(
const char *,
const char *,
const char *);
40 return misc_read_line(
"units",
name, mapset);
53 misc_write_line(
"units",
name, str);
69 return misc_read_line(
"vertical_datum",
name, mapset);
82 misc_write_line(
"vertical_datum",
name, str);
98 return misc_read_line(
"semantic_label",
name, mapset);
132 misc_write_line(
"semantic_label",
name, str);
158 if (strlen(semantic_label) >=
GNAME_MAX) {
168 if (!((*s >=
'A' && *s <=
'Z') || (*s >=
'a' && *s <=
'z') ||
169 (*s >=
'0' && *s <=
'9') || *s ==
'_' || *s ==
'-')) {
170 G_warning(
_(
"Character '%c' not allowed in a semantic label."), *s);
190 static char *misc_read_line(
const char *elem,
const char *
name,
203 G_warning(
_(
"Unable to read <%s> for raster map <%s@%s>"), elem,
name,
207 if (
G_getl2(buff,
sizeof(buff) - 1, fp) == 0) {
214 _(
"Error closing <%s> metadata file for raster map <%s@%s>"), elem,
230 static void misc_write_line(
const char *elem,
const char *
name,
const char *str)
237 _(
"Unable to create <%s> metadata file for raster map <%s@%s>"),
242 fprintf(fp,
"%s\n", str);
246 _(
"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.