Changeset 4833 for trunk/Ohana/src/opihi/lib.shell/ConfigInit.c
- Timestamp:
- Aug 19, 2005, 5:14:08 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/lib.shell/ConfigInit.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/lib.shell/ConfigInit.c
r2598 r4833 26 26 27 27 answer = get_variable (keyword); 28 if (answer != (char *) NULL) { 29 30 if (!strcmp (mode, "%s")) { 31 strcpy ((char *) ptr, answer); 32 } else { 33 if (!strcmp (mode, "%d")) *(int *) ptr = atoi (answer); 34 if (!strcmp (mode, "%u")) *(unsigned *) ptr = atoi (answer); 35 if (!strcmp (mode, "%ld")) *(long *) ptr = atoi (answer); 36 if (!strcmp (mode, "%hd")) *(short *) ptr = atoi (answer); 37 if (!strcmp (mode, "%f")) *(float *) ptr = atof (answer); 38 if (!strcmp (mode, "%lf")) *(double *) ptr = atof (answer); 39 } 40 free (answer); 41 return (ptr); 28 if (answer == (char *) NULL) { 29 answer = ScanConfig (GlobalConfig, keyword, mode, 0, ptr); 30 return (answer); 42 31 } 43 32 44 answer = ScanConfig (GlobalConfig, keyword, mode, 0, ptr); 45 return (answer); 33 if (!strcmp (mode, "%s")) strcpy ((char *) ptr, answer); 34 if (!strcmp (mode, "%d")) *(int *) ptr = atoi (answer); 35 if (!strcmp (mode, "%u")) *(unsigned *) ptr = atoi (answer); 36 if (!strcmp (mode, "%ld")) *(long *) ptr = atoi (answer); 37 if (!strcmp (mode, "%hd")) *(short *) ptr = atoi (answer); 38 if (!strcmp (mode, "%f")) *(float *) ptr = atof (answer); 39 if (!strcmp (mode, "%lf")) *(double *) ptr = atof (answer); 40 41 free (answer); 42 return (ptr); 46 43 } 47 48
Note:
See TracChangeset
for help on using the changeset viewer.
