eaarl-io
1.0.1+71abbd4
EAARL Input/Output Library (Public API)
|
Interface for working with a flight. More...
#include "eaarlio/edb.h"
#include "eaarlio/error.h"
#include "eaarlio/memory.h"
#include "eaarlio/raster.h"
#include "eaarlio/tld_opener.h"
Go to the source code of this file.
Data Structures | |
struct | eaarlio_flight |
Flight data. More... | |
Macros | |
#define | eaarlio_flight_empty() |
Empty eaarlio_flight value. More... | |
Functions | |
eaarlio_error | eaarlio_flight_init (struct eaarlio_flight *flight, struct eaarlio_memory *memory) |
Initialize an eaarlio_flight. More... | |
eaarlio_error | eaarlio_flight_read_raster (struct eaarlio_flight *flight, struct eaarlio_raster *raster, int32_t *time_offset, uint32_t raster_number, int include_pulses, int include_waveforms) |
Retrieve data for a raster. More... | |
eaarlio_error | eaarlio_flight_free (struct eaarlio_flight *flight) |
Release resources held by eaarlio_flight. More... | |
Interface for working with a flight.
This header defines an interface for working with a flight, which in this context means an EDB file and its associated TLD files.
struct eaarlio_flight |
Flight data.
This structure contains the data necessary for working with a flight, which in this context means a set of TLD files and their associated EDB index. The structure contains the EDB data, which calling code can refer to directly. The structure can be used with eaarlio_flight_read_raster to retrieve raster data given a raster number.
Implementations must do the following:
Data Fields | ||
---|---|---|
struct eaarlio_edb | edb |
EDB data for the flight.
|
void * | internal |
Internal data pointer used for tracking state. Calling code should not interact with this directly. |
struct eaarlio_tld_opener | tld_opener |
A TLD opener for the flight.
|
#define eaarlio_flight_empty | ( | ) |
Empty eaarlio_flight value.
All numeric fields will contain zero values. All pointers will be null.
eaarlio_error eaarlio_flight_free | ( | struct eaarlio_flight * | flight | ) |
Release resources held by eaarlio_flight.
[in] | flight | Flight with resources to release |
eaarlio_error eaarlio_flight_init | ( | struct eaarlio_flight * | flight, |
struct eaarlio_memory * | memory | ||
) |
Initialize an eaarlio_flight.
[in,out] | flight | A flight to initialize |
[in] | memory | A memory handler, or NULL for stdlib |
flight->edb
must already be populated with valid data. flight->tld_opener
must already be populated with a valid TLD opener.flight->internal
will be populated with an opaque pointer for internal use. flight->internal
is not NULL
, then it represets newly allocated memory. That memory should later be released with eaarlio_flight_free.flight
keeps an internal reference to memory
, which is used by eaarlio_flight_read_raster for allocating memory and by eaarlio_flight_free for releasing memory. If you provide a memory handler, you must ensure it remains valid until eaarlio_flight_free is called. eaarlio_error eaarlio_flight_read_raster | ( | struct eaarlio_flight * | flight, |
struct eaarlio_raster * | raster, | ||
int32_t * | time_offset, | ||
uint32_t | raster_number, | ||
int | include_pulses, | ||
int | include_waveforms | ||
) |
Retrieve data for a raster.
[in] | flight | Flight to use to retrieve the raster |
[out] | raster | Pointer to raster to be populated |
[out] | time_offset | Pointer to time offset to be populated. This can be null if you do not want the time_offset. |
[in] | raster_number | Raster number to retrieve |
[in] | include_pulses | Should pulse data be read? 1 = yes, 0 = no |
[in] | include_waveforms | Should waveform data be read? 1 = yes, 0 = no |
flight
. flight
was not modified after calling eaarlio_flight_init.raster
is populated with the data for the raster requested. time_offset
was null null, then it is populated with the time offset detected in the EDB data. The time offset is the difference in time between the EDB timestamp and the TLD timestamp for the raster. This needs to be added to eaarlio_raster::time_seconds if you want the correct time. raster
represent newly allocated memory.flight
after calling eaarlio_flight_init or between calls to eaarlio_flight_read_raster. If you do, then the behavior of this function is undefined.