aboutsummaryrefslogtreecommitdiff
path: root/test/tsupport.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/tsupport.c')
-rw-r--r--test/tsupport.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/test/tsupport.c b/test/tsupport.c
index 9b3582c..706fd44 100644
--- a/test/tsupport.c
+++ b/test/tsupport.c
@@ -20,7 +20,7 @@
static void _setup_pool(ls_value_t * pool, size_t n);
static void _setup_label_cache(ls_label_cache_t * label_cache);
-static int _fetcher(void * ctx, uint16_t loc);
+static int _fetcher(void * arg, uint16_t loc);
// --- PUBLIC VARIABLES --------------------------------------------------------
// --- PRIVATE VARIABLES -------------------------------------------------------
@@ -29,25 +29,25 @@ static ls_value_t _pool[LS_TEST_NPOOL];
// --- PUBLIC FUNCTIONS --------------------------------------------------------
-void ls_test_setup(ls_context_t * ctx, char const * text)
+void ls_test_setup(ls_t * ls, char const * text)
{
_setup_pool(_pool, LS_TEST_NPOOL);
- ctx->callstack = NULL;
- ctx->funcs = NULL;
- ctx->pool = _pool;
- ctx->pc = 0;
- ctx->fetcher = _fetcher;
- ctx->fetcher_ctx = (void *) text;
- ctx->line_trace_hook = NULL;
- _setup_label_cache(ctx->label_cache);
- ctx->label_cache_i = 0;
+ ls->callstack = NULL;
+ ls->funcs = NULL;
+ ls->pool = _pool;
+ ls->pc = 0;
+ ls->fetcher = _fetcher;
+ ls->fetcher_arg = (void *) text;
+ ls->line_trace_hook = NULL;
+ _setup_label_cache(ls->label_cache);
+ ls->label_cache_i = 0;
}
-void ls_setup_run(ls_context_t * ctx, char const * text)
+void ls_setup_run(ls_t * ls, char const * text)
{
- ctx->fetcher = _fetcher;
- ctx->fetcher_ctx = (void *) text;
- ctx->line_trace_hook = NULL;
+ ls->fetcher = _fetcher;
+ ls->fetcher_arg = (void *) text;
+ ls->line_trace_hook = NULL;
}
// --- PRIVATE FUNCTION DEFINITIONS --------------------------------------------
@@ -74,9 +74,9 @@ static void _setup_label_cache(ls_label_cache_t * label_cache)
}
}
-static int _fetcher(void * ctx, uint16_t loc)
+static int _fetcher(void * arg, uint16_t loc)
{
- char const * text = (char const *) ctx;
+ char const * text = (char const *) arg;
// Slightly naughty memoization of pointer bc i can't be arsed to
// make the API cleaner right now. We just need to implement read-past-