DDS Developers Documentation → "C" API → scantn


Index
cdds_addaxis
cdds_align
cdds_axis_prod
cdds_binfd
cdds_calloc
cdds_check
cdds_close
cdds_closepr
cdds_closepr2
cdds_copy
cdds_count
cdds_datadefn
cdds_dict
cdds_errors
cdds_fflush
cdds_free
cdds_genus
cdds_get
cdds_history
cdds_in
cdds_index
cdds_info
cdds_initmpi
cdds_initmpix
cdds_initopenmp
cdds_isreg
cdds_key
cdds_lseek
cdds_lseek8
cdds_malloc
cdds_map
cdds_member
cdds_memuse
cdds_mod
cdds_name
cdds_newer
cdds_next
cdds_object
cdds_offset
cdds_open
cdds_openm
cdds_openpr
cdds_out
cdds_parent
cdds_prec
cdds_prev
cdds_prime
cdds_printf
cdds_printt
cdds_printv
cdds_prtcon
cdds_prterr
cdds_prthdr
cdds_prtmsg
cdds_put
cdds_read
cdds_readm
cdds_realloc
cdds_rmaxis
cdds_savepr
cdds_scale
cdds_scanf
cdds_scank
cdds_scant
cdds_scantn
cdds_scanv
cdds_switch
cdds_write
cdds_writem
setargcv

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)
For additional help, open an issue here