From 4d497fcf5f021117d644e955bac6e6427ce3d9b4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 14 Nov 2019 09:27:02 -0500 Subject: Add initial error handler code --- reloc.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/reloc.h b/reloc.h index a047e19..8412fe4 100644 --- a/reloc.h +++ b/reloc.h @@ -18,6 +18,18 @@ #define SIZE_T_FMT "%lu" #endif +#define NULLBYTE '\0' + +extern int reloc_error; + +enum { + RELOC_ESUCCESS=0, + RELOC_EREAD, + RELOC_EWRITE, + RELOC_EVERIFY, + RELOC_ELENGTH, + RELOC_ENOMEM, +}; typedef struct { size_t size; @@ -35,6 +47,8 @@ typedef struct { size_t total_length; } RelocMatch; +const char *reloc_strerror(int code); +void reloc_perror(const char *msg); RelocMatch *reloc_match(char *haystack, const char *needle); RelocData *reloc_read(const char *filename); -- cgit