aboutsummaryrefslogtreecommitdiff
path: root/client/libacron/include/common.h
blob: 79dd29b0d529e48ee6c9ea24270a08eefc7faee7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
 * Created by yuuta on 7/13/22.
 */

#ifndef LIBAC_COMMON_H
#define LIBAC_COMMON_H

/* Library errors */
/* OK */
#define AC_E_OK  0
/* The library is not initialized on that thread. */
#define AC_E_NOT_INITIALIZED    1
/* ac_init(): The library is already initialized on that thread. */
#define AC_E_ALREADY_INITIALIZED    2
/* Cannot allocate memory. */
#define AC_E_MEMORY_ALLOCATION  3
/* Library internal error. */
#define AC_E_INTERNAL           4
/* The server returns an invalid response. */
#define AC_E_INVALID_RESPONSE    5
/* The request is invalid. */
#define AC_E_INVALID_REQUEST    6
/* Network error */
#define AC_E_NET                7

/* Remote errors */
#define AC_ER_BAD_REQUEST       400
#define AC_ER_NOT_AUTHORIZED    401
#define AC_ER_FORBIDDEN         403
#define AC_ER_INTERNAL_ERROR    500

/* General Structs */
enum ac_world {
    overworld,
    nether,
    end
};

typedef struct ac_vec3d {
    double x;
    double y;
    double z;
} ac_vec3d_t;

typedef struct ac_vec2f {
    double x;
    double y;
} ac_vec2f_t;

typedef struct ac_entity {
    char *name;
    char *uuid;
    char *type;
    ac_vec3d_t pos;
    enum ac_world world;
} ac_entity_t;

typedef struct ac_config {
    enum ac_world *world;
    ac_vec3d_t *pos;
    ac_vec2f_t *rot;
    char *name;
} ac_config_t;

#endif /* LIBAC_COMMON_H */