+2020-07-22 Nick Alcock <nick.alcock@oracle.com>
+
+ * ctf-api.h (ctf_ref): New.
+
2020-07-22 Nick Alcock <nick.alcock@oracle.com>
* ctf-api.h (ctf_archive_count): New.
size_t, const char *, size_t, int *);
extern ctf_file_t *ctf_bufopen (const ctf_sect_t *, const ctf_sect_t *,
const ctf_sect_t *, int *);
+extern void ctf_ref (ctf_file_t *);
extern void ctf_file_close (ctf_file_t *);
extern int ctf_arc_write (const char *, ctf_file_t **, size_t,
+2020-07-22 Nick Alcock <nick.alcock@oracle.com>
+
+ * libctf.ver (ctf_ref): New.
+ * ctf-open.c (ctf_ref): Implement it.
+
2020-07-22 Nick Alcock <nick.alcock@oracle.com>
* ctf-inlines.h (ctf_forwardable_kind): New.
return NULL;
}
+/* Bump the refcount on the specified CTF container, to allow export of
+ ctf_file_t's from iterators that open and close the ctf_file_t around the
+ loop. (This does not extend their lifetime beyond that of the ctf_archive_t
+ in which they are contained.) */
+
+void
+ctf_ref (ctf_file_t *fp)
+{
+ fp->ctf_refcnt++;
+}
+
/* Close the specified CTF container and free associated data structures. Note
that ctf_file_close() is a reference counted operation: if the specified file
is the parent of other active containers, its reference count will be greater
ctf_simple_open;
ctf_create;
ctf_close;
+ ctf_ref;
ctf_file_close;
ctf_cuname;