DMCLOSESTREAM(5ICD)

NAME
dmCloseStream - close a DDM stream

SYNOPSIS

#include "dmincl.h"
dmCloseStream (dmstream)
DM_STREAM *dmstream;

PARAMETERS

dmstream
    is a pointer to a valid DM_STREAM as obtained from the function dmOpenStream() when the stream was opened.

DESCRIPTION
Function dmCloseStream() closes the stream specified by the access key dmstream. In the current implementation streams are mapped more or less directly to UNIX files. Therefore, dmCloseStream() causes any buffers for the file to be emptied, and the file to be closed, like fclose(3S) does. Buffers allocated by the standard input/output system are freed.

DIAGNOSTICS
If the call to dmCloseStream() is successful 0 is returned. If dmCloseStream() fails EOF is returned. This happens if dmstream is invalid, or if buffered data cannot be transferred to its file. External variable dmerrno will be set to indicate the error, and a call to function dmError() will be done.
This might happen in the following cases:

DME_BADKEY
    Illegal access key given.

DME_SYS
    Return value is EOF from fclose().

SEE ALSO
dmOpenStream(5ICD), fclose(3S).