From 479604f44fc1eaa02a97ebcc1b60f55a606c4046 Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Tue, 23 Apr 2019 22:05:52 +0100 Subject: 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. --- include/ChangeLog | 5 +++++ include/ctf-api.h | 2 ++ 2 files changed, 7 insertions(+) (limited to 'include') diff --git a/include/ChangeLog b/include/ChangeLog index d113f98..75e71dd 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,5 +1,10 @@ 2019-05-28 Nick Alcock + * ctf-api.h (ctf_errno): New declaration. + (ctf_errmsg): Likewise. + +2019-05-28 Nick Alcock + * ctf-api.h (ctf_setdebug): New. (ctf_getdebug): Likewise. diff --git a/include/ctf-api.h b/include/ctf-api.h index 8c6b770..cfe4d56 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); -- cgit v1.1