getpar(3)

NAME
getparInteger, getparFloat, getparIdentifier, getparString -- routines to read values from an RCI parameter set.

USAGE
getparInteger (ival, key, handle)
  int *ival;
  const char* key;
  int handle;

getparFloat (fval, key, handle)
  float *fval;
  const char* key;
  int handle;

getparString (sval, key, handle)
  char **sval;
  const char* key;
  int handle;

getparIdentifier (sval, key, handle)
  char **sval;
  const char* key;
  int handle;

ARGUMENTS

key --
    Key name associated with the parameter.

handle --
    Parameter set handle returned by rciParameters().

ival --
    Place to return integer value.

fval --
    Place to return floating point value.

sval --
    Place to return pointer to string.

RESTRICTIONS
These routines must be called from the planning level.

DESCRIPTION
These routines are used to read parameters associated with an RCI parameter set (see rciParameters(3)).

In general, the routines search the parameter set for a parameter of the indicated type which has the specified name (key). If this is found, the routine returns 1. If no parameter in the set has that name, then 0 is returned, and if the set has a parameter with that name but the type is incorrect, -1 is returned.

getparInteger() returns an integer from the parameter set.

getparFloat() returns a floating point value from the parameter set, converting an integer type to a float if necessary.

getparIndentifier() returns an indentifier from the parameter set (an identifier is an alphanumeric string, including underscores and dollar signs, that does not begin with a digit).

getparString() returns a string from the parameter set, converting an indentifier to a string if necessary.

DIAGNOSTICS
These routines will abort the program if called from the control level.

BUGS
The access functions to the parameter sets are rather crude; a better way would probably be to have one function which returns the value and the type. But while we're doing this, we should probably extend the facility to allow aggregates as well, and then we're off into the wild blue yonder.

SEE ALSO
rciParameters(3), setpar(3).