diff options
Diffstat (limited to 'src/aplwc_internal.h')
| -rw-r--r-- | src/aplwc_internal.h | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/aplwc_internal.h b/src/aplwc_internal.h deleted file mode 100644 index 97a89ba..0000000 --- a/src/aplwc_internal.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef APLWC_INTERNAL_H -#define APLWC_INTERNAL_H - -#include <aplwc.h> - -#define UNUSED_PARAMETER(arg) ((void)arg) - -#define RETURN_ERROR(aplwcp, rc, msg) do{ \ - return ((aplwc)->last_error = (rc)); \ - }while(0) - -#define NELEM(x) (sizeof(x)/sizeof(x[0])) - -#if APLWC_BUILD_TYPE_DEBUG - #define ALWAYS(x) ((x) ? 1 : (assert(0), 0)) - #define NEVER(x) ((x) ? (assert(0), 1) : 0) -#elif APLWC_BUILD_TYPE_RELEASE - #define ALWAYS(x) (X) - #define NEVER(X) (X) -#elif APLWC_BUILD_TYPE_COVERAGE - #define ALWAYS(x) (1) - #define NEVER(x) (0) -#endif - -#include <assert.h> -#include <stdalign.h> -#include <stdbool.h> -#include <string.h> - -struct memory { - uint8_t *data; - size_t size; - size_t offset; -}; - -struct aplwc { - enum aplwc_rc last_error; - char last_error_msg[64]; - struct memory memory; -}; - -/* errors.c */ -const char *rc_to_string(enum aplwc_rc); - -/* memory.c */ -struct memory memory_init(uint8_t *, size_t); -struct aplwc *memory_alloc_aplwc(struct memory *); -void memory_free_aplwc(struct memory *, struct aplwc *); - -#endif /* APLWC_INTERNAL_H */ |