#ident "$URL: svn://elmer/devel/SVN/SDDAS/trunk/libCfg/Pconfig.h $ %D% SwRI" #ifndef _loc_ParseConfig_h /* Definitions for using the Pconfig function set. */ #define T_CHAR 1 #define T_SHORT 2 #define T_INT 3 #define T_FLOAT 4 #define T_DOUBLE 5 #define T_STRING 6 #define T_STRPTR 7 #define T_SHORT_ARRY 8 #define T_INT_ARRY 9 #define T_FLOAT_ARRY 10 #define T_DOUBLE_ARRY 11 #define T_STRING_ARRY 12 #define T_STRPTR_ARRY 13 #define IS_OPTIONAL 1 #define IS_REQUIRED 2 #define SYMBOLSIZE 256 #define CONFIG_TABLE_WIDTH 128 #define ALLOC_ATOM 10 #ifndef CNULL #define CNULL (config_t *)0x0 #endif #define SNULL (symb_t *)0x0 /* Structures for using the Pconfig function set. */ typedef struct symb_s { short referenced; /* Indicates if this element has been used. */ char *param; /* The name of a config parameter. */ char *value; /* The value of a config parameter. */ } symb_t; typedef struct config_s { int elements[CONFIG_TABLE_WIDTH]; /* The length of each symbol array. */ int used[CONFIG_TABLE_WIDTH]; /* The number of array elements used. */ symb_t *symbols[CONFIG_TABLE_WIDTH]; /* Array of pointers to symbol arrays.*/ } config_t; typedef struct def_s { char *param; /* Name of the parameter in the config file. */ int type; /* Type of input to use for the value. */ void *value; /* Pointer to the storage location for the value. */ int required; /* Flag for optional or required parameter. */ int n_values; /* number of values for param. */ } def_t; #if defined(__cplusplus) extern "C" { #endif /* Function declarations for using the Pconfig function set. */ extern char *get_symbol(); extern config_t *open_config(); extern void close_config(); extern void refresh_config(); #if defined(__cplusplus) } #endif #define _loc_ParseConfig_h #endif