From ad48ac7d16eff3b1df60d9a40ebb9d8b99a35075 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Sat, 13 Sep 2014 09:56:54 -0400 Subject: [PATCH] random: Add doxygen information I updated the Doxyfile to extract static inline functions. Signed-off-by: Anna Schumaker --- Doxyfile | 2 +- core/random.cpp | 3 ++- include/core/random.h | 16 ++++++++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Doxyfile b/Doxyfile index 4a3107cc..b8dee93c 100644 --- a/Doxyfile +++ b/Doxyfile @@ -427,7 +427,7 @@ EXTRACT_PACKAGE = NO # included in the documentation. # The default value is: NO. -EXTRACT_STATIC = NO +EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined # locally in source files will be included in the documentation. If set to NO diff --git a/core/random.cpp b/core/random.cpp index 84de4890..d6f24e34 100644 --- a/core/random.cpp +++ b/core/random.cpp @@ -1,4 +1,5 @@ -/* +/** + * @file * Copyright 2014 (c) Anna Schumaker */ #ifdef CONFIG_TEST diff --git a/include/core/random.h b/include/core/random.h index 573d3302..0f30100e 100644 --- a/include/core/random.h +++ b/include/core/random.h @@ -1,4 +1,5 @@ -/* +/** + * @file * Copyright 2014 (c) Anna Schumaker */ #ifndef OCARINA_CORE_RANDOM_H @@ -18,12 +19,23 @@ static inline unsigned int _pick_random() { return rand(); } #endif /* CONFIG_TEST */ - +/** + * Seed the random number generator. + * + * @param n Value used to initialize the RNG + */ static inline void random_seed(unsigned int n) { _seed_random(n); } +/** + * Get a random number in the specified range. + * + * @param min Minimum value that will be returned. + * @param max Maximum value that will be returned. + * @return A random value where min <= value <= max. + */ static inline unsigned int random(unsigned int min, unsigned int max) { if (min >= max)