X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Fltt%2Fparser.c;h=795b3f96f4ba0d5a8be7be6ab666c293c5b2c16b;hb=6da3640c5dfff6319edcb000391cb2fdfa5abe56;hp=b4bd088b5c8fb8e22859d7e20dc6fe0c43b03a96;hpb=90395b4b8344644a20bcf6e912f619e0bba848f9;p=lttv.git diff --git a/ltt/branches/poly/ltt/parser.c b/ltt/branches/poly/ltt/parser.c index b4bd088b..795b3f96 100644 --- a/ltt/branches/poly/ltt/parser.c +++ b/ltt/branches/poly/ltt/parser.c @@ -38,11 +38,24 @@ This program is distributed in the hope that it will be useful, #include #include #include - +#include #include "parser.h" +static char *intOutputTypes[] = { + "int8_t", "int16_t", "int32_t", "int64_t", "short int", "int", "long int" }; + +static char *uintOutputTypes[] = { + "uint8_t", "uint16_t", "uint32_t", "uint64_t", "unsigned short int", + "unsigned int", "unsigned long int" }; + +static char *floatOutputTypes[] = { + "undef", "undef", "float", "double", "undef", "float", "double" }; + + + + /* helper function */ void strupper(char *string) { @@ -81,7 +94,7 @@ int getSizeindex(int value) * size *****************************************************************************/ -int getSize(parse_file *in) +int getSize(parse_file_t *in) { char *token; @@ -109,7 +122,7 @@ int getSize(parse_file *in) * msg : message to be printed ****************************************************************************/ -void error_callback(parse_file *in, char *msg) +void error_callback(parse_file_t *in, char *msg) { if(in) printf("Error in file %s, line %d: %s\n", in->name, in->lineno, msg); @@ -170,10 +183,9 @@ char *allocAndCopy(char *str) * **************************************************************************/ -void getTypeAttributes(parse_file *in, type_descriptor *t) +void getTypeAttributes(parse_file_t *in, type_descriptor_t *t) { char * token; - char car; t->fmt = NULL; t->size = -1; @@ -217,7 +229,7 @@ void getTypeAttributes(parse_file *in, type_descriptor *t) * **************************************************************************/ -void getEventAttributes(parse_file *in, event *ev) +void getEventAttributes(parse_file_t *in, event_t *ev) { char * token; char car; @@ -260,7 +272,7 @@ void getEventAttributes(parse_file *in, event *ev) * **************************************************************************/ -void getFacilityAttributes(parse_file *in, facility *fac) +void getFacilityAttributes(parse_file_t *in, facility_t *fac) { char * token; char car; @@ -296,7 +308,7 @@ void getFacilityAttributes(parse_file *in, facility *fac) * **************************************************************************/ -void getFieldAttributes(parse_file *in, field *f) +void getFieldAttributes(parse_file_t *in, field_t *f) { char * token; char car; @@ -320,7 +332,7 @@ void getFieldAttributes(parse_file *in, field *f) } } -char *getNameAttribute(parse_file *in) +char *getNameAttribute(parse_file_t *in) { char * token; char *name = NULL; @@ -349,7 +361,7 @@ char *getNameAttribute(parse_file *in) //for