• Antelope Release 5.9 Mac OS X 10.13.2 2019-05-01

 

NAME

parse_param - parameter parsing from parameter file objects

SYNOPSIS

#include "brttutil.h"

int
parse_param (Pf *pf, char *name, int type, int need, void *val)

DESCRIPTION

This is an interface to a parameter file object (see pf(3)) that allows specific parameters to be parsed. It is similar in function to the pfget(3) routines. However, unlike some of the pfget(3) routines, parse_param will always return regardless of whether or not a name is found or is of the expected type. Also, the application programmer has control of how errors are determined through the need argument.

The parameter file object to be parsed is specified in pf. The name of the parameter is specified in name. The expected type of the parameter is specified in type which must be one of the following values:

If the need flag is set, then parse_param will return an error if the parameter is not found or is not of the expected type. If the need flag is not set, then parse_param will silently return without an error if the parameter is not found, leaving val untouched. This can be used for overriding parameters that were set somewhere else, like in a "default" section of the original parameter file. The parameter value is returned in *val according to the type definitions above.

RETURN VALUES

parse_param returns 0 if OK or -1 if there is an error. If there is an error, then messages are left on the error register.

LIBRARY

-lbrttutil

SEE ALSO

pf(3), pfget(3)

AUTHOR

Danny Harvey
Printer icon