Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > ParamHelper
diff Param.h @ 0:481dd533f0e8
initial add
| author | Me |
|---|---|
| date | Sat, 22 May 2010 19:50:16 -0700 |
| parents | |
| children | 396fda650c30 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/Param.h Sat May 22 19:50:16 2010 -0700 1.3 @@ -0,0 +1,52 @@ 1.4 +/* 1.5 + * File: Param.h 1.6 + * Author: SeanHalle@yahoo.com 1.7 + * 1.8 + * Created on November 19, 2009, 6:30 PM 1.9 + */ 1.10 + 1.11 +#ifndef _PARAM_H 1.12 +#define _PARAM_H 1.13 + 1.14 +typedef 1.15 +struct 1.16 + { int type; 1.17 + int intValue; 1.18 + char * strValue; 1.19 + float floatValue; 1.20 + } 1.21 +ParamStruc; 1.22 + 1.23 +#define INT_PARAM_TYPE 0 1.24 +#define STRING_PARAM_TYPE 1 1.25 +#define FLOAT_PARAM_TYPE 2 1.26 + 1.27 +#define HASHSIZE 101 1.28 + 1.29 +typedef 1.30 +struct _HashEntry 1.31 + { 1.32 + char *key; 1.33 + ParamStruc *param; 1.34 + struct _HashEntry *next; 1.35 + } 1.36 +HashEntry; 1.37 + 1.38 +typedef 1.39 +struct 1.40 + { int bagSz; 1.41 + HashEntry* *entries; 1.42 + } 1.43 +ParamBag; 1.44 + 1.45 +ParamBag *makeParamBag(); 1.46 +ParamStruc *getParamFromBag( char *key, ParamBag * bag ); 1.47 +int addParamToBag( char* key, ParamStruc *param, ParamBag *bag ); 1.48 +void freeParamBag( ParamBag *bag ); 1.49 +//char *paramBagToString( ParamBag * bag ) 1.50 +ParamStruc *makeParamStruc(); 1.51 +ParamStruc *makeParamFromStrs( char * type, char *value ); 1.52 +ssize_t getline( char **lineptr, size_t *n, FILE *stream ); 1.53 + 1.54 +#endif /* _PARAM_H */ 1.55 +
