libclod
C library for interacting with NBTs, region files, LOD data and other things.
Loading...
Searching...
No Matches
filename.h
1#ifndef LIBCLOD_REGION_FILENAME_H
2#define LIBCLOD_REGION_FILENAME_H
3
4#include <string.h>
5#include <clod/region.h>
6
7#define PREFIX_MAX CLOD_REGION_PREFIX_MAX
8#define EXTENSION_MAX (CLOD_REGION_EXTENSION_MAX + 4)
9#define REGION_FILENAME_MAX (PREFIX_MAX + 1 + CLOD_REGION_DIMENSIONS_MAX * 21 + EXTENSION_MAX)
10static_assert(REGION_FILENAME_MAX == 255);
11
16size_t filename_make(
17 char filename[REGION_FILENAME_MAX + 1],
18 const char prefix[PREFIX_MAX],
19 const char *extension,
20 const int64_t *pos, uint8_t dims
21);
22
27bool filename_parse_pos(
28 const char filename[REGION_FILENAME_MAX + 1],
29 const char prefix[PREFIX_MAX],
30 const char *extension,
31 int64_t *pos, uint8_t dims
32);
33
34#endif
Sized string helpers.