struct definition *
(*definition_new)(struct declaration *declaration,
struct definition_scope *parent_scope,
- GQuark field_name, int index);
+ GQuark field_name, int index,
+ const char *root_name);
/*
* definition_free called with definition ref is decremented to 0.
*/
size_t len; /* length, in bits. */
int byte_order; /* byte order */
int signedness;
+ int base; /* Base for pretty-printing: 2, 8, 10, 16 */
};
struct definition_integer {
struct definition_integer *sign;
struct definition_integer *mantissa;
struct definition_integer *exp;
+ struct definition_scope *scope;
/* Last values read */
long double value;
};
struct definition p;
struct definition_integer *integer;
struct declaration_enum *declaration;
+ struct definition_scope *scope;
/* Last GQuark values read. Keeping a reference on the GQuark array. */
GArray *value;
};
struct declaration_sequence {
struct declaration p;
- struct declaration_integer *len_declaration;
+ GArray *length_name; /* Array of GQuark */
struct declaration *elem;
struct declaration_scope *scope;
};
struct definition p;
struct declaration_sequence *declaration;
struct definition_scope *scope;
- struct definition_integer *len;
+ struct definition_integer *length;
GPtrArray *elems; /* Array of pointers to struct definition */
};
struct definition_scope *scope);
struct definition_scope *
new_definition_scope(struct definition_scope *parent_scope,
- GQuark field_name);
-void set_dynamic_definition_scope(struct definition *definition,
- struct definition_scope *scope,
- const char *root_name);
+ GQuark field_name, const char *root_name);
void free_definition_scope(struct definition_scope *scope);
-GQuark new_definition_path(struct definition_scope *parent_scope, GQuark field_name);
+GQuark new_definition_path(struct definition_scope *parent_scope,
+ GQuark field_name, const char *root_name);
static inline
int compare_definition_path(struct definition *definition, GQuark path)
void definition_unref(struct definition *definition);
struct declaration_integer *integer_declaration_new(size_t len, int byte_order,
- int signedness, size_t alignment);
+ int signedness, size_t alignment,
+ int base);
/*
* mantissa_len is the length of the number of bytes represented by the mantissa
string_declaration_new(enum ctf_string_encoding encoding);
struct declaration_struct *
- struct_declaration_new(struct declaration_scope *parent_scope);
+ struct_declaration_new(struct declaration_scope *parent_scope,
+ uint64_t min_align);
void struct_declaration_add_field(struct declaration_struct *struct_declaration,
const char *field_name,
struct declaration *field_declaration);
struct_definition_get_field_from_index(struct definition_struct *struct_definition,
int index);
int struct_rw(struct stream_pos *pos, struct definition *definition);
+uint64_t struct_declaration_len(struct declaration_struct *struct_declaration);
/*
* The tag enumeration is validated to ensure that it contains only mappings
* to the sequence. No need to free them explicitly.
*/
struct declaration_sequence *
- sequence_declaration_new(struct declaration_integer *len_declaration,
+ sequence_declaration_new(const char *length_name,
struct declaration *elem_declaration,
struct declaration_scope *parent_scope);
uint64_t sequence_len(struct definition_sequence *sequence);