IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3142


Ignore:
Timestamp:
Feb 5, 2005, 6:56:22 PM (21 years ago)
Author:
eugene
Message:

added get_variable_default

Location:
trunk/Ohana/src/opihi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/include/dvomath.h

    r2843 r3142  
    8484void          InitVariables         PROTO((void));
    8585void          ListVariables         PROTO((void));
     86float         get_variable_default  PROTO((char *name, float dvalue));
    8687
    8788/* vector handling */
  • trunk/Ohana/src/opihi/lib.shell/variable.c

    r2598 r3142  
    171171}
    172172
     173float get_variable_default (char *name, float dvalue) {
     174
     175  char *value;
     176  float fvalue;
     177
     178  value = get_variable (name);
     179  if (value == NULL) {
     180    return (dvalue);
     181  }
     182  fvalue = atof (value);
     183  return (fvalue);
     184}
     185
    173186double get_double_variable (char *name) {
    174187 
Note: See TracChangeset for help on using the changeset viewer.