eaarl-io
1.0.1+71abbd4
EAARL Input/Output Library (Public API)
|
TLD file opener interface. More...
#include <tld_opener.h>
Data Fields | |
eaarlio_error(* | open_tld )(struct eaarlio_tld_opener *self, struct eaarlio_stream *stream, char const *tld_file) |
Open a readable stream for a TLD file. More... | |
eaarlio_error(* | close )(struct eaarlio_tld_opener *self) |
Close the opener. More... | |
void * | opaque |
Internal data pointer. More... | |
TLD file opener interface.
This interface generalizes the operations needed to open a TLD file in read mode given its file name as provided by an EDB file. This interface addresses several issues:
Both functions return an eaarlio_error and should use EAARLIO_SUCCESS to represent a successful outcome. Each function is documented with some suggested error codes for failing conditions, but you are not restricted to those listed. In particular, stream-related errors should be propagated to the caller as-is.
eaarlio_error(* eaarlio_tld_opener::close) (struct eaarlio_tld_opener *self) |
Close the opener.
[in] | self | The TLD opener to be closed |
EAARLIO_SUCCESS | on success |
EAARLIO_NULL | if provided a null pointer |
EAARLIO_TLD_OPENER_INVALID | if the TLD opener is not valid |
self
should have all of its pointers set to NULL
, as by eaarlio_tld_opener_empty. void* eaarlio_tld_opener::opaque |
Internal data pointer.
This is not used by calling code directly. It provides a means for the functions in the structure to maintain internal state. If you do not need it, you can set it to NULL
.
eaarlio_error(* eaarlio_tld_opener::open_tld) (struct eaarlio_tld_opener *self, struct eaarlio_stream *stream, char const *tld_file) |
Open a readable stream for a TLD file.
[in] | self | The TLD opener being used |
[out] | stream | The stream to be opened |
[in] | tld_file | The name of the TLD file to open |
EAARLIO_SUCCESS | on success |
EAARLIO_NULL | if provided a null pointer |
EAARLIO_TLD_OPENER_INVALID | if the TLD opener is not valid |
stream
must be a valid, readable stream for the requested TLD file.