libclod
C library for interacting with NBTs, region files, LOD data and other things.
Loading...
Searching...
No Matches
format.h
1
#ifndef LIBCLOD_FORMAT_H
2
#define LIBCLOD_FORMAT_H
3
4
#include <
clod/region_format.h
>
5
#include <../../include/clod/data_structures/table.h>
6
#include "bitarray.h"
7
#include <stdint.h>
8
9
#define LIBCLOD_MAGIC \
10
"\n\n"\
11
"libclod extended region file format version 1.\n"\
12
"See github.com/stewi1014/clod for format details.\n"\
13
"\n\n"
14
15
constexpr
size_t
MAGIC_LEN =
sizeof
(LIBCLOD_MAGIC);
16
constexpr
size_t
HEADER_SIZE = 20480u;
17
18
struct
clod_rfmt
{
19
struct
clod_rfmt_opts
opts;
20
21
uint8_t *data;
22
size_t
data_size;
23
24
#ifndef NDEBUG
25
bool
file_locked;
26
bitarray(1024) held_locks;
27
bitarray(1024) observing_locks;
28
#endif
29
};
30
31
enum
clod_rfmt_result
chunk_lock_acquire(
struct
clod_rfmt
*rfmt,
unsigned
chunk_index);
32
enum
clod_rfmt_result
chunk_lock_refresh(
struct
clod_rfmt
*rfmt,
unsigned
chunk_index);
33
enum
clod_rfmt_result
chunk_lock_release(
struct
clod_rfmt
*rfmt,
unsigned
chunk_index);
34
35
enum
clod_rfmt_result
global_lock_acquire(
struct
clod_rfmt
*rfmt);
36
enum
clod_rfmt_result
global_lock_refresh(
struct
clod_rfmt
*rfmt);
37
enum
clod_rfmt_result
global_lock_release(
struct
clod_rfmt
*rfmt);
38
39
enum
clod_rfmt_result
resize_lock_acquire(
struct
clod_rfmt
*rfmt,
size_t
*old_size,
size_t
grow_size);
40
enum
clod_rfmt_result
resize_lock_release(
struct
clod_rfmt
*rfmt);
41
42
#endif
clod_rfmt_result
clod_rfmt_result
Definition
region_format.h:39
region_format.h
clod_rfmt_opts
Definition
region_format.h:67
clod_rfmt
Definition
format.h:18
src
region_format
format.h
Generated by
1.16.1