eaarl-io  1.0.1+71abbd4
EAARL Input/Output Library (Public API)
Functions
file.h File Reference

File-based implementations for interfaces. More...

#include "eaarlio/error.h"
#include "eaarlio/flight.h"
#include "eaarlio/memory.h"
#include "eaarlio/stream.h"
#include "eaarlio/tld_opener.h"

Go to the source code of this file.

Functions

eaarlio_error eaarlio_file_flight (struct eaarlio_flight *flight, char const *edb_file, char const *tld_path, struct eaarlio_memory *memory)
 Open an eaarlio_flight using normal files. More...
 
eaarlio_error eaarlio_file_stream (struct eaarlio_stream *stream, char const *fn, char const *mode)
 Open a stream for a normal file. More...
 
eaarlio_error eaarlio_file_tld_opener (struct eaarlio_tld_opener *tld_opener, char const *tld_path, struct eaarlio_memory *memory)
 Open a tld_opener using normal files. More...
 

Detailed Description

File-based implementations for interfaces.

The library has three generalized interfaces to decouple it from direct file access. This header provides implementations of those interfaces for working with normal files.

Function Documentation

◆ eaarlio_file_flight()

eaarlio_error eaarlio_file_flight ( struct eaarlio_flight flight,
char const *  edb_file,
char const *  tld_path,
struct eaarlio_memory memory 
)

Open an eaarlio_flight using normal files.

Parameters
[out]flightPointer to flight to be populated
[in]edb_filePath to the EDB file to load
[in]tld_pathPath where the associated TLD files are located
[in]memoryMemory handler, or NULL for stdlib
Returns
On success, EAARLIO_SUCCESS.
On failure, eaarlio_error representing the failure condition.

Anything from eaarlio_file_stream Anything from eaarlio_edb_read Anything from stream.close Anything from eaarlio_file_tld_opener Anything from eaarlio_flight_init

Examples:
eaarlio_yaml.c, example_flight_read_raster_pulse.c, and example_flight_read_rasters.c.

◆ eaarlio_file_stream()

eaarlio_error eaarlio_file_stream ( struct eaarlio_stream stream,
char const *  fn,
char const *  mode 
)

Open a stream for a normal file.

This opens a binary file and configures stream to access it using the C standard library file functionality (<stdio.h>).

Parameters fn and mode are passed directly to fopen.

Returns
On success, EAARLIO_SUCCESS.
On failure, eaarlio_error representing the failure condition.
Parameters
streamStream to open the file with
fnPath to file to open
modeMode to open the file as
Examples:
example_edb_read.c, example_edb_write.c, and file_stream.c.

◆ eaarlio_file_tld_opener()

eaarlio_error eaarlio_file_tld_opener ( struct eaarlio_tld_opener tld_opener,
char const *  tld_path,
struct eaarlio_memory memory 
)

Open a tld_opener using normal files.

Examples:
example_file_tld_opener.c.