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/ctf-api.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/ctf-api.h') 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