libctf: fix a number of build problems found on Solaris and NetBSD
[deliverable/binutils-gdb.git] / libctf / ctf-impl.h
index 898be8ce3a419be005c8991d3df72695ce5e3399..fa9c574941415a3f896b6fbe9710782cc296ece5 100644 (file)
@@ -21,7 +21,8 @@
 #define        _CTF_IMPL_H
 
 #include "config.h"
-#include <sys/errno.h>
+#include <errno.h>
+#include "ctf-decls.h"
 #include <ctf-api.h>
 #include <sys/types.h>
 #include <stdlib.h>
@@ -31,6 +32,7 @@
 #include <limits.h>
 #include <ctype.h>
 #include <elf.h>
+#include <bfd.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -188,6 +190,8 @@ struct ctf_file
   ctf_sect_t ctf_data;             /* CTF data from object file.  */
   ctf_sect_t ctf_symtab;           /* Symbol table from object file.  */
   ctf_sect_t ctf_strtab;           /* String table from object file.  */
+  void *ctf_data_mmapped;          /* CTF data we mmapped, to free later.  */
+  size_t ctf_data_mmapped_len;     /* Length of CTF data we mmapped.  */
   ctf_hash_t *ctf_structs;         /* Hash table of struct types.  */
   ctf_hash_t *ctf_unions;          /* Hash table of union types.  */
   ctf_hash_t *ctf_enums;           /* Hash table of enum types.  */
@@ -240,6 +244,8 @@ struct ctf_archive_internal
   ctf_sect_t ctfi_symsect;
   ctf_sect_t ctfi_strsect;
   void *ctfi_data;
+  bfd *ctfi_abfd;                  /* Optional source of section data.  */
+  void (*ctfi_bfd_close) (struct ctf_archive_internal *);
 };
 
 /* Return x rounded up to an alignment boundary.
@@ -319,6 +325,14 @@ extern void ctf_dvd_insert (ctf_file_t *, ctf_dvdef_t *);
 extern void ctf_dvd_delete (ctf_file_t *, ctf_dvdef_t *);
 extern ctf_dvdef_t *ctf_dvd_lookup (const ctf_file_t *, const char *);
 
+extern void ctf_decl_init (ctf_decl_t *);
+extern void ctf_decl_fini (ctf_decl_t *);
+extern void ctf_decl_push (ctf_decl_t *, ctf_file_t *, ctf_id_t);
+
+_libctf_printflike_ (2, 3)
+extern void ctf_decl_sprintf (ctf_decl_t *, const char *, ...);
+extern char *ctf_decl_buf (ctf_decl_t *cd);
+
 extern const char *ctf_strraw (ctf_file_t *, uint32_t);
 extern const char *ctf_strptr (ctf_file_t *, uint32_t);
 
@@ -326,7 +340,7 @@ extern struct ctf_archive *ctf_arc_open_internal (const char *, int *);
 extern struct ctf_archive *ctf_arc_bufopen (const void *, size_t, int *);
 extern void ctf_arc_close_internal (struct ctf_archive *);
 extern void *ctf_set_open_errno (int *, int);
-extern long ctf_set_errno (ctf_file_t *, int);
+extern unsigned long ctf_set_errno (ctf_file_t *, int);
 
 _libctf_malloc_
 extern void *ctf_data_alloc (size_t);
@@ -355,11 +369,14 @@ extern void ctf_dprintf (const char *, ...);
 extern void libctf_init_debug (void);
 
 extern Elf64_Sym *ctf_sym_to_elf64 (const Elf32_Sym *src, Elf64_Sym *dst);
+extern const char *ctf_lookup_symbol_name (ctf_file_t *fp, unsigned long symidx);
 
 /* Variables, all underscore-prepended. */
 
+extern const char _CTF_SECTION[];      /* name of CTF ELF section */
 extern const char _CTF_NULLSTR[];      /* empty string */
 
+extern int _libctf_version;    /* library client version */
 extern int _libctf_debug;      /* debugging messages enabled */
 
 #ifdef __cplusplus
This page took 0.025919 seconds and 4 git commands to generate.