diff libmlk-core/mlk/core/sys.h @ 540:876eee0eb0ad

core: doxygenize sys
author David Demelier <markand@malikania.fr>
date Sun, 05 Mar 2023 12:50:11 +0100
parents 6e8f6640e05b
children 4349b591c3ac
line wrap: on
line diff
--- a/libmlk-core/mlk/core/sys.h	Sun Mar 05 12:33:01 2023 +0100
+++ b/libmlk-core/mlk/core/sys.h	Sun Mar 05 12:50:11 2023 +0100
@@ -19,9 +19,21 @@
 #ifndef MLK_CORE_SYS_H
 #define MLK_CORE_SYS_H
 
+/**
+ * \file mlk/core/sys.h
+ * \brief System routines
+ */
+
 #include <stdarg.h>
 
+/**
+ * \enum mlk_sys_dir
+ * \brief Special directory constants
+ */
 enum mlk_sys_dir {
+	/**
+	 * Path to the preferred save directory.
+	 */
 	MLK_SYS_DIR_SAVE
 };
 
@@ -29,15 +41,40 @@
 extern "C" {
 #endif
 
+/**
+ * Initialize system, takes same arguments as ::mlk_core_init.
+ *
+ * \note This function is already called by ::mlk_core_init and usually not
+ *       required by the user.
+ */
 int
-mlk_sys_init(const char *, const char *);
+mlk_sys_init(const char *organization, const char *name);
 
+/**
+ * Obtain a path for the given special directory.
+ *
+ * \param directory directory type
+ * \return a path to a thread-local static array
+ */
 const char *
-mlk_sys_dir(enum mlk_sys_dir);
+mlk_sys_dir(enum mlk_sys_dir directory);
 
+/**
+ * Try to create a directory recursively specified by the path.
+ *
+ * \pre path != NULL
+ * \param path the path to the directory
+ * \return 0 on success or an error code on failure
+ */
 int
-mlk_sys_mkdir(const char *);
+mlk_sys_mkdir(const char *path);
 
+/**
+ * Cleanup system resources.
+ *
+ * \note This function is already called by ::mlk_core_finish and usually not
+ *       required by the user.
+ */
 void
 mlk_sys_finish(void);