- Create another branch for networking fixes
[reactos.git] / base / applications / mstsc / rdesktop.h
1 /*
2 rdesktop: A Remote Desktop Protocol client.
3 Master include file
4 Copyright (C) Matthew Chapman 1999-2005
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 along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21 #ifndef __RDESKTOP_MSTSC_H
22 #define __RDESKTOP_MSTSC_H
23
24 #include <stdlib.h>
25 #include <stdio.h>
26 #include <string.h>
27 #ifdef _WIN32
28 //#include <winsock2.h> /* winsock2.h first */
29 #include <windows.h>
30 #include <time.h>
31 #else /* WIN32 */
32 #include <dirent.h>
33 #include <sys/types.h>
34 #include <sys/time.h>
35 #ifdef HAVE_SYS_SELECT_H
36 #include <sys/select.h>
37 #else /* HAVE_SYS_SELECT_H */
38 #include <sys/types.h>
39 #include <unistd.h>
40 #endif /* HAVE_SYS_SELECT_H */
41 #endif /* WIN32 */
42 #include <limits.h> /* PATH_MAX */
43
44 #define VERSION "1.4.1"
45
46 #ifdef WITH_DEBUG
47 #define DEBUG(args) printf args;
48 #else
49 #define DEBUG(args)
50 #endif
51
52 #ifdef WITH_DEBUG_KBD
53 #define DEBUG_KBD(args) printf args;
54 #else
55 #define DEBUG_KBD(args)
56 #endif
57
58 #ifdef WITH_DEBUG_RDP5
59 #define DEBUG_RDP5(args) printf args;
60 #else
61 #define DEBUG_RDP5(args)
62 #endif
63
64 #ifdef WITH_DEBUG_CLIPBOARD
65 #define DEBUG_CLIPBOARD(args) printf args;
66 #else
67 #define DEBUG_CLIPBOARD(args)
68 #endif
69
70 #ifdef WITH_DEBUG_CHANNEL
71 #define DEBUG_CHANNEL(args) printf args;
72 #else
73 #define DEBUG_CHANNEL(args)
74 #endif
75
76 #define STRNCPY(dst,src,n) { strncpy(dst,src,n-1); dst[n-1] = 0; }
77
78 #ifndef MIN
79 #define MIN(x,y) (((x) < (y)) ? (x) : (y))
80 #endif
81
82 #ifndef MAX
83 #define MAX(x,y) (((x) > (y)) ? (x) : (y))
84 #endif
85
86 /* timeval macros */
87 #ifndef timerisset
88 #define timerisset(tvp)\
89 ((tvp)->tv_sec || (tvp)->tv_usec)
90 #endif
91 #ifndef timercmp
92 #define timercmp(tvp, uvp, cmp)\
93 ((tvp)->tv_sec cmp (uvp)->tv_sec ||\
94 (tvp)->tv_sec == (uvp)->tv_sec &&\
95 (tvp)->tv_usec cmp (uvp)->tv_usec)
96 #endif
97 #ifndef timerclear
98 #define timerclear(tvp)\
99 ((tvp)->tv_sec = (tvp)->tv_usec = 0)
100 #endif
101
102 /* If configure does not define the endianess, try
103 to find it out */
104 #if !defined(L_ENDIAN) && !defined(B_ENDIAN)
105 #if __BYTE_ORDER == __LITTLE_ENDIAN
106 #define L_ENDIAN
107 #elif __BYTE_ORDER == __BIG_ENDIAN
108 #define B_ENDIAN
109 #else
110 #error Unknown endianness. Edit rdesktop.h.
111 #endif
112 #endif /* B_ENDIAN, L_ENDIAN from configure */
113
114 /* No need for alignment on x86 and amd64 */
115 #if !defined(NEED_ALIGN)
116 #if !(defined(__x86__) || defined(__x86_64__) || \
117 defined(__AMD64__) || defined(_M_IX86) || \
118 defined(__i386__))
119 #define NEED_ALIGN
120 #endif
121 #endif
122
123 #include "parse.h"
124 #include "constants.h"
125 #include "types.h"
126
127 #ifndef MAKE_PROTO
128 #include "proto.h"
129 #endif
130
131 #endif /* __RDESKTOP_MSTSC_H */