From a1ce2ac48f158d18c3e25a6131ab28f8f72cdf33 Mon Sep 17 00:00:00 2001
From: dscho <dscho>
Date: Sun, 27 Jul 2003 21:30:29 +0000
Subject: make vncauth usable also for upcoming libvncclient

---
 rfb/rfb.h      | 56 --------------------------------------------------------
 rfb/rfbproto.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 vncauth.c      |  3 ++-
 3 files changed, 60 insertions(+), 57 deletions(-)

diff --git a/rfb/rfb.h b/rfb/rfb.h
index 70d0d19..a76d955 100644
--- a/rfb/rfb.h
+++ b/rfb/rfb.h
@@ -35,54 +35,12 @@ extern "C"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <rfb/rfbconfig.h>
-#undef VERSION
-#include <rfb/rfbint.h>
-#include <rfb/keysym.h>
-
-#ifdef HAVE_LIBZ
-#include <zlib.h>
-#endif
-
 #include <rfb/rfbproto.h>
 
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
 
-#if defined(WIN32)
-#define WORDS_BIGENDIAN
-#undef Bool
-#define Bool int
-#include <sys/timeb.h>
-#include <winsock.h>
-#undef SOCKET
-#define SOCKET int
-#else
-#define max(a,b) (((a)>(b))?(a):(b))
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#define SOCKET int
-#ifndef Bool
-typedef int8_t Bool;
-#undef FALSE
-#define FALSE 0
-#undef TRUE
-#define TRUE -1
-#endif
-#endif
-
-typedef uint32_t KeySym;
-typedef uint32_t Pixel;
-
-#ifndef INADDR_NONE
-#define                INADDR_NONE     ((in_addr_t) 0xffffffff)
-#endif
-
 #ifdef HAVE_LIBPTHREAD
 #include <pthread.h>
 #if 0 /* debugging */
@@ -144,8 +102,6 @@ typedef uint32_t Pixel;
 #endif
 #endif
 
-#define MAX_ENCODINGS 10
-
 struct _rfbClientRec;
 struct _rfbScreenInfo;
 struct rfbCursor;
@@ -327,18 +283,6 @@ typedef void (*rfbTranslateFnType)(char *table, rfbPixelFormat *in,
                                    int width, int height);
 
 
-/* 
- * vncauth.h - describes the functions provided by the vncauth library.
- */
-
-#define MAXPWLEN 8
-#define CHALLENGESIZE 16
-
-extern int vncEncryptAndStorePasswd(char *passwd, char *fname);
-extern char *vncDecryptPasswdFromFile(char *fname);
-extern void vncRandomBytes(unsigned char *bytes);
-extern void vncEncryptBytes(unsigned char *bytes, char *passwd);
-
 /* region stuff */
 
 struct sraRegion;
diff --git a/rfb/rfbproto.h b/rfb/rfbproto.h
index 9a64484..718b04f 100644
--- a/rfb/rfbproto.h
+++ b/rfb/rfbproto.h
@@ -47,6 +47,51 @@
  */
 
 
+#include <rfb/rfbconfig.h>
+#undef VERSION
+#include <rfb/rfbint.h>
+#include <rfb/keysym.h>
+
+#ifdef HAVE_LIBZ
+#include <zlib.h>
+#endif
+
+
+#if defined(WIN32)
+#define WORDS_BIGENDIAN
+#undef Bool
+#define Bool int
+#include <sys/timeb.h>
+#include <winsock.h>
+#undef SOCKET
+#define SOCKET int
+#else
+#define max(a,b) (((a)>(b))?(a):(b))
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#define SOCKET int
+#ifndef Bool
+typedef int8_t Bool;
+#undef FALSE
+#define FALSE 0
+#undef TRUE
+#define TRUE -1
+#endif
+#endif
+
+typedef uint32_t KeySym;
+typedef uint32_t Pixel;
+
+#ifndef INADDR_NONE
+#define                INADDR_NONE     ((in_addr_t) 0xffffffff)
+#endif
+
+#define MAX_ENCODINGS 20
+
 /*****************************************************************************
  *
  * Structures used in several messages
@@ -941,4 +986,17 @@ typedef union {
     rfbClientCutTextMsg cct;
 } rfbClientToServerMsg;
 
+/* 
+ * vncauth.h - describes the functions provided by the vncauth library.
+ */
+
+#define MAXPWLEN 8
+#define CHALLENGESIZE 16
+
+extern int vncEncryptAndStorePasswd(char *passwd, char *fname);
+extern char *vncDecryptPasswdFromFile(char *fname);
+extern void vncRandomBytes(unsigned char *bytes);
+extern void vncEncryptBytes(unsigned char *bytes, char *passwd);
+
+
 #endif
diff --git a/vncauth.c b/vncauth.c
index 9caf834..cc88fcf 100644
--- a/vncauth.c
+++ b/vncauth.c
@@ -21,7 +21,8 @@
  * vncauth.c - Functions for VNC password management and authentication.
  */
 
-#include "rfb.h"
+#include <stdio.h>
+#include <rfb/rfbproto.h>
 #include "d3des.h"
 
 #include <string.h>
-- 
cgit v1.2.3

