cdds_scantn - retrieve definition from dictionary

SYNOPSIS

#include "cdds.h"

int cdds_scantn(alias, str, count);

const char *alias
const char **str
intcount

[ Description | Examples ]


DESCRIPTION

cdds_scantn retrieves a definition from dictionaries. The scan dictionaries must have been previously selected by cdds_dict, or related function. The name of the definition is specified by alias (multiple names, delimited by white space, may be specified). If a null alias is specified (i.e. NULL, zero length string, or a string that only contains white space) the value is processed, starting from the current position of the current scan definition.

Dictionaries are scanned from bottom-to-top and right-to-left. The newest definition that matches any alias is selected.

cdds_scantn differs from cdds_scant in that a count is specified to determine which token in the definition is to be returned (count=1 for first token). The function returns the number of characters in the string. If a token is not found or the count it out of range, it returns EOF and *str is not changed.

Dictionaries may contain alias definitions. They define alternate names for older definitions. Alias definitions are denoted by a special prefix, "alias:defn_name" or "$defn_name". The value of an alias definition is a list of alternate names. For example:

out_data= /very/long/path/name/file
name= value...
alias:data= out_data

foo= hidden definition...
name= value...
$foo=
    
Alias definitions are processed, when scan functions search for a name. If a definition name matches an alias, the search list is modified and processing continues. The defined values (definition names delimited by white space) replace the one name matched in the original alias list.

EXAMPLES

const char *bar;
int j;

bar = "default for third bar token";
j = cdds_scantn("bar", &bar, 3);
    

SEE ALSO

cdds_dict Select DDS dictionary and mode
cdds_scanf Retrieve a definition
cdds_scank Retrieve a definition
cdds_scant Retrieve a definition
cdds_scanv Retrieve a definition
    

AUTHOR

R. L. Selzler, EPTG (Oct 1995)