summaryrefslogtreecommitdiffstats
path: root/src/pstream.h
blob: c0b5749672be00b86a0463ecc88f064b9848d05d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef foopstreamhfoo
#define foopstreamhfoo

#include <inttypes.h>

#include "packet.h"
#include "memblock.h"
#include "iochannel.h"

struct pstream;

struct pstream* pstream_new(struct mainloop *m, struct iochannel *io);
void pstream_free(struct pstream*p);

void pstream_set_send_callback(struct pstream*p, void (*callback) (struct pstream *p, void *userdata), void *userdata);
void pstream_send_packet(struct pstream*p, struct packet *packet);
void pstream_send_memblock(struct pstream*p, uint32_t channel, int32_t delta, struct memchunk *chunk);

void pstream_set_recieve_packet_callback(struct pstream *p, void (*callback) (struct pstream *p, struct packet *packet, void *userdata), void *userdata);
void pstream_set_recieve_memblock_callback(struct pstream *p, void (*callback) (struct pstream *p, uint32_t channel, int32_t delta, struct memchunk *chunk, void *userdata), void *userdata);

#endif