annotate Param.h @ 0:481dd533f0e8

initial add
author Me
date Sat, 22 May 2010 19:50:16 -0700
parents
children 396fda650c30
rev   line source
Me@0 1 /*
Me@0 2 * File: Param.h
Me@0 3 * Author: SeanHalle@yahoo.com
Me@0 4 *
Me@0 5 * Created on November 19, 2009, 6:30 PM
Me@0 6 */
Me@0 7
Me@0 8 #ifndef _PARAM_H
Me@0 9 #define _PARAM_H
Me@0 10
Me@0 11 typedef
Me@0 12 struct
Me@0 13 { int type;
Me@0 14 int intValue;
Me@0 15 char * strValue;
Me@0 16 float floatValue;
Me@0 17 }
Me@0 18 ParamStruc;
Me@0 19
Me@0 20 #define INT_PARAM_TYPE 0
Me@0 21 #define STRING_PARAM_TYPE 1
Me@0 22 #define FLOAT_PARAM_TYPE 2
Me@0 23
Me@0 24 #define HASHSIZE 101
Me@0 25
Me@0 26 typedef
Me@0 27 struct _HashEntry
Me@0 28 {
Me@0 29 char *key;
Me@0 30 ParamStruc *param;
Me@0 31 struct _HashEntry *next;
Me@0 32 }
Me@0 33 HashEntry;
Me@0 34
Me@0 35 typedef
Me@0 36 struct
Me@0 37 { int bagSz;
Me@0 38 HashEntry* *entries;
Me@0 39 }
Me@0 40 ParamBag;
Me@0 41
Me@0 42 ParamBag *makeParamBag();
Me@0 43 ParamStruc *getParamFromBag( char *key, ParamBag * bag );
Me@0 44 int addParamToBag( char* key, ParamStruc *param, ParamBag *bag );
Me@0 45 void freeParamBag( ParamBag *bag );
Me@0 46 //char *paramBagToString( ParamBag * bag )
Me@0 47 ParamStruc *makeParamStruc();
Me@0 48 ParamStruc *makeParamFromStrs( char * type, char *value );
Me@0 49 ssize_t getline( char **lineptr, size_t *n, FILE *stream );
Me@0 50
Me@0 51 #endif /* _PARAM_H */
Me@0 52