#ifndef APLWC_H #define APLWC_H #include #include enum aplwc_rc { APLWC_OK, APLWC_OUT_OF_MEMORY, APLWC_NOT_YET_IMPLEMENTED, APLWC_INVALID_UTF8, APLWC_INVALID_SYNTAX, APLWC_RC_LAST = APLWC_INVALID_SYNTAX }; struct aplwc; struct aplwc_ref { struct aplwc *aplwc; int id; }; typedef struct { struct aplwc_ref ref; } AplwcLine; typedef struct { struct aplwc_ref ref; } AplwcValue; struct aplwc_fns { void *(*alloc)(size_t, size_t, size_t *); void (*dealloc)(void *); }; struct aplwc *aplwc_new(struct aplwc_fns, enum aplwc_rc *); void aplwc_destroy(struct aplwc *); void aplwc_clear_line(AplwcLine *); void aplwc_clear_value(AplwcValue *); int aplwc_valid_line(AplwcLine); int aplwc_valid_value(AplwcValue); const char *aplwc_errstr_rc(enum aplwc_rc); const char *aplwc_errstr(struct aplwc *); enum aplwc_rc aplwc_last_error(struct aplwc *); AplwcLine aplwc_read(struct aplwc *, const char *); void aplwc_free_line(AplwcLine); AplwcValue aplwc_eval(AplwcLine); void aplwc_free_value(AplwcValue); const char *aplwc_value_string(AplwcValue); enum aplwc_rc aplwc_load_module(struct aplwc *, const char *, const char *, int n); #endif /* APLWC_H */