changeset 513:b59a1f00bf80

core: doxygenize core
author David Demelier <markand@malikania.fr>
date Sat, 04 Mar 2023 10:33:34 +0100
parents 9877e34bb6eb
children daf085bf8a8c
files libmlk-core/mlk/core/core.c libmlk-core/mlk/core/core.h
diffstat 2 files changed, 32 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libmlk-core/mlk/core/core.c	Sat Mar 04 10:22:42 2023 +0100
+++ b/libmlk-core/mlk/core/core.c	Sat Mar 04 10:33:34 2023 +0100
@@ -1,5 +1,5 @@
 /*
- * core.c -- libcore main entry
+ * core.c -- libmlk-core main entry
  *
  * Copyright (c) 2020-2023 David Demelier <markand@malikania.fr>
  *
@@ -30,10 +30,12 @@
 	assert(organization);
 	assert(name);
 
+	int err;
+
 	srand(time(NULL));
 
-	if (mlk_sys_init(organization, name) < 0)
-		return -1;
+	if ((err = mlk_sys_init(organization, name)) < 0)
+		return err;
 
 	return 0;
 }
--- a/libmlk-core/mlk/core/core.h	Sat Mar 04 10:22:42 2023 +0100
+++ b/libmlk-core/mlk/core/core.h	Sat Mar 04 10:33:34 2023 +0100
@@ -1,5 +1,5 @@
 /*
- * core.c -- libcore main entry
+ * core.h -- libmlk-core main entry
  *
  * Copyright (c) 2020-2023 David Demelier <markand@malikania.fr>
  *
@@ -19,6 +19,13 @@
 #ifndef MLK_CORE_CORE_H
 #define MLK_CORE_CORE_H
 
+/**
+ * \file mlk/core/core.h
+ * \brief libmlk-core main entry
+ *
+ * This is the main header for the libmlk-core file.
+ */
+
 #if defined(__cplusplus)
 #       define MLK_CORE_BEGIN_DECLS extern "C" {
 #       define MLK_CORE_END_DECLS }
@@ -29,9 +36,27 @@
 
 MLK_CORE_BEGIN_DECLS
 
+/**
+ * Initialize the libmlk-core library.
+ *
+ * The caller should specify an organization and a game name, they can be used
+ * when retrieving home/special folder on some platforms.
+ *
+ * The organization is usually a reverse DNS name, e.g. com.example. The name
+ * is just your game name.
+ *
+ * \pre organization != NULL
+ * \pre name != NULL
+ * \param organization the organization name
+ * \param name the game name
+ * \return 0 on success or any error code instead
+ */
 int
-mlk_core_init(const char *, const char *);
+mlk_core_init(const char *organization, const char *name);
 
+/**
+ * Cleanup resources allocated by the library.
+ */
 void
 mlk_core_finish(void);