summaryrefslogtreecommitdiff
path: root/test.c
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-08-28 15:31:47 -0400
committerPaul Duncan <pabs@pablotron.org>2016-08-28 15:31:47 -0400
commit0485651622e4078532d8d834668b2ec9c255a820 (patch)
tree9dd3f8c1a49caabd248140d081a4bb5953321eaf /test.c
parentb63fcd650a42b6035c35de951e1e8476234dd2e5 (diff)
downloadlibfhp-0485651622e4078532d8d834668b2ec9c255a820.tar.bz2
libfhp-0485651622e4078532d8d834668b2ec9c255a820.zip
s/fhp_t/fhp_ctx_t/g
Diffstat (limited to 'test.c')
-rw-r--r--test.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/test.c b/test.c
index 66ada5a..a2ccb0a 100644
--- a/test.c
+++ b/test.c
@@ -38,14 +38,14 @@ basic_str =
static bool
basic_cb(
- fhp_t *fhp,
+ fhp_ctx_t *ctx,
fhp_token_t token,
uint8_t * const buf,
size_t len
) {
fhp_err_t err;
- UNUSED(fhp);
+ UNUSED(ctx);
UNUSED(buf);
// get token name
@@ -63,17 +63,17 @@ basic_cb(
static void
test_basic(void) {
fhp_err_t err;
- fhp_t fhp;
+ fhp_ctx_t ctx;
// init parser
- if ((err = fhp_init(&fhp, NULL, basic_cb, NULL)) != FHP_OK) {
- die("test_basic", "fhp_init", err);
+ if ((err = fhp_ctx_init(&ctx, NULL, basic_cb, NULL)) != FHP_OK) {
+ die("test_basic", "fhp_ctx_init", err);
}
// parse data
size_t len = strlen(basic_str);
- if ((err = fhp_push(&fhp, (uint8_t*) basic_str, len)) != FHP_OK) {
- die("test_basic", "fhp_push", err);
+ if ((err = fhp_ctx_push(&ctx, (uint8_t*) basic_str, len)) != FHP_OK) {
+ die("test_basic", "fhp_ctx_push", err);
}
}
@@ -95,12 +95,12 @@ percent_str =
static bool
percent_cb(
- fhp_t *fhp,
+ fhp_ctx_t *ctx,
fhp_token_t token,
uint8_t * const buf,
size_t len
) {
- percent_data *data = fhp_get_user_data(fhp);
+ percent_data *data = fhp_ctx_get_user_data(ctx);
switch (token) {
case FHP_TOKEN_URL_START:
@@ -132,18 +132,18 @@ percent_cb(
static void
test_percent(void) {
fhp_err_t err;
- fhp_t fhp;
+ fhp_ctx_t ctx;
percent_data data;
// init parser
- if ((err = fhp_init(&fhp, NULL, percent_cb, &data)) != FHP_OK) {
- die("test_percent", "fhp_init", err);
+ if ((err = fhp_ctx_init(&ctx, NULL, percent_cb, &data)) != FHP_OK) {
+ die("test_percent", "fhp_ctx_init", err);
}
// parse data
size_t len = strlen(percent_str);
- if ((err = fhp_push(&fhp, (uint8_t*) percent_str, len)) != FHP_OK) {
- die("test_percent", "fhp_push", err);
+ if ((err = fhp_ctx_push(&ctx, (uint8_t*) percent_str, len)) != FHP_OK) {
+ die("test_percent", "fhp_ctx_push", err);
}
}