#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#include <ngc/core/ngcb.h>Macros | |
| #define | _GNU_SOURCE |
| #define | _REENTRANT |
| #define | ngcbKEY_COMMENT '#' |
| #define | ngcbKEY_COMMENT1 '/' |
| #define | ngcbKEY_NEWLINE '\n' |
| #define | ngcbKEY_BREAK ';' |
| #define | ngcbKEY_NULL '\0' |
| #define | ngcbKEY_SEP '.' |
| #define | ngcbKEY_VECSEP ',' |
| #define | ngcbMAX_KEY_LEN 256 |
| #define | ngcbMAX_KEYELE_LEN 512 |
Functions | |
| int | ngcbKeyGetNext (char *fileBuffer, int fileLen, int *pos, int *line, const char *mask, char *key, char *keyVal, char *erms) |
| int | ngcbKeySplit (char *key, int *nsplit, char **ksplit, int *val, char *erms) |
| int | ngcbKeyIdx (char *key, int *nsplit, int *kval, char *erms) |
| int | ngcbKeyMaskIdx (char *key, const char *mask) |
| int | ngcbKeyGetVecInt (const char *keyVal, int *vec, char *erms) |
| int | ngcbKeyGetVecFloat (const char *keyVal, float *vec, char *erms) |
| int | ngcbKeyGetVecDouble (const char *keyVal, double *vec, char *erms) |
| void | ngcbDiscardDetIdx (char *key) |
| #define _GNU_SOURCE |
| #define _REENTRANT |
| #define ngcbKEY_BREAK ';' |
break key
| #define ngcbKEY_COMMENT '#' |
comment key
| #define ngcbKEY_COMMENT1 '/' |
comment key
| #define ngcbKEY_NEWLINE '\n' |
new line key
| #define ngcbKEY_NULL '\0' |
NULL key
| #define ngcbKEY_SEP '.' |
separator key
| #define ngcbKEY_VECSEP ',' |
vector separator key
| #define ngcbMAX_KEY_LEN 256 |
maximum keyword length
| #define ngcbMAX_KEYELE_LEN 512 |
maximum keyword value length
| void ngcbDiscardDetIdx | ( | char * | key | ) |
Discards the DETi index from the keyword, if it is present.
| int ngcbKeyGetNext | ( | char * | fileBuffer, |
| int | fileLen, | ||
| int * | pos, | ||
| int * | line, | ||
| const char * | mask, | ||
| char * | key, | ||
| char * | keyVal, | ||
| char * | erms ) |
Read the next keyword from fileBuffer. The function returns -1 in case of error. If operation was successful zero is returned. If the end of the buffer has been reached the function returns a positive value(1).
| int ngcbKeyGetVecDouble | ( | const char * | keyVal, |
| double * | vec, | ||
| char * | erms ) |
Get 64-bit floating point vector from keyword value keyVal. The function returna the length of the scanned vector. A negative return value indicates an error.
| int ngcbKeyGetVecFloat | ( | const char * | keyVal, |
| float * | vec, | ||
| char * | erms ) |
Get 32-bit floating point vector from keyword value keyVal. The function returna the length of the scanned vector. A negative return value indicates an error.
| int ngcbKeyGetVecInt | ( | const char * | keyVal, |
| int * | vec, | ||
| char * | erms ) |
Get 32-bit integer vector vector from keyword value keyVal. The function returna the length of the scanned vector. A negative return value indicates an error.
| int ngcbKeyIdx | ( | char * | key, |
| int * | nsplit, | ||
| int * | kval, | ||
| char * | erms ) |
Get the index-array of all categories in the keyword. The function returns ngcbFAILURE in case of error. If operation was successful ngcbSUCCESS is returned.
| int ngcbKeyMaskIdx | ( | char * | key, |
| const char * | mask ) |
Return the index after the first occurrence of mask in the keyword or -1 if mask is not found or no index is present.
| int ngcbKeySplit | ( | char * | key, |
| int * | nsplit, | ||
| char ** | ksplit, | ||
| int * | val, | ||
| char * | erms ) |
Split a keyword into its category parts. The function returns ngcbFAILURE in case of error. If operation was successful ngcbSUCCESS is returned.