13 "Rast3d_key_get_int: cannot find field %s in key structure", key);
17 if (sscanf(str,
"%d", i) == 1)
20 Rast3d_error(
"Rast3d_key_get_int: invalid value: field %s in key structure",
33 "Rast3d_key_get_double: cannot find field %s in key structure",
38 if (sscanf(str,
"%lf", d) == 1)
42 "Rast3d_key_get_double: invalid value: field %s in key structure", key);
55 "Rast3d_key_get_string: cannot find field %s in key structure",
67 char *val2,
int result1,
int result2,
int *resultVar)
73 "Rast3d_key_get_value: cannot find field %s in key structure", key);
77 if (strcmp(str, val1) == 0) {
81 if (strcmp(str, val2) == 0) {
87 "Rast3d_key_get_value: invalid type: field %s in key structure", key);
97 sprintf(keyValStr,
"%d", *i);
109 sprintf(keyValStr,
"%.50f", *d);
117 char *
const *keyValStr)
126 const char *val1,
const char *val2,
int keyval1,
127 int keyval2,
const int *keyvalVar)
129 if (*keyvalVar == keyval1) {
134 if (*keyvalVar == keyval2) {
const char * G_find_key_value(const char *, const struct Key_Value *)
Find given key (case sensitive)
void G_set_key_value(const char *, const char *, struct Key_Value *)
Set value for given key.
char * G_store(const char *)
Copy string to allocated memory.
void Rast3d_error(const char *,...) __attribute__((format(printf
int Rast3d_key_get_string(struct Key_Value *keys, const char *key, char **returnStr)
int Rast3d_key_set_value(struct Key_Value *keys, const char *key, const char *val1, const char *val2, int keyval1, int keyval2, const int *keyvalVar)
int Rast3d_key_set_double(struct Key_Value *keys, const char *key, const double *d)
int Rast3d_key_get_int(struct Key_Value *keys, const char *key, int *i)
int Rast3d_key_get_double(struct Key_Value *keys, const char *key, double *d)
int Rast3d_key_get_value(struct Key_Value *keys, const char *key, char *val1, char *val2, int result1, int result2, int *resultVar)
int Rast3d_key_set_int(struct Key_Value *keys, const char *key, const int *i)
int Rast3d_key_set_string(struct Key_Value *keys, const char *key, char *const *keyValStr)