Me@0: /* Me@0: * File: Param.h 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@0: #define HASHSIZE 101 Me@0: Me@0: typedef Me@0: struct _HashEntry Me@0: { Me@0: char *key; Me@0: ParamStruc *param; Me@0: struct _HashEntry *next; Me@0: } Me@0: HashEntry; Me@0: Me@0: typedef Me@0: struct Me@0: { int bagSz; Me@0: HashEntry* *entries; Me@0: } Me@0: ParamBag; Me@0: Me@0: ParamBag *makeParamBag(); 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@0: //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: