libclod
C library for interacting with NBTs, region files, LOD data and other things.
Loading...
Searching...
No Matches
file.h
1#ifndef LIBCLOD_FILE_H
2#define LIBCLOD_FILE_H
3
4#include <clod/lib.h>
5#include <clod/stream.h>
6#include <clod/memory.h>
7
8#define CLOD_FILE_READ 1
9#define CLOD_FILE_WRITE 2
10#define CLOD_FILE_TRUNCATE 4
11#define CLOD_FILE_CREATE 8
12#define CLOD_FILE_APPEND 16
13#define CLOD_FILE_DIRECTORY 32
14
15#define CLOD_DIRENT_FILE 128
16#define CLOD_DIRENT_DIRECTORY 129
17
24
26 uintptr_t id;
27
29 unsigned short name_size;
30
32 unsigned char type;
33
35 char name[];
36};
37
46CLOD_API CLOD_NONNULL(1)
47int clod_file(
48 clod_stream *stream_out,
49 const clod_stream *directory,
50 const char *path,
51 int flags
52);
53
54#endif
Memory allocation methods.
struct clod_dirent * next
Pointer to the next directory entry.
Definition file.h:23
unsigned short name_size
Size of name.
Definition file.h:29
char name[]
Name of the entry.
Definition file.h:35
uintptr_t id
Unique identifier for the entry.
Definition file.h:26
unsigned char type
Type of the entry.
Definition file.h:32