From: compudj Date: Wed, 22 Feb 2006 21:14:50 +0000 (+0000) Subject: parser network support X-Git-Tag: v0.12.20~1934 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7479dd857d2a8b86acd83da6f1ed123c19a9256e;p=lttv.git parser network support git-svn-id: http://ltt.polymtl.ca/svn@1555 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/genevent-new/parser.c b/genevent-new/parser.c index 84a0b5f4..2d8c9c4a 100644 --- a/genevent-new/parser.c +++ b/genevent-new/parser.c @@ -183,6 +183,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 +206,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 +330,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) @@ -555,6 +558,8 @@ void parseFields(parse_file_t *in, field_t *f, getRAnglebracket(in); f->description = getDescription(in); + } else { + f->description = NULL; } // diff --git a/genevent-new/parser.h b/genevent-new/parser.h index 5a4c5b02..c3a0c5ee 100644 --- a/genevent-new/parser.h +++ b/genevent-new/parser.h @@ -111,7 +111,8 @@ typedef struct _type_descriptor { sequence_t labels_description; int already_printed; sequence_t fields; // for structure, array and sequence (field_t type) - int custom_write; /* Should we use a custom write function ? */ + int custom_write; /* Should we use a custom write function ? */ + int network; /* Is the type a in network byte order ? */ } type_descriptor_t;