psyclpc/src/pkg-psyc.h

35 lines
615 B
C

#ifdef USE_PSYC
/* pkg-psyc takes and produces PSYC packets in form
* of an array of mapping, mapping, string and string
* or int* where necessary.
*/
# define PSYC_ROUTING 0
# define PSYC_ENTITY 1
# define PSYC_METHOD 2
# define PSYC_BODY 3
# include <psyc/parser.h>
typedef struct {
psycParseState *parser;
vector_t *packet;
char *tmp;
size_t tmplen;
} psycState;
static inline void
psyc_free_parser (psycState *ps) {
if (!ps)
return;
if (ps->tmp)
pxfree((void *) ps->tmp);
if (ps->parser)
pxfree((void *) ps->parser);
if (ps->packet)
free_array(ps->packet);
}
#endif