File stream functions.

File stream functions are used for stream operations with files. More...

Functions

EXTERNRT int rtxStreamFileAttach (OSCTXT *pctxt, FILE *pFile, OSUINT16 flags)
 Attaches the existing file structure pointer to the stream.
EXTERNRT int rtxStreamFileOpen (OSCTXT *pctxt, const char *pFilename, OSUINT16 flags)
 Opens a file stream.
EXTERNRT int rtxStreamFileCreateReader (OSCTXT *pctxt, const char *pFilename)
 This function creates an input file stream using the specified file name.
EXTERNRT int rtxStreamFileCreateWriter (OSCTXT *pctxt, const char *pFilename)
 This function creates an output file stream using the file name.

Detailed Description

File stream functions are used for stream operations with files.


Function Documentation

EXTERNRT int rtxStreamFileAttach ( OSCTXT pctxt,
FILE *  pFile,
OSUINT16  flags 
)

Attaches the existing file structure pointer to the stream.

The file should be already opened either for the reading or writing. The 'flags' parameter specifies the access mode for the stream - input or output.

Parameters:
pctxt Pointer to a context structure variable that has been initialized for stream operations.
pFile Pointer to FILE structure. File should be already opened either for the writing or reading.
flags Specifies the access mode for the stream:

  • OSRTSTRMF_INPUT = input (reading) stream;
  • OSRTSTRMF_OUTPUT = output (writing) stream.
Returns:
Completion status of operation: 0 = success, negative return value is error.
EXTERNRT int rtxStreamFileCreateReader ( OSCTXT pctxt,
const char *  pFilename 
)

This function creates an input file stream using the specified file name.

Parameters:
pctxt Pointer to a context structure variable that has been initialized for stream operations.
pFilename Pointer to null-terminated string that contains the name of file.
Returns:
Completion status of operation: 0 = success, negative return value is error.
EXTERNRT int rtxStreamFileCreateWriter ( OSCTXT pctxt,
const char *  pFilename 
)

This function creates an output file stream using the file name.

Parameters:
pctxt Pointer to a context structure variable that has been initialized for stream operations.
pFilename Pointer to null-terminated string that contains the name of file.
Returns:
Completion status of operation: 0 = success, negative return value is error.
EXTERNRT int rtxStreamFileOpen ( OSCTXT pctxt,
const char *  pFilename,
OSUINT16  flags 
)

Opens a file stream.

The 'flags' parameter specifies the access mode for the stream - input or output.

Parameters:
pctxt Pointer to a context structure variable that has been initialized for stream operations.
pFilename Pointer to null-terminated string that contains the name of file.
flags Specifies the access mode for the stream:

  • OSRTSTRMF_INPUT = input (reading) stream;
  • OSRTSTRMF_OUTPUT = output (writing) stream.
Returns:
Completion status of operation: 0 = success, negative return value is error.