]> git.tdb.fi Git - gldbg.git/blob - source/packet.h
Enable bidirectional communication between gldbg and glwrap.so
[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 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
15 struct GlPacket;
16 typedef struct GlPacket GlPacket;
17
18 GlPacket *packet_begin(unsigned short);
19 void packet_send_partial(GlPacket *, int);
20 void packet_send(GlPacket *, int);
21
22 // XXX Should use something with fixed sizes
23
24 void packet_write_char(GlPacket *, char);
25 void packet_write_short(GlPacket *, short);
26 void packet_write_int(GlPacket *, int);
27 void packet_write_long(GlPacket *, long);
28 void packet_write_long_long(GlPacket *, long long);
29 void packet_write_float(GlPacket *, float);
30 void packet_write_double(GlPacket *, double);
31 void packet_write_pointer(GlPacket *, const void *);
32 void packet_write_data(GlPacket *, const void *, unsigned);
33 void packet_write_string(GlPacket *, const char *);
34 void packet_write_string_array(GlPacket *, const char **, unsigned);
35
36 GlPacket *packet_receive_str(const char *, unsigned *);
37 GlPacket *packet_receive(int);
38
39 void packet_read_char(GlPacket *, char *);
40 void packet_read_short(GlPacket *, short *);
41 void packet_read_int(GlPacket *, int *);
42 void packet_read_long(GlPacket *, long *);
43 void packet_read_long_long(GlPacket *, long long *);
44 void packet_read_float(GlPacket *, float *);
45 void packet_read_double(GlPacket *, double *);
46 void packet_read_pointer(GlPacket *, const void **);
47 void packet_read_data(GlPacket *, const void **);
48 void packet_read_string(GlPacket *, const char **);
49 void packet_read_string_array(GlPacket *, const char ***);
50
51 #ifdef __cplusplus
52 }
53 #endif
54
55 #endif