libclod
C library for interacting with NBTs, region files, LOD data and other things.
Loading...
Searching...
No Matches
clod_rfmt_opts Struct Reference

#include <region_format.h>

Public Attributes

uint32_t dead_lock_timeout_ms
bool(* file_manage )(uint8_t **data, size_t *size, const size_t *new_size, void *user)
bool(* file_sync )(size_t size, void *user)
void *(* malloc_func )(size_t size, void *user)
void(* free_func )(void *ptr, void *user)
void * user

Detailed Description

Configuration options for the region format.

Definition at line 67 of file region_format.h.

Member Data Documentation

◆ dead_lock_timeout_ms

uint32_t clod_rfmt_opts::dead_lock_timeout_ms

The amount of time that must pass with no progress being made before a lock's owner is considered dead. A zero value uses defaults.

Definition at line 70 of file region_format.h.

◆ file_manage

bool(* clod_rfmt_opts::file_manage) (uint8_t **data, size_t *size, const size_t *new_size, void *user)

Method provided by the user that is used to get, query, and truncate the region file. Multiple optional arguments may be provided in the same call.

Parameters
[in]data(nullable) If non-null, the method shall return a pointer to the complete file contents.
[in]size(nullable) If non-null, the method shall return the size of the file.
[in]new_size(nullable) If non-null, the method shall truncate the file to the provided size.
[in]userThe provided user pointer.
Returns
True if the operation was successful, false if not.

Definition at line 82 of file region_format.h.

◆ file_sync

bool(* clod_rfmt_opts::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.

Parameters
[in]sizeSize of the section of the file from the start to synchronise.
[in]userThe provided user pointer.
Returns
True if the operation was successful, false if not.

Definition at line 93 of file region_format.h.

◆ malloc_func

void *(* clod_rfmt_opts::malloc_func) (size_t size, void *user)

Custom allocation function. Nullable. This is not used for any buffers, this library doesn't buffer anything.

Definition at line 97 of file region_format.h.

◆ free_func

void(* clod_rfmt_opts::free_func) (void *ptr, void *user)

Custom free function. Nullable.

Definition at line 100 of file region_format.h.

◆ user

void* clod_rfmt_opts::user

User value passed to callbacks.

Definition at line 103 of file region_format.h.


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