#ifndef APLWC_INTERNAL_H #define APLWC_INTERNAL_H #include #include #define RETURN_ERROR(aplwcp, rc, msg) do{ \ return ((aplwc)->last_error = (rc)); \ }while(0) #include #include #include #include struct memory { uint8_t *data; size_t size; size_t offset; }; struct aplwc { enum aplwc_rc last_error; struct memory memory; }; struct aplwc_line { struct aplwc *aplwc; struct string *text; struct token_list *tokens; }; struct string { size_t bytes; size_t chars; uint8_t *utf8; }; struct token_list { size_t length; }; /* eval.c */ void eval_line(struct aplwc_line *); /* memory.c */ struct memory memory_init(uint8_t *, size_t); struct aplwc *memory_alloc_aplwc(struct memory *); struct aplwc_line *memory_alloc_aplwc_line(struct memory *); struct string *memory_alloc_string(struct memory *, size_t); void memory_free_aplwc(struct memory *, struct aplwc *); void memory_free_aplwc_line(struct memory *, struct aplwc_line *); void memory_free_string(struct memory *, struct string *); /* string.c */ struct string *chars_to_string(struct aplwc *, const char *); /* syntax.c */ struct token_list *scan_line(struct aplwc *, struct string *); #endif /* APLWC_INTERNAL_H */