X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Fltt%2Fparser.c;h=bcae82e1a4ab89e62948c998a6d7d088bf88c22f;hb=9f2d599db2cff6ee2a1733e43966eb5aeebdd35e;hp=84a0b5f4d273517f6912f22a5129b8b93541921b;hpb=845a3be5d28365527f858fcdaba910aca0065284;p=lttv.git diff --git a/ltt/branches/poly/ltt/parser.c b/ltt/branches/poly/ltt/parser.c index 84a0b5f4..bcae82e1 100644 --- a/ltt/branches/poly/ltt/parser.c +++ b/ltt/branches/poly/ltt/parser.c @@ -97,11 +97,26 @@ int getSizeindex(unsigned int value) unsigned long long int getSize(parse_file_t *in) { char *token; + int has_quotes = 0; + unsigned long long int ret; token = getToken(in); + if(token[0] == '"') { + has_quotes = 1; + token = getToken(in); + } if(in->type == NUMBER) { - return strtoull(token, NULL, 0); - } + ret = strtoull(token, NULL, 0); + } else { + goto error; + } + if(has_quotes) { + token = getToken(in); + if(token[0] != '"') goto error; + } + + return ret; +error: in->error(in,"incorrect size specification"); return -1; } @@ -183,6 +198,7 @@ void getTypeAttributes(parse_file_t *in, type_descriptor_t *t, t->fmt = NULL; t->size = 0; t->custom_write = 0; + t->network = 0; while(1) { token = getToken(in); @@ -205,7 +221,9 @@ void getTypeAttributes(parse_file_t *in, type_descriptor_t *t, t->size = getSize(in); } else if(!strcmp("custom_write", token)) { t->custom_write = 1; - } + } else if(!strcmp("network", token)) { + t->network = 1; + } } } @@ -327,7 +345,7 @@ void getFieldAttributes(parse_file_t *in, field_t *f) else if(car == '\"') f->name = allocAndCopy(getQuotedString(in)); else f->name = allocAndCopy(getName(in)); } - } + } } char *getNameAttribute(parse_file_t *in) @@ -357,21 +375,40 @@ char *getNameAttribute(parse_file_t *in) //for