From d1b91e5451d8a347cd65c8f87b5588df65ac501a Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz <jakob@collabora.com>
Date: Sat, 6 Apr 2019 12:28:56 +0100
Subject: [PATCH] aux/util: Group the files and structs in documentation

---
 src/xrt/auxiliary/CMakeLists.txt         |  1 +
 src/xrt/auxiliary/util/u_debug.c         |  1 +
 src/xrt/auxiliary/util/u_debug.h         |  1 +
 src/xrt/auxiliary/util/u_device.c        |  1 +
 src/xrt/auxiliary/util/u_device.h        |  3 ++
 src/xrt/auxiliary/util/u_documentation.h | 40 ++++++++++++++++++++++++
 src/xrt/auxiliary/util/u_misc.c          |  1 +
 src/xrt/auxiliary/util/u_misc.h          |  5 +++
 src/xrt/auxiliary/util/u_time.cpp        |  1 +
 src/xrt/auxiliary/util/u_time.h          | 12 +++++++
 10 files changed, 66 insertions(+)
 create mode 100644 src/xrt/auxiliary/util/u_documentation.h

diff --git a/src/xrt/auxiliary/CMakeLists.txt b/src/xrt/auxiliary/CMakeLists.txt
index 8ba74c589..36acf157c 100644
--- a/src/xrt/auxiliary/CMakeLists.txt
+++ b/src/xrt/auxiliary/CMakeLists.txt
@@ -16,6 +16,7 @@ set(SOURCE_FILES
 	util/u_debug.h
 	util/u_device.c
 	util/u_device.h
+	util/u_documentation.h
 	util/u_time.cpp
 	util/u_time.h
 	)
diff --git a/src/xrt/auxiliary/util/u_debug.c b/src/xrt/auxiliary/util/u_debug.c
index 96805e964..42f140c45 100644
--- a/src/xrt/auxiliary/util/u_debug.c
+++ b/src/xrt/auxiliary/util/u_debug.c
@@ -4,6 +4,7 @@
  * @file
  * @brief  Small debug helpers.
  * @author Jakob Bornecrantz <jakob@collabora.com>
+ * @ingroup aux_util
  *
  * Debug get option helpers heavily inspired from mesa ones.
  */
diff --git a/src/xrt/auxiliary/util/u_debug.h b/src/xrt/auxiliary/util/u_debug.h
index e9dd7c2d3..dc093caa9 100644
--- a/src/xrt/auxiliary/util/u_debug.h
+++ b/src/xrt/auxiliary/util/u_debug.h
@@ -4,6 +4,7 @@
  * @file
  * @brief  Small debug helpers.
  * @author Jakob Bornecrantz <jakob@collabora.com>
+ * @ingroup aux_util
  *
  * Debug get option helpers heavily inspired from mesa ones.
  */
diff --git a/src/xrt/auxiliary/util/u_device.c b/src/xrt/auxiliary/util/u_device.c
index ed4274d5c..34fda8989 100644
--- a/src/xrt/auxiliary/util/u_device.c
+++ b/src/xrt/auxiliary/util/u_device.c
@@ -4,6 +4,7 @@
  * @file
  * @brief  Misc helpers for device drivers.
  * @author Jakob Bornecrantz <jakob@collabora.com>
+ * @ingroup aux_util
  */
 
 #include <math.h>
diff --git a/src/xrt/auxiliary/util/u_device.h b/src/xrt/auxiliary/util/u_device.h
index 645092604..b111eec98 100644
--- a/src/xrt/auxiliary/util/u_device.h
+++ b/src/xrt/auxiliary/util/u_device.h
@@ -4,6 +4,7 @@
  * @file
  * @brief  Misc helpers for device drivers.
  * @author Jakob Bornecrantz <jakob@collabora.com>
+ * @ingroup aux_util
  */
 
 #pragma once
@@ -23,6 +24,8 @@ extern const struct xrt_matrix_2x2 u_device_rotation_180;
 
 /*!
  * Dump the device config to stderr.
+ *
+ * @ingroup aux_util
  */
 void
 u_device_dump_config(struct xrt_device* xdev,
diff --git a/src/xrt/auxiliary/util/u_documentation.h b/src/xrt/auxiliary/util/u_documentation.h
new file mode 100644
index 000000000..4116065ab
--- /dev/null
+++ b/src/xrt/auxiliary/util/u_documentation.h
@@ -0,0 +1,40 @@
+// Copyright 2019, Collabora, Ltd.
+// SPDX-License-Identifier: BSL-1.0
+/*!
+ * @file
+ * @brief  Header with just documentation.
+ * @author Jakob Bornecrantz <jakob@collabora.com>
+ * @ingroup aux_util
+ */
+
+#pragma once
+
+
+/*!
+ * @defgroup aux Auxiliary
+ * @ingroup xrt
+ *
+ * @brief Shared code and helpers for Monado.
+ */
+
+/*!
+ * @defgroup aux_util Utilities
+ * @ingroup aux
+ *
+ * @brief Smaller pieces of auxiliary utilities code.
+ */
+
+
+/*!
+ * @dir auxiliary
+ * @ingroup aux
+ *
+ * @brief Shared code and helpers for Monado.
+ */
+
+/*!
+ * @dir auxiliary/util
+ * @ingroup aux
+ *
+ * @brief Smaller pieces of auxiliary utilities code.
+ */
diff --git a/src/xrt/auxiliary/util/u_misc.c b/src/xrt/auxiliary/util/u_misc.c
index 72bdd15d7..06a68c326 100644
--- a/src/xrt/auxiliary/util/u_misc.c
+++ b/src/xrt/auxiliary/util/u_misc.c
@@ -4,6 +4,7 @@
  * @file
  * @brief  Very small misc utils.
  * @author Jakob Bornecrantz <jakob@collabora.com>
+ * @ingroup aux_util
  */
 
 #include "util/u_misc.h"
diff --git a/src/xrt/auxiliary/util/u_misc.h b/src/xrt/auxiliary/util/u_misc.h
index 709018e64..fb0bea1ab 100644
--- a/src/xrt/auxiliary/util/u_misc.h
+++ b/src/xrt/auxiliary/util/u_misc.h
@@ -4,6 +4,7 @@
  * @file
  * @brief  Very small misc utils.
  * @author Jakob Bornecrantz <jakob@collabora.com>
+ * @ingroup aux_util
  */
 
 #pragma once
@@ -17,12 +18,16 @@ extern "C" {
 /*!
  * Allocate and zero the space required for some type, and cast the return type
  * appropriately.
+ *
+ * @ingroup aux_util
  */
 #define U_TYPED_CALLOC(TYPE) ((TYPE *)calloc(1, sizeof(TYPE)))
 
 /*!
  * Allocate and zero the space required for some type, and cast the return type
  * appropriately.
+ *
+ * @ingroup aux_util
  */
 #define U_TYPED_ARRAY_CALLOC(TYPE, COUNT)                                      \
 	((TYPE *)calloc((COUNT), sizeof(TYPE)))
diff --git a/src/xrt/auxiliary/util/u_time.cpp b/src/xrt/auxiliary/util/u_time.cpp
index 64e580cd6..0d717e6ca 100644
--- a/src/xrt/auxiliary/util/u_time.cpp
+++ b/src/xrt/auxiliary/util/u_time.cpp
@@ -4,6 +4,7 @@
  * @file
  * @brief  Implementation of a steady, convertible clock.
  * @author Ryan Pavlik <ryan.pavlik@collabora.com>
+ * @ingroup aux_util
  */
 
 #include "u_time.h"
diff --git a/src/xrt/auxiliary/util/u_time.h b/src/xrt/auxiliary/util/u_time.h
index 10f7230fc..54b1ca225 100644
--- a/src/xrt/auxiliary/util/u_time.h
+++ b/src/xrt/auxiliary/util/u_time.h
@@ -5,6 +5,7 @@
  * @brief  Time-keeping: a clock that is steady, convertible to system time, and
  * ideally high-resolution.
  * @author Ryan Pavlik <ryan.pavlik@collabora.com>
+ * @ingroup aux_util
  *
  * @see time_state
  */
@@ -23,6 +24,7 @@ extern "C" {
  *
  * @see time_state
  * @see time_duration_ns
+ * @ingroup aux_util
  */
 typedef int64_t timepoint_ns;
 
@@ -33,6 +35,7 @@ typedef int64_t timepoint_ns;
  *
  * @see time_state
  * @see timepoint_ns
+ * @ingroup aux_util
  */
 typedef int64_t time_duration_ns;
 
@@ -40,6 +43,7 @@ typedef int64_t time_duration_ns;
  * Convert nanoseconds duration to float seconds.
  *
  * @see timepoint_ns
+ * @ingroup aux_util
  */
 static inline float
 time_ns_to_s(time_duration_ns ns)
@@ -51,6 +55,7 @@ time_ns_to_s(time_duration_ns ns)
  * Convert float seconds to nanoseconds.
  *
  * @see timepoint_ns
+ * @ingroup aux_util
  */
 static inline time_duration_ns
 time_s_to_ns(float duration)
@@ -65,6 +70,7 @@ time_s_to_ns(float duration)
  * Exposed as an opaque pointer.
  *
  * @see timepoint_ns
+ * @ingroup aux_util
  */
 struct time_state;
 
@@ -72,6 +78,7 @@ struct time_state;
  * Create a struct time_state.
  *
  * @public @memberof time_state
+ * @ingroup aux_util
  */
 struct time_state*
 time_state_create();
@@ -83,6 +90,7 @@ time_state_create();
  * Should not be called simultaneously with any other time_state function.
  *
  * @public @memberof time_state
+ * @ingroup aux_util
  */
 void
 time_state_destroy(struct time_state* state);
@@ -94,6 +102,7 @@ time_state_destroy(struct time_state* state);
  * Should not be called simultaneously with time_state_get_now_and_update.
  *
  * @public @memberof time_state
+ * @ingroup aux_util
  */
 timepoint_ns
 time_state_get_now(struct time_state const* state);
@@ -107,6 +116,7 @@ time_state_get_now(struct time_state const* state);
  * Should not be called simultaneously with any other time_state function.
  *
  * @public @memberof time_state
+ * @ingroup aux_util
  */
 timepoint_ns
 time_state_get_now_and_update(struct time_state* state);
@@ -117,6 +127,7 @@ time_state_get_now_and_update(struct time_state* state);
  * Should not be called simultaneously with time_state_get_now_and_update.
  *
  * @public @memberof time_state
+ * @ingroup aux_util
  */
 void
 time_state_to_timespec(struct time_state const* state,
@@ -129,6 +140,7 @@ time_state_to_timespec(struct time_state const* state,
  * Should not be called simultaneously with time_state_get_now_and_update.
  *
  * @public @memberof time_state
+ * @ingroup aux_util
  */
 timepoint_ns
 time_state_from_timespec(struct time_state const* state,
-- 
GitLab