X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Fltt%2Fparser.c;h=b6561ca57793f38c48ad6837680bd924aefa5b7e;hb=2864f4c5ccd6f4d5401b40a05b4f4d816617a557;hp=31e89a51036f84f4dd3353fbf6ae8ee2e66ce45b;hpb=963b5f2df23dc1c70bdc70d4aecb76f50651997b;p=lttv.git diff --git a/ltt/branches/poly/ltt/parser.c b/ltt/branches/poly/ltt/parser.c index 31e89a51..b6561ca5 100644 --- a/ltt/branches/poly/ltt/parser.c +++ b/ltt/branches/poly/ltt/parser.c @@ -162,7 +162,7 @@ char * getFormatAttribute(parse_file *in) //format is an option token = getToken(in); - if(strcmp("/",token) == 0){ + if(strcmp("/",token) == 0 || strcmp(">",token) == 0){ ungetToken(in); return NULL; } @@ -263,7 +263,7 @@ void parseFacility(parse_file *in, facility * fac) fac->name = allocAndCopy(getNameAttribute(in)); getRAnglebracket(in); - fac->description = allocAndCopy(getDescription(in)); + fac->description = getDescription(in); while(1){ getLAnglebracket(in); @@ -311,7 +311,7 @@ void parseEvent(parse_file *in, event * ev, sequence * unnamed_types, getRAnglebracket(in); //... - ev->description = allocAndCopy(getDescription(in)); + ev->description = getDescription(in); //event can have STRUCT, TYPEREF or NOTHING getLAnglebracket(in); @@ -359,7 +359,7 @@ void parseFields(parse_file *in, type_descriptor *t, sequence * unnamed_types, f->name = allocAndCopy(getNameAttribute(in)); getRAnglebracket(in); - f->description = allocAndCopy(getDescription(in)); + f->description = getDescription(in); // getLAnglebracket(in); @@ -497,10 +497,9 @@ type_descriptor *parseType(parse_file *in, type_descriptor *inType, free(str); str = appendString(str1,token); free(str1); - sequence_push(&(t->labels),allocAndCopy(str)); - free(str); + sequence_push(&(t->labels),str); }else - sequence_push(&(t->labels),allocAndCopy(str)); + sequence_push(&(t->labels),str); getForwardslash(in); getRAnglebracket(in); @@ -579,7 +578,8 @@ type_descriptor * find_named_type(char *name, table * named_types) t->type_name = allocAndCopy(name); t->type = NONE; t->fmt = NULL; - table_insert(named_types,allocAndCopy(name),t); + table_insert(named_types,t->type_name,t); + // table_insert(named_types,allocAndCopy(name),t); } return t; }