16 #include <grass/gis.h>
33 for (n = 0; n < kv->nitems; n++)
34 if (kv->value[n][0]) {
35 if (EOF == fprintf(fd,
"%s: %s\n", kv->key[n], kv->value[n]))
60 while (
G_getl2(buf,
sizeof(buf) - 1, fd) != 0) {
62 while (*value && *value !=
':')
struct Key_Value * G_fread_key_value(FILE *fd)
Read key/values pairs from file.
int G_free_key_value(struct Key_Value *kv)
Free allocated Key_Value structure.
int G_fwrite_key_value(FILE *fd, const struct Key_Value *kv)
Write key/value pairs to file.
int G_getl2(char *buf, int n, FILE *fd)
gets a line of text from a file of any pedigree
int G_strip(char *buf)
Removes all leading and trailing white space from string.
char buf[GNAME_MAX+sizeof(G3D_DIRECTORY)+2]
int G_set_key_value(const char *key, const char *value, struct Key_Value *kv)
Set value for given key.
struct Key_Value * G_create_key_value(void)
Allocate and initialize Key_Value structure.