12 G3d_error(
"G3d_keyGetInt: cannot find field %s in key structure",
17 if (sscanf(str,
"%d", i) == 1)
20 G3d_error(
"G3d_keyGetInt: invalid value: field %s in key structure", key);
31 G3d_error(
"G3d_keyGetDouble: cannot find field %s in key structure",
36 if (sscanf(str,
"%lf", d) == 1)
39 G3d_error(
"G3d_keyGetDouble: invalid value: field %s in key structure",
52 G3d_error(
"G3d_keyGetString: cannot find field %s in key structure",
66 char *
val2,
int result1,
int result2,
int *resultVar)
71 G3d_error(
"G3d_keyGetValue: cannot find field %s in key structure",
77 if (strcmp(str, val1) == 0) {
81 if (strcmp(str, val2) == 0) {
86 G3d_error(
"G3d_keyGetValue: invalid type: field %s in key structure",
93 int G3d_keySetInt(
struct Key_Value *keys,
const char *key,
const int *i)
107 sprintf(keyValStr,
"%.50f", *d);
115 char *
const *keyValStr)
124 const char *
val2,
int keyval1,
int keyval2,
125 const int *keyvalVar)
127 if (*keyvalVar == keyval1)
129 if (*keyvalVar == keyval2)
132 G3d_error(
"G3d_keySetValue: wrong key value");
char * G_find_key_value(const char *key, const struct Key_Value *kv)
Find given key.
sprintf(buf2,"%s", G3D_CATS_ELEMENT)
int G3d_keyGetValue(struct Key_Value *keys, const char *key, char *val1, char *val2, int result1, int result2, int *resultVar)
char * G_store(const char *s)
Copy string to allocated memory.
void G3d_error(const char *msg,...)
int G3d_keyGetDouble(struct Key_Value *keys, const char *key, double *d)
int G3d_keySetInt(struct Key_Value *keys, const char *key, const int *i)
int G3d_keySetValue(struct Key_Value *keys, const char *key, const char *val1, const char *val2, int keyval1, int keyval2, const int *keyvalVar)
int G_strip(char *buf)
Removes all leading and trailing white space from string.
int G3d_keySetDouble(struct Key_Value *keys, const char *key, const double *d)
int G3d_keyGetString(struct Key_Value *keys, const char *key, char **returnStr)
int G3d_keySetString(struct Key_Value *keys, const char *key, char *const *keyValStr)
int G3d_keyGetInt(struct Key_Value *keys, const char *key, int *i)
int G_set_key_value(const char *key, const char *value, struct Key_Value *kv)
Set value for given key.