summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2009-03-31 04:57:48 +0200
committerPatrick McHardy <kaber@trash.net>2009-03-31 04:57:48 +0200
commit4ffa6882a5eafa50625d0e4d49cdaafe69d7877c (patch)
tree6f6e5c33a3d7774120b315b6da0a07bffe19126f /include
parent4fee12b4b0a837b4d34d21be99cda8185563f784 (diff)
datatype: add/move size and byte order information into data types
Add size and type information to non-basetype types and remove the now redundant information from the symbol tables. This will be used to determine size and byteorder of set members without analyzing the ruleset for incremental update operations. Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include')
-rw-r--r--include/datatype.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/datatype.h b/include/datatype.h
index 9131d72a..ea18f719 100644
--- a/include/datatype.h
+++ b/include/datatype.h
@@ -81,6 +81,8 @@ struct expr;
* struct datatype
*
* @type: numeric identifier
+ * @byteorder: byteorder of type (non-basetypes only)
+ * @size: type size (fixed sized non-basetypes only)
* @name: type name
* @desc: type description
* @basetype: basetype for subtypes, determines type compatibilty
@@ -91,6 +93,8 @@ struct expr;
*/
struct datatype {
enum datatypes type;
+ enum byteorder byteorder;
+ unsigned int size;
const char *name;
const char *desc;
const struct datatype *basetype;
@@ -126,13 +130,10 @@ struct symbolic_constant {
/**
* struct symbol_table - type construction from symbolic values
*
- * @byteorder: byteorder of symbol values
- * @size: size of symbol values
* @symbols: the symbols
*/
struct symbol_table {
- enum byteorder byteorder;
- unsigned int size;
+ int gcc_workaround;
struct symbolic_constant symbols[];
};
@@ -141,7 +142,8 @@ extern struct error_record *symbolic_constant_parse(const struct expr *sym,
struct expr **res);
extern void symbolic_constant_print(const struct symbol_table *tbl,
const struct expr *expr);
-extern void symbol_table_print(const struct symbol_table *tbl);
+extern void symbol_table_print(const struct symbol_table *tbl,
+ const struct datatype *dtype);
extern struct symbol_table *rt_symbol_table_init(const char *filename);
extern void rt_symbol_table_free(struct symbol_table *tbl);