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

#include <region.h>

Public Attributes

uint8_t version
uint8_t dims
uint8_t mode
enum clod_compression_method compression
uint32_t sector_size
int unix_fd
uint32_t unix_file_perms
char prefix [30+1]
char region_ext [10+1]
char chunk_ext [10+1]

Detailed Description

Configuration options passed to region_open. Zero values imply defaults.

Definition at line 168 of file region.h.

Member Data Documentation

◆ version

uint8_t clod_region_opts::version

Must be the value of the CLOD_REGION_VERSION macro. Used to ensure backwards compatability.

Definition at line 170 of file region.h.

◆ dims

uint8_t clod_region_opts::dims

Number of dimensions. Min 1, Max 10. Defaults to 2.

Definition at line 173 of file region.h.

◆ mode

uint8_t clod_region_opts::mode

Open mode. Defaults to CLOD_REGION_MODE_RDWR.

Definition at line 176 of file region.h.

◆ compression

enum clod_compression_method clod_region_opts::compression

Compression used for new chunks. Defaults to CLOD_ZLIB if dims is 2, prefix is "region" and region_ext is "mca" or "mcr". Otherwise, defaults to CLOD_LZ4F or CLOD_UNCOMPRESSED.

Definition at line 181 of file region.h.

◆ sector_size

uint32_t clod_region_opts::sector_size

Size of region file sectors. This should be sized so that 255 * sector_size is large enough to hold almost all chunks. Chunks greater than this size are supported, but do so using dedicated files for each chunk, which is significantly slower.

Definition at line 186 of file region.h.

◆ unix_fd

int clod_region_opts::unix_fd

File descriptor for the directory relative to which path is resolved. Allows openat to be used. Can be closed after open. 0 is reserved as the sentinel nonexistent value.

Definition at line 191 of file region.h.

◆ unix_file_perms

uint32_t clod_region_opts::unix_file_perms

File permissions to be applied to newly created files. Again, 0 is reserved as the sentinel nonexistent value.

Definition at line 195 of file region.h.

◆ prefix

char clod_region_opts::prefix[30+1]

Prefix to filename. Defaults to "region". Max CLOD_REGION_PREFIX_MAX characters. Must be valid in a filename and cannot contain '.'.

Definition at line 199 of file region.h.

◆ region_ext

char clod_region_opts::region_ext[10+1]

File extension for region files. Defaults to "mca". Max CLOD_REGION_EXTENSION_MAX characters. Must be valid in a filename.

Definition at line 203 of file region.h.

◆ chunk_ext

char clod_region_opts::chunk_ext[10+1]

File extension for chunk files. Defaults to "mcc". Max CLOD_REGION_EXTENSION_MAX characters. Must be valid in a filename.

Definition at line 207 of file region.h.


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