Lines Matching refs:cw
103 ri.cw.p(f'free({var}->{ref}{self.c_name});')
116 ri.cw.p(f"unsigned int n_{self.c_name};")
120 ri.cw.p(f"{member} {ptr}{self.c_name};")
124 ri.cw.p(one + ';')
129 def attr_policy(self, cw): argument
133 cw.p(f"\t[{self.enum_name}] = {spec},")
138 def attr_typol(self, cw): argument
140 cw.p(f'[{self.enum_name}] = {"{"} .name = "{self.name}", {typol}{"}"},')
144 ri.cw.p(f"if ({var}->_present.{self.c_name})")
146 ri.cw.p(f"if ({var}->_present.{self.c_name}_len)")
147 ri.cw.p(f"{line};")
167 ri.cw.block_start(line=f"{kw} (type == {self.enum_name})")
170 ri.cw.p(local)
171 ri.cw.nl()
174 ri.cw.p("if (ynl_attr_validate(yarg, attr))")
175 ri.cw.p("return MNL_CB_ERROR;")
177 ri.cw.p(f"{var}->_present.{self.c_name} = 1;")
180 ri.cw.nl()
182 ri.cw.p(line)
185 ri.cw.p(line)
186 ri.cw.block_end()
210 ri.cw.write_func('static inline void', func_name, body=code,
227 def attr_policy(self, cw): argument
247 def attr_policy(self, cw): argument
352 ri.cw.p(f"char *{self.c_name};")
364 def attr_policy(self, cw): argument
371 cw.p(f"\t[{self.enum_name}] = {spec},")
401 ri.cw.p(f"void *{self.c_name};")
441 ri.cw.p(f'{self.nested_render_name}_free(&{var}->{ref}{self.c_name});')
500 ri.cw.p(f"free({var}->{ref}{self.c_name});")
502 ri.cw.p(f"for (i = 0; i < {var}->{ref}n_{self.c_name}; i++)")
503 ri.cw.p(f'{self.nested_render_name}_free(&{var}->{ref}{self.c_name}[i]);')
504 ri.cw.p(f"free({var}->{ref}{self.c_name});")
520 ri.cw.p(f"for (unsigned int i = 0; i < {var}->n_{self.c_name}; i++)")
521 ri.cw.p(f"mnl_attr_put_{put_type}(nlh, {self.enum_name}, {var}->{self.c_name}[i]);")
523 ri.cw.p(f"for (unsigned int i = 0; i < {var}->n_{self.c_name}; i++)")
1007 def __init__(self, cw, family, ku_space, op, op_mode, attr_set=None): argument
1009 self.nl = cw.nlib
1034 self.cw = cw
1323 ri.cw.write_func_prot(ret, fname, args, doc=doc, suffix=suffix)
1334 def put_typol(cw, struct): argument
1336 cw.block_start(line=f'struct ynl_policy_attr {struct.render_name}_policy[{type_max} + 1] =')
1339 arg.attr_typol(cw)
1341 cw.block_end(line=';')
1342 cw.nl()
1344 cw.block_start(line=f'struct ynl_policy_nest {struct.render_name}_nest =')
1345 cw.p(f'.max_attr = {type_max},')
1346 cw.p(f'.table = {struct.render_name}_policy,')
1347 cw.block_end(line=';')
1348 cw.nl()
1351 def _put_enum_to_str_helper(cw, render_name, map_name, arg_name, enum=None): argument
1355 cw.write_func_prot('const char *', f'{render_name}_str', args)
1356 cw.block_start()
1358 cw.p(f'{arg_name} = ffs({arg_name}) - 1;')
1359 cw.p(f'if ({arg_name} < 0 || {arg_name} >= (int)MNL_ARRAY_SIZE({map_name}))')
1360 cw.p('return NULL;')
1361 cw.p(f'return {map_name}[{arg_name}];')
1362 cw.block_end()
1363 cw.nl()
1366 def put_op_name_fwd(family, cw): argument
1367 cw.write_func_prot('const char *', f'{family.name}_op_str', ['int op'], suffix=';')
1370 def put_op_name(family, cw): argument
1372 cw.block_start(line=f"static const char * const {map_name}[] =")
1376 cw.p(f'[{op.enum_name}] = "{op_name}",')
1378 cw.p(f'[{op.rsp_value}] = "{op_name}",')
1379 cw.block_end(line=';')
1380 cw.nl()
1382 _put_enum_to_str_helper(cw, family.name + '_op', map_name, 'op')
1385 def put_enum_to_str_fwd(family, cw, enum): argument
1389 cw.write_func_prot('const char *', f'{enum.render_name}_str', args, suffix=';')
1392 def put_enum_to_str(family, cw, enum): argument
1394 cw.block_start(line=f"static const char * const {map_name}[] =")
1396 cw.p(f'[{entry.value}] = "{entry.name}",')
1397 cw.block_end(line=';')
1398 cw.nl()
1400 _put_enum_to_str_helper(cw, enum.render_name, map_name, 'value', enum=enum)
1408 ri.cw.write_func_prot('int', f'{struct.render_name}_put', func_args)
1409 ri.cw.block_start()
1410 ri.cw.write_func_lvar('struct nlattr *nest;')
1412 ri.cw.p("nest = mnl_attr_nest_start(nlh, attr_type);")
1417 ri.cw.p("mnl_attr_nest_end(nlh, nest);")
1419 ri.cw.nl()
1420 ri.cw.p('return 0;')
1421 ri.cw.block_end()
1422 ri.cw.nl()
1452 ri.cw.block_start()
1453 ri.cw.write_func_lvar(local_vars)
1456 ri.cw.p(line)
1457 ri.cw.nl()
1460 ri.cw.p(f'dst->{arg} = {arg};')
1464 ri.cw.p(f"if (dst->{aspec.c_name})")
1465 …ri.cw.p(f'return ynl_error_parse(yarg, "attribute already present ({struct.attr_set.name}.{aspec.n…
1467 ri.cw.nl()
1468 ri.cw.block_start(line=iter_line)
1469 ri.cw.p('unsigned int type = mnl_attr_get_type(attr);')
1470 ri.cw.nl()
1478 ri.cw.block_end()
1479 ri.cw.nl()
1484 ri.cw.block_start(line=f"if (n_{aspec.c_name})")
1485 ri.cw.p(f"dst->{aspec.c_name} = calloc({aspec.c_name}, sizeof(*dst->{aspec.c_name}));")
1486 ri.cw.p(f"dst->n_{aspec.c_name} = n_{aspec.c_name};")
1487 ri.cw.p('i = 0;')
1488 ri.cw.p(f"parg.rsp_policy = &{aspec.nested_render_name}_nest;")
1489 ri.cw.block_start(line=f"mnl_attr_for_each_nested(attr, attr_{aspec.c_name})")
1490 ri.cw.p(f"parg.data = &dst->{aspec.c_name}[i];")
1491 ri.cw.p(f"if ({aspec.nested_render_name}_parse(&parg, attr, mnl_attr_get_type(attr)))")
1492 ri.cw.p('return MNL_CB_ERROR;')
1493 ri.cw.p('i++;')
1494 ri.cw.block_end()
1495 ri.cw.block_end()
1496 ri.cw.nl()
1500 ri.cw.block_start(line=f"if (n_{aspec.c_name})")
1501 ri.cw.p(f"dst->{aspec.c_name} = calloc(n_{aspec.c_name}, sizeof(*dst->{aspec.c_name}));")
1502 ri.cw.p(f"dst->n_{aspec.c_name} = n_{aspec.c_name};")
1503 ri.cw.p('i = 0;')
1505 ri.cw.p(f"parg.rsp_policy = &{aspec.nested_render_name}_nest;")
1506 ri.cw.block_start(line=iter_line)
1507 ri.cw.block_start(line=f"if (mnl_attr_get_type(attr) == {aspec.enum_name})")
1509 ri.cw.p(f"parg.data = &dst->{aspec.c_name}[i];")
1510 ri.cw.p(f"if ({aspec.nested_render_name}_parse(&parg, attr))")
1511 ri.cw.p('return MNL_CB_ERROR;')
1516 ri.cw.p(f"dst->{aspec.c_name}[i] = mnl_attr_get_{t}(attr);")
1519 ri.cw.p('i++;')
1520 ri.cw.block_end()
1521 ri.cw.block_end()
1522 ri.cw.block_end()
1523 ri.cw.nl()
1526 ri.cw.p('return 0;')
1528 ri.cw.p('return MNL_CB_OK;')
1529 ri.cw.block_end()
1530 ri.cw.nl()
1543 ri.cw.write_func_prot('int', f'{struct.render_name}_parse', func_args)
1560 ri.cw.write_func_prot('int', f'{op_prefix(ri, "reply", deref=deref)}_parse', func_args)
1566 ri.cw.block_start()
1567 ri.cw.p('return MNL_CB_OK;')
1568 ri.cw.block_end()
1569 ri.cw.nl()
1586 ri.cw.block_start()
1587 ri.cw.write_func_lvar(local_vars)
1589 ri.cw.p(f"nlh = ynl_gemsg_start_req(ys, {ri.nl.get_family_id()}, {ri.op.enum_name}, 1);")
1591 ri.cw.p(f"ys->req_policy = &{ri.struct['request'].render_name}_nest;")
1593 ri.cw.p(f"yrs.yarg.rsp_policy = &{ri.struct['reply'].render_name}_nest;")
1594 ri.cw.nl()
1597 ri.cw.nl()
1601 ri.cw.p('rsp = calloc(1, sizeof(*rsp));')
1602 ri.cw.p('yrs.yarg.data = rsp;')
1603 ri.cw.p(f"yrs.cb = {op_prefix(ri, 'reply')}_parse;")
1605 ri.cw.p(f'yrs.rsp_cmd = {ri.op.enum_name};')
1607 ri.cw.p(f'yrs.rsp_cmd = {ri.op.rsp_value};')
1608 ri.cw.nl()
1610 ri.cw.p(f"err = ynl_exec(ys, nlh, {parse_arg});")
1611 ri.cw.p('if (err < 0)')
1613 ri.cw.p('goto err_free;')
1615 ri.cw.p('return -1;')
1616 ri.cw.nl()
1618 ri.cw.p(f"return {ret_ok};")
1619 ri.cw.nl()
1622 ri.cw.p('err_free:')
1623 ri.cw.p(f"{call_free(ri, rdir(direction), 'rsp')}")
1624 ri.cw.p(f"return {ret_err};")
1626 ri.cw.block_end()
1632 ri.cw.block_start()
1638 ri.cw.p(f'{var}')
1639 ri.cw.nl()
1641 ri.cw.p('yds.ys = ys;')
1642 ri.cw.p(f"yds.alloc_sz = sizeof({type_name(ri, rdir(direction))});")
1643 ri.cw.p(f"yds.cb = {op_prefix(ri, 'reply', deref=True)}_parse;")
1645 ri.cw.p(f'yds.rsp_cmd = {ri.op.enum_name};')
1647 ri.cw.p(f'yds.rsp_cmd = {ri.op.rsp_value};')
1648 ri.cw.p(f"yds.rsp_policy = &{ri.struct['reply'].render_name}_nest;")
1649 ri.cw.nl()
1650 ri.cw.p(f"nlh = ynl_gemsg_start_dump(ys, {ri.nl.get_family_id()}, {ri.op.enum_name}, 1);")
1653 ri.cw.p(f"ys->req_policy = &{ri.struct['request'].render_name}_nest;")
1654 ri.cw.nl()
1657 ri.cw.nl()
1659 ri.cw.p('err = ynl_exec_dump(ys, nlh, &yds);')
1660 ri.cw.p('if (err < 0)')
1661 ri.cw.p('goto free_list;')
1662 ri.cw.nl()
1664 ri.cw.p('return yds.first;')
1665 ri.cw.nl()
1666 ri.cw.p('free_list:')
1667 ri.cw.p(call_free(ri, rdir(direction), 'yds.first'))
1668 ri.cw.p('return NULL;')
1669 ri.cw.block_end()
1684 ri.cw.write_func_prot(f'static inline struct {name} *', f"{name}_alloc", [f"void"])
1685 ri.cw.block_start()
1686 ri.cw.p(f'return calloc(1, sizeof(struct {name}));')
1687 ri.cw.block_end()
1696 ri.cw.write_func_prot('void', f"{name}_free", [f"struct {struct_name} *{arg}"], suffix=suffix)
1707 ri.cw.block_start(line=f"struct {ri.family['name']}{suffix}")
1715 ri.cw.block_start(line=f"struct")
1717 ri.cw.p(line)
1719 ri.cw.block_end(line='_present;')
1720 ri.cw.nl()
1723 ri.cw.p(f"__u32 {arg};")
1728 ri.cw.block_end(line=';')
1729 ri.cw.nl()
1742 ri.cw.nl()
1747 ri.cw.nl()
1765 ri.cw.write_func_prot('void', f"{ri.op.render_name}{suffix}_parse",
1792 ri.cw.block_start(line=f"{type_name(ri, 'reply')}")
1794 ri.cw.p(f"{type_name(ri, 'reply')} *next;")
1796 ri.cw.p('__u16 family;')
1797 ri.cw.p('__u8 cmd;')
1798 ri.cw.p('struct ynl_ntf_base_type *next;')
1799 ri.cw.p(f"void (*free)({type_name(ri, 'reply')} *ntf);")
1800 ri.cw.p(f"{type_name(ri, 'reply', deref=True)} obj __attribute__ ((aligned (8)));")
1801 ri.cw.block_end(line=';')
1802 ri.cw.nl()
1804 ri.cw.nl()
1810 ri.cw.p('unsigned int i;')
1811 ri.cw.nl()
1824 ri.cw.block_start()
1828 ri.cw.p(f'free({var});')
1829 ri.cw.block_end()
1830 ri.cw.nl()
1847 ri.cw.block_start()
1848 ri.cw.p(f"{sub_type} *next = rsp;")
1849 ri.cw.nl()
1850 ri.cw.block_start(line='while ((void *)next != YNL_LIST_END)')
1852 ri.cw.p('rsp = next;')
1853 ri.cw.p('next = rsp->next;')
1854 ri.cw.nl()
1857 ri.cw.p(f'free(rsp);')
1858 ri.cw.block_end()
1859 ri.cw.block_end()
1860 ri.cw.nl()
1865 ri.cw.block_start()
1868 ri.cw.p(f'free(rsp);')
1869 ri.cw.block_end()
1870 ri.cw.nl()
1873 def print_req_policy_fwd(cw, struct, ri=None, terminate=True): argument
1894 cw.p(f"{prefix}const struct nla_policy {name}_nl_policy[{max_attr.enum_name} + 1]{suffix}")
1897 def print_req_policy(cw, struct, ri=None): argument
1898 print_req_policy_fwd(cw, struct, ri=ri, terminate=False)
1900 arg.attr_policy(cw)
1901 cw.p("};")
1902 cw.nl()
1913 def print_kernel_op_table_fwd(family, cw, terminate): argument
1917 cw.p(f"/* Ops table for {family.name} */")
1939 cw.p(f"extern {line};")
1941 cw.block_start(line=line + ' =')
1946 cw.nl()
1948 cw.write_func_prot('int', c_lower(name),
1952 cw.write_func_prot('void', c_lower(name),
1956 cw.write_func_prot('int', c_lower(name),
1959 cw.write_func_prot('int', c_lower(name),
1962 cw.nl()
1970 cw.write_func_prot('int', name,
1975 cw.write_func_prot('int', name,
1977 cw.nl()
1980 def print_kernel_op_table_hdr(family, cw): argument
1981 print_kernel_op_table_fwd(family, cw, terminate=True)
1984 def print_kernel_op_table(family, cw): argument
1985 print_kernel_op_table_fwd(family, cw, terminate=False)
1991 cw.block_start()
2010 cw.write_struct_init(members)
2011 cw.block_end(line=',')
2021 cw.block_start()
2054 cw.write_struct_init(members)
2055 cw.block_end(line=',')
2057 cw.block_end(line=';')
2058 cw.nl()
2061 def print_kernel_mcgrp_hdr(family, cw): argument
2065 cw.block_start('enum')
2068 cw.p(grp_id)
2069 cw.block_end(';')
2070 cw.nl()
2073 def print_kernel_mcgrp_src(family, cw): argument
2077 cw.block_start('static const struct genl_multicast_group ' + family.name + '_nl_mcgrps[] =')
2081 cw.p('[' + grp_id + '] = { "' + name + '", },')
2082 cw.block_end(';')
2083 cw.nl()
2086 def print_kernel_family_struct_hdr(family, cw): argument
2090 cw.p(f"extern struct genl_family {family.name}_nl_family;")
2091 cw.nl()
2094 def print_kernel_family_struct_src(family, cw): argument
2098 cw.block_start(f"struct genl_family {family.name}_nl_family __ro_after_init =")
2099 cw.p('.name\t\t= ' + family.fam_key + ',')
2100 cw.p('.version\t= ' + family.ver_key + ',')
2101 cw.p('.netnsok\t= true,')
2102 cw.p('.parallel_ops\t= true,')
2103 cw.p('.module\t\t= THIS_MODULE,')
2105 cw.p(f'.ops\t\t= {family.name}_nl_ops,')
2106 cw.p(f'.n_ops\t\t= ARRAY_SIZE({family.name}_nl_ops),')
2108 cw.p(f'.split_ops\t= {family.name}_nl_ops,')
2109 cw.p(f'.n_split_ops\t= ARRAY_SIZE({family.name}_nl_ops),')
2111 cw.p(f'.mcgrps\t\t= {family.name}_nl_mcgrps,')
2112 cw.p(f'.n_mcgrps\t= ARRAY_SIZE({family.name}_nl_mcgrps),')
2113 cw.block_end(';')
2116 def uapi_enum_start(family, cw, obj, ckey='', enum_name='enum-name'): argument
2123 cw.block_start(line=start_line)
2126 def render_uapi(family, cw): argument
2128 cw.p('#ifndef ' + hdr_prot)
2129 cw.p('#define ' + hdr_prot)
2130 cw.nl()
2134 cw.writes_defines(defines)
2135 cw.nl()
2140 cw.writes_defines(defines)
2142 cw.nl()
2149 cw.p('/**')
2153 cw.write_doc_line(enum.enum_name + doc)
2157 cw.write_doc_line(doc)
2158 cw.p(' */')
2160 uapi_enum_start(family, cw, const, 'name')
2166 cw.p(entry.c_name + suffix)
2169 cw.nl()
2170 cw.p('/* private: */')
2174 cw.p(max_name + max_val)
2177 cw.p('__' + max_name + ',')
2178 cw.p(max_name + ' = (__' + max_name + ' - 1)')
2179 cw.block_end(line=';')
2180 cw.nl()
2187 cw.writes_defines(defines)
2188 cw.nl()
2200 uapi_enum_start(family, cw, attr_set.yaml, 'enum-name')
2207 cw.p(attr.enum_name + suffix)
2208 cw.nl()
2209 cw.p(cnt_name + ('' if max_by_define else ','))
2211 cw.p(f"{attr_set.max_name} = {max_value}")
2212 cw.block_end(line=';')
2214 cw.p(f"#define {attr_set.max_name} {max_value}")
2215 cw.nl()
2224 uapi_enum_start(family, cw, family['operations'], 'enum-name')
2234 cw.p(op.enum_name + suffix)
2236 cw.nl()
2237 cw.p(cnt_name + ('' if max_by_define else ','))
2239 cw.p(f"{max_name} = {max_value}")
2240 cw.block_end(line=';')
2242 cw.p(f"#define {max_name} {max_value}")
2243 cw.nl()
2246 uapi_enum_start(family, cw, family['operations'], enum_name='async-enum')
2254 cw.p(op.enum_name + suffix)
2255 cw.block_end(line=';')
2256 cw.nl()
2264 cw.nl()
2266 cw.writes_defines(defines)
2267 cw.nl()
2269 cw.p(f'#endif /* {hdr_prot} */')
2273 ri.cw.block_start(line=f"[{op.enum_name}] = ")
2274 ri.cw.p(f".alloc_sz\t= sizeof({type_name(ri, 'event')}),")
2275 ri.cw.p(f".cb\t\t= {op_prefix(ri, 'reply', deref=True)}_parse,")
2276 ri.cw.p(f".policy\t\t= &{ri.struct['reply'].render_name}_nest,")
2277 ri.cw.p(f".free\t\t= (void *){op_prefix(ri, 'notify')}_free,")
2278 ri.cw.block_end(line=',')
2281 def render_user_family(family, cw, prototype): argument
2284 cw.p(f'extern {symbol};')
2288 cw.block_start(line=f"static const struct ynl_ntf_info {family['name']}_ntf_info[] = ")
2292 ri = RenderInfo(cw, family, "user", op, "notify")
2294 ri = RenderInfo(cw, family, "user", ntf_op, "event")
2301 ri = RenderInfo(cw, family, "user", op, "event")
2303 cw.block_end(line=";")
2304 cw.nl()
2306 cw.block_start(f'{symbol} = ')
2307 cw.p(f'.name\t\t= "{family.name}",')
2309 cw.p(f".ntf_info\t= {family['name']}_ntf_info,")
2310 cw.p(f".ntf_info_size\t= MNL_ARRAY_SIZE({family['name']}_ntf_info),")
2311 cw.block_end(line=';')
2358 cw = CodeWriter(BaseNlLib(), args.out_file)
2362 cw.p(f'/* SPDX-License-Identifier: {parsed.license} */')
2364 cw.p(f'// SPDX-License-Identifier: {parsed.license}')
2365 cw.p("/* Do not edit directly, auto-generated from: */")
2366 cw.p(f"/*\t{spec_kernel} */")
2367 cw.p(f"/* YNL-GEN {args.mode} {'header' if args.header else 'source'} */")
2372 cw.p(f'/* YNL-ARG{line} */')
2373 cw.nl()
2376 render_uapi(parsed, cw)
2381 cw.p('#ifndef ' + hdr_prot)
2382 cw.p('#define ' + hdr_prot)
2383 cw.nl()
2386 cw.p('#include <net/netlink.h>')
2387 cw.p('#include <net/genetlink.h>')
2388 cw.nl()
2391 cw.p(f'#include "{os.path.basename(args.out_file[:-2])}.h"')
2392 cw.nl()
2395 cw.p('#include <stdlib.h>')
2396 cw.p('#include <string.h>')
2398 cw.p('#include <linux/types.h>')
2400 cw.p(f'#include "{parsed.name}-user.h"')
2401 cw.p('#include "ynl.h"')
2407 cw.p(f"#include <{one}>")
2408 cw.nl()
2412 cw.p("#include <libmnl/libmnl.h>")
2413 cw.p("#include <linux/genetlink.h>")
2414 cw.nl()
2416 cw.p(f'#include "{one}"')
2418 cw.p('struct ynl_sock;')
2419 cw.nl()
2420 render_user_family(parsed, cw, True)
2421 cw.nl()
2427 cw.p('/* Common nested types */')
2431 print_req_policy_fwd(cw, struct)
2432 cw.nl()
2435 cw.p(f"/* Global operation policy for {parsed.name} */")
2438 print_req_policy_fwd(cw, struct)
2439 cw.nl()
2444 ri = RenderInfo(cw, parsed, args.mode, op, "do")
2445 print_req_policy_fwd(cw, ri.struct['request'], ri=ri)
2446 cw.nl()
2448 print_kernel_op_table_hdr(parsed, cw)
2449 print_kernel_mcgrp_hdr(parsed, cw)
2450 print_kernel_family_struct_hdr(parsed, cw)
2454 cw.p('/* Common nested types */')
2458 print_req_policy(cw, struct)
2459 cw.nl()
2462 cw.p(f"/* Global operation policy for {parsed.name} */")
2465 print_req_policy(cw, struct)
2466 cw.nl()
2472 cw.p(f"/* {op.enum_name} - {op_mode} */")
2473 ri = RenderInfo(cw, parsed, args.mode, op, op_mode)
2474 print_req_policy(cw, ri.struct['request'], ri=ri)
2475 cw.nl()
2477 print_kernel_op_table(parsed, cw)
2478 print_kernel_mcgrp_src(parsed, cw)
2479 print_kernel_family_struct_src(parsed, cw)
2483 cw.p('/* Enums */')
2484 put_op_name_fwd(parsed, cw)
2488 put_enum_to_str_fwd(parsed, cw, const)
2489 cw.nl()
2491 cw.p('/* Common nested types */')
2493 ri = RenderInfo(cw, parsed, args.mode, "", "", attr_set)
2497 cw.p(f"/* ============== {op.enum_name} ============== */")
2500 cw.p(f"/* {op.enum_name} - do */")
2501 ri = RenderInfo(cw, parsed, args.mode, op, "do")
2504 cw.nl()
2507 cw.nl()
2509 cw.nl()
2512 cw.p(f"/* {op.enum_name} - dump */")
2513 ri = RenderInfo(cw, parsed, args.mode, op, 'dump')
2521 cw.nl()
2524 cw.p(f"/* {op.enum_name} - notify */")
2525 ri = RenderInfo(cw, parsed, args.mode, op, 'notify')
2532 ri = RenderInfo(cw, parsed, args.mode, op, 'event')
2533 cw.p(f"/* {op.enum_name} - event */")
2535 cw.nl()
2537 cw.nl()
2539 cw.p('/* Enums */')
2540 put_op_name(parsed, cw)
2544 put_enum_to_str(parsed, cw, const)
2545 cw.nl()
2547 cw.p('/* Policies */')
2550 put_typol(cw, struct)
2553 put_typol(cw, struct)
2555 cw.p('/* Common nested types */')
2557 ri = RenderInfo(cw, parsed, args.mode, "", "", attr_set)
2566 cw.p(f"/* ============== {op.enum_name} ============== */")
2568 cw.p(f"/* {op.enum_name} - do */")
2569 ri = RenderInfo(cw, parsed, args.mode, op, "do")
2574 cw.nl()
2577 cw.p(f"/* {op.enum_name} - dump */")
2578 ri = RenderInfo(cw, parsed, args.mode, op, "dump")
2583 cw.nl()
2586 cw.p(f"/* {op.enum_name} - notify */")
2587 ri = RenderInfo(cw, parsed, args.mode, op, 'notify')
2594 cw.p(f"/* {op.enum_name} - event */")
2596 ri = RenderInfo(cw, parsed, args.mode, op, "do")
2599 ri = RenderInfo(cw, parsed, args.mode, op, "event")
2601 cw.nl()
2602 render_user_family(parsed, cw, False)
2605 cw.p(f'#endif /* {hdr_prot} */')