11<%!
22import re
3- from templates import helper as th
3+ from templates import print_helper as tph
44%><%
55 n= namespace
66 N= n.upper()
@@ -9,7 +9,7 @@ from templates import helper as th
99 X= x.upper()
1010%> /*
1111 *
12- * Copyright (C) 2023 Intel Corporation
12+ * Copyright (C) 2023-2024 Intel Corporation
1313 *
1414 * Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
1515 * See LICENSE.TXT
@@ -27,50 +27,19 @@ from templates import helper as th
2727extern "C" {
2828# endif
2929
30- ## Declarations ###############################################################
31- % for spec in specs:
32- % for obj in spec[' objects' ]:
33- % if re.match(r " enum" , obj[' type' ]):
34- ///////////////////////////////////////////////////////////////////////////////
35- /// @brief Print ${ th.make_enum_name(n, tags, obj)} enum
36- /// @returns
37- /// - ::${ X} _RESULT_SUCCESS
38- /// - ::${ X} _RESULT_ERROR_INVALID_NULL_POINTER
39- /// - `NULL == buffer`
40- /// - ::${ X} _RESULT_ERROR_INVALID_SIZE
41- /// - `buff_size < out_size`
42- ${ X} _APIEXPORT ${ x} _result_t ${ X} _APICALL ${ th.make_func_name_with_prefix(f ' { x} Print ' , obj[' name' ])} (enum ${ th.make_enum_name(n, tags, obj)} value, char *buffer, const size_t buff_size, size_t *out_size);
43-
44- % elif re.match(r " struct" , obj[' type' ]):
45- ///////////////////////////////////////////////////////////////////////////////
46- /// @brief Print ${ th.make_type_name(n, tags, obj)} struct
47- /// @returns
48- /// - ::${ X} _RESULT_SUCCESS
49- /// - ::${ X} _RESULT_ERROR_INVALID_NULL_POINTER
50- /// - `NULL == buffer`
51- /// - ::${ X} _RESULT_ERROR_INVALID_SIZE
52- /// - `buff_size < out_size`
53- ${ X} _APIEXPORT ${ x} _result_t ${ X} _APICALL ${ th.make_func_name_with_prefix(f ' { x} Print ' , obj[' name' ])} (const ${ obj[' type' ]} ${ th.make_type_name(n, tags, obj)} params, char *buffer, const size_t buff_size, size_t *out_size);
54-
55- %endif
56- %endfor # obj in spec['objects']
57- %endfor
58-
59- % for tbl in th.get_pfncbtables(specs, meta, n, tags):
60- % for obj in tbl[' functions' ]:
6130<%
62- name = th.make_pfncb_param_type(n, tags, obj )
31+ api_types_funcs = tph.get_api_types_funcs(specs, meta, n, tags )
6332%>
33+ ## Declarations ###############################################################
34+ % for func in api_types_funcs:
6435///////////////////////////////////////////////////////////////////////////////
65- /// @brief Print ${ th.make_pfncb_param_type(n, tags, obj) } params struct
36+ /// @brief Print ${ func.print_arg.type_name } ${ func.print_arg.base_type }
6637/// @returns
6738/// - ::${ X} _RESULT_SUCCESS
68- /// - ::${ X} _RESULT_ERROR_INVALID_NULL_POINTER
69- /// - `NULL == buffer`
7039/// - ::${ X} _RESULT_ERROR_INVALID_SIZE
7140/// - `buff_size < out_size`
72- ${ X} _APIEXPORT ${ x} _result_t ${ X} _APICALL ${ th.make_func_name_with_prefix( f ' { x } Print ' , name) } (const struct ${ th.make_pfncb_param_type(n, tags, obj) } *params, char *buffer, const size_t buff_size, size_t *out_size );
73- %endfor
41+ ${ X} _APIEXPORT ${ x} _result_t ${ X} _APICALL ${ func.c_name } ( ${ func.c_args } );
42+
7443%endfor
7544
7645///////////////////////////////////////////////////////////////////////////////
@@ -80,7 +49,6 @@ ${X}_APIEXPORT ${x}_result_t ${X}_APICALL ${th.make_func_name_with_prefix(f'{x}P
8049/// - ::${ X} _RESULT_ERROR_INVALID_ENUMERATION
8150/// - ::${ X} _RESULT_ERROR_INVALID_NULL_POINTER
8251/// - `NULL == params`
83- /// - `NULL == buffer`
8452/// - ::${ X} _RESULT_ERROR_INVALID_SIZE
8553/// - `buff_size < out_size`
8654${ X} _APIEXPORT ${ x} _result_t ${ X} _APICALL ${ x} PrintFunctionParams(enum ${ x} _function_t function, const void *params, char *buffer, const size_t buff_size, size_t *out_size);
0 commit comments