#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
◆ data_type_t
Enumerator |
---|
data_type_file | This data is a file. *.zst
|
data_type_dir | This data is a directory. *.tar.zst
|
◆ data_buffer_compare()
Calls memcmp() on the contents [0, size) of both buffers.
◆ data_buffer_create()
Create a buffer with the specified capacity.
- Returns
- The buffer, which is NULL on failure.
data buffer helper functions (documented in header).
◆ data_buffer_free()
Frees an allocated buffer.
◆ data_buffer_get_data()
Read the file that data points to into a buffer. NOTE: data must be a file, not a directory.
- Returns
- The buffer, which is NULL on failure.
◆ data_buffer_get_dict()
Read the dictionary that the data points to into a buffer.
- Returns
- The buffer, which is NULL on failure.
◆ data_buffer_read()
Read the contents of filename into a buffer.
- Returns
- The buffer, which is NULL on failure.
◆ data_buffers_free()
◆ data_buffers_get()
- Returns
- a list of buffers for every file in data. It is zero sized on error.
data buffers helpers.
◆ data_finish()
void data_finish |
( |
void | | ) |
|
Must be called at exit to free resources allocated by data_init().
◆ data_has_dict()
◆ data_init()
Initializes the data module and downloads the data necessary. Caches the downloads in dir. We add a stamp file in the directory after a successful download. If a stamp file already exists, and matches our current data stamp, we will use the cached data without downloading.
- Parameters
-
dir | The directory to cache the downloaded data into. |
- Returns
- 0 on success.
◆ data
The NULL-terminated list of data objects.