Mercurial > cgi-bin > hgwebdir.cgi > PR > PR_Implementations > PR__Univ > PR__includes > PR__include
comparison prparam.h @ 4:10986666560d
Changes on copy on D:
| author | Sean Halle <seanhalle@yahoo.com> |
|---|---|
| date | Sun, 15 Sep 2013 07:18:46 -0700 |
| parents | |
| children | f3cb11baf791 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:316cc8839ef1 |
|---|---|
| 1 /* | |
| 2 * | |
| 3 * Author: SeanHalle@yahoo.com | |
| 4 * | |
| 5 * Created on November 19, 2009, 6:30 PM | |
| 6 */ | |
| 7 | |
| 8 #ifndef _PARAM_H | |
| 9 #define _PARAM_H | |
| 10 | |
| 11 #include <PR__include/PR__primitive_data_types.h> | |
| 12 | |
| 13 | |
| 14 typedef | |
| 15 struct | |
| 16 { int type; | |
| 17 int intValue; | |
| 18 char * strValue; | |
| 19 float floatValue; | |
| 20 } | |
| 21 ParamStruc; | |
| 22 | |
| 23 #define INT_PARAM_TYPE 0 | |
| 24 #define STRING_PARAM_TYPE 1 | |
| 25 #define FLOAT_PARAM_TYPE 2 | |
| 26 | |
| 27 #define PARAM_BAG_HASHSIZE 1024 | |
| 28 | |
| 29 typedef struct _ParamBagHashEntry ParamBagHashEntry; | |
| 30 | |
| 31 struct _ParamBagHashEntry | |
| 32 { | |
| 33 char *key; | |
| 34 ParamStruc *param; | |
| 35 struct _ParamBagHashEntry *next; | |
| 36 } | |
| 37 /*ParamBagHashEntry*/; | |
| 38 | |
| 39 | |
| 40 typedef | |
| 41 struct | |
| 42 { int bagSz; | |
| 43 ParamBagHashEntry* *entries; | |
| 44 } | |
| 45 ParamBag; | |
| 46 | |
| 47 | |
| 48 ParamBag *makeParamBag(); | |
| 49 void readParamFileIntoBag( char *paramFileName, ParamBag * bag ); | |
| 50 ParamStruc *getParamFromBag( char *key, ParamBag * bag ); | |
| 51 int addParamToBag( char* key, ParamStruc *param, ParamBag *bag ); | |
| 52 void freeParamBag( ParamBag *bag ); | |
| 53 //char *paramBagToString( ParamBag * bag ); | |
| 54 ParamStruc *makeParamStruc(); | |
| 55 ParamStruc *makeParamFromStrs( char * type, char *value ); | |
| 56 ssize_t getline( char **lineptr, size_t *n, FILE *stream ); | |
| 57 | |
| 58 #endif /* _PARAM_H */ | |
| 59 |
