fdds_scant - retrieve definition from DDS dictionary


SYNOPSIS

#include <fdds.h> (fixed-format sources)
#include <f90dds.h> (free-format sources)

integer function fdds_scant(alias, str)

character*(*) alias
character*(*) str

DESCRIPTION

fdds_scant retrieves a definition from a dictionary. The "scan" dictionary(s) must have been previously selected by fdds_dict, or related function. The name of the definition is specified by alias.

A new definition may be selected for retrieval. Multiple names, delimited by white space, may be specified by alias. If a name is specified, the "scan" dictionaries are searched. Dictionaries are scanned from bottom-to-top and right-to-left. The newest definition that matches any alias is selected. The function returns EOF, if no match is found.

The current "scan" definition is accessed, if a blank alias is specified. The value is processed, starting from the current position. The function returns EOF, if a "scan" definition is not already selected.

fdds_scant assigns a string pointer to str. The string contains the next token parsed from the value. White space is skipped, starting at the current position in the value. If the next character is a double quote, a matching quote terminates the token. If not quoted, the token is terminated by the next white space. The current position is advanced to EOT (end of token). The function returns the number of characters in the string. If a token is not found, it returns EOF and str is not changed.

If the token is delimited by double quotes, the value may contain special characters. Any single character may be escaped by prefixing it with "\". Escapes are required to preserve special characters ('\', '=', '"'). White space within the token does not need to be escaped. Escape characters "\" are removed during retrieval.

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.

EXAMPLES

!     retrieve first and second token from any of "bar", "Bar" or "BAR"
      ier = fdds_scant('bar Bar BAR', bar1)
      ier = fdds_scant(' ', bar2)
    

SEE ALSO

fdds_dict Select DDS dictionary and mode
fdds_scank Retrieve a definition
fdds_scanf Retrieve a definition
fdds_scantn Retrieve a definition
fdds_scanv Retrieve a definition
    

AUTHOR

R. L. Selzler, EPTG (May, 1994)