X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=genevent%2Fgenevent.h;h=4515c7586cb788bac6b494b112a9dbe0a79aa48d;hb=4173fa0e5b30faede1db23413e0192e92b419dbf;hp=11ffda0d914076810886bd9f8fb1ff0c02ca48e4;hpb=8c6ca411f1f7dc33394552044fcfc0bed6e961b4;p=lttv.git diff --git a/genevent/genevent.h b/genevent/genevent.h index 11ffda0d..4515c758 100644 --- a/genevent/genevent.h +++ b/genevent/genevent.h @@ -1,11 +1,66 @@ +/****************************************************************************** + * Genevent + * + * Event generator. XML to logging C code converter. + * + * Supports : + * - C Alignment + * - C types : struct, union, enum, basic types. + * - Architectures : LP32, ILP32, ILP64, LLP64, LP64. + * + * Additionnal structures supported : + * - embedded variable size strings + * - embedded variable size arrays + * - embedded variable size sequences + * + * Notes : + * (1) + * enums are limited to integer type, as this is what is used in C. Note, + * however, that ISO/IEC 9899:TC2 specify that the type of enum can be char, + * unsigned int or int. This is implementation defined (compiler). That's why we + * add a check for sizeof enum. + * + * (2) + * Because of archtecture defined type sizes, we need to ask for ltt_align + * (which gives the alignment) by passing basic types, not their actual sizes. + * It's up to ltt_align to determine sizes of types. + * + * Note that, from + * http://www.usenix.org/publications/login/standards/10.data.html + * (Andrew Josey ) : + * + * Data Type LP32 ILP32 ILP64 LLP64 LP64 + * char 8 8 8 8 8 + * short 16 16 16 16 16 + * int32 32 + * int 16 32 64 32 32 + * long 32 32 64 32 64 + * long long (int64) 64 + * pointer 32 32 64 64 64 + * + * With these constraints : + * sizeof(char) <= sizeof(short) <= sizeof(int) + * <= sizeof(long) = sizeof(size_t) + * + * and therefore sizeof(long) <= sizeof(pointer) <= sizeof(size_t) + * + * Which means we only have to remember which is the biggest type in a structure + * to know the structure's alignment. + */ + + + +/* Code printing */ + +/* Type size checking */ +int print_check(int fd); + + +/* Print types */ +int print_types(int fd); + +/* Print events */ +int print_events(int fd); -void generateFile(char * file); -void generateHfile(FILE *); -void generateTypeDefs(FILE *); -void generateEnumEvent(FILE * fp,char * facName, int * nbEvent, unsigned long checksum); -void generateStructFunc(FILE * fp, char * facName, unsigned long checksum); -void generateLoaderfile(FILE * fp, char * facName, int nbEvent, unsigned long checksum, char *capname); -void generateEnumDefinition(FILE * fp, type_descriptor * fHead); -char * getTypeStr(type_descriptor * td);