summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/abort.c22
-rw-r--r--core/callbacks.c21
-rw-r--r--core/mod.c27
-rw-r--r--core/thread.c31
4 files changed, 93 insertions, 8 deletions
diff --git a/core/abort.c b/core/abort.c
index cd66ab1..5ee42f6 100644
--- a/core/abort.c
+++ b/core/abort.c
@@ -1,4 +1,26 @@
+/*
+ * Rune Game Engine
+ * Copyright 2024 Danny Holman <dholman@gymli.org>
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
#include <rune/core/abort.h>
+#include <rune/core/alloc.h>
#include <rune/core/init.h>
#include <rune/core/logging.h>
#include <rune/util/exits.h>
diff --git a/core/callbacks.c b/core/callbacks.c
index 03b7c46..ea7f50e 100644
--- a/core/callbacks.c
+++ b/core/callbacks.c
@@ -1,3 +1,24 @@
+/*
+ * Rune Game Engine
+ * Copyright 2024 Danny Holman <dholman@gymli.org>
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
#include <rune/core/callbacks.h>
#include <rune/core/logging.h>
diff --git a/core/mod.c b/core/mod.c
index 4a4eac8..3d9e710 100644
--- a/core/mod.c
+++ b/core/mod.c
@@ -1,3 +1,24 @@
+/*
+ * Rune Game Engine
+ * Copyright 2024 Danny Holman <dholman@gymli.org>
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
#include <rune/core/mod.h>
#include <rune/core/logging.h>
#include <rune/core/alloc.h>
@@ -6,7 +27,7 @@
#include <dirent.h>
#include <dlfcn.h>
-struct list_head *mods = NULL;
+list_head_t *mods = NULL;
void _load_mod(const char *filename) {
char mod_path[4096];
@@ -31,7 +52,7 @@ void rune_load_mods(void) {
}
void rune_init_mods(void) {
- struct list_head *temp = mods;
+ list_head_t *temp = mods;
struct mod *mod;
while (temp != NULL) {
mod = (struct mod*)((void*)temp - offsetof(struct mod, list));
@@ -44,7 +65,7 @@ void rune_close_mods(void) {
if (mods == NULL)
return;
- struct list_head *temp = mods;
+ list_head_t *temp = mods;
struct mod *mod;
while (temp != NULL) {
mod = (struct mod*)((void*)temp - offsetof(struct mod, list));
diff --git a/core/thread.c b/core/thread.c
index 45de463..3c5db8c 100644
--- a/core/thread.c
+++ b/core/thread.c
@@ -1,3 +1,24 @@
+/*
+ * Rune Game Engine
+ * Copyright 2024 Danny Holman <dholman@gymli.org>
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
#include <rune/core/thread.h>
#include <rune/core/logging.h>
#include <rune/core/alloc.h>
@@ -5,8 +26,8 @@
#include <string.h>
#include <stdatomic.h>
-static struct list_head *threads = NULL;
-static struct list_head *mutexes = NULL;
+static list_head_t *threads = NULL;
+static list_head_t *mutexes = NULL;
static int next_tid = 0;
static int next_mid = 0;
@@ -20,7 +41,7 @@ static struct thread* _find_thread_by_handle(void *handle) {
if (threads == NULL)
return NULL;
- struct list_head *temp = threads;
+ list_head_t *temp = threads;
struct thread *ret;
while (temp != NULL) {
ret = (struct thread*)((void*)temp - offsetof(struct thread, list));
@@ -35,7 +56,7 @@ static struct thread* _find_thread_by_id(int ID) {
if (threads == NULL)
return NULL;
- struct list_head *temp = threads;
+ list_head_t *temp = threads;
struct thread *ret;
while (temp != NULL) {
ret = (struct thread*)((void*)temp - offsetof(struct thread, list));
@@ -50,7 +71,7 @@ static struct mutex* _find_mutex_by_id(int ID) {
if (mutexes == NULL)
return NULL;
- struct list_head *temp = mutexes;
+ list_head_t *temp = mutexes;
struct mutex *ret;
while (temp != NULL) {
ret = (struct mutex*)((void*)temp - offsetof(struct mutex, list));