From dab6623a9d610067da19411bb61f7b2bfd70b42b Mon Sep 17 00:00:00 2001 From: Sergey Lebedev Date: Thu, 29 Feb 2024 17:08:22 +0100 Subject: [PATCH] UTIL: add parser doc (#934) --- config/m4/ucx.m4 | 4 ++++ src/utils/ucc_parser.h | 24 +++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/config/m4/ucx.m4 b/config/m4/ucx.m4 index fa608685cd..ba57dae303 100644 --- a/config/m4/ucx.m4 +++ b/config/m4/ucx.m4 @@ -128,6 +128,10 @@ AS_IF([test "x$ucx_checked" != "xyes"],[ [AC_DEFINE([UCS_HAVE_PARSER_SET_VALUE_TABLE_PREFIX], [1], [flags for ucs_rcache_get])], []) + AC_CHECK_MEMBER(ucs_config_parser_t.doc, + [AC_DEFINE([UCS_HAVE_PARSER_CONFIG_DOC], [1], [flags for ucs_rcache_get])], + [], + [#include ]) ], [ AS_IF([test "x$with_ucx" != "xguess"], diff --git a/src/utils/ucc_parser.h b/src/utils/ucc_parser.h index f8bd2e7ede..f6605cb252 100644 --- a/src/utils/ucc_parser.h +++ b/src/utils/ucc_parser.h @@ -268,8 +268,29 @@ int ucc_config_sprintf_uint_ranged(char *buf, size_t max, const void *src, ucs_status_t ucc_config_clone_uint_ranged(const void *src, void *dest, const void *arg); -void ucc_config_release_uint_ranged(void *ptr, const void *arg); +void ucc_config_release_uint_ranged(void *ptr, const void *arg); +#ifdef UCS_HAVE_PARSER_CONFIG_DOC +#define UCC_CONFIG_TYPE_UINT_RANGED \ + { \ + ucc_config_sscanf_uint_ranged, ucc_config_sprintf_uint_ranged, \ + ucc_config_clone_uint_ranged, ucc_config_release_uint_ranged, \ + ucs_config_help_generic, ucs_config_doc_nop, \ + "[-:[mtype]:value," \ + "-:[mtype]:value,...,]default_value\n" \ + "# value and default_value can be \"auto\"" \ + } + +#define UCC_CONFIG_TYPE_PIPELINE_PARAMS \ + { \ + ucc_config_sscanf_pipeline_params, ucc_config_sprintf_pipeline_params, \ + ucc_config_clone_pipeline_params, \ + ucc_config_release_pipeline_params, ucs_config_help_generic, \ + ucs_config_doc_nop, \ + "thresh=:fragsize=:nfrags=" \ + ":pdepth=:" \ + } +#else #define UCC_CONFIG_TYPE_UINT_RANGED \ { \ ucc_config_sscanf_uint_ranged, ucc_config_sprintf_uint_ranged, \ @@ -289,3 +310,4 @@ void ucc_config_release_uint_ranged(void *ptr, const void *arg); } #endif +#endif