Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > ParamHelper
diff ParamBag.c @ 7:1bf28dddc45f
Created MC_shared branch
| author | Me@portablequad |
|---|---|
| date | Sat, 11 Feb 2012 20:08:58 -0800 |
| parents | d46150af45ad |
| children | b80587574901 |
line diff
1.1 --- a/ParamBag.c Tue Feb 07 12:51:29 2012 -0800 1.2 +++ b/ParamBag.c Sat Feb 11 20:08:58 2012 -0800 1.3 @@ -24,8 +24,8 @@ 1.4 ParamBag * 1.5 makeParamBag() 1.6 { ParamBag * retBag; 1.7 - retBag = malloc( sizeof( ParamBag ) ); 1.8 - retBag->entries = malloc( PARAM_BAG_HASHSIZE * sizeof( ParamBagHashEntry *) ); 1.9 + retBag = VMS__malloc( sizeof( ParamBag ) ); 1.10 + retBag->entries = VMS__malloc( PARAM_BAG_HASHSIZE * sizeof( ParamBagHashEntry *) ); 1.11 retBag->bagSz = PARAM_BAG_HASHSIZE; 1.12 nullOutParamBagHashEntries( retBag ); 1.13 1.14 @@ -80,7 +80,7 @@ 1.15 hashEntry = lookupKeyInHash( key, bag ); 1.16 if( hashEntry == NULL ) 1.17 { hashIdx = hashKey( key, bag->bagSz ); 1.18 - hashEntry = (ParamBagHashEntry*) malloc( sizeof( ParamBagHashEntry ) ); 1.19 + hashEntry = (ParamBagHashEntry*) VMS__malloc( sizeof( ParamBagHashEntry ) ); 1.20 if( hashEntry == NULL ) return 0; 1.21 hashEntry->key = strdup( key ); 1.22 if( hashEntry->key == NULL ) return 0; 1.23 @@ -118,20 +118,20 @@ 1.24 freeParamBagHashEntry( ParamBagHashEntry *entry ) 1.25 { 1.26 freeParamStruc( entry->param ); 1.27 - free( entry->key ); //was malloc'd above, so free it 1.28 - free( entry ); 1.29 + VMS__free( entry->key ); //was malloc'd above, so free it 1.30 + VMS__free( entry ); 1.31 } 1.32 1.33 void 1.34 freeParamStruc( ParamStruc * param ) 1.35 - { if( param->type == STRING_PARAM_TYPE ) free( param->strValue ); 1.36 - free( param ); 1.37 + { if( param->type == STRING_PARAM_TYPE ) VMS__free( param->strValue ); 1.38 + VMS__free( param ); 1.39 } 1.40 1.41 ParamStruc * 1.42 makeParamStruc() 1.43 { ParamStruc *retStruc; 1.44 - retStruc = malloc( sizeof( ParamStruc ) ); 1.45 + retStruc = VMS__malloc( sizeof( ParamStruc ) ); 1.46 retStruc->floatValue = 0.0; 1.47 retStruc->intValue = 0; 1.48 retStruc->strValue = NULL; 1.49 @@ -164,7 +164,7 @@ 1.50 } break; 1.51 case 's': 1.52 { retParam->type = STRING_PARAM_TYPE; 1.53 - retParam->strValue = malloc( strlen(value) + 1); 1.54 + retParam->strValue = VMS__malloc( strlen(value) + 1); 1.55 strcpy( retParam->strValue, value ); 1.56 removeEndWhtSpaceFromStr( retParam->strValue ); 1.57 } break;
