- int_class = g_new(struct type_class_integer, 1);
- int_class->p.name = g_quark_from_string(name);
- int_class->p.alignment = alignment;
- int_class->p.copy = integer_copy;
- int_class->len = len;
- int_class->byte_order = byte_order;
- int_class->signedness = signedness;
- if (int_class->p.name) {
- ret = ctf_register_type(&int_class.p);
- if (ret) {
- g_free(int_class);
- return NULL;
- }
+size_t bt_get_int_len(const struct bt_definition *field)
+{
+ struct definition_integer *integer_definition;
+ const struct declaration_integer *integer_declaration;
+
+ integer_definition = container_of(field, struct definition_integer, p);
+ integer_declaration = integer_definition->declaration;
+
+ return integer_declaration->len;
+}
+
+int bt_get_int_byte_order(const struct bt_definition *field)
+{
+ struct definition_integer *integer_definition;
+ const struct declaration_integer *integer_declaration;
+
+ integer_definition = container_of(field, struct definition_integer, p);
+ integer_declaration = integer_definition->declaration;
+
+ return integer_declaration->byte_order;
+}
+
+int bt_get_int_signedness(const struct bt_definition *field)
+{
+ struct definition_integer *integer_definition;
+ const struct declaration_integer *integer_declaration;
+
+ integer_definition = container_of(field, struct definition_integer, p);
+ integer_declaration = integer_definition->declaration;
+
+ return integer_declaration->signedness;
+}
+
+uint64_t bt_get_unsigned_int(const struct bt_definition *field)
+{
+ struct definition_integer *integer_definition;
+ const struct declaration_integer *integer_declaration;
+
+ integer_definition = container_of(field, struct definition_integer, p);
+ integer_declaration = integer_definition->declaration;
+
+ if (!integer_declaration->signedness) {
+ return integer_definition->value._unsigned;