cdds_open - open DDS binary stream

SYNOPSIS

#include "cdds.h"

BIN_TAG cdds_open(dict, format_alias, data_alias, mode);

const char *dict
const char *format_alias
const char *data_alias
const char *mode

[ Input | Output | Examples ]


DESCRIPTION

This function opens a data stream and returns a binary tag (handle). Definitions within dict describe the format and data name. It also contains the processing history associated with the data.

cdds_open may update the first dictionary named by dict. This may be required to accurately describe the input or output data.

This may be done for input or output streams. This is required to fully describe the binary data associated with the binary stream. The stream is described by the dict dictionaries.

INPUT

dict is a dictionary that describes the binary data to be opened.

format_alias is a definition name selected by the programmer. If specified, the end user is allowed to override the format definition using this name (i.e. out_format= segy).

data_alias is a definition name selected by the programmer. If specified, the end user is allowed to override the data definition using this name (i.e. out_data= line88).

mode determines how data may be accessed within the stream.

mode   access        description.
"r"    read only     open existing file.
"w"    write only    create file or discard contents.
"a"    append only   open existing or create.
"r+"   read write    open existing file.
"w+"   read write    create file or discard existing contents.
"a+"   read append   open existing or create.
"m"    read write    open memory resident file.
    

Open processing retrieves the DDS_PATH definition from the extended dictionaries. The value names paths, delimited by white space, that are searched for special dictionaries. These dictionaries describe how to create formats and map field contents.

OUTPUT

The return value is a binary tag (small integer), or negative if the stream could not be opened.

The contents of dict may be updated during cdds_open processing to describe the binary data. dict may be scanned after returning from cdds_open. Definitions should NOT be appended to dict after the binary stream is opened.

EXAMPLES

          
            const char *in, *out;
            BIN_TAG in_bin, out_bin;
            ...
            /* open an existing binary i/o stream */
            in_bin = cdds_open(in, "", "", "r");

            ...

            /* open a new binary i/o stream */
            out_bin = cdds_open(out, "out_format", "out_data", "w+");
          

SEE ALSO

      cdds_close Close binary stream
    

AUTHOR

R. L. Selzler, EPTG (Oct 1995)