]> git.tdb.fi Git - gldbg.git/blob - source/packet.h
Use a centralized packet framework
[gldbg.git] / source / packet.h
1 /* $Id$
2
3 This file is part of gldbg
4 Copyright © 2010  Mikko Rasa, Mikkosoft Productions
5 Distributed under the GPL
6 */
7
8 #ifndef PACKET_H_
9 #define PACKET_H_
10
11 struct GlPacket;
12 typedef struct GlPacket GlPacket;
13
14 GlPacket *packet_begin(unsigned short);
15 void packet_send_partial(GlPacket *, int);
16 void packet_send(GlPacket *, int);
17
18 // XXX Should use something with fixed sizes
19
20 void packet_write_char(GlPacket *, char);
21 void packet_write_short(GlPacket *, short);
22 void packet_write_int(GlPacket *, int);
23 void packet_write_long(GlPacket *, long);
24 void packet_write_long_long(GlPacket *, long long);
25 void packet_write_float(GlPacket *, float);
26 void packet_write_double(GlPacket *, double);
27 void packet_write_pointer(GlPacket *, const void *);
28 void packet_write_data(GlPacket *, const void *, unsigned);
29 void packet_write_string(GlPacket *, const char *);
30 void packet_write_string_array(GlPacket *, const char **, unsigned);
31
32 GlPacket *packet_receive_str(const char *, unsigned *);
33
34 void packet_read_char(GlPacket *, char *);
35 void packet_read_short(GlPacket *, short *);
36 void packet_read_int(GlPacket *, int *);
37 void packet_read_long(GlPacket *, long *);
38 void packet_read_long_long(GlPacket *, long long *);
39 void packet_read_float(GlPacket *, float *);
40 void packet_read_double(GlPacket *, double *);
41 typedef const void *pointer;
42 void packet_read_pointer(GlPacket *, pointer *);
43 void packet_read_data(GlPacket *, pointer *);
44 typedef const char *string;
45 void packet_read_string(GlPacket *, string *);
46 void packet_read_string_array(GlPacket *, string **);
47
48 #endif