1
0
Fork 0
mirror of git://git.psyced.org/git/psyclpc synced 2024-08-15 03:20:16 +00:00
psyclpc/src/pkg-psyc.h
psyc://psyced.org/~lynX c9bc7364fa +
2011-05-08 21:05:54 +02:00

40 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