File stream functions.

Functions

int rtxStreamFileAttach (OSCTXT *pctxt, FILE *pFile, OSUINT16 flags)
int rtxStreamFileOpen (OSCTXT *pctxt, const char *pFilename, OSUINT16 flags)
int rtxStreamFileCreateReader (OSCTXT *pctxt, const char *pFilename)
int rtxStreamFileCreateWriter (OSCTXT *pctxt, const char *pFilename)

Detailed Description

File stream functions are used for stream operations with files.


Function Documentation

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.
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.
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.
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.