libclod
C library for interacting with NBTs, region files, LOD data and other things.
Loading...
Searching...
No Matches
region_impl.h
1#ifndef LIBCLOD_REGION_IMPL_H
2#define LIBCLOD_REGION_IMPL_H
3
4#include <clod/region.h>
5#include "platform/platform.h"
6
7#include <assert.h>
8#include <stdint.h>
9#include <string.h>
10#include <time.h>
11
13 struct clod_region_opts opts;
14
15 atomic int32_t inside;
16 mutex mtx;
17 dir d;
18
19 size_t cache_len;
20 struct file_cache *cache;
21};
22
23enum clod_region_result file_cache_destroy(struct clod_region *r);
24enum clod_region_result read_opts(struct clod_region_opts *dst, const struct clod_region_opts *src);
25
26#define REGION_PUBLIC_ENTER(region) do {\
27 assert((region) != nullptr);\
28 const int32_t inside = ++(region)->inside;\
29 assert(inside > 0);\
30} while (0)
31
32#define REGION_PUBLIC_LEAVE(region) do {\
33 const int32_t inside = (region)->inside--;\
34 assert(inside > 0);\
35} while(0)
36
37#endif
clod_region_result
Definition region.h:33
Sized string helpers.