summaryrefslogtreecommitdiffstats
path: root/libvncserver/main.c
diff options
context:
space:
mode:
authordscho <dscho>2005-09-27 15:18:22 +0000
committerdscho <dscho>2005-09-27 15:18:22 +0000
commit93be927b1c1c74bc4da6f6d5978ba8e6e52f3cc2 (patch)
tree0ec66825e92a2cf60e0f32b7ab74bc5777318bd6 /libvncserver/main.c
parent94fcd86cc20dd2ccf7e2299a7dfbcc255c6cc771 (diff)
downloadlibtdevnc-93be927b1c1c74bc4da6f6d5978ba8e6e52f3cc2.tar.gz
libtdevnc-93be927b1c1c74bc4da6f6d5978ba8e6e52f3cc2.zip
Introduce generic protocol extension method. Deprecate
the processCustomClientMessage() method.
Diffstat (limited to 'libvncserver/main.c')
-rw-r--r--libvncserver/main.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/libvncserver/main.c b/libvncserver/main.c
index a9161ce..905bb83 100644
--- a/libvncserver/main.c
+++ b/libvncserver/main.c
@@ -40,6 +40,7 @@
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
static MUTEX(logMutex);
+static MUTEX(extMutex);
#endif
static int rfbEnableLogging=1;
@@ -50,6 +51,43 @@ char rfbEndianTest = 0;
char rfbEndianTest = -1;
#endif
+/*
+ * Protocol extensions
+ */
+
+static rfbProtocolExtension* rfbExtensionHead = NULL;
+
+void
+rfbRegisterProtocolExtension(rfbProtocolExtension* extension)
+{
+ rfbProtocolExtension* last;
+
+ LOCK(extMutex);
+ last = extension;
+
+ while(last->next)
+ last = last->next;
+
+ last->next = rfbExtensionHead;
+ rfbExtensionHead = extension;
+ UNLOCK(extMutex);
+}
+
+rfbProtocolExtension* rfbGetExtensionIterator()
+{
+ LOCK(extMutex);
+ return rfbExtensionHead;
+}
+
+void rfbReleaseExtensionIterator()
+{
+ UNLOCK(extMutex);
+}
+
+/*
+ * Logging
+ */
+
void rfbLogEnable(int enabled) {
rfbEnableLogging=enabled;
}