diff options
author | Trumeet <yuuta@yuuta.moe> | 2022-07-20 18:12:22 -0700 |
---|---|---|
committer | Trumeet <yuuta@yuuta.moe> | 2022-07-20 18:12:22 -0700 |
commit | b4afa06e383325f4a0c751a64ca896d769db07a8 (patch) | |
tree | 7647fdd73d4f487de778c27aea99bf890458b647 /client/libacron/include/common.h | |
parent | da14a17298c67d83e6da4732f47304954acc26fc (diff) | |
download | acron-b4afa06e383325f4a0c751a64ca896d769db07a8.tar acron-b4afa06e383325f4a0c751a64ca896d769db07a8.tar.gz acron-b4afa06e383325f4a0c751a64ca896d769db07a8.tar.bz2 acron-b4afa06e383325f4a0c751a64ca896d769db07a8.zip |
libac: First Commit
Diffstat (limited to 'client/libacron/include/common.h')
-rw-r--r-- | client/libacron/include/common.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/client/libacron/include/common.h b/client/libacron/include/common.h new file mode 100644 index 0000000..89738c4 --- /dev/null +++ b/client/libacron/include/common.h @@ -0,0 +1,64 @@ +/* + * 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; + 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 */ |