IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 13, 2006, 9:22:35 AM (20 years ago)
Author:
eugene
Message:

working on the client/server interactions for pantasks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/lib.shell/ConfigInit.c

    r4833 r7892  
    4242  return (ptr);
    4343}
     44
     45char *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.