Me@0: /* Me@1: * Me@0: * Author: SeanHalle@yahoo.com Me@0: * Me@0: * Created on November 19, 2009, 6:30 PM Me@0: */ Me@0: Me@0: #ifndef _PARAM_H Me@0: #define _PARAM_H Me@0: Me@0: typedef Me@0: struct Me@0: { int type; Me@0: int intValue; Me@0: char * strValue; Me@0: float floatValue; Me@0: } Me@0: ParamStruc; Me@0: Me@0: #define INT_PARAM_TYPE 0 Me@0: #define STRING_PARAM_TYPE 1 Me@0: #define FLOAT_PARAM_TYPE 2 Me@0: Me@2: #define PARAM_BAG_HASHSIZE 1024 Me@0: Me@2: typedef struct _ParamBagHashEntry ParamBagHashEntry; Me@2: Me@2: struct _ParamBagHashEntry Me@0: { Me@2: char *key; Me@2: ParamStruc *param; Me@2: struct _ParamBagHashEntry *next; Me@0: } Me@2: /*ParamBagHashEntry*/; Me@2: Me@0: Me@0: typedef Me@0: struct Me@0: { int bagSz; Me@2: ParamBagHashEntry* *entries; Me@0: } Me@0: ParamBag; Me@0: Me@2: Me@0: ParamBag *makeParamBag(); Me@2: void readParamFileIntoBag( char *paramFileName, ParamBag * bag ); Me@0: ParamStruc *getParamFromBag( char *key, ParamBag * bag ); Me@0: int addParamToBag( char* key, ParamStruc *param, ParamBag *bag ); Me@0: void freeParamBag( ParamBag *bag ); Me@2: //char *paramBagToString( ParamBag * bag ); Me@0: ParamStruc *makeParamStruc(); Me@0: ParamStruc *makeParamFromStrs( char * type, char *value ); Me@0: ssize_t getline( char **lineptr, size_t *n, FILE *stream ); Me@0: Me@0: #endif /* _PARAM_H */ Me@0: