/* * 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 */