diff options
Diffstat (limited to 'src/include/aplwc.h')
| -rw-r--r-- | src/include/aplwc.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/include/aplwc.h b/src/include/aplwc.h index 5a6cb79..09507a1 100644 --- a/src/include/aplwc.h +++ b/src/include/aplwc.h @@ -29,6 +29,7 @@ enum aplwc_rc { APLWC_NOT_YET_IMPLEMENTED, APLWC_INVALID_UTF8, APLWC_INVALID_SYNTAX, + APLWC_OTHER_FAILURE, APLWC_RC_LAST = APLWC_INVALID_SYNTAX }; @@ -44,14 +45,21 @@ struct aplwc_ref { typedef struct { struct aplwc_ref ref; } AplwcLine; typedef struct { struct aplwc_ref ref; } AplwcValue; +enum aplwc_failsim_parameter { + APLWC_FAILSIM_START, + APLWC_FAILSIM_COUNT, + APLWC_FAILSIM_HITS, + APLWC_FAILSIM_FAILS, + + APLWC_FAILSIM_PARAMETER_COUNT /* Not a real parameter, just the count */ +}; + struct aplwc_fns { void *(*alloc)(size_t, size_t *); void (*dealloc)(void *); + unsigned long (*setup_failsim)(enum aplwc_failsim_parameter, unsigned long); }; -extern uint64_t aplwc_simulate_failure_at; -extern uint64_t aplwc_simulate_failure_count; - struct aplwc *aplwc_new(struct aplwc_fns, enum aplwc_rc *); void aplwc_destroy(struct aplwc *); void aplwc_clear_line(AplwcLine *); @@ -67,6 +75,7 @@ void aplwc_eval(AplwcLine *, AplwcValue *); 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); +unsigned long aplwc_failsim_query(enum aplwc_failsim_parameter); int aplwc_simulate_failure(void); #endif /* APLWC_H */ |