ASN1C C/C++ Common Runtime  ASN1C v7.8.x
Functions
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

◆ rtxStreamFileAttach()

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
pctxtPointer to a context structure variable that has been initialized for stream operations.
pFilePointer to FILE structure. File should be already opened either for the writing or reading.
flagsSpecifies 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.

◆ rtxStreamFileCreateReader()

int rtxStreamFileCreateReader ( OSCTXT pctxt,
const char *  pFilename 
)

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

Parameters
pctxtPointer to a context structure variable that has been initialized for stream operations.
pFilenamePointer to null-terminated string that contains the name of file.
Returns
Completion status of operation: 0 = success, negative return value is error.

◆ rtxStreamFileCreateWriter()

int rtxStreamFileCreateWriter ( OSCTXT pctxt,
const char *  pFilename 
)

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

Parameters
pctxtPointer to a context structure variable that has been initialized for stream operations.
pFilenamePointer to null-terminated string that contains the name of file.
Returns
Completion status of operation: 0 = success, negative return value is error.

◆ rtxStreamFileOpen()

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
pctxtPointer to a context structure variable that has been initialized for stream operations.
pFilenamePointer to null-terminated string that contains the name of file.
flagsSpecifies 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.