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