summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2023-02-14 08:04:09 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2023-02-14 08:05:47 +0100
commit285b817d88671df0b3a49cdc2fb43edc1cb62423 (patch)
treeefc6256f8b19a47b4e3d2edc34be24e31bef7b71
parentrtemsspec: Use @ref for appl config options (diff)
downloadrtems-central-285b817d88671df0b3a49cdc2fb43edc1cb62423.tar.bz2
applconfig: Add refs to unspecified functions
-rw-r--r--rtemsspec/applconfig.py18
-rw-r--r--rtemsspec/tests/test_applconfig.py2
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()
*