psyclpc/src/pkg-psyc.h

41 lines
703 B
C

#ifdef USE_PSYC
# ifndef PKG_PSYC_H
/* 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>
# include "array.h"
# include "xalloc.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)
pfree((void *) ps->tmp);
if (ps->parser)
pfree((void *) ps->parser);
if (ps->packet)
free_array(ps->packet);
}
# define PKG_PSYC_H
# endif
#endif