You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libpEpTransport/src/gen_c.ysl2

48 lines
835 B
Plaintext

include yslt.yml2
tstylesheet {
include standardlib.ysl2
template "/enum"
||
#ifndef __«yml:ucase(@name)»_H__
#define __«yml:ucase(@name)»_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef enum PEP_«@name» {
`` apply "item|doc"
} PEP_«@name»;
#ifdef __cplusplus
}
#endif
#endif // __«yml:ucase(@name)»_H__
||
template "item" {
param "hexdigits", 8;
indent 0;
choose {
when "@output='hex'"
> PEP_«yml:abbr(../@name)»_«@name» = 0x«yml:dec2hex(.,$hexdigits)»
otherwise
> PEP_«yml:abbr(../@name)»_«@name» = «.»
}
if "position()!=last()" > ,
if "@doc" > // «@doc»
> \n
}
template "doc"
||
// «.»
||
}