summaryrefslogtreecommitdiffstats
path: root/rfb
diff options
context:
space:
mode:
Diffstat (limited to 'rfb')
-rw-r--r--rfb/rfb.h16
-rw-r--r--rfb/rfbclient.h17
-rw-r--r--rfb/rfbconfig.h.in119
3 files changed, 86 insertions, 66 deletions
diff --git a/rfb/rfb.h b/rfb/rfb.h
index a55f34a..fa66916 100644
--- a/rfb/rfb.h
+++ b/rfb/rfb.h
@@ -44,16 +44,16 @@ extern "C"
#ifdef HAVE_LIBPTHREAD
#include <pthread.h>
#if 0 /* debugging */
-#define LOCK(mutex) (fprintf(stderr,"%s:%d LOCK(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_lock(&(mutex)))
-#define UNLOCK(mutex) (fprintf(stderr,"%s:%d UNLOCK(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_unlock(&(mutex)))
+#define LOCK(mutex) (rfbLog("%s:%d LOCK(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_lock(&(mutex)))
+#define UNLOCK(mutex) (rfbLog("%s:%d UNLOCK(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_unlock(&(mutex)))
#define MUTEX(mutex) pthread_mutex_t (mutex)
-#define INIT_MUTEX(mutex) (fprintf(stderr,"%s:%d INIT_MUTEX(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_init(&(mutex),NULL))
-#define TINI_MUTEX(mutex) (fprintf(stderr,"%s:%d TINI_MUTEX(%s)\n",__FILE__,__LINE__,#mutex), pthread_mutex_destroy(&(mutex)))
-#define TSIGNAL(cond) (fprintf(stderr,"%s:%d TSIGNAL(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_signal(&(cond)))
-#define WAIT(cond,mutex) (fprintf(stderr,"%s:%d WAIT(%s,%s)\n",__FILE__,__LINE__,#cond,#mutex), pthread_cond_wait(&(cond),&(mutex)))
+#define INIT_MUTEX(mutex) (rfbLog("%s:%d INIT_MUTEX(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_init(&(mutex),NULL))
+#define TINI_MUTEX(mutex) (rfbLog("%s:%d TINI_MUTEX(%s)\n",__FILE__,__LINE__,#mutex), pthread_mutex_destroy(&(mutex)))
+#define TSIGNAL(cond) (rfbLog("%s:%d TSIGNAL(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_signal(&(cond)))
+#define WAIT(cond,mutex) (rfbLog("%s:%d WAIT(%s,%s)\n",__FILE__,__LINE__,#cond,#mutex), pthread_cond_wait(&(cond),&(mutex)))
#define COND(cond) pthread_cond_t (cond)
-#define INIT_COND(cond) (fprintf(stderr,"%s:%d INIT_COND(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_init(&(cond),NULL))
-#define TINI_COND(cond) (fprintf(stderr,"%s:%d TINI_COND(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_destroy(&(cond)))
+#define INIT_COND(cond) (rfbLog("%s:%d INIT_COND(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_init(&(cond),NULL))
+#define TINI_COND(cond) (rfbLog("%s:%d TINI_COND(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_destroy(&(cond)))
#define IF_PTHREADS(x) x
#else
#define LOCK(mutex) pthread_mutex_lock(&(mutex));
diff --git a/rfb/rfbclient.h b/rfb/rfbclient.h
index c4f0418..c08f3a5 100644
--- a/rfb/rfbclient.h
+++ b/rfb/rfbclient.h
@@ -31,10 +31,10 @@
#include <rfb/rfbproto.h>
#include <rfb/keysym.h>
-#define Swap16IfLE(s) \
+#define rfbClientSwap16IfLE(s) \
(*(char *)&client->endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s))
-#define Swap32IfLE(l) \
+#define rfbClientSwap32IfLE(l) \
(*(char *)&client->endianTest ? ((((l) & 0xff000000) >> 24) | \
(((l) & 0x00ff0000) >> 8) | \
(((l) & 0x0000ff00) << 8) | \
@@ -92,7 +92,7 @@ struct _rfbClient;
typedef Bool (*HandleCursorPosProc)(struct _rfbClient* client, int x, int y);
typedef void (*SoftCursorLockAreaProc)(struct _rfbClient* client, int x, int y, int w, int h);
typedef void (*SoftCursorUnlockScreenProc)(struct _rfbClient* client);
-typedef void (*FramebufferUpdateReceivedProc)(struct _rfbClient* client, int x, int y, int w, int h);
+typedef void (*GotFrameBufferUpdateProc)(struct _rfbClient* client, int x, int y, int w, int h);
typedef char* (*GetPasswordProc)(struct _rfbClient* client);
typedef Bool (*MallocFrameBufferProc)(struct _rfbClient* client);
typedef void (*BellProc)(struct _rfbClient* client);
@@ -137,7 +137,7 @@ typedef struct _rfbClient {
HandleCursorPosProc HandleCursorPos;
SoftCursorLockAreaProc SoftCursorLockArea;
SoftCursorUnlockScreenProc SoftCursorUnlockScreen;
- FramebufferUpdateReceivedProc FramebufferUpdateReceived;
+ GotFrameBufferUpdateProc GotFrameBufferUpdate;
GetPasswordProc GetPassword;
MallocFrameBufferProc MallocFrameBuffer;
BellProc Bell;
@@ -155,6 +155,8 @@ extern void listenForIncomingConnections(rfbClient* viewer);
/* rfbproto.c */
+extern Bool rfbEnableClientLogging;
+extern void rfbClientLog(const char *format, ...);
extern Bool ConnectToRFBServer(rfbClient* client,const char *hostname, int port);
extern Bool InitialiseRFBConnection(rfbClient* client);
extern Bool SetFormatAndEncodings(rfbClient* client);
@@ -174,13 +176,16 @@ extern void PrintPixelFormat(rfbPixelFormat *format);
extern Bool errorMessageOnReadFailure;
extern Bool ReadFromRFBServer(rfbClient* client, char *out, unsigned int n);
-extern Bool WriteExact(rfbClient* client, char *buf, int n);
+extern Bool WriteToRFBServer(rfbClient* client, char *buf, int n);
extern int FindFreeTcpPort(void);
extern int ListenAtTcpPort(int port);
-extern int ConnectToTcpAddr(unsigned int host, int port);
+extern int ConnectClientToTcpAddr(unsigned int host, int port);
extern int AcceptTcpConnection(int listenSock);
extern Bool SetNonBlocking(int sock);
extern Bool StringToIPAddr(const char *str, unsigned int *addr);
extern Bool SameMachine(int sock);
+/* vncviewer.c */
+rfbClient* rfbGetClient(int* argc,char** argv,int bitsPerSample,int samplesPerPixel,int bytesPerPixel);
+Bool rfbInitClient(rfbClient* client,const char* vncServerHost,int vncServerPort);
diff --git a/rfb/rfbconfig.h.in b/rfb/rfbconfig.h.in
index 5736804..bd65138 100644
--- a/rfb/rfbconfig.h.in
+++ b/rfb/rfbconfig.h.in
@@ -1,4 +1,4 @@
-/* rfb/rfbconfig.h.in. Generated automatically from configure.ac by autoheader. */
+/* rfb/rfbconfig.h.in. Generated from configure.ac by autoheader. */
/* Enable 24 bit per pixel in native framebuffer */
#undef ALLOW24BPP
@@ -6,146 +6,161 @@
/* Enable BackChannel communication */
#undef BACKCHANNEL
-/* Define if you have the <arpa/inet.h> header file. */
+/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
-/* Define if you don't have `vprintf' but do have `_doprnt.' */
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
#undef HAVE_DOPRNT
-/* Define if you have the <fcntl.h> header file. */
+/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
-/* Define if you have the `ftime' function. */
+/* Define to 1 if you have the `ftime' function. */
#undef HAVE_FTIME
-/* Define if you have the `gethostbyname' function. */
+/* Define to 1 if you have the `gethostbyname' function. */
#undef HAVE_GETHOSTBYNAME
-/* Define if you have the `gethostname' function. */
+/* Define to 1 if you have the `gethostname' function. */
#undef HAVE_GETHOSTNAME
-/* Define if you have the `gettimeofday' function. */
+/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
-/* Define if you have the `inet_ntoa' function. */
+/* Define to 1 if you have the `inet_ntoa' function. */
#undef HAVE_INET_NTOA
-/* Define if you have the <inttypes.h> header file. */
+/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
-/* Define if you have the `jpeg' library (-ljpeg). */
+/* Define to 1 if you have the `jpeg' library (-ljpeg). */
#undef HAVE_LIBJPEG
-/* Define if you have the `nsl' library (-lnsl). */
+/* Define to 1 if you have the `nsl' library (-lnsl). */
#undef HAVE_LIBNSL
-/* Define if you have the `pthread' library (-lpthread). */
+/* Define to 1 if you have the `pthread' library (-lpthread). */
#undef HAVE_LIBPTHREAD
-/* Define if you have the `socket' library (-lsocket). */
+/* Define to 1 if you have the `socket' library (-lsocket). */
#undef HAVE_LIBSOCKET
-/* Define if you have the `z' library (-lz). */
+/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
-/* Define if your system has a working `malloc' function. */
+/* Define to 1 if your system has a working `malloc' function. */
#undef HAVE_MALLOC
-/* Define if you have the `memmove' function. */
+/* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE
-/* Define if you have the <memory.h> header file. */
+/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
-/* Define if you have the `memset' function. */
+/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
-/* Define if you have the `mkfifo' function. */
+/* Define to 1 if you have the `mkfifo' function. */
#undef HAVE_MKFIFO
-/* Define if you have the <netdb.h> header file. */
+/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
-/* Define if you have the <netinet/in.h> header file. */
+/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
-/* Define if you have the `select' function. */
+/* Define to 1 if you have the `select' function. */
#undef HAVE_SELECT
-/* Define if you have the `socket' function. */
+/* Define to 1 if you have the `socket' function. */
#undef HAVE_SOCKET
-/* Define if `stat' has the bug that it succeeds when given the zero-length
- file name argument. */
+/* Define to 1 if `stat' has the bug that it succeeds when given the
+ zero-length file name argument. */
#undef HAVE_STAT_EMPTY_STRING_BUG
-/* Define if you have the <stdint.h> header file. */
+/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
-/* Define if you have the <stdlib.h> header file. */
+/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
-/* Define if you have the `strchr' function. */
+/* Define to 1 if you have the `strchr' function. */
#undef HAVE_STRCHR
-/* Define if you have the `strcspn' function. */
+/* Define to 1 if you have the `strcspn' function. */
#undef HAVE_STRCSPN
-/* Define if you have the `strdup' function. */
+/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
-/* Define if you have the `strerror' function. */
+/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
-/* Define if you have the `strftime' function. */
+/* Define to 1 if you have the `strftime' function. */
#undef HAVE_STRFTIME
-/* Define if you have the <strings.h> header file. */
+/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
-/* Define if you have the <string.h> header file. */
+/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
-/* Define if you have the `strstr' function. */
+/* Define to 1 if you have the `strstr' function. */
#undef HAVE_STRSTR
-/* Define if you have the <syslog.h> header file. */
+/* Define to 1 if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
-/* Define if you have the <sys/socket.h> header file. */
+/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
-/* Define if you have the <sys/stat.h> header file. */
+/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
-/* Define if you have the <sys/timeb.h> header file. */
+/* Define to 1 if you have the <sys/timeb.h> header file. */
#undef HAVE_SYS_TIMEB_H
-/* Define if you have the <sys/time.h> header file. */
+/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
-/* Define if you have the <sys/types.h> header file. */
+/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
-/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
-/* Define if you have the <unistd.h> header file. */
+/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define if you have the `vprintf' function. */
+/* Define to 1 if you have the `vprintf' function. */
#undef HAVE_VPRINTF
/* Use zrle compression; needs a c++ compiler */
#undef HAVE_ZRLE
-/* Define if `lstat' dereferences a symlink specified with a trailing slash.
- */
+/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
+ slash. */
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
/* Name of package */
#undef PACKAGE
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
/* The number of bytes in type char */
#undef SIZEOF_CHAR
@@ -161,20 +176,20 @@
/* The number of bytes in type void* */
#undef SIZEOF_VOIDP
-/* Define if you have the ANSI C header files. */
+/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
-/* Define if you can safely include both <sys/time.h> and <time.h>. */
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Version number of package */
#undef VERSION
-/* Define if your processor stores words with the most significant byte first
- (like Motorola and SPARC, unlike Intel and VAX). */
+/* Define to 1 if your processor stores words with the most significant byte
+ first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
-/* Define if the X Window System is missing or not being used. */
+/* Define to 1 if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING
/* Define to empty if `const' does not conform to ANSI C. */