[rtems-central commit] applconfig: Add refs to unspecified functions
Sebastian Huber
sebh at rtems.org
Tue Feb 14 06:49:42 UTC 2023
Module: rtems-central
Branch: master
Commit: 285b817d88671df0b3a49cdc2fb43edc1cb62423
Changeset: http://git.rtems.org/rtems-central/commit/?id=285b817d88671df0b3a49cdc2fb43edc1cb62423
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Feb 14 08:04:09 2023 +0100
applconfig: Add refs to unspecified functions
---
rtemsspec/applconfig.py | 18 +++++++++++++++---
rtemsspec/tests/test_applconfig.py | 2 +-
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/rtemsspec/applconfig.py b/rtemsspec/applconfig.py
index 54929be5..d203426d 100644
--- a/rtemsspec/applconfig.py
+++ b/rtemsspec/applconfig.py
@@ -271,10 +271,17 @@ def _generate(group: Item, options: ItemMap, enabled: List[str],
content.add_licence_and_copyrights()
-def _get_value_doxygen_url(ctx: ItemGetValueContext) -> Optional[str]:
+def _get_value(ctx: ItemGetValueContext) -> str:
+ return ctx.value[ctx.key]
+
+
+def _get_value_doxygen_url(
+ ctx: ItemGetValueContext,
+ get_value: Callable[[ItemGetValueContext],
+ str] = _get_value) -> Optional[str]:
for ref in ctx.item["references"]:
if ref["type"] == "url":
- return f"<a href=\"{ref['identifier']}\">{ctx.value[ctx.key]}</a>"
+ return f"<a href=\"{ref['identifier']}\">{get_value(ctx)}</a>"
return None
@@ -282,6 +289,11 @@ def _get_value_doxygen_unspecified_define(ctx: ItemGetValueContext) -> Any:
return _get_value_doxygen_url(ctx) or get_value_hash(ctx)
+def _get_value_doxygen_unspecified_function(ctx: ItemGetValueContext) -> Any:
+ return _get_value_doxygen_url(
+ ctx, get_value_doxygen_function) or get_value_doxygen_function(ctx)
+
+
def _get_value_doxygen_unspecified_group(ctx: ItemGetValueContext) -> Any:
return _get_value_doxygen_url(ctx) or ctx.value[ctx.key]
@@ -306,7 +318,7 @@ def _add_doxygen_get_values(mapper: ItemMapper) -> None:
mapper.add_get_value("interface/unspecified-define:/name",
_get_value_doxygen_unspecified_define)
mapper.add_get_value("interface/unspecified-function:/name",
- get_value_doxygen_function)
+ _get_value_doxygen_unspecified_function)
mapper.add_get_value("interface/unspecified-group:/name",
_get_value_doxygen_unspecified_group)
mapper.add_get_value("interface/unspecified-enum:/name",
diff --git a/rtemsspec/tests/test_applconfig.py b/rtemsspec/tests/test_applconfig.py
index 4c307d36..a6c11acc 100644
--- a/rtemsspec/tests/test_applconfig.py
+++ b/rtemsspec/tests/test_applconfig.py
@@ -533,7 +533,7 @@ description m
*
* * <a href="unspec-group-3.html">Unspec Group 3</a>
*
- * * unspec_func()
+ * * <a href="unspec-func.html">unspec_func()</a>
*
* * func()
*
More information about the vc
mailing list