eaarl-io  1.0.1+71abbd4
EAARL Input/Output Library (Public API)
Data Fields
eaarlio_tld_opener Struct Reference

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

Detailed Description

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.

Examples:
example_file_tld_opener.c.

Field Documentation

◆ close

eaarlio_error(* eaarlio_tld_opener::close) (struct eaarlio_tld_opener *self)

Close the opener.

Parameters
[in]selfThe TLD opener to be closed
Return values
EAARLIO_SUCCESSon success
EAARLIO_NULLif provided a null pointer
EAARLIO_TLD_OPENER_INVALIDif the TLD opener is not valid
Postcondition
On success, any internal resources allocated by the implementation must be released.
On success, self should have all of its pointers set to NULL, as by eaarlio_tld_opener_empty.
Examples:
example_file_tld_opener.c.

◆ opaque

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.

◆ open_tld

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.

Parameters
[in]selfThe TLD opener being used
[out]streamThe stream to be opened
[in]tld_fileThe name of the TLD file to open
Return values
EAARLIO_SUCCESSon success
EAARLIO_NULLif provided a null pointer
EAARLIO_TLD_OPENER_INVALIDif the TLD opener is not valid
Postcondition
On success, stream must be a valid, readable stream for the requested TLD file.
Examples:
example_file_tld_opener.c.

The documentation for this struct was generated from the following file: