Simple C Expat Wrapper (SCEW)  1.1.7
Files | Functions
Files

Read data from files. More...

Files

file  reader_file.h
 SCEW reader functions for files.
 

Functions

SCEW_API scew_readerscew_reader_file_create (char const *file_name)
 Creates a new SCEW reader for the given file name. More...
 
SCEW_API scew_readerscew_reader_fp_create (FILE *file)
 Creates a new SCEW reader for the given file stream. More...
 

Detailed Description

Read data from files.

Function Documentation

SCEW_API scew_reader* scew_reader_file_create ( char const *  file_name)

Creates a new SCEW reader for the given file name.

This routine will open the given file in text mode. Once the reader is created, the Readers routines must be called in order to read data from the file or to know the file status.

For UTF-16 encoding (only in Windows paltforms) the BOM (Byte Order Mask) is automatically handled by the Windows API.

Precondition
file_name != NULL
Parameters
file_namethe file name to open for the new SCEW reader.
Returns
a new SCEW reader for the given file name or NULL if the reader could not be created (e.g. memory allocation, the file does not exist, etc.).
SCEW_API scew_reader* scew_reader_fp_create ( FILE *  file)

Creates a new SCEW reader for the given file stream.

The file stream is opened in text mode. Once the reader is created, any of the Readers routines must be called in order to read data from the file or to know the file status.

For UTF-16 encoding (only in Windows paltforms) the BOM (Byte Order Mask) is automatically handled by the Windows API.

Precondition
file != NULL
Parameters
filethe file where the new SCEW reader should read data from.
Returns
a new SCEW reader for the given file stream or NULL if the reader could not be created (e.g. memory allocation, the file does not exist, etc.).