X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf-ir%2Ffields-internal.h;h=43e79b72b7527d23c67c0721f1569f94f350482f;hb=50842bdc4c21f3de2b63e29cdac730af8b6dcca6;hp=bd95bd2ec35d9f871d1388e0b6150dd95d0e0d73;hpb=2e33ac5abec88a4be03907091474324dfcc42e23;p=babeltrace.git diff --git a/include/babeltrace/ctf-ir/fields-internal.h b/include/babeltrace/ctf-ir/fields-internal.h index bd95bd2e..43e79b72 100644 --- a/include/babeltrace/ctf-ir/fields-internal.h +++ b/include/babeltrace/ctf-ir/fields-internal.h @@ -27,79 +27,79 @@ * SOFTWARE. */ +#include #include #include #include -#include +#include +#include +#include #include -struct bt_ctf_field { +struct bt_stream_pos; + +struct bt_field { struct bt_object base; - struct bt_ctf_field_type *type; - int payload_set; + struct bt_field_type *type; + bool payload_set; + bool frozen; }; -struct bt_ctf_field_integer { - struct bt_ctf_field parent; - struct definition_integer definition; +struct bt_field_integer { + struct bt_field parent; + union { + int64_t signd; + uint64_t unsignd; + } payload; }; -struct bt_ctf_field_enumeration { - struct bt_ctf_field parent; - struct bt_ctf_field *payload; +struct bt_field_enumeration { + struct bt_field parent; + struct bt_field *payload; }; -struct bt_ctf_field_floating_point { - struct bt_ctf_field parent; - struct definition_float definition; - struct definition_integer sign, mantissa, exp; +struct bt_field_floating_point { + struct bt_field parent; + double payload; }; -struct bt_ctf_field_structure { - struct bt_ctf_field parent; - GHashTable *field_name_to_index; - GPtrArray *fields; /* Array of pointers to struct bt_ctf_field */ +struct bt_field_structure { + struct bt_field parent; + GPtrArray *fields; /* Array of pointers to struct bt_field */ }; -struct bt_ctf_field_variant { - struct bt_ctf_field parent; - struct bt_ctf_field *tag; - struct bt_ctf_field *payload; +struct bt_field_variant { + struct bt_field parent; + struct bt_field *tag; + struct bt_field *payload; }; -struct bt_ctf_field_array { - struct bt_ctf_field parent; - GPtrArray *elements; /* Array of pointers to struct bt_ctf_field */ +struct bt_field_array { + struct bt_field parent; + GPtrArray *elements; /* Array of pointers to struct bt_field */ }; -struct bt_ctf_field_sequence { - struct bt_ctf_field parent; - struct bt_ctf_field *length; - GPtrArray *elements; /* Array of pointers to struct bt_ctf_field */ +struct bt_field_sequence { + struct bt_field parent; + struct bt_field *length; + GPtrArray *elements; /* Array of pointers to struct bt_field */ }; -struct bt_ctf_field_string { - struct bt_ctf_field parent; +struct bt_field_string { + struct bt_field parent; GString *payload; }; -/* - * Set a field's value with an already allocated field instance. - */ -BT_HIDDEN -int bt_ctf_field_structure_set_field(struct bt_ctf_field *structure, - const char *name, struct bt_ctf_field *value); - /* Validate that the field's payload is set (returns 0 if set). */ BT_HIDDEN -int bt_ctf_field_validate(struct bt_ctf_field *field); +int bt_field_validate(struct bt_field *field); -/* Mark field payload as unset. */ BT_HIDDEN -int bt_ctf_field_reset(struct bt_ctf_field *field); +int bt_field_serialize(struct bt_field *field, + struct bt_stream_pos *pos, + enum bt_byte_order native_byte_order); BT_HIDDEN -int bt_ctf_field_serialize(struct bt_ctf_field *field, - struct ctf_stream_pos *pos); +void bt_field_freeze(struct bt_field *field); #endif /* BABELTRACE_CTF_IR_FIELDS_INTERNAL_H */