31 for (n = 0; n < kv->nitems; n++)
32 if (kv->value[n][0]) {
33 if (EOF == fprintf(fd,
"%s: %s\n", kv->key[n], kv->value[n]))
58 while (
G_getl2(buf,
sizeof(buf) - 1, fd) != 0) {
60 while (*value && *value !=
':')
int G_getl2(char *buf, int n, FILE *fd)
Gets a line of text from a file of any pedigree.
void 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.
struct Key_Value * G_fread_key_value(FILE *fd)
Read key/values pairs from file.
int G_fwrite_key_value(FILE *fd, const struct Key_Value *kv)
Write key/value pairs to file.
void G_strip(char *buf)
Removes all leading and trailing white space from string.
SYMBOL * err(FILE *fp, SYMBOL *s, char *msg)