cdds_datadefn - DDS, create filename for binary output.

SYNOPSIS

#include "cdds.h"

const char *cdds_datadefn(data_dict, data_alias);

const char * data_dict
const char * data_alias

[ Input | Output | Examples ]


DESCRIPTION

This function creates a filename for binary output. The name is defined in data_dict and returned to the caller.

INPUT

Data_dict names one dictionary that describes the binary output.

If data_alias is specified (i.e. "out_data"), the user is allowed to override the filename (i.e.out_data= name). If an override is not defined, a name is derived automatically. The name is based upon the data_dict name and media. If the dictionary is a regular file, then the data is output to another regular file. The new filename is created using DATA_PATH, DATA_SUFFIX, and the last component of the dictionary name. If the dictionary is NOT a regular file (i.e. pipe, tape, ...), or if data_alias defines a blank name, then binary data is attached to the output dictionary, i.e. they share the same file, pipe stream, or tape media.

The values for DATA_PATH and DATA_SUFFIX are retrieved from the extended dictionaries.

OUTPUT

If the user defines an override via data_alias, two definitions are appended to data_dict. The first is an alias that references the override (i.e. $data= out_data). The second is an alias that prevents the override from being used again (i.e. $out_data= ).

The function returns a constant character pointer to a static string. It contains the override defined by the user, or the filename created by cdds_datadefn. The string is over written with each call.

EXAMPLE

          
            const char *name, *data_dict = "line73";
            ...
            /* change alias used to default data path */
            /* default is "DATA_PATH" */
            cdds_printf("data_path=", "CM_DATA_PATH");

            /* create data filename (suffix is "-") or */
            /* retrieve override "out_data= filename" */
            name = cdds_datadefn(data_dict, "out_data");
          

AUTHOR

Randy Selzler, EPTG (Oct 1995)