From adaecb65eaa1abf437a24c93a08b2b7c2266c5dc Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Thu, 20 Mar 2025 14:15:38 -0500 Subject: core: refactor core API to be in proper style Bring the rest of the core API to be in line with the project coding style. This commit also makes the coding style change formal by updating the coding style document in the documentation. Signed-off-by: Danny Holman --- include/rune/core/mod.h | 4 ++-- include/rune/core/thread.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'include/rune/core') diff --git a/include/rune/core/mod.h b/include/rune/core/mod.h index f0940ce..32d1465 100644 --- a/include/rune/core/mod.h +++ b/include/rune/core/mod.h @@ -53,13 +53,13 @@ typedef void (*mod_func)(void); /** * Class-like definition for in-game mod */ -struct mod { +typedef struct mod { const char *name; ///< Name of the mod mod_func init_func; ///< Mod initialization function, called by rune_init_mods mod_func exit_func; ///< Mod exit function, called by rune_close_mods mod_func update_func; ///< Mod update function, called at every frame struct list_head list; ///< Linked list of all mod structs, used internally -}; +} mod_t; /** * \brief Load all the mods from the mod folder, mods must be either DLLs on Windows, diff --git a/include/rune/core/thread.h b/include/rune/core/thread.h index 976b7d3..a397b0c 100644 --- a/include/rune/core/thread.h +++ b/include/rune/core/thread.h @@ -28,21 +28,21 @@ /** * Platform-agnostic thread handle */ -struct thread { +typedef struct thread { int ID; ///< In-engine thread ID int detached; ///< 1 if thread has been detached, 0 otherwise void *thread_handle; ///< System-defined thread handle, usually a pthread_t struct list_head list; ///< Linked list of all threads, used internally -}; +} thread_t; /** * Platform-agnostic mutex handle */ -struct mutex { +typedef struct mutex { int ID; ///< In-engine mutex ID void *mutex_handle; ///< System-defined mutex handle, usually a pthread_mutex_t struct list_head list; ///< Linked list of all mutexes, used internally -}; +} mutex_t; /** * \brief Initializes the engine's thread API, must be called before using any -- cgit v1.2.3