+static struct declaration_integer *get_declaration_integer(const struct declaration *decl)
+{
+ struct declaration_field *field_decl;
+ struct declaration_integer *ret = NULL;
+
+ if (decl && bt_ctf_field_type(decl) == CTF_TYPE_INTEGER) {
+ field_decl = (struct declaration_field *) decl;
+ ret = ((struct declaration_integer *) field_decl->declaration);
+ }
+
+ return ret;
+}
+
+static struct declaration_string *get_declaration_string(const struct declaration *decl)
+{
+ struct declaration_field *field_decl;
+ struct declaration_string *ret = NULL;
+
+ if (decl && bt_ctf_field_type(decl) == CTF_TYPE_STRING) {
+ field_decl = (struct declaration_field *) decl;
+ ret = ((struct declaration_string *) field_decl->declaration);
+ }
+
+ return ret;
+}
+
+static struct declaration_array *get_declaration_array(const struct declaration *decl)
+{
+ struct declaration_field *field_decl;
+ struct declaration_array *ret = NULL;
+
+ if (decl && bt_ctf_field_type(decl) == CTF_TYPE_ARRAY) {
+ field_decl = (struct declaration_field *) decl;
+ ret = ((struct declaration_array *) field_decl->declaration);
+ }
+
+ return ret;
+}
+
+int bt_ctf_get_int_signedness(const struct declaration *decl)