diff options
Diffstat (limited to 'src/aplwc_internal.h')
| -rw-r--r-- | src/aplwc_internal.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/aplwc_internal.h b/src/aplwc_internal.h index f80c8ab..ccf600f 100644 --- a/src/aplwc_internal.h +++ b/src/aplwc_internal.h @@ -1,6 +1,8 @@ #ifndef APLWC_INTERNAL_H #define APLWC_INTERNAL_H +#include <aplwc.h> + #define UNUSED_PARAMETER(arg) ((void)arg) #define RETURN_ERROR(aplwc, rc, msg) do{ \ @@ -12,21 +14,32 @@ #define NELEM(x) (sizeof(x)/sizeof(x[0])) -#include <stddef.h> -#include <stdint.h> +#include <stdalign.h> +#include <stdbool.h> #include <stdlib.h> #include <stdio.h> #include <string.h> +typedef struct Memory Memory; + +struct Memory { + uint8_t *data; + size_t size; + size_t offset; +}; + struct Aplwc { AplwcRc last_error; char last_error_msg[64]; + Memory memory; }; /* errors.c */ const char *rc_to_string(AplwcRc); -/* malloc.c */ -void *malloc_zero(size_t); +/* memory.c */ +Memory memory_init(uint8_t *, size_t); +Aplwc *memory_alloc_aplwc(Memory *); +void memory_free_aplwc(Memory *, Aplwc *); #endif /* APLWC_INTERNAL_H */ |