18 char XYZ[3] = {
'X',
'Y',
'Z'};
24 int len = strlen(str), plen = strlen(prefix);
26 if (len >= plen && !memcmp(str, prefix, plen))
return 0;
35 int len = strlen(ptr), slen = strlen(suffix);
38 if (len < slen || memcmp(ptr + len - slen, suffix, slen))
return -1;
49 double *
value,
double scale)
51 if (!
string || !suffix || !value)
return -1;
55 char *ptr = strdup(
string);
59 *value = scale*atof(ptr);
79 qstr = strdup(str);
if (!qstr)
return -1; len = strlen(qstr);
101 if (len >= var->
plen &&
104 char *ptr = qstr + var->
plen;
109 printf(
"'%s': syntax error (%s)!\n", var->
prefix, qstr);
116 printf(
"'%s': key double counting (%s)!\n", var->
prefix, qstr);
122 *var->
addr = atof(ptr);
125 printf(
"'%s': value out of range (%s)!\n", var->
prefix, qstr);