fstrm  0.4.0
Frame Streams implementation in C
fstrm_file

Detailed Description

fstrm_file contains interfaces for opening fstrm_reader or fstrm_writer objects that are backed by file I/O.

Functions

struct fstrm_file_options * fstrm_file_options_init (void)
 Initialize an fstrm_file_options object, which is needed to configure the file path to be opened by fstrm_file_reader_init() or fstrm_file_writer_init(). More...
 
void fstrm_file_options_destroy (struct fstrm_file_options **fopt)
 Destroy an fstrm_file_options object. More...
 
void fstrm_file_options_set_file_path (struct fstrm_file_options *fopt, const char *file_path)
 Set the file_path option. More...
 
struct fstrm_reader * fstrm_file_reader_init (const struct fstrm_file_options *fopt, const struct fstrm_reader_options *ropt)
 Open a file containing Frame Streams data for reading. More...
 
struct fstrm_writer * fstrm_file_writer_init (const struct fstrm_file_options *fopt, const struct fstrm_writer_options *wopt)
 Open a file for writing Frame Streams data. More...
 

Function Documentation

◆ fstrm_file_options_init()

struct fstrm_file_options* fstrm_file_options_init ( void  )

Initialize an fstrm_file_options object, which is needed to configure the file path to be opened by fstrm_file_reader_init() or fstrm_file_writer_init().

Returns
fstrm_file_options object.

◆ fstrm_file_options_destroy()

void fstrm_file_options_destroy ( struct fstrm_file_options **  fopt)

Destroy an fstrm_file_options object.

Parameters
foptPointer to fstrm_file_options object.

◆ fstrm_file_options_set_file_path()

void fstrm_file_options_set_file_path ( struct fstrm_file_options *  fopt,
const char *  file_path 
)

Set the file_path option.

This is a filesystem path to a regular file to be opened for reading or writing.

Parameters
foptfstrm_file_options object.
file_pathThe filesystem path for a regular file.

◆ fstrm_file_reader_init()

struct fstrm_reader* fstrm_file_reader_init ( const struct fstrm_file_options *  fopt,
const struct fstrm_reader_options *  ropt 
)

Open a file containing Frame Streams data for reading.

Parameters
foptfstrm_file_options object. Must be non-NULL, and have the file_path option set.
roptfstrm_reader_options object. May be NULL, in which case default values will be used.
Returns
fstrm_reader object.
Return values
NULLon failure.

◆ fstrm_file_writer_init()

struct fstrm_writer* fstrm_file_writer_init ( const struct fstrm_file_options *  fopt,
const struct fstrm_writer_options *  wopt 
)

Open a file for writing Frame Streams data.

The file will be truncated if it already exists.

Parameters
foptfstrm_file_options object. Must be non-NULL, and have the file_path option set.
woptfstrm_writer_options object. May be NULL, in which case default values will be used.
Returns
fstrm_writer object.
Return values
NULLon failure.