libvnc: add initial port

This commit is contained in:
Christian Prochaska
2020-04-09 15:37:14 +02:00
committed by Alexander Boettcher
parent e774b38395
commit 765f547140
8 changed files with 661 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
SDLVNCVIEWER_PORT_DIR := $(call select_from_ports,libvnc)
TARGET = sdl_vnc
SRC_C = SDLvncviewer.c scrap.c
LIBS = vncclient sdl libc zlib
vpath %.c $(SDLVNCVIEWER_PORT_DIR)/src/lib/vnc/client_examples

View File

@@ -0,0 +1,33 @@
+++ src/lib/vnc/client_examples/SDLvncviewer.c
@@ -474,6 +474,10 @@
put_scrap(T('T', 'E', 'X', 'T'), len, text);
}
+static char * pwd_hack = 0;
+static char* ReadPassword(rfbClient* client) {
+ return pwd_hack;
+}
#ifdef mac
#define main SDLmain
@@ -500,6 +504,12 @@
argv[i] = "-listennofork";
++j;
}
+ else if (i+1<argc && !strcmp(argv[i], "-password")) {
+ pwd_hack = strdup(argv[i+1]);
+ for (int k = i; k + 2 < argc; k++)
+ argv[k] = argv[k+2];
+ argc -= 2;
+ }
else {
if (i != j)
argv[j] = argv[i];
@@ -525,6 +535,7 @@
cl->GotXCutText = got_selection;
cl->listenPort = LISTEN_PORT_OFFSET;
cl->listen6Port = LISTEN_PORT_OFFSET;
+ cl->GetPassword = ReadPassword;
if(!rfbInitClient(cl,&argc,argv))
{
cl = NULL; /* rfbInitClient has already freed the client struct */