/* Public API to libctf.
- Copyright (C) 2019 Free Software Foundation, Inc.
+ Copyright (C) 2019-2020 Free Software Foundation, Inc.
This file is part of libctf.
#ifndef _CTF_API_H
#define _CTF_API_H
-#include <sys/param.h>
#include <sys/types.h>
#include <ctf.h>
#include <zlib.h>
ECTF_SLICEOVERFLOW, /* Overflow of type bitness or offset in slice. */
ECTF_DUMPSECTUNKNOWN, /* Unknown section number in dump. */
ECTF_DUMPSECTCHANGED, /* Section changed in middle of dump. */
- ECTF_NOTYET /* Feature not yet implemented. */
+ ECTF_NOTYET, /* Feature not yet implemented. */
+ ECTF_INTERNAL, /* Internal error in link. */
+ ECTF_NONREPRESENTABLE /* Type not representable in CTF. */
};
/* The CTF data model is inferred to be the caller's data model or the data
size_t);
extern const char *ctf_cuname (ctf_file_t *);
-extern void ctf_cuname_set (ctf_file_t *, const char *);
+extern int ctf_cuname_set (ctf_file_t *, const char *);
extern ctf_file_t *ctf_parent_file (ctf_file_t *);
extern const char *ctf_parent_name (ctf_file_t *);
-extern void ctf_parent_name_set (ctf_file_t *, const char *);
+extern int ctf_parent_name_set (ctf_file_t *, const char *);
extern int ctf_type_isparent (ctf_file_t *, ctf_id_t);
extern int ctf_type_ischild (ctf_file_t *, ctf_id_t);
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 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 *);
+
extern void ctf_setdebug (int debug);
extern int ctf_getdebug (void);