Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > ParamHelper
diff ReadParamsFromFile.c @ 9:b80587574901
fixed #include and changed VMS__malloc to VMS_WL__malloc
| author | Me@portablequad |
|---|---|
| date | Sun, 12 Feb 2012 01:06:02 -0800 |
| parents | 1bf28dddc45f |
| children |
line diff
1.1 --- a/ReadParamsFromFile.c Sat Feb 11 20:08:58 2012 -0800 1.2 +++ b/ReadParamsFromFile.c Sun Feb 12 01:06:02 2012 -0800 1.3 @@ -8,7 +8,7 @@ 1.4 #include <stdlib.h> 1.5 #include <string.h> 1.6 1.7 -#include "Param.h" 1.8 +#include "ParamBag.h" 1.9 1.10 ParamStruc * makeParamFromStrs( char * type, char *value ); 1.11 1.12 @@ -16,13 +16,13 @@ 1.13 1.14 /*Copied from gnu's win32 lib 1.15 */ 1.16 - ssize_t 1.17 +ssize_t 1.18 getline( char **lineptr, size_t *n, FILE *stream ) 1.19 { 1.20 if ( lineptr == NULL || n == NULL) return -1; 1.21 if (*lineptr == NULL || *n == 0) 1.22 { *n = 500; //max length of line in a config file 1.23 - *lineptr = (char *) VMS__malloc( *n ); 1.24 + *lineptr = (char *) VMS_WL__malloc( *n ); 1.25 if (*lineptr == NULL) return -1; 1.26 } 1.27 if( fgets( *lineptr, *n, stream ) ) 1.28 @@ -31,7 +31,7 @@ 1.29 return -1; 1.30 } 1.31 1.32 - void 1.33 +void 1.34 readParamFileIntoBag( char *paramFileName, ParamBag * bag ) 1.35 { 1.36 size_t lineSz = 0; 1.37 @@ -43,7 +43,7 @@ 1.38 char* paramValue;// = malloc( 500 ); //max of 500 chars in value 1.39 1.40 lineSz = 500; //max length of line in a config file 1.41 - line = (char *) VMS__malloc( lineSz ); 1.42 + line = (char *) VMS_WL__malloc( lineSz ); 1.43 if( line == NULL ) 1.44 { printf( "\nIn readParamFileIntoBag: no mem for line\n" ); 1.45 return; 1.46 @@ -106,6 +106,6 @@ 1.47 } 1.48 } 1.49 } 1.50 - VMS__free( line ); 1.51 + VMS_WL__free( line ); 1.52 } 1.53
