📄 details-enums.m2i
字号:
############################################################# -*- c -*-## generic include for enums. Do not use directly.#### $Id: details-enums.m2i 12011 2005-03-18 23:01:44Z rstory $########################################################################@if $m2c_mark_boundary == 1@/** START code generated by $RCSfile$ $Revision: 12011 $ */@end@########################################################################@ifconf $node.syntax.m2i@@ include $node.syntax.m2i@@else@#### Generating enums#### Examples:#### enums syntax perltype net-snmp type cdecl m2c_decl## ----- -------- -------- ------------- ----- -------## 1 SomeTC BITS ASN_OCTET_STR char u_long## 1 INTEGER INTEGER ASN_INTEGER long u_long## 1 RowStatus INTEGER ASN_INTEGER long u_long##/************************************************************* * constants for enums for the MIB node * $node ($node.syntax / $node.type) * * since a Textual Convention may be referenced more than once in a * MIB, protect againt redefinitions of the enum values. */###ifndef ${m2c_de_pfx}_ENUMS#define ${m2c_de_pfx}_ENUMS@ eval $m2c_mask=""@@ foreach $e $v enum@@ include m2c_setup_enum.m2i@@ if "$node.perltype" eq "BITS"@@ if $v > 31@@ print ** ACK! I cannot handle BITS longer than 4 bytes!@@ exit@@ end@@ if "x$m2c_mask" eq "x"@@ eval $m2c_mask="$m2c_ename"@@ else@@ eval $m2c_mask="$m2c_mask | $m2c_ename"@@ end@$m2c_const_dcl $m2c_ename $m2c_const_del (1 << (31-$v)) $m2c_const_sfx@ else@$m2c_const_dcl $m2c_ename $m2c_const_del $v $m2c_const_sfx@ end@@ end@ # for each#endif /* ${m2c_de_pfx}_ENUMS */@ if "$node.perltype" eq "BITS"@$m2c_const_dcl $m2c_enum_mask $m2c_const_del ($m2c_mask) @ end@@ if ($m2c_node_skip_mapping != 1) && ($node.enums == 1)@ /* * TODO:140:o: Define your interal representation of $node enums. * (used for value mapping; see notes at top of file) */@ foreach $e $v enum@@ include m2c_setup_enum.m2i@@ if ("$node.perltype" ne "BITS")@$m2c_const_dcl INTERNAL_$context.uc_$m2c_iname $m2c_const_del $v $m2c_const_sfx@ else@$m2c_const_dcl INTERNAL_$context.uc_$m2c_iname $m2c_const_del (0x01 << $v) $m2c_const_sfx@ end@@ end@ // foreach@ end@ // skip mapping / enums@end@ # ! syntax include########################################################################@if $m2c_mark_boundary == 1@/** END code generated by $RCSfile$ $Revision: 12011 $ */@end@
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -