typedef enum _token_type {
ENDFILE,
- COMA,
- LPARENTHESIS,
- RPARENTHESIS,
- SEMICOLON,
+ FORWARDSLASH,
+ LANGLEBRACKET,
+ RANGLEBRACKET,
EQUAL,
QUOTEDSTRING,
NUMBER,
void ungetToken(parse_file * in);
char *getToken(parse_file *in);
-char *getComa(parse_file *in);
-char *getLParenthesis(parse_file *in);
-char *getRParenthesis(parse_file *in);
-char *getSemiColon(parse_file *in);
+char *getForwardslash(parse_file *in);
+char *getLAnglebracket(parse_file *in);
+char *getRAnglebracket(parse_file *in);
char *getQuotedString(parse_file *in);
char *getName(parse_file *in);
-int getNumber(parse_file *in);
-char * getEqual(parse_file *in);
+int getNumber(parse_file *in);
+char *getEqual(parse_file *in);
+char seekNextChar(parse_file *in);
void skipComment(parse_file * in);
void skipEOL(parse_file * in);
-int isalpha(char car);
-int isalnum(char car);
/* Some constants */
typedef enum _data_type {
INT,
UINT,
+ POINTER,
+ LONG,
+ ULONG,
+ SIZE_T,
+ SSIZE_T,
+ OFF_T,
FLOAT,
STRING,
ENUM,
ARRAY,
SEQUENCE,
STRUCT,
+ UNION,
NONE
} data_type;
-
/* Event type descriptors */
typedef struct _type_descriptor {
char *fmt;
int size;
sequence labels; // for enumeration
+ sequence labels_description;
+ int already_printed;
sequence fields; // for structure
struct _type_descriptor *nested_type; // for array and sequence
+ int alignment;
} type_descriptor;
char *name;
char *description;
type_descriptor *type;
- int nested;
+ int per_trace; /* Is the event able to be logged to a specific trace ? */
+ int per_tracefile; /* Must we log this event in a specific tracefile ? */
} event;
+typedef struct _facility {
+ char * name;
+ char * capname;
+ char * description;
+ sequence events;
+ sequence unnamed_types;
+ table named_types;
+} facility;
+
int getSize(parse_file *in);
-unsigned long getTypeChecksum(unsigned long aCrc, type_descriptor * type, int * nestedStruct);
+unsigned long getTypeChecksum(unsigned long aCrc, type_descriptor * type);
+void parseFacility(parse_file *in, facility * fac);
void parseEvent(parse_file *in, event *ev, sequence * unnamed_types, table * named_types);
void parseTypeDefinition(parse_file *in, sequence * unnamed_types, table * named_types);
type_descriptor *parseType(parse_file *in, type_descriptor *t, sequence * unnamed_types, table * named_types);
void generateChecksum(char * facName, unsigned long * checksum, sequence * events);
+/* get attributes */
+char * getNameAttribute(parse_file *in);
+char * getFormatAttribute(parse_file *in);
+int getSizeAttribute(parse_file *in);
+int getValueAttribute(parse_file *in);
+char * getValueStrAttribute(parse_file *in);
+
+char * getDescription(parse_file *in);
+
static char *intOutputTypes[] = {
"int8_t", "int16_t", "int32_t", "int64_t", "short int", "int", "long int" };