2 rdesktop: A Remote Desktop Protocol client.
4 Copyright (C) Matthew Chapman 1999-2005
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.
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.
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.
21 #ifndef __RDESKTOP_MSTSC_H
22 #define __RDESKTOP_MSTSC_H
28 //#include <winsock2.h> /* winsock2.h first */
33 #include <sys/types.h>
35 #ifdef HAVE_SYS_SELECT_H
36 #include <sys/select.h>
37 #else /* HAVE_SYS_SELECT_H */
38 #include <sys/types.h>
40 #endif /* HAVE_SYS_SELECT_H */
42 #include <limits.h> /* PATH_MAX */
44 #define VERSION "1.4.1"
47 #define DEBUG(args) printf args;
53 #define DEBUG_KBD(args) printf args;
55 #define DEBUG_KBD(args)
58 #ifdef WITH_DEBUG_RDP5
59 #define DEBUG_RDP5(args) printf args;
61 #define DEBUG_RDP5(args)
64 #ifdef WITH_DEBUG_CLIPBOARD
65 #define DEBUG_CLIPBOARD(args) printf args;
67 #define DEBUG_CLIPBOARD(args)
70 #ifdef WITH_DEBUG_CHANNEL
71 #define DEBUG_CHANNEL(args) printf args;
73 #define DEBUG_CHANNEL(args)
76 #define STRNCPY(dst,src,n) { strncpy(dst,src,n-1); dst[n-1] = 0; }
79 #define MIN(x,y) (((x) < (y)) ? (x) : (y))
83 #define MAX(x,y) (((x) > (y)) ? (x) : (y))
88 #define timerisset(tvp)\
89 ((tvp)->tv_sec || (tvp)->tv_usec)
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)
98 #define timerclear(tvp)\
99 ((tvp)->tv_sec = (tvp)->tv_usec = 0)
102 /* If configure does not define the endianess, try
104 #if !defined(L_ENDIAN) && !defined(B_ENDIAN)
105 #if __BYTE_ORDER == __LITTLE_ENDIAN
107 #elif __BYTE_ORDER == __BIG_ENDIAN
110 #error Unknown endianness. Edit rdesktop.h.
112 #endif /* B_ENDIAN, L_ENDIAN from configure */
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) || \
124 #include "constants.h"
131 #endif /* __RDESKTOP_MSTSC_H */