It's either not used, or no longer relevant.
set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
endif()
check_function_exists(inet_aton HAVE_INET_ATON)
-check_function_exists(inet_ntop HAVE_INET_NTOP)
check_function_exists(getaddrinfo HAVE_GETADDRINFO)
-check_type_size(socklen_t SOCKLEN_T)
set(CMAKE_EXTRA_INCLUDE_FILES)
set(CMAKE_REQUIRED_LIBRARIES)
-# Check for the newer standard string functions
-check_function_exists(snprintf HAVE_SNPRINTF)
-check_function_exists(strcasecmp HAVE_STRCASECMP)
-check_function_exists(strncasecmp HAVE_STRNCASECMP)
-check_function_exists(vsnprintf HAVE_VSNPRINTF)
-
# Generate config.h and make sure the source finds it
configure_file(config.h.in config.h)
add_definitions(-DHAVE_CONFIG_H)
#include <stdlib.h>
#include <network/TcpSocket.h>
-#include <os/net.h>
#include <rfb/util.h>
#include <rfb/LogWriter.h>
include_directories(${CMAKE_SOURCE_DIR}/common)
add_library(os STATIC
- print.c
- net.c
w32tiger.c
os.cxx
tls.cxx)
+++ /dev/null
-/* Copyright (C) 2008 TightVNC Team. All Rights Reserved.
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- * USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef WIN32
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#else
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#endif
-
-#include <os/net.h>
-
-
-#ifndef HAVE_INET_NTOP
-const char *tight_inet_ntop(int af, const void *src, char *dst,
- socklen_t size) {
- char *tempstr;
-
- /* Catch bugs - we should not use IPv6 if we don't have inet_ntop */
- if (af != AF_INET)
- abort();
-
- /* inet_ntoa never fails */
- tempstr = inet_ntoa(*(struct in_addr *)(src));
- memcpy(dst, tempstr, strlen(tempstr) + 1);
-
- return dst;
-}
-#endif
+++ /dev/null
-/* Copyright (C) 2008 TightVNC Team. All Rights Reserved.
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- * USA.
- */
-
-#ifndef OS_NET_H
-#define OS_NET_H
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef HAVE_SOCKLEN_T
-typedef int socklen_t;
-#endif
-
-/* IPv6 support on server side - we have to have all those functions */
-#if defined(HAVE_INET_NTOP)
-#define HAVE_IPV6
-#endif
-
-/* IPv4-only stub implementation */
-#ifndef HAVE_INET_NTOP
-const char *tight_inet_ntop(int af, const void *src,
- char *dst, socklen_t size);
-#define inet_ntop tight_inet_ntop
-#endif
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* OS_NET_H */
+++ /dev/null
-/* Copyright (C) 2008 TightVNC Team. All Rights Reserved.
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- * USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <os/print.h>
-
-#include <stdarg.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifndef HAVE_VSNPRINTF
-size_t internal_memcpy(char *dest, const char *src, size_t destsize,
- size_t srcsize) {
- size_t copied;
-
- copied = ((destsize) < (srcsize)) ? (destsize) : (srcsize);
- memcpy(dest, src, copied);
-
- return copied;
-}
-
-int tight_vsnprintf(char *str, size_t n, const char *format, va_list ap) {
- int written = 0;
- int tmpint, len;
- char buf[64]; /* Is it enough? */
- char *tmpstr;
-
- if (format == NULL || n < 1)
- return 0;
-
- while (*format != '\0' && written < n - 1) {
- if (*format != '%') {
- if (written < n) {
- str[written++] = *format++;
- continue;
- } else
- break;
- }
-
- format++;
- switch (*format) {
- case '\0':
- str[written++] = '%';
- continue;
- case 'd':
- tmpint = va_arg(ap, int);
- sprintf(buf, "%d", tmpint);
- len = strlen(buf);
- written += internal_memcpy (&str[written], buf,
- len, n - written);
- break;
- case 's':
- tmpstr = va_arg(ap, char *);
- len = strlen(tmpstr);
- written += internal_memcpy (&str[written],
- tmpstr, len,
- n - written);
- break;
- /* Catch unimplemented stuff */
- default:
- fprintf(stderr, "Unimplemented format: %c\n",
- *format);
- abort();
- }
- format++;
- }
-
- str[written] = '\0';
-
- return written;
-}
-#endif /* HAVE_VSNPRINTF */
-
-#ifndef HAVE_SNPRINTF
-int tight_snprintf(char *str, size_t n, const char *format, ...) {
- va_list ap;
- int written;
-
- va_start(ap, format);
- written = vsnprintf(str, n, format, ap);
- va_end(ap);
-
- return written;
-}
-#endif /* HAVE_SNPRINTF */
-
+++ /dev/null
-/* Copyright (C) 2008 TightVNC Team. All Rights Reserved.
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- * USA.
- */
-
-#ifndef OS_PRINT_H
-#define OS_PRINT_H
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef HAVE_VSNPRINTF
-/* NOTE:
- *
- * This is only very limited implementation for our internal purposes. It
- * doesn't conform to C99/POSIX
- * - limited conversion specifiers
- * - returns written number of characters instead of number what would be
- * written
- */
-int tight_vsnprintf(char *str, size_t n, const char *format, va_list ap);
-#define vsnprintf tight_vsnprintf
-#endif
-
-#ifndef HAVE_SNPRINTF
-/* Inherits tight_vsnprintf limitations if vsnprintf is not present */
-int tight_snprintf(char *str, size_t n, const char *format, ...);
-#define snprintf tight_snprintf
-#endif
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* OS_PRINT_H */
#include <wininet.h>
+/* Windows has different names for these */
+#define strcasecmp _stricmp
+#define strncasecmp _strnicmp
+
+
/* MSLLHOOKSTRUCT structure*/
#ifndef LLMHF_INJECTED
#define LLMHF_INJECTED 0x00000001
#include <config.h>
#endif
+#include <stdio.h>
+#include <stdarg.h>
+
#include <rdr/Exception.h>
#include <rdr/TLSException.h>
#ifdef _WIN32
#include <windows.h>
#endif
-#include <os/print.h>
-
#include <string.h>
#ifdef HAVE_GNUTLS
* USA.
*/
+#include <stdio.h>
+
#include <rdr/ZlibOutStream.h>
#include <rdr/Exception.h>
-#include <os/print.h>
#include <zlib.h>
+++ /dev/null
-/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- * USA.
- */
-
-// Trim out extraneous cruft from windows.h includes
-#define WIN32_LEAN_AND_MEAN
-
-// Force all Windows NT-specific APIs to be visible
-#define _WIN32_WINNT 0xffff
-
-#pragma warning( disable : 4800 ) // forcing bool 'true' or 'false'
-#pragma warning( disable : 4786 ) // truncating debug information to 255 chars
\ No newline at end of file
#include <rdr/TLSInStream.h>
#include <rdr/TLSOutStream.h>
#include <os/os.h>
-#include <os/print.h>
#include <os/tls.h>
#include <gnutls/x509.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
-#ifdef WIN32
-#define strcasecmp _stricmp
-#define strncasecmp _strnicmp
-#endif
#include <rfb/util.h>
#include <rfb/Configuration.h>
#include <rfb/util.h>
#include <rdr/MemOutStream.h>
-#ifdef WIN32
-#define strcasecmp _stricmp
-#endif
-
using namespace rfb;
using namespace rdr;
#include <rfb/Rect.h>
#include <rfb/PixelFormat.h>
#include <rfb/ConnParams.h>
-#include <os/print.h>
#include <stdio.h>
extern "C" {
#include <rdr/Exception.h>
#include <rfb/Rect.h>
#include <rfb/PixelFormat.h>
-#include <os/print.h>
#include <stdio.h>
extern "C" {
// -=- LogWriter.cxx - client-side logging interface
#include <string.h>
-#ifdef WIN32
-#define strcasecmp _stricmp
-#endif
#include <rfb/LogWriter.h>
#include <rfb/Configuration.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
-#ifdef WIN32
-#define strcasecmp _stricmp
-#endif
-#include <os/print.h>
#include <rfb/Logger.h>
#include <rfb/LogWriter.h>
#include <rfb/util.h>
#include <rfb/Rect.h>
#include <rfb/ScaleFilters.h>
-#ifdef _WIN32
-#define strcasecmp _stricmp
-#endif
-
using namespace rfb;
//
#include <assert.h>
#include <stdlib.h>
#include <string.h>
-#ifdef _WIN32
-#define strcasecmp _stricmp
-#endif
#include <rfb/CSecurityNone.h>
#include <rfb/CSecurityStack.h>
#include <rfb/CSecurityVeNCrypt.h>
* USA.
*/
#include <string.h>
-#ifdef _WIN32
-#define strcasecmp _stricmp
-#endif
#include <rfb/encodings.h>
#include <rfb/util.h>
#include <rfb/util.h>
-// Provide strcasecmp() and/or strncasecmp() if absent on this system.
-
-#ifndef WIN32
-#if !defined(HAVE_STRCASECMP) || !defined(HAVE_STRNCASECMP)
-
-extern "C" {
-
-/*
- * This array is designed for mapping upper and lower case letter
- * together for a case independent comparison. The mappings are
- * based upon ascii character sequences.
- */
-static unsigned char s_charmap[] = {
- '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
- '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
- '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
- '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037',
- '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047',
- '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057',
- '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067',
- '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077',
- '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
- '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
- '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
- '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137',
- '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
- '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
- '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
- '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177',
- '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
- '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217',
- '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
- '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
- '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247',
- '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
- '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
- '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
- '\300', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
- '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
- '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
- '\370', '\371', '\372', '\333', '\334', '\335', '\336', '\337',
- '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
- '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
- '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
- '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',
-};
-
-#ifndef HAVE_STRCASECMP
-int
-strcasecmp(const char *s1, const char *s2)
-{
- unsigned char u1, u2;
-
- for (;;) {
- u1 = (unsigned char) *s1++;
- u2 = (unsigned char) *s2++;
- if (s_charmap[u1] != s_charmap[u2]) {
- return s_charmap[u1] - s_charmap[u2];
- }
- if (u1 == '\0') {
- return 0;
- }
- }
-}
-#endif // !defined(HAVE_STRCASECMP)
-
-#ifndef HAVE_STRNCASECMP
-int
-strncasecmp(const char *s1, const char *s2, size_t n)
-{
- unsigned char u1, u2;
-
- for (; n != 0; --n) {
- u1 = (unsigned char) *s1++;
- u2 = (unsigned char) *s2++;
- if (s_charmap[u1] != s_charmap[u2]) {
- return s_charmap[u1] - s_charmap[u2];
- }
- if (u1 == '\0') {
- return 0;
- }
- }
- return 0;
-}
-#endif // !defined(HAVE_STRNCASECMP)
-
-} // extern "C"
-
-#endif // !defined(HAVE_STRCASECMP) || !defined(HAVE_STRNCASECMP)
-#endif // defined(WIN32)
-
namespace rfb {
char* strDup(const char* s) {
#define __rfbmin(a,b) (((a) < (b)) ? (a) : (b))
#endif
-// Declare strcasecmp() and/or strncasecmp() if absent on this system.
-
-#if !defined(WIN32) && !defined(HAVE_STRCASECMP)
-extern "C" {
- int strcasecmp(const char *s1, const char *s2);
-}
-#endif
-#if !defined(WIN32) && !defined(HAVE_STRNCASECMP)
-extern "C" {
- int strncasecmp(const char *s1, const char *s2, size_t n);
-}
-#endif
-
#endif
#define PACKAGE_NAME "@CMAKE_PROJECT_NAME@"
#define PACKAGE_VERSION "@VERSION@"
-#cmakedefine HAVE_SOCKLEN_T
#cmakedefine HAVE_INET_ATON
-#cmakedefine HAVE_INET_NTOP
#cmakedefine HAVE_GETADDRINFO
-#cmakedefine HAVE_SNPRINTF
-#cmakedefine HAVE_STRCASECMP
-#cmakedefine HAVE_STRNCASECMP
-#cmakedefine HAVE_VSNPRINTF
#cmakedefine HAVE_GNUTLS_SET_GLOBAL_ERRNO
#cmakedefine HAVE_GNUTLS_SET_ERRNO
#cmakedefine HAVE_GNUTLS_X509_CRT_PRINT
#include <windows.h>
#include <commctrl.h>
#include <string.h>
-#ifdef WIN32
-#define strcasecmp _stricmp
-#endif
#include "resource.h"
#include <rfb/Logger_stdio.h>
#include <windows.h>
-#define strcasecmp _stricmp
-
using namespace winvnc;
using namespace rfb;
// -=- VNC Server 4.0 for Windows (WinVNC4)
#include <string.h>
-#ifdef WIN32
-#define strcasecmp _stricmp
-#endif
#include <winvnc/VNCServerWin32.h>
#include <winvnc/VNCServerService.h>