summaryrefslogtreecommitdiffstats
path: root/libvncserver/main.c
diff options
context:
space:
mode:
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;
}