|
libclod
C library for interacting with NBTs, region files, LOD data and other things.
|
Classes | |
| struct | clod_rfmt_opts |
Typedefs | |
| typedef bool | clod_rfmt_file_sync(size_t size, void *user) |
Enumerations | |
| enum | clod_rfmt_result { CLOD_RFMT_OK = 0 , CLOD_RFMT_ALLOCATION_FAILURE = 1 , CLOD_RFMT_TIMEOUT = 2 , CLOD_RFMT_OTHER = 3 , CLOD_RFMT_INVALID = 4 , CLOD_RFMT_MISUSE = 5 , CLOD_RFMT_OTHER_MISUSE = 6 , CLOD_RFMT_FILE_MANAGE_ERROR = 7 , CLOD_RFMT_FILE_SYNC_ERROR = 8 } |
Functions | |
| enum clod_rfmt_result | clod_rfmt_init_new (struct clod_rfmt **rfmt_out, struct clod_rfmt_opts *opts, char *chunk_filename_prefix, char *chunk_filename_extension, uint32_t sector_size) |
| enum clod_rfmt_result | clod_rfmt_init_rw (struct clod_rfmt **rfmt_out, struct clod_rfmt_opts *opts) |
| enum clod_rfmt_result | clod_rfmt_init_ro (struct clod_rfmt **rfmt_out, struct clod_rfmt_opts *opts) |
| enum clod_rfmt_result | clod_rfmt_free (struct clod_rfmt *rfmt) |
| enum clod_rfmt_result | clod_rfmt_lock_acquire (struct clod_rfmt *rfmt, uint32_t index) |
| enum clod_rfmt_result | clod_rfmt_lock_refresh (struct clod_rfmt *rfmt, uint32_t index) |
Methods for reading and writing to region files. None of the methods here are thread safe; for concurrent usage each thread must independently create its own handle to the same region file.
When the NDEBUG flag is not set (i.e. in debug builds), additional checks are performed to ensure that usage follows the file specification e.g. holding required locks before certain accesses.
| typedef bool clod_rfmt_file_sync(size_t size, void *user) |
Method provided by the user that is used to synchronise the file to disk. This method does not need external synchronisation as it is only called with the protection of the file lock.
| [in] | size | Size of the section of the file from the start to synchronise. |
| [in] | user | The provided user pointer. |
Definition at line 31 of file region_format.h.
| enum clod_rfmt_result |
Result of an operation.
Definition at line 39 of file region_format.h.
| enum clod_rfmt_result clod_rfmt_init_new | ( | struct clod_rfmt ** | rfmt_out, |
| struct clod_rfmt_opts * | opts, | ||
| char * | chunk_filename_prefix, | ||
| char * | chunk_filename_extension, | ||
| uint32_t | sector_size ) |
Create a new region file in read/write mode.
| [out] | rfmt_out | Handle to the region file. |
| [in] | opts | Configuration options for the opened file. |
| [in] | chunk_filename_prefix | Filename prefix for chunk files. |
| [in] | chunk_filename_extension | Filename extension for chunk files. |
| [in] | sector_size | Size fo sectors in the file. Ideally a multiple of system page size. |
| enum clod_rfmt_result clod_rfmt_init_rw | ( | struct clod_rfmt ** | rfmt_out, |
| struct clod_rfmt_opts * | opts ) |
| enum clod_rfmt_result clod_rfmt_init_ro | ( | struct clod_rfmt ** | rfmt_out, |
| struct clod_rfmt_opts * | opts ) |
| enum clod_rfmt_result clod_rfmt_free | ( | struct clod_rfmt * | rfmt | ) |