diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-11-14 09:27:02 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-11-14 09:27:02 -0500 |
commit | 4d497fcf5f021117d644e955bac6e6427ce3d9b4 (patch) | |
tree | 6baf8027fea37153f65db7b346686b0c70ca82e6 | |
parent | 062ae1ba5f5661b249366969e03024992f843b5d (diff) | |
download | reloc-4d497fcf5f021117d644e955bac6e6427ce3d9b4.tar.gz |
Add initial error handler code
-rw-r--r-- | reloc.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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); |