diff --git a/src/pkg-psyc.c b/src/pkg-psyc.c index 042b200..0b5463e 100644 --- a/src/pkg-psyc.c +++ b/src/pkg-psyc.c @@ -24,11 +24,14 @@ #ifdef USE_PSYC +# include "pkg-psyc.h" + # include # include # include # include +# include # include /*-------------------------------------------------------------------------*/ @@ -88,10 +91,10 @@ f_psyc_render(svalue_t *sp) { // TODO: handle _lists // FIXME: handle mappings packet = psyc_newPacket2(NULL, 0, NULL, 0, - meth, mlen, body, blen, - PSYC_PACKET_CHECK_LENGTH); + meth, mlen, body, blen, + PSYC_PACKET_CHECK_LENGTH); - printf("rendering... packet.length = %d\n", packet.length); + printf("rendering... packet.length = %ld\n", packet.length); // alloc_mstring creates an *untabled* string suitable for tmp data memsafe(out = alloc_mstring(packet.length), packet.length, "f_psyc_render"); psyc_render(&packet, get_txt(out), packet.length); @@ -117,6 +120,7 @@ f_psyc_parse (svalue_t *sp) { psycString name = {0,0}, value = {0,0}, elem = {0,0}; psycParseListState listState; int ret; + size_t len; psycState *state = O_GET_PSYC_STATE(current_object); if (!state) { @@ -133,9 +137,9 @@ f_psyc_parse (svalue_t *sp) { errorf("\npsyc_parse got %ld int* bytes... not supported yet\n", i); } else if (sp->type == T_STRING) { - printf("\npsyc_parse got a %d bytes long string...\n", mstrsize(sp->u.str)); - psyc_setParseBuffer(&state, psyc_newString(get_txt(sp->u.str), - mstrsize(sp->u.str))); + printf("\npsyc_parse got a %ld bytes long string...\n", mstrsize(sp->u.str)); + psyc_setParseBuffer(state->parser, psyc_newString(get_txt(sp->u.str), + mstrsize(sp->u.str))); } if (!state->packet) { @@ -152,7 +156,7 @@ f_psyc_parse (svalue_t *sp) { put_mapping(&v->item[PSYC_ENTITY], map); do { - ret = psyc_parse(&state, &oper, &name, &value); + ret = psyc_parse(state->parser, &oper, &name, &value); switch (ret) { case PSYC_PARSE_ENTITY_START: case PSYC_PARSE_BODY_START: