interfacing between transports written in different programming languages
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

49 lines
890 B

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»;
const char *«@name»_label(PEP_«@name» value);
#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"
||
// «.»
||
}