+extern int ctf_version (int);
+
+extern int ctf_func_info (ctf_file_t *, unsigned long, ctf_funcinfo_t *);
+extern int ctf_func_args (ctf_file_t *, unsigned long, uint32_t, ctf_id_t *);
+extern int ctf_func_type_info (ctf_file_t *, ctf_id_t, ctf_funcinfo_t *);
+extern int ctf_func_type_args (ctf_file_t *, ctf_id_t, uint32_t, ctf_id_t *);
+
+extern ctf_id_t ctf_lookup_by_name (ctf_file_t *, const char *);
+extern ctf_id_t ctf_lookup_by_symbol (ctf_file_t *, unsigned long);
+extern ctf_id_t ctf_lookup_variable (ctf_file_t *, const char *);
+
+extern ctf_id_t ctf_type_resolve (ctf_file_t *, ctf_id_t);
+extern char *ctf_type_aname (ctf_file_t *, ctf_id_t);
+extern char *ctf_type_aname_raw (ctf_file_t *, ctf_id_t);
+extern ssize_t ctf_type_lname (ctf_file_t *, ctf_id_t, char *, size_t);
+extern char *ctf_type_name (ctf_file_t *, ctf_id_t, char *, size_t);
+extern ssize_t ctf_type_size (ctf_file_t *, ctf_id_t);
+extern ssize_t ctf_type_align (ctf_file_t *, ctf_id_t);
+extern int ctf_type_kind (ctf_file_t *, ctf_id_t);
+extern ctf_id_t ctf_type_reference (ctf_file_t *, ctf_id_t);
+extern ctf_id_t ctf_type_pointer (ctf_file_t *, ctf_id_t);
+extern int ctf_type_encoding (ctf_file_t *, ctf_id_t, ctf_encoding_t *);
+extern int ctf_type_visit (ctf_file_t *, ctf_id_t, ctf_visit_f *, void *);
+extern int ctf_type_cmp (ctf_file_t *, ctf_id_t, ctf_file_t *, ctf_id_t);
+extern int ctf_type_compat (ctf_file_t *, ctf_id_t, ctf_file_t *, ctf_id_t);
+
+extern int ctf_member_info (ctf_file_t *, ctf_id_t, const char *,
+ ctf_membinfo_t *);
+extern int ctf_array_info (ctf_file_t *, ctf_id_t, ctf_arinfo_t *);
+
+extern const char *ctf_enum_name (ctf_file_t *, ctf_id_t, int);
+extern int ctf_enum_value (ctf_file_t *, ctf_id_t, const char *, int *);
+
+extern void ctf_label_set (ctf_file_t *, const char *);
+extern const char *ctf_label_get (ctf_file_t *);
+
+extern const char *ctf_label_topmost (ctf_file_t *);
+extern int ctf_label_info (ctf_file_t *, const char *, ctf_lblinfo_t *);
+
+extern int ctf_member_iter (ctf_file_t *, ctf_id_t, ctf_member_f *, void *);
+extern int ctf_enum_iter (ctf_file_t *, ctf_id_t, ctf_enum_f *, void *);
+extern int ctf_type_iter (ctf_file_t *, ctf_type_f *, void *);
+extern int ctf_type_iter_all (ctf_file_t *, ctf_type_all_f *, void *);
+extern int ctf_label_iter (ctf_file_t *, ctf_label_f *, void *);
+extern int ctf_variable_iter (ctf_file_t *, ctf_variable_f *, void *);
+extern int ctf_archive_iter (const ctf_archive_t *, ctf_archive_member_f *,
+ void *);
+/* This function alone does not currently operate on CTF files masquerading
+ as archives, and returns -EINVAL: the raw data is no longer available. It is
+ expected to be used only by archiving tools, in any case, which have no need
+ to deal with non-archives at all. */
+extern int ctf_archive_raw_iter (const ctf_archive_t *,
+ ctf_archive_raw_member_f *, void *);
+extern char *ctf_dump (ctf_file_t *, ctf_dump_state_t **state,
+ ctf_sect_names_t sect, ctf_dump_decorate_f *,
+ void *arg);
+
+extern ctf_id_t ctf_add_array (ctf_file_t *, uint32_t,
+ const ctf_arinfo_t *);
+extern ctf_id_t ctf_add_const (ctf_file_t *, uint32_t, ctf_id_t);
+extern ctf_id_t ctf_add_enum_encoded (ctf_file_t *, uint32_t, const char *,
+ const ctf_encoding_t *);
+extern ctf_id_t ctf_add_enum (ctf_file_t *, uint32_t, const char *);
+extern ctf_id_t ctf_add_float (ctf_file_t *, uint32_t,
+ const char *, const ctf_encoding_t *);
+extern ctf_id_t ctf_add_forward (ctf_file_t *, uint32_t, const char *,
+ uint32_t);
+extern ctf_id_t ctf_add_function (ctf_file_t *, uint32_t,
+ const ctf_funcinfo_t *, const ctf_id_t *);
+extern ctf_id_t ctf_add_integer (ctf_file_t *, uint32_t, const char *,
+ const ctf_encoding_t *);
+extern ctf_id_t ctf_add_slice (ctf_file_t *, uint32_t, ctf_id_t, const ctf_encoding_t *);
+extern ctf_id_t ctf_add_pointer (ctf_file_t *, uint32_t, ctf_id_t);
+extern ctf_id_t ctf_add_type (ctf_file_t *, ctf_file_t *, ctf_id_t);
+extern ctf_id_t ctf_add_typedef (ctf_file_t *, uint32_t, const char *,
+ ctf_id_t);
+extern ctf_id_t ctf_add_restrict (ctf_file_t *, uint32_t, ctf_id_t);
+extern ctf_id_t ctf_add_struct (ctf_file_t *, uint32_t, const char *);
+extern ctf_id_t ctf_add_union (ctf_file_t *, uint32_t, const char *);
+extern ctf_id_t ctf_add_struct_sized (ctf_file_t *, uint32_t, const char *,
+ size_t);
+extern ctf_id_t ctf_add_union_sized (ctf_file_t *, uint32_t, const char *,
+ size_t);
+extern ctf_id_t ctf_add_volatile (ctf_file_t *, uint32_t, ctf_id_t);
+
+extern int ctf_add_enumerator (ctf_file_t *, ctf_id_t, const char *, int);
+extern int ctf_add_member (ctf_file_t *, ctf_id_t, const char *, ctf_id_t);
+extern int ctf_add_member_offset (ctf_file_t *, ctf_id_t, const char *,
+ ctf_id_t, unsigned long);
+extern int ctf_add_member_encoded (ctf_file_t *, ctf_id_t, const char *,
+ ctf_id_t, unsigned long,
+ const ctf_encoding_t);
+
+extern int ctf_add_variable (ctf_file_t *, const char *, ctf_id_t);
+
+extern int ctf_set_array (ctf_file_t *, ctf_id_t, const ctf_arinfo_t *);
+
+extern ctf_file_t *ctf_create (int *);
+extern int ctf_update (ctf_file_t *);
+extern ctf_snapshot_id_t ctf_snapshot (ctf_file_t *);
+extern int ctf_rollback (ctf_file_t *, ctf_snapshot_id_t);
+extern int ctf_discard (ctf_file_t *);
+extern int ctf_write (ctf_file_t *, int);
+extern int ctf_gzwrite (ctf_file_t *fp, gzFile fd);
+extern int ctf_compress_write (ctf_file_t * fp, int fd);
+extern unsigned char *ctf_write_mem (ctf_file_t *, size_t *, size_t threshold);
+
+/* The ctf_link interfaces are not stable yet. No guarantees! */
+
+extern int ctf_link_add_ctf (ctf_file_t *, ctf_archive_t *, const char *);
+extern int ctf_link (ctf_file_t *, int share_mode);
+typedef const char *ctf_link_strtab_string_f (uint32_t *offset, void *arg);
+extern int ctf_link_add_strtab (ctf_file_t *, ctf_link_strtab_string_f *,
+ void *);
+typedef ctf_link_sym_t *ctf_link_iter_symbol_f (ctf_link_sym_t *dest,
+ void *arg);
+extern int ctf_link_shuffle_syms (ctf_file_t *, ctf_link_iter_symbol_f *,
+ void *);
+extern unsigned char *ctf_link_write (ctf_file_t *, size_t *size,
+ size_t threshold);
+
+/* Specialist linker functions. These functions are not used by ld, but can be
+ used by other prgorams making use of the linker machinery for other purposes
+ to customize its output. */
+extern int ctf_link_add_cu_mapping (ctf_file_t *, const char *from,
+ const char *to);
+typedef char *ctf_link_memb_name_changer_f (ctf_file_t *,
+ const char *, void *);
+extern void ctf_link_set_memb_name_changer
+ (ctf_file_t *, ctf_link_memb_name_changer_f *, void *);