[vlc-devel] [PATCH 2/4] playlist: add randomizer to documentation

Alexandre Janniaux ajanni at videolabs.io
Thu Apr 4 22:51:15 CEST 2019


---
 src/playlist/randomizer.c | 9 ++++++++-
 src/playlist/randomizer.h | 7 +++++++
 src/playlist/test.c       | 4 ++++
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/playlist/randomizer.c b/src/playlist/randomizer.c
index 7aa5da272f..6c30c01354 100644
--- a/src/playlist/randomizer.c
+++ b/src/playlist/randomizer.c
@@ -32,7 +32,11 @@
 #include <vlc_rand.h>
 #include "randomizer.h"
 
-/* Playlist helper to manage random playback.
+/**
+ * \addtogroup playlist_randomizer Playlist randomizer helper
+ * \ingroup playlist
+ *
+ * Playlist helper to manage random playback.
  *
  * The purpose is to guarantee the following rules:
  *  - an item must never be selected twice
@@ -550,6 +554,7 @@ randomizer_Clear(struct randomizer *r)
     r->history = 0;
 }
 
+#ifndef DOC
 #ifdef TEST_RANDOMIZER
 
 /* fake structure to simplify tests */
@@ -1122,3 +1127,5 @@ int main(void)
 }
 
 #endif
+#endif
+
diff --git a/src/playlist/randomizer.h b/src/playlist/randomizer.h
index 9b392ec11f..8835ab7d37 100644
--- a/src/playlist/randomizer.h
+++ b/src/playlist/randomizer.h
@@ -26,6 +26,11 @@
 
 typedef struct vlc_playlist_item vlc_playlist_item_t;
 
+/**
+ * \defgroup playlist_randomizer Playlist randomizer helper
+ * \ingroup playlist
+ *  @{ */
+
 /**
  * Playlist helper to manage random playback.
  *
@@ -145,4 +150,6 @@ randomizer_Remove(struct randomizer *randomizer,
 void
 randomizer_Clear(struct randomizer *randomizer);
 
+/** @} */
+
 #endif
diff --git a/src/playlist/test.c b/src/playlist/test.c
index df0eb6fe0e..c2740cb156 100644
--- a/src/playlist/test.c
+++ b/src/playlist/test.c
@@ -18,6 +18,8 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#ifndef DOC
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
@@ -2280,3 +2282,5 @@ int main(void)
     test_sort();
     return 0;
 }
+
+#endif
-- 
2.21.0



More information about the vlc-devel mailing list