Changeset 7892 for trunk/Ohana/src/opihi/lib.shell/ConfigInit.c
- Timestamp:
- Jul 13, 2006, 9:22:35 AM (20 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
r4833 r7892 42 42 return (ptr); 43 43 } 44 45 char *VarConfigEntry (char *keyword, char *mode, int entry, void *ptr) { 46 47 char *answer; 48 49 answer = get_variable (keyword); 50 if (answer == (char *) NULL) { 51 answer = ScanConfig (GlobalConfig, keyword, mode, entry, ptr); 52 return (answer); 53 } 54 55 if (!strcmp (mode, "%s")) strcpy ((char *) ptr, answer); 56 if (!strcmp (mode, "%d")) *(int *) ptr = atoi (answer); 57 if (!strcmp (mode, "%u")) *(unsigned *) ptr = atoi (answer); 58 if (!strcmp (mode, "%ld")) *(long *) ptr = atoi (answer); 59 if (!strcmp (mode, "%hd")) *(short *) ptr = atoi (answer); 60 if (!strcmp (mode, "%f")) *(float *) ptr = atof (answer); 61 if (!strcmp (mode, "%lf")) *(double *) ptr = atof (answer); 62 63 free (answer); 64 return (ptr); 65 }
Note:
See TracChangeset
for help on using the changeset viewer.
