/[rdesktop]/sourceforge.net/trunk/rdesktop/parse.h
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /sourceforge.net/trunk/rdesktop/parse.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 7 - (show annotations)
Fri Jul 7 09:40:03 2000 UTC (23 years, 11 months ago) by matty
File MIME type: text/plain
File size: 1814 byte(s)
Miscellaneous updates: implemented some more protocol features including
colour maps. Started on a new bitmap decompression engine which is not
completely working yet - however I am going back on the road so I am
committing now.

1 /*
2 rdesktop: A Remote Desktop Protocol client.
3 Protocol services - parsing layer
4 Copyright (C) Matthew Chapman 1999-2000
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21 /* Parser state */
22 typedef struct stream
23 {
24 /* Parsing layer */
25 unsigned char *data;
26 unsigned int size;
27 unsigned int offset;
28 unsigned int end;
29 BOOL marshall;
30 BOOL error;
31
32 /* Other layers */
33 int iso_offset;
34 int mcs_offset;
35 int rdp_offset;
36
37 } *STREAM;
38
39 /* Connection state */
40 typedef struct connection
41 {
42 /* User interface */
43 HWINDOW wnd;
44 HBITMAP bmpcache[8];
45
46 /* Parsing layer */
47 struct stream in;
48 struct stream out;
49
50 /* TCP layer */
51 int tcp_socket;
52
53 /* MCS layer */
54 uint16 mcs_userid;
55
56 } *HCONN;
57
58 #define STREAM_INIT(s,m) { s.data = xmalloc(2048); s.end = s.size = 2048; s.offset = 0; s.marshall = m; s.error = False; }
59 #define STREAM_SIZE(s,l) { if (l > s.size) { s.data = xrealloc(s.data,l); s.end = s.size = l; } }
60 #define REMAINING(s) ( s->end - s->offset )
61 #define PUSH_LAYER(s,v,l) { s.v = s.offset; s.offset += l; }
62 #define POP_LAYER(s,v) { s.offset = s.v; }
63 #define MARK_END(s) { s.end = s.offset; }

  ViewVC Help
Powered by ViewVC 1.1.26