parser network support
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 22 Feb 2006 21:14:50 +0000 (21:14 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 22 Feb 2006 21:14:50 +0000 (21:14 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1555 04897980-b3bd-0310-b5e0-8ef037075253

genevent-new/parser.c
genevent-new/parser.h

index 84a0b5f4d273517f6912f22a5129b8b93541921b..2d8c9c4ae2f992d4f4252181caeb11747b140bd9 100644 (file)
@@ -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;
        }
 
   //<int size=...>
index 5a4c5b02cb1e41fd884be1de3de633508d9a45d6..c3a0c5eec7efcedd4f5174ad874270535f0f4224 100644 (file)
@@ -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;
 
 
This page took 0.025759 seconds and 4 git commands to generate.