2011-05-06 20:15:37 +00:00
|
|
|
#ifdef USE_PSYC
|
|
|
|
|
2011-04-26 08:02:17 +00:00
|
|
|
/* pkg-psyc takes and produces PSYC packets in form
|
|
|
|
* of an array of mapping, mapping, string and string
|
|
|
|
* or int* where necessary.
|
|
|
|
*/
|
|
|
|
|
2011-05-06 20:15:37 +00:00
|
|
|
# define PSYC_ROUTING 0
|
|
|
|
# define PSYC_ENTITY 1
|
|
|
|
# define PSYC_METHOD 2
|
|
|
|
# define PSYC_BODY 3
|
|
|
|
|
|
|
|
# include <psyc/parser.h>
|
|
|
|
|
2011-05-08 14:58:35 +00:00
|
|
|
typedef struct {
|
|
|
|
psycParseState *parser;
|
|
|
|
vector_t *packet;
|
|
|
|
char *tmp;
|
|
|
|
size_t tmplen;
|
|
|
|
} psycState;
|
|
|
|
|
2011-05-06 20:15:37 +00:00
|
|
|
static inline void
|
2011-05-08 14:58:35 +00:00
|
|
|
psyc_free_parser (psycState *ps) {
|
|
|
|
if (!ps)
|
|
|
|
return;
|
2011-05-08 18:53:12 +00:00
|
|
|
if (ps->tmp)
|
|
|
|
pxfree((void *) ps->tmp);
|
|
|
|
if (ps->parser)
|
|
|
|
pxfree((void *) ps->parser);
|
2011-05-08 14:58:35 +00:00
|
|
|
if (ps->packet)
|
|
|
|
free_array(ps->packet);
|
2011-05-06 20:15:37 +00:00
|
|
|
}
|
2011-04-26 08:02:17 +00:00
|
|
|
|
2011-05-06 20:15:37 +00:00
|
|
|
#endif
|