From 16bcf7d8dcd411e6a6b8d217cce5e450f7357bb3 Mon Sep 17 00:00:00 2001 From: Chris Luke Date: Thu, 1 Sep 2016 14:31:46 -0400 Subject: VPP-346 A swathe of doc fixes Fixes various Doxygen warnings and other structural defects. Note: This does not attempt to improve the content of the documentation; only to improve the syntax and structure of it and in some cases the consistency. Change-Id: Ib1915f33edbdbc4558c85565de80dce323193906 Signed-off-by: Chris Luke --- doxygen/filter_c.py | 49 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 15 deletions(-) (limited to 'doxygen/filter_c.py') diff --git a/doxygen/filter_c.py b/doxygen/filter_c.py index 733fdefb3d4..30b933ba79e 100755 --- a/doxygen/filter_c.py +++ b/doxygen/filter_c.py @@ -22,26 +22,45 @@ if len(sys.argv) < 2: sys.exit(1) replace_patterns = [ - # Search for VLIB_CLI_COMMAND, extract its parameter and add a docblock for it - ( re.compile("(?PVLIB_CLI_COMMAND)\s*[(](?P[a-zA-Z0-9_]+)(,[^)]*)?[)]"), r"/** @brief (@em constructor) \g (\g) */ vlib_cli_command_t \g"), - - # Search for VLIB_REGISTER_NODE, extract its parameter and add a docblock for it - ( re.compile("(?PVLIB_REGISTER_NODE)\s*[(](?P[a-zA-Z0-9_]+)(,[^)]*)?[)]"), r"/** @brief (@em constructor) \g (\g) */ vlib_node_registration_t \g"), + # Search for VLIB_CLI_COMMAND, extract its parameters and add a docblock for it + ( re.compile("(?PVLIB_CLI_COMMAND)\s*[(](?P[a-zA-Z0-9_]+)[)]"), + r"/** @brief (@em constructor) \g (\g) */ vlib_cli_command_t \g"), + ( re.compile("(?PVLIB_CLI_COMMAND)\s*[(](?P[a-zA-Z0-9_]+),\s*(?P[^)]*)[)]"), + r"/** @brief (@em constructor) \g (\g) */ \g vlib_cli_command_t \g"), + + # Search for VLIB_REGISTER_NODE, extract its parameters and add a docblock for it + ( re.compile("(?PVLIB_REGISTER_NODE)\s*[(](?P[a-zA-Z0-9_]+)[)]"), + r"/** @brief (@em constructor) \g (\g) */ vlib_node_registration_t \g"), + ( re.compile("(?PVLIB_REGISTER_NODE)\s*[(](?P[a-zA-Z0-9_]+),\s*(?P[^)]*)[)]"), + r"/** @brief (@em constructor) \g (\g) */ \g vlib_node_registration_t \g"), # Search for VLIB_INIT_FUNCTION, extract its parameter and add a docblock for it - ( re.compile("(?PVLIB_INIT_FUNCTION)\s*[(](?P[a-zA-Z0-9_]+)[)]"), r"/** @brief (@em constructor) \g (@ref \g) */ vlib_init_function_t * _vlib_init_function_\g"), - ( re.compile("(?PVLIB_DECLARE_INIT_FUNCTION)\s*[(](?P[a-zA-Z0-9_]+)[)]"), r"/** @brief (@em constructor) \g (@ref \g) */ vlib_init_function_t * _vlib_init_function_\g"), + ( re.compile("(?PVLIB_INIT_FUNCTION)\s*[(](?P[a-zA-Z0-9_]+)[)]"), + r"/** @brief (@em constructor) \g (@ref \g) */ vlib_init_function_t * _vlib_init_function_\g"), + ( re.compile("(?PVLIB_DECLARE_INIT_FUNCTION)\s*[(](?P[a-zA-Z0-9_]+)[)]"), + r"/** @brief (@em constructor) \g (@ref \g) */ vlib_init_function_t * _vlib_init_function_\g"), + + # Search for VLIB_LOOP_ENTER_FUNCTION, extract the parameters and add a docblock for it + ( re.compile("(?PVLIB_MAIN_LOOP_ENTER_FUNCTION)\s*[(](?P[a-zA-Z0-9_]+)(,[^)]*)?[)]"), + r"/** @brief (@em constructor) \g (@ref \g) */ _vlib_main_loop_enter_\g"), + ( re.compile("(?PVLIB_MAIN_LOOP_EXIT_FUNCTION)\s*[(](?P[a-zA-Z0-9_]+)(,[^)]*)?[)]"), + r"/** @brief (@em constructor) \g (@ref \g) */ _vlib_main_loop_exit_\g"), + + # Search for VLIB_CONFIG_FUNCTION, extract the parameters and add a docblock for it + ( re.compile("(?PVLIB_CONFIG_FUNCTION)\s*[(](?P[a-zA-Z0-9_]+),\s*(?P\"[^\"]+\")(,[^)]*)?[)]"), + r"/** @brief (@em constructor) \g (\g, \g) */ vlib_config_function_runtime_t _vlib_config_function_\g"), + ( re.compile("(?PVLIB_EARLY_CONFIG_FUNCTION)\s*[(](?P[a-zA-Z0-9_]+),\s*(?P\"[^\"]+\")(,[^)]*)?[)]"), + r"/** @brief (@em constructor) \g (\g, \g) */ vlib_config_function_runtime_t _vlib_config_function_\g"), - # Search for VLIB_LOOP_ENTER_FUNCTION, extract the 1st parameter (ignore any others) and add a docblock for it - ( re.compile("(?PVLIB_MAIN_LOOP_ENTER_FUNCTION)\s*[(](?P[a-zA-Z0-9_]+)(,[^)]*)?[)]"), r"/** @brief (@em constructor) \g (@ref \g) */ _vlib_main_loop_enter_\g"), - ( re.compile("(?PVLIB_MAIN_LOOP_EXIT_FUNCTION)\s*[(](?P[a-zA-Z0-9_]+)(,[^)]*)?[)]"), r"/** @brief (@em constructor) \g (@ref \g) */ _vlib_main_loop_exit_\g"), + # Search for "format_thing" and "unformat_thing" when used as a function pointer and add parens + ( re.compile("(?P
(^|,)\s*)(?P(un)?format_[a-zA-Z0-9_]+)(?P\s*(,|$))"),
+        r"\g
\g()\g" ),
 
-    # Search for VLIB_CONFIG_FUNCTION, extract the 1st parameter (ignore any others) and add a docblock for it
-    ( re.compile("(?PVLIB_CONFIG_FUNCTION)\s*[(](?P[a-zA-Z0-9_]+),\s*(?P\"[^\"]+\")(,[^)]*)?[)]"), r"/** @brief (@em constructor) \g (\g, \g) */ vlib_config_function_runtime_t _vlib_config_function_\g"),
-    ( re.compile("(?PVLIB_EARLY_CONFIG_FUNCTION)\s*[(](?P[a-zA-Z0-9_]+),\s*(?P\"[^\"]+\")(,[^)]*)?[)]"), r"/** @brief (@em constructor) \g (\g, \g) */ vlib_config_function_runtime_t _vlib_config_function_\g"),
+    # Search for CLIB_PAD_FROM_TO(...); and replace with padding
+    # #define CLIB_PAD_FROM_TO(from,to) u8 pad_##from[(to) - (from)]
+    ( re.compile("(?PCLIB_PAD_FROM_TO)\s*[(](?P[^,]+),\s*(?P[^)]+)[)]"),
+        r"/** Padding. */ u8 pad_\g[(\g) - (\g)]" ),
 
-    # Search for "format_thing" and "unformat_thing" when used as a function pointer and add parens
-    ( re.compile("(?P
(^|,)\s*)(?P(un)?format_[a-zA-Z0-9_]+)(?P\s*(,|$))") , r"\g
\g()\g" ),
 ]
 
 
-- 
cgit 1.2.3-korg