summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2019-04-23 22:05:52 +0100
committerNick Alcock <nick.alcock@oracle.com>2019-05-28 17:07:24 +0100
commit479604f44fc1eaa02a97ebcc1b60f55a606c4046 (patch)
tree57b7d78a75be9c8e243dc3a0d957c7c48c8235f1 /include
parent94585e7f93c9477bcf2835d8245e967053ce2b41 (diff)
downloadbinutils-gdb-479604f44fc1eaa02a97ebcc1b60f55a606c4046.tar.gz
libctf: error handling
CTF functions return zero on success or an extended errno value which can be translated into a string via the functions in this commit. The errno numbers start at -CTF_BASE. libctf/ * ctf-error.c: New file. include/ * ctf-api.h (ctf_errno): New declaration. (ctf_errmsg): Likewise.
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog5
-rw-r--r--include/ctf-api.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index d113f987637..75e71ddd635 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,5 +1,10 @@
2019-05-28 Nick Alcock <nick.alcock@oracle.com>
+ * ctf-api.h (ctf_errno): New declaration.
+ (ctf_errmsg): Likewise.
+
+2019-05-28 Nick Alcock <nick.alcock@oracle.com>
+
* ctf-api.h (ctf_setdebug): New.
(ctf_getdebug): Likewise.
diff --git a/include/ctf-api.h b/include/ctf-api.h
index 8c6b770cb96..cfe4d56f595 100644
--- a/include/ctf-api.h
+++ b/include/ctf-api.h
@@ -122,6 +122,8 @@ enum
#define CTF_ADD_NONROOT 0 /* Type only visible in nested scope. */
#define CTF_ADD_ROOT 1 /* Type visible at top-level scope. */
+extern int ctf_errno (ctf_file_t *);
+extern const char *ctf_errmsg (int);
extern void ctf_setdebug (int debug);
extern int ctf_getdebug (void);