Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > ParamHelper
comparison Param.h @ 0:481dd533f0e8
initial add
| author | Me |
|---|---|
| date | Sat, 22 May 2010 19:50:16 -0700 |
| parents | |
| children | 396fda650c30 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:4f018908dfee |
|---|---|
| 1 /* | |
| 2 * File: Param.h | |
| 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 typedef | |
| 12 struct | |
| 13 { int type; | |
| 14 int intValue; | |
| 15 char * strValue; | |
| 16 float floatValue; | |
| 17 } | |
| 18 ParamStruc; | |
| 19 | |
| 20 #define INT_PARAM_TYPE 0 | |
| 21 #define STRING_PARAM_TYPE 1 | |
| 22 #define FLOAT_PARAM_TYPE 2 | |
| 23 | |
| 24 #define HASHSIZE 101 | |
| 25 | |
| 26 typedef | |
| 27 struct _HashEntry | |
| 28 { | |
| 29 char *key; | |
| 30 ParamStruc *param; | |
| 31 struct _HashEntry *next; | |
| 32 } | |
| 33 HashEntry; | |
| 34 | |
| 35 typedef | |
| 36 struct | |
| 37 { int bagSz; | |
| 38 HashEntry* *entries; | |
| 39 } | |
| 40 ParamBag; | |
| 41 | |
| 42 ParamBag *makeParamBag(); | |
| 43 ParamStruc *getParamFromBag( char *key, ParamBag * bag ); | |
| 44 int addParamToBag( char* key, ParamStruc *param, ParamBag *bag ); | |
| 45 void freeParamBag( ParamBag *bag ); | |
| 46 //char *paramBagToString( ParamBag * bag ) | |
| 47 ParamStruc *makeParamStruc(); | |
| 48 ParamStruc *makeParamFromStrs( char * type, char *value ); | |
| 49 ssize_t getline( char **lineptr, size_t *n, FILE *stream ); | |
| 50 | |
| 51 #endif /* _PARAM_H */ | |
| 52 |
