global structures/functions should have "rfb", "sra" or "zrle" as prefix,

while structure members should not
pull/1/head
dscho 19 years ago
parent 0d3b958b47
commit 97299606da

@ -29,7 +29,7 @@ int main (int argc, char **argv)
server = rfbGetScreen (&argc, argv, maxx, maxy, 8, 3, bpp);
server->desktopName = "Zippy das wundersquirrel\'s VNC server";
server->frameBuffer = (char*)malloc(maxx*maxy*bpp);
server->rfbAlwaysShared = TRUE;
server->alwaysShared = TRUE;
server->kbdAddEvent = on_key_press;
server->ptrAddEvent = on_mouse_event;
@ -76,7 +76,7 @@ void draw_primary_colors (char* frame_buffer, int x1, int y1, int x2, int y2)
/* Dscho's versions (slower, but works for bpp != 3 or 4) */
void draw_primary_colours_generic(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2)
{
rfbPixelFormat f=s->rfbServerFormat;
rfbPixelFormat f=s->serverFormat;
int i,j;
for(j=y1;j<y2;j++)
for(i=x1;i<x2;i++)
@ -90,7 +90,7 @@ void draw_primary_colours_generic(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2
void draw_primary_colours_generic_fast(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2)
{
rfbPixelFormat f=s->rfbServerFormat;
rfbPixelFormat f=s->serverFormat;
int i,j,y3=(y1*2+y2)/3,y4=(y1+y2*2)/3;
/* draw first pixel */
rfbDrawPixel(s,x1,y1,f.redMax<<f.redShift);
@ -108,7 +108,7 @@ void draw_primary_colours_generic_fast(rfbScreenInfoPtr s,int x1,int y1,int x2,i
void draw_primary_colours_generic_ultrafast(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2)
{
rfbPixelFormat f=s->rfbServerFormat;
rfbPixelFormat f=s->serverFormat;
int y3=(y1*2+y2)/3,y4=(y1+y2*2)/3;
/* fill rectangles */
rfbFillRect(s,x1,y1,x2,y3,f.redMax<<f.redShift);

@ -8,7 +8,7 @@ int main(int argc,char** argv)
rfbScreenInfoPtr server=rfbGetScreen(&argc,argv,256,256,8,1,1);
server->rfbServerFormat.trueColour=FALSE;
server->serverFormat.trueColour=FALSE;
server->colourMap.count=256;
server->colourMap.is16=FALSE;
for(i=0;i<256;i++) {

@ -157,7 +157,7 @@ void doptr(int buttonMask,int x,int y,rfbClientPtr cl)
cd->oldx=x; cd->oldy=y; cd->oldButton=buttonMask;
}
defaultPtrAddEvent(buttonMask,x,y,cl);
rfbDefaultPtrAddEvent(buttonMask,x,y,cl);
}
/* aux function to draw a character to x, y */
@ -277,7 +277,7 @@ int main(int argc,char** argv)
rfbGetScreen(&argc,argv,maxx,maxy,8,3,bpp);
rfbScreen->desktopName = "LibVNCServer Example";
rfbScreen->frameBuffer = (char*)malloc(maxx*maxy*bpp);
rfbScreen->rfbAlwaysShared = TRUE;
rfbScreen->alwaysShared = TRUE;
rfbScreen->ptrAddEvent = doptr;
rfbScreen->kbdAddEvent = dokey;
rfbScreen->newClientHook = newclient;

@ -64,7 +64,7 @@ int main(int argc,char** argv)
rfbScreen->desktopName = argv[1];
else
rfbScreen->desktopName = "Picture";
rfbScreen->rfbAlwaysShared = TRUE;
rfbScreen->alwaysShared = TRUE;
rfbScreen->kbdAddEvent = HandleKey;
/* enable http */
@ -76,7 +76,7 @@ int main(int argc,char** argv)
fclose(in);
if(picType!=TRUECOLOUR) {
rfbScreen->rfbServerFormat.trueColour=FALSE;
rfbScreen->serverFormat.trueColour=FALSE;
rfbScreen->colourMap.count=256;
rfbScreen->colourMap.is16=FALSE;
rfbScreen->colourMap.data.bytes=malloc(256*3);

@ -57,7 +57,7 @@ int main(int argc,char** argv)
rfbScreen->desktopName = argv[1];
else
rfbScreen->desktopName = "Picture";
rfbScreen->rfbAlwaysShared = TRUE;
rfbScreen->alwaysShared = TRUE;
rfbScreen->kbdAddEvent = HandleKey;
/* enable http */

@ -36,7 +36,7 @@ int main(int argc, char *argv[])
if (argc != 3)
usage();
if (vncEncryptAndStorePasswd(argv[1], argv[2]) != 0) {
if (rfbEncryptAndStorePasswd(argv[1], argv[2]) != 0) {
printf("storing password failed.\n");
return 1;
} else {

@ -105,7 +105,7 @@ int main(int argc,char** argv)
s->colourMap.is16=FALSE;
s->colourMap.count=2;
s->colourMap.data.bytes=(unsigned char*)"\xd0\xd0\xd0\x30\x01\xe0";
s->rfbServerFormat.trueColour=FALSE;
s->serverFormat.trueColour=FALSE;
s->frameBuffer=f;
s->kbdAddEvent=dokey;
s->ptrAddEvent=doptr;

@ -246,7 +246,7 @@ ConnectToRFBServer(rfbClient* client,const char *hostname, int port)
return SetNonBlocking(client->sock);
}
static void rfbEncryptBytes(unsigned char *bytes, char *passwd);
extern void rfbClientEncryptBytes(unsigned char* bytes, char* passwd);
/*
* InitialiseRFBConnection.
@ -327,7 +327,7 @@ InitialiseRFBConnection(rfbClient* client)
passwd[8] = '\0';
}
rfbEncryptBytes(challenge, passwd);
rfbClientEncryptBytes(challenge, passwd);
/* Lose the password from memory */
for (i = strlen(passwd); i >= 0; i--) {
@ -1136,14 +1136,14 @@ JpegSetSrcManager(j_decompress_ptr cinfo, uint8_t *compressedData,
/* avoid name clashes with LibVNCServer */
#define vncEncryptBytes rfbEncryptBytes
#define vncEncryptAndStorePasswd rfbEncryptAndStorePasswdUnused
#define vncDecryptPasswdFromFile rfbDecryptPasswdFromFileUnused
#define vncRandomBytes rfbRandomBytesUnused
#define des rfbDES
#define deskey rfbDESKey
#define usekey rfbUseKey
#define cpkey rfbCPKey
#define rfbEncryptBytes rfbClientEncryptBytes
#define rfbEncryptAndStorePasswd rfbClientEncryptAndStorePasswdUnused
#define rfbDecryptPasswdFromFile rfbClientDecryptPasswdFromFileUnused
#define rfbRandomBytes rfbClientRandomBytesUnused
#define rfbDes rfbClientDes
#define rfbDesKey rfbClientDesKey
#define rfbUseKey rfbClientUseKey
#define rfbCPKey rfbClientCPKey
#include "../libvncserver/vncauth.c"
#include "../libvncserver/d3des.c"

@ -43,9 +43,9 @@ rfbAuthNewClient(cl)
cl->state = RFB_AUTHENTICATION;
if (cl->screen->rfbAuthPasswdData && !cl->reverseConnection) {
if (cl->screen->authPasswdData && !cl->reverseConnection) {
*(uint32_t *)buf = Swap32IfLE(rfbVncAuth);
vncRandomBytes(cl->authChallenge);
rfbRandomBytes(cl->authChallenge);
memcpy(&buf[4], (char *)cl->authChallenge, CHALLENGESIZE);
len = 4 + CHALLENGESIZE;
} else {
@ -54,7 +54,7 @@ rfbAuthNewClient(cl)
cl->state = RFB_INITIALISATION;
}
if (WriteExact(cl, buf, len) < 0) {
if (rfbWriteExact(cl, buf, len) < 0) {
rfbLogPerror("rfbAuthNewClient: write");
rfbCloseClient(cl);
return;
@ -75,7 +75,7 @@ rfbAuthProcessClientMessage(cl)
uint8_t response[CHALLENGESIZE];
uint32_t authResult;
if ((n = ReadExact(cl, (char *)response, CHALLENGESIZE)) <= 0) {
if ((n = rfbReadExact(cl, (char *)response, CHALLENGESIZE)) <= 0) {
if (n != 0)
rfbLogPerror("rfbAuthProcessClientMessage: read");
rfbCloseClient(cl);
@ -85,7 +85,7 @@ rfbAuthProcessClientMessage(cl)
if(!cl->screen->passwordCheck(cl,(const char*)response,CHALLENGESIZE)) {
rfbErr("rfbAuthProcessClientMessage: password check failed\n");
authResult = Swap32IfLE(rfbVncAuthFailed);
if (WriteExact(cl, (char *)&authResult, 4) < 0) {
if (rfbWriteExact(cl, (char *)&authResult, 4) < 0) {
rfbLogPerror("rfbAuthProcessClientMessage: write");
}
rfbCloseClient(cl);
@ -94,7 +94,7 @@ rfbAuthProcessClientMessage(cl)
authResult = Swap32IfLE(rfbVncAuthOK);
if (WriteExact(cl, (char *)&authResult, 4) < 0) {
if (rfbWriteExact(cl, (char *)&authResult, 4) < 0) {
rfbLogPerror("rfbAuthProcessClientMessage: write");
rfbCloseClient(cl);
return;

@ -64,19 +64,19 @@ rfbProcessArguments(rfbScreenInfoPtr rfbScreen,int* argc, char *argv[])
rfbUsage();
return FALSE;
}
rfbScreen->rfbPort = atoi(argv[++i]);
rfbScreen->port = atoi(argv[++i]);
} else if (strcmp(argv[i], "-rfbwait") == 0) { /* -rfbwait ms */
if (i + 1 >= *argc) {
rfbUsage();
return FALSE;
}
rfbScreen->rfbMaxClientWait = atoi(argv[++i]);
rfbScreen->maxClientWait = atoi(argv[++i]);
} else if (strcmp(argv[i], "-rfbauth") == 0) { /* -rfbauth passwd-file */
if (i + 1 >= *argc) {
rfbUsage();
return FALSE;
}
rfbScreen->rfbAuthPasswdData = argv[++i];
rfbScreen->authPasswdData = argv[++i];
} else if (strcmp(argv[i], "-passwd") == 0) { /* -passwd password */
char **passwds = malloc(sizeof(char**)*2);
if (i + 1 >= *argc) {
@ -85,14 +85,14 @@ rfbProcessArguments(rfbScreenInfoPtr rfbScreen,int* argc, char *argv[])
}
passwds[0] = argv[++i];
passwds[1] = 0;
rfbScreen->rfbAuthPasswdData = (void*)passwds;
rfbScreen->authPasswdData = (void*)passwds;
rfbScreen->passwordCheck = rfbCheckPasswordByList;
} else if (strcmp(argv[i], "-deferupdate") == 0) { /* -deferupdate milliseconds */
if (i + 1 >= *argc) {
rfbUsage();
return FALSE;
}
rfbScreen->rfbDeferUpdateTime = atoi(argv[++i]);
rfbScreen->deferUpdateTime = atoi(argv[++i]);
} else if (strcmp(argv[i], "-desktop") == 0) { /* -desktop desktop-name */
if (i + 1 >= *argc) {
rfbUsage();
@ -100,11 +100,11 @@ rfbProcessArguments(rfbScreenInfoPtr rfbScreen,int* argc, char *argv[])
}
rfbScreen->desktopName = argv[++i];
} else if (strcmp(argv[i], "-alwaysshared") == 0) {
rfbScreen->rfbAlwaysShared = TRUE;
rfbScreen->alwaysShared = TRUE;
} else if (strcmp(argv[i], "-nevershared") == 0) {
rfbScreen->rfbNeverShared = TRUE;
rfbScreen->neverShared = TRUE;
} else if (strcmp(argv[i], "-dontdisconnect") == 0) {
rfbScreen->rfbDontDisconnect = TRUE;
rfbScreen->dontDisconnect = TRUE;
} else if (strcmp(argv[i], "-httpdir") == 0) { /* -httpdir directory-path */
if (i + 1 >= *argc) {
rfbUsage();

@ -115,7 +115,7 @@ rfbSendSmallRectEncodingCoRRE(cl, x, y, w, h)
rreAfterBuf = (char *)realloc(rreAfterBuf, rreAfterBufSize);
}
(*cl->translateFn)(cl->translateLookupTable,&(cl->screen->rfbServerFormat),
(*cl->translateFn)(cl->translateLookupTable,&(cl->screen->serverFormat),
&cl->format, fbptr, rreBeforeBuf,
cl->screen->paddedWidthInBytes, w, h);
@ -141,8 +141,8 @@ rfbSendSmallRectEncodingCoRRE(cl, x, y, w, h)
return rfbSendRectEncodingRaw(cl, x, y, w, h);
}
cl->rfbRectanglesSent[rfbEncodingCoRRE]++;
cl->rfbBytesSent[rfbEncodingCoRRE] += (sz_rfbFramebufferUpdateRectHeader
cl->rectanglesSent[rfbEncodingCoRRE]++;
cl->bytesSent[rfbEncodingCoRRE] += (sz_rfbFramebufferUpdateRectHeader
+ sz_rfbRREHeader + rreAfterBufLen);
if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader

@ -46,11 +46,11 @@ rfbSendCursorShape(cl)
if (cl->useRichCursorEncoding) {
if(pCursor && !pCursor->richSource)
MakeRichCursorFromXCursor(cl->screen,pCursor);
rfbMakeRichCursorFromXCursor(cl->screen,pCursor);
rect.encoding = Swap32IfLE(rfbEncodingRichCursor);
} else {
if(pCursor && !pCursor->source)
MakeXCursorFromRichCursor(cl->screen,pCursor);
rfbMakeXCursorFromRichCursor(cl->screen,pCursor);
rect.encoding = Swap32IfLE(rfbEncodingXCursor);
}
@ -73,8 +73,8 @@ rfbSendCursorShape(cl)
sz_rfbFramebufferUpdateRectHeader);
cl->ublen += sz_rfbFramebufferUpdateRectHeader;
cl->rfbCursorShapeBytesSent += sz_rfbFramebufferUpdateRectHeader;
cl->rfbCursorShapeUpdatesSent++;
cl->cursorShapeBytesSent += sz_rfbFramebufferUpdateRectHeader;
cl->cursorShapeUpdatesSent++;
if (!rfbSendUpdateBuf(cl))
return FALSE;
@ -139,10 +139,10 @@ rfbSendCursorShape(cl)
}
} else {
/* RichCursor encoding. */
int bpp1=cl->screen->rfbServerFormat.bitsPerPixel/8,
int bpp1=cl->screen->serverFormat.bitsPerPixel/8,
bpp2=cl->format.bitsPerPixel/8;
(*cl->translateFn)(cl->translateLookupTable,
&(cl->screen->rfbServerFormat),
&(cl->screen->serverFormat),
&cl->format, (char*)pCursor->richSource,
&cl->updateBuf[cl->ublen],
pCursor->width*bpp1, pCursor->width, pCursor->height);
@ -163,8 +163,8 @@ rfbSendCursorShape(cl)
/* Send everything we have prepared in the cl->updateBuf[]. */
cl->rfbCursorShapeBytesSent += (cl->ublen - saved_ublen);
cl->rfbCursorShapeUpdatesSent++;
cl->cursorShapeBytesSent += (cl->ublen - saved_ublen);
cl->cursorShapeUpdatesSent++;
if (!rfbSendUpdateBuf(cl))
return FALSE;
@ -196,8 +196,8 @@ rfbSendCursorPos(rfbClientPtr cl)
sz_rfbFramebufferUpdateRectHeader);
cl->ublen += sz_rfbFramebufferUpdateRectHeader;
cl->rfbCursorPosBytesSent += sz_rfbFramebufferUpdateRectHeader;
cl->rfbCursorPosUpdatesSent++;
cl->cursorPosBytesSent += sz_rfbFramebufferUpdateRectHeader;
cl->cursorPosUpdatesSent++;
if (!rfbSendUpdateBuf(cl))
return FALSE;
@ -326,9 +326,9 @@ void rfbFreeCursor(rfbCursorPtr cursor)
}
/* background and foregroud colour have to be set beforehand */
void MakeXCursorFromRichCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor)
void rfbMakeXCursorFromRichCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor)
{
rfbPixelFormat* format=&rfbScreen->rfbServerFormat;
rfbPixelFormat* format=&rfbScreen->serverFormat;
int i,j,w=(cursor->width+7)/8,bpp=format->bitsPerPixel/8,
width=cursor->width*bpp;
uint32_t background;
@ -352,9 +352,9 @@ void MakeXCursorFromRichCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor)
cursor->source[j*w+i/8]|=bit;
}
void MakeRichCursorFromXCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor)
void rfbMakeRichCursorFromXCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor)
{
rfbPixelFormat* format=&rfbScreen->rfbServerFormat;
rfbPixelFormat* format=&rfbScreen->serverFormat;
int i,j,w=(cursor->width+7)/8,bpp=format->bitsPerPixel/8;
uint32_t background,foreground;
char *back=(char*)&background,*fore=(char*)&foreground;
@ -387,7 +387,7 @@ void MakeRichCursorFromXCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor)
void rfbUndrawCursor(rfbScreenInfoPtr s)
{
rfbCursorPtr c=s->cursor;
int j,x1,x2,y1,y2,bpp=s->rfbServerFormat.bitsPerPixel/8,
int j,x1,x2,y1,y2,bpp=s->serverFormat.bitsPerPixel/8,
rowstride=s->paddedWidthInBytes;
LOCK(s->cursorMutex);
if(!s->cursorIsDrawn || !c) {
@ -429,7 +429,7 @@ void rfbUndrawCursor(rfbScreenInfoPtr s)
void rfbDrawCursor(rfbScreenInfoPtr s)
{
rfbCursorPtr c=s->cursor;
int i,j,x1,x2,y1,y2,i1,j1,bpp=s->rfbServerFormat.bitsPerPixel/8,
int i,j,x1,x2,y1,y2,i1,j1,bpp=s->serverFormat.bitsPerPixel/8,
rowstride=s->paddedWidthInBytes,
bufSize,w;
rfbBool wasChanged=FALSE;
@ -487,7 +487,7 @@ void rfbDrawCursor(rfbScreenInfoPtr s)
}
if(!c->richSource)
MakeRichCursorFromXCursor(s,c);
rfbMakeRichCursorFromXCursor(s,c);
/* now the cursor has to be drawn */
for(j=0;j<y2;j++)

@ -71,7 +71,7 @@ static unsigned char pc2[48] = {
40, 51, 30, 36, 46, 54, 29, 39, 50, 44, 32, 47,
43, 48, 38, 55, 33, 52, 45, 41, 49, 35, 28, 31 };
void deskey(key, edf) /* Thanks to James Gillogly & Phil Karn! */
void rfbDesKey(key, edf) /* Thanks to James Gillogly & Phil Karn! */
unsigned char *key;
int edf;
{
@ -127,11 +127,11 @@ register unsigned long *raw1;
*cook |= (*raw1 & 0x0003f000L) >> 4;
*cook++ |= (*raw1 & 0x0000003fL);
}
usekey(dough);
rfbUseKey(dough);
return;
}
void cpkey(into)
void rfbCPKey(into)
register unsigned long *into;
{
register unsigned long *from, *endp;
@ -141,7 +141,7 @@ register unsigned long *into;
return;
}
void usekey(from)
void rfbUseKey(from)
register unsigned long *from;
{
register unsigned long *to, *endp;
@ -151,7 +151,7 @@ register unsigned long *from;
return;
}
void des(inblock, outblock)
void rfbDes(inblock, outblock)
unsigned char *inblock, *outblock;
{
unsigned long work[2];

@ -25,25 +25,25 @@
#define EN0 0 /* MODE == encrypt */
#define DE1 1 /* MODE == decrypt */
extern void deskey(unsigned char *, int);
extern void rfbDesKey(unsigned char *, int);
/* hexkey[8] MODE
* Sets the internal key register according to the hexadecimal
* key contained in the 8 bytes of hexkey, according to the DES,
* for encryption or decryption according to MODE.
*/
extern void usekey(unsigned long *);
extern void rfbUseKey(unsigned long *);
/* cookedkey[32]
* Loads the internal key register with the data in cookedkey.
*/
extern void cpkey(unsigned long *);
extern void rfbCPKey(unsigned long *);
/* cookedkey[32]
* Copies the contents of the internal key register into the storage
* located at &cookedkey[0].
*/
extern void des(unsigned char *, unsigned char *);
extern void rfbDes(unsigned char *, unsigned char *);
/* from[8] to[8]
* Encrypts/Decrypts (according to the key currently loaded in the
* internal key register) one block of eight bytes at address 'from'

@ -7,7 +7,7 @@ int rfbDrawChar(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
unsigned char* data=font->data+font->metaData[c*5];
unsigned char d=*data;
int rowstride=rfbScreen->paddedWidthInBytes;
int bpp=rfbScreen->rfbServerFormat.bitsPerPixel/8;
int bpp=rfbScreen->serverFormat.bitsPerPixel/8;
char *colour=(char*)&col;
if(!rfbEndianTest)
@ -52,7 +52,7 @@ int rfbDrawCharWithClip(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
unsigned char* data=font->data+font->metaData[c*5];
unsigned char d;
int rowstride=rfbScreen->paddedWidthInBytes;
int bpp=rfbScreen->rfbServerFormat.bitsPerPixel/8,extra_bytes=0;
int bpp=rfbScreen->serverFormat.bitsPerPixel/8,extra_bytes=0;
char* colour=(char*)&col;
char* bcolour=(char*)&bcol;

@ -58,8 +58,8 @@ rfbSendRectEncodingHextile(cl, x, y, w, h)
sz_rfbFramebufferUpdateRectHeader);
cl->ublen += sz_rfbFramebufferUpdateRectHeader;
cl->rfbRectanglesSent[rfbEncodingHextile]++;
cl->rfbBytesSent[rfbEncodingHextile] += sz_rfbFramebufferUpdateRectHeader;
cl->rectanglesSent[rfbEncodingHextile]++;
cl->bytesSent[rfbEncodingHextile] += sz_rfbFramebufferUpdateRectHeader;
switch (cl->format.bitsPerPixel) {
case 8:
@ -130,7 +130,7 @@ sendHextiles##bpp(cl, rx, ry, rw, rh)
fbptr = (cl->screen->frameBuffer + (cl->screen->paddedWidthInBytes * y) \
+ (x * (cl->screen->bitsPerPixel / 8))); \
\
(*cl->translateFn)(cl->translateLookupTable, &(cl->screen->rfbServerFormat), \
(*cl->translateFn)(cl->translateLookupTable, &(cl->screen->serverFormat), \
&cl->format, fbptr, (char *)clientPixelData, \
cl->screen->paddedWidthInBytes, w, h); \
\
@ -149,7 +149,7 @@ sendHextiles##bpp(cl, rx, ry, rw, rh)
} \
\
if (solid) { \
cl->rfbBytesSent[rfbEncodingHextile] += cl->ublen - startUblen; \
cl->bytesSent[rfbEncodingHextile] += cl->ublen - startUblen; \
continue; \
} \
\
@ -174,7 +174,7 @@ sendHextiles##bpp(cl, rx, ry, rw, rh)
cl->ublen = startUblen; \
cl->updateBuf[cl->ublen++] = rfbHextileRaw; \
(*cl->translateFn)(cl->translateLookupTable, \
&(cl->screen->rfbServerFormat), &cl->format, fbptr, \
&(cl->screen->serverFormat), &cl->format, fbptr, \
(char *)clientPixelData, \
cl->screen->paddedWidthInBytes, w, h); \
\
@ -184,7 +184,7 @@ sendHextiles##bpp(cl, rx, ry, rw, rh)
cl->ublen += w * h * (bpp/8); \
} \
\
cl->rfbBytesSent[rfbEncodingHextile] += cl->ublen - startUblen; \
cl->bytesSent[rfbEncodingHextile] += cl->ublen - startUblen; \
} \
} \
\

@ -84,7 +84,7 @@ static size_t buf_filled=0;
*/
void
httpInitSockets(rfbScreenInfoPtr rfbScreen)
rfbHttpInitSockets(rfbScreenInfoPtr rfbScreen)
{
if (rfbScreen->httpInitDone)
return;
@ -95,14 +95,14 @@ httpInitSockets(rfbScreenInfoPtr rfbScreen)
return;
if (rfbScreen->httpPort == 0) {
rfbScreen->httpPort = rfbScreen->rfbPort-100;
rfbScreen->httpPort = rfbScreen->port-100;
}
rfbLog("Listening for HTTP connections on TCP port %d\n", rfbScreen->httpPort);
rfbLog(" URL http://%s:%d\n",rfbScreen->rfbThisHost,rfbScreen->httpPort);
rfbLog(" URL http://%s:%d\n",rfbScreen->thisHost,rfbScreen->httpPort);
if ((rfbScreen->httpListenSock = ListenOnTCPPort(rfbScreen->httpPort)) < 0) {
if ((rfbScreen->httpListenSock = rfbListenOnTCPPort(rfbScreen->httpPort)) < 0) {
rfbLogPerror("ListenOnTCPPort");
return;
}
@ -117,7 +117,7 @@ httpInitSockets(rfbScreenInfoPtr rfbScreen)
*/
void
httpCheckFds(rfbScreenInfoPtr rfbScreen)
rfbHttpCheckFds(rfbScreenInfoPtr rfbScreen)
{
int nfds;
fd_set fds;
@ -274,15 +274,15 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
if(rfbScreen->httpEnableProxyConnect) {
const static char* PROXY_OK_STR = "HTTP/1.0 200 OK\r\nContent-Type: octet-stream\r\nPragma: no-cache\r\n\r\n";
if(!strncmp(buf, "CONNECT ", 8)) {
if(atoi(strchr(buf, ':')+1)!=rfbScreen->rfbPort) {
if(atoi(strchr(buf, ':')+1)!=rfbScreen->port) {
rfbErr("httpd: CONNECT format invalid.\n");
WriteExact(&cl,INVALID_REQUEST_STR, strlen(INVALID_REQUEST_STR));
rfbWriteExact(&cl,INVALID_REQUEST_STR, strlen(INVALID_REQUEST_STR));
httpCloseSock(rfbScreen);
return;
}
/* proxy connection */
rfbLog("httpd: client asked for CONNECT\n");
WriteExact(&cl,PROXY_OK_STR,strlen(PROXY_OK_STR));
rfbWriteExact(&cl,PROXY_OK_STR,strlen(PROXY_OK_STR));
rfbNewClientConnection(rfbScreen,rfbScreen->httpSock);
rfbScreen->httpSock = -1;
return;
@ -290,7 +290,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
if (!strncmp(buf, "GET ",4) && !strncmp(strchr(buf,'/'),"/proxied.connection HTTP/1.", 27)) {
/* proxy connection */
rfbLog("httpd: client asked for /proxied.connection\n");
WriteExact(&cl,PROXY_OK_STR,strlen(PROXY_OK_STR));
rfbWriteExact(&cl,PROXY_OK_STR,strlen(PROXY_OK_STR));
rfbNewClientConnection(rfbScreen,rfbScreen->httpSock);
rfbScreen->httpSock = -1;
return;
@ -320,14 +320,14 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
if (fname[0] != '/') {
rfbErr("httpd: filename didn't begin with '/'\n");
WriteExact(&cl, NOT_FOUND_STR, strlen(NOT_FOUND_STR));
rfbWriteExact(&cl, NOT_FOUND_STR, strlen(NOT_FOUND_STR));
httpCloseSock(rfbScreen);
return;
}
if (strchr(fname+1, '/') != NULL) {
rfbErr("httpd: asking for file in other directory\n");
WriteExact(&cl, NOT_FOUND_STR, strlen(NOT_FOUND_STR));
rfbWriteExact(&cl, NOT_FOUND_STR, strlen(NOT_FOUND_STR));
httpCloseSock(rfbScreen);
return;
}
@ -366,12 +366,12 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
if ((fd = fopen(fullFname, "r")) == 0) {
rfbLogPerror("httpProcessInput: open");
WriteExact(&cl, NOT_FOUND_STR, strlen(NOT_FOUND_STR));
rfbWriteExact(&cl, NOT_FOUND_STR, strlen(NOT_FOUND_STR));
httpCloseSock(rfbScreen);
return;
}
WriteExact(&cl, OK_STR, strlen(OK_STR));
rfbWriteExact(&cl, OK_STR, strlen(OK_STR));
while (1) {
int n = fread(buf, 1, BUF_SIZE-1, fd);
@ -397,74 +397,74 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
buf[n] = 0; /* make sure it's null-terminated */
while ((dollar = strchr(ptr, '$'))!=NULL) {
WriteExact(&cl, ptr, (dollar - ptr));
rfbWriteExact(&cl, ptr, (dollar - ptr));
ptr = dollar;
if (compareAndSkip(&ptr, "$WIDTH")) {
sprintf(str, "%d", rfbScreen->width);
WriteExact(&cl, str, strlen(str));
rfbWriteExact(&cl, str, strlen(str));
} else if (compareAndSkip(&ptr, "$HEIGHT")) {
sprintf(str, "%d", rfbScreen->height);
WriteExact(&cl, str, strlen(str));
rfbWriteExact(&cl, str, strlen(str));
} else if (compareAndSkip(&ptr, "$APPLETWIDTH")) {
sprintf(str, "%d", rfbScreen->width);
WriteExact(&cl, str, strlen(str));
rfbWriteExact(&cl, str, strlen(str));
} else if (compareAndSkip(&ptr, "$APPLETHEIGHT")) {
sprintf(str, "%d", rfbScreen->height + 32);
WriteExact(&cl, str, strlen(str));
rfbWriteExact(&cl, str, strlen(str));
} else if (compareAndSkip(&ptr, "$PORT")) {
sprintf(str, "%d", rfbScreen->rfbPort);
WriteExact(&cl, str, strlen(str));
sprintf(str, "%d", rfbScreen->port);
rfbWriteExact(&cl, str, strlen(str));
} else if (compareAndSkip(&ptr, "$DESKTOP")) {
WriteExact(&cl, rfbScreen->desktopName, strlen(rfbScreen->desktopName));
rfbWriteExact(&cl, rfbScreen->desktopName, strlen(rfbScreen->desktopName));
} else if (compareAndSkip(&ptr, "$DISPLAY")) {
sprintf(str, "%s:%d", rfbScreen->rfbThisHost, rfbScreen->rfbPort-5900);
WriteExact(&cl, str, strlen(str));
sprintf(str, "%s:%d", rfbScreen->thisHost, rfbScreen->port-5900);
rfbWriteExact(&cl, str, strlen(str));
} else if (compareAndSkip(&ptr, "$USER")) {
#ifndef WIN32
if (user) {
WriteExact(&cl, user,
rfbWriteExact(&cl, user,
strlen(user));
} else
#endif
WriteExact(&cl, "?", 1);
rfbWriteExact(&cl, "?", 1);
} else if (compareAndSkip(&ptr, "$PARAMS")) {
if (params[0] != '\0')
WriteExact(&cl, params, strlen(params));
rfbWriteExact(&cl, params, strlen(params));
} else {
if (!compareAndSkip(&ptr, "$$"))
ptr++;
if (WriteExact(&cl, "$", 1) < 0) {
if (rfbWriteExact(&cl, "$", 1) < 0) {
fclose(fd);
httpCloseSock(rfbScreen);
return;
}
}
}
if (WriteExact(&cl, ptr, (&buf[n] - ptr)) < 0)
if (rfbWriteExact(&cl, ptr, (&buf[n] - ptr)) < 0)
break;
} else {
/* For files not ending .vnc, just write out the buffer */
if (WriteExact(&cl, buf, n) < 0)
if (rfbWriteExact(&cl, buf, n) < 0)
break;
}
}

@ -159,22 +159,22 @@ void rfbScheduleCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,in
rfbReleaseClientIterator(iterator);
}
void rfbDoCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,int dx,int dy)
void rfbDoCopyRegion(rfbScreenInfoPtr screen,sraRegionPtr copyRegion,int dx,int dy)
{
sraRectangleIterator* i;
sraRect rect;
int j,widthInBytes,bpp=rfbScreen->rfbServerFormat.bitsPerPixel/8,
rowstride=rfbScreen->paddedWidthInBytes;
int j,widthInBytes,bpp=screen->serverFormat.bitsPerPixel/8,
rowstride=screen->paddedWidthInBytes;
char *in,*out;
rfbUndrawCursor(rfbScreen);
rfbUndrawCursor(screen);
/* copy it, really */
i = sraRgnGetReverseIterator(copyRegion,dx<0,dy<0);
while(sraRgnIteratorNext(i,&rect)) {
widthInBytes = (rect.x2-rect.x1)*bpp;
out = rfbScreen->frameBuffer+rect.x1*bpp+rect.y1*rowstride;
in = rfbScreen->frameBuffer+(rect.x1-dx)*bpp+(rect.y1-dy)*rowstride;
out = screen->frameBuffer+rect.x1*bpp+rect.y1*rowstride;
in = screen->frameBuffer+(rect.x1-dx)*bpp+(rect.y1-dy)*rowstride;
if(dy<0)
for(j=rect.y1;j<rect.y2;j++,out+=rowstride,in+=rowstride)
memmove(out,in,widthInBytes);
@ -186,27 +186,27 @@ void rfbDoCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,int dx,i
}
}
rfbScheduleCopyRegion(rfbScreen,copyRegion,dx,dy);
rfbScheduleCopyRegion(screen,copyRegion,dx,dy);
}
void rfbDoCopyRect(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y2,int dx,int dy)
void rfbDoCopyRect(rfbScreenInfoPtr screen,int x1,int y1,int x2,int y2,int dx,int dy)
{
sraRegionPtr region = sraRgnCreateRect(x1,y1,x2,y2);
rfbDoCopyRegion(rfbScreen,region,dx,dy);
rfbDoCopyRegion(screen,region,dx,dy);
}
void rfbScheduleCopyRect(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y2,int dx,int dy)
void rfbScheduleCopyRect(rfbScreenInfoPtr screen,int x1,int y1,int x2,int y2,int dx,int dy)
{
sraRegionPtr region = sraRgnCreateRect(x1,y1,x2,y2);
rfbScheduleCopyRegion(rfbScreen,region,dx,dy);
rfbScheduleCopyRegion(screen,region,dx,dy);
}
void rfbMarkRegionAsModified(rfbScreenInfoPtr rfbScreen,sraRegionPtr modRegion)
void rfbMarkRegionAsModified(rfbScreenInfoPtr screen,sraRegionPtr modRegion)
{
rfbClientIteratorPtr iterator;
rfbClientPtr cl;
iterator=rfbGetClientIterator(rfbScreen);
iterator=rfbGetClientIterator(screen);
while((cl=rfbClientIteratorNext(iterator))) {
LOCK(cl->updateMutex);
sraRgnOr(cl->modifiedRegion,modRegion);
@ -217,23 +217,23 @@ void rfbMarkRegionAsModified(rfbScreenInfoPtr rfbScreen,sraRegionPtr modRegion)
rfbReleaseClientIterator(iterator);
}
void rfbMarkRectAsModified(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y2)
void rfbMarkRectAsModified(rfbScreenInfoPtr screen,int x1,int y1,int x2,int y2)
{
sraRegionPtr region;
int i;
if(x1>x2) { i=x1; x1=x2; x2=i; }
if(x1<0) x1=0;
if(x2>=rfbScreen->width) x2=rfbScreen->width-1;
if(x2>=screen->width) x2=screen->width-1;
if(x1==x2) return;
if(y1>y2) { i=y1; y1=y2; y2=i; }
if(y1<0) y1=0;
if(y2>=rfbScreen->height) y2=rfbScreen->height-1;
if(y2>=screen->height) y2=screen->height-1;
if(y1==y2) return;
region = sraRgnCreateRect(x1,y1,x2,y2);
rfbMarkRegionAsModified(rfbScreen,region);
rfbMarkRegionAsModified(screen,region);
sraRgnDestroy(region);
}
@ -269,7 +269,7 @@ clientOutput(void *data)
/* OK, now, to save bandwidth, wait a little while for more
updates to come along. */
usleep(cl->screen->rfbDeferUpdateTime * 1000);
usleep(cl->screen->deferUpdateTime * 1000);
/* Now, get the region we're going to update, and remove
it from cl->modifiedRegion _before_ we send the update.
@ -319,7 +319,7 @@ clientInput(void *data)
static void*
listenerRun(void *data)
{
rfbScreenInfoPtr rfbScreen=(rfbScreenInfoPtr)data;
rfbScreenInfoPtr screen=(rfbScreenInfoPtr)data;
int client_fd;
struct sockaddr_in peer;
rfbClientPtr cl;
@ -328,9 +328,9 @@ listenerRun(void *data)
len = sizeof(peer);
/* TODO: this thread wont die by restarting the server */
while ((client_fd = accept(rfbScreen->rfbListenSock,
while ((client_fd = accept(screen->listenSock,
(struct sockaddr*)&peer, &len)) >= 0) {
cl = rfbNewClient(rfbScreen,client_fd);
cl = rfbNewClient(screen,client_fd);
len = sizeof(peer);
if (cl && !cl->onHold )
@ -363,12 +363,12 @@ rfbRefuseOnHoldClient(rfbClientPtr cl)
}
static void
defaultKbdAddEvent(rfbBool down, rfbKeySym keySym, rfbClientPtr cl)
rfbDefaultKbdAddEvent(rfbBool down, rfbKeySym keySym, rfbClientPtr cl)
{
}
void
defaultPtrAddEvent(int buttonMask, int x, int y, rfbClientPtr cl)
rfbDefaultPtrAddEvent(int buttonMask, int x, int y, rfbClientPtr cl)
{
rfbClientIteratorPtr iterator;
rfbClientPtr other_client;
@ -398,7 +398,7 @@ defaultPtrAddEvent(int buttonMask, int x, int y, rfbClientPtr cl)
}
}
void defaultSetXCutText(char* text, int len, rfbClientPtr cl)
void rfbDefaultSetXCutText(char* text, int len, rfbClientPtr cl)
{
}
@ -431,23 +431,23 @@ static rfbCursor myCursor =
};
#endif
rfbCursorPtr defaultGetCursorPtr(rfbClientPtr cl)
rfbCursorPtr rfbDefaultGetCursorPtr(rfbClientPtr cl)
{
return(cl->screen->cursor);
}
/* response is cl->authChallenge vncEncrypted with passwd */
rfbBool defaultPasswordCheck(rfbClientPtr cl,const char* response,int len)
rfbBool rfbDefaultPasswordCheck(rfbClientPtr cl,const char* response,int len)
{
int i;
char *passwd=vncDecryptPasswdFromFile(cl->screen->rfbAuthPasswdData);
char *passwd=rfbDecryptPasswdFromFile(cl->screen->authPasswdData);
if(!passwd) {
rfbErr("Couldn't read password file: %s\n",cl->screen->rfbAuthPasswdData);
rfbErr("Couldn't read password file: %s\n",cl->screen->authPasswdData);
return(FALSE);
}
vncEncryptBytes(cl->authChallenge, passwd);
rfbEncryptBytes(cl->authChallenge, passwd);
/* Lose the password from memory */
for (i = strlen(passwd); i >= 0; i--) {
@ -457,7 +457,7 @@ rfbBool defaultPasswordCheck(rfbClientPtr cl,const char* response,int len)
free(passwd);
if (memcmp(cl->authChallenge, response, len) != 0) {
rfbErr("rfbAuthProcessClientMessage: authentication failed from %s\n",
rfbErr("authProcessClientMessage: authentication failed from %s\n",
cl->host);
return(FALSE);
}
@ -465,55 +465,55 @@ rfbBool defaultPasswordCheck(rfbClientPtr cl,const char* response,int len)
return(TRUE);
}
/* for this method, rfbAuthPasswdData is really a pointer to an array
/* for this method, authPasswdData is really a pointer to an array
of char*'s, where the last pointer is 0. */
rfbBool rfbCheckPasswordByList(rfbClientPtr cl,const char* response,int len)
{
char **passwds;
int i=0;
for(passwds=(char**)cl->screen->rfbAuthPasswdData;*passwds;passwds++,i++) {
for(passwds=(char**)cl->screen->authPasswdData;*passwds;passwds++,i++) {
uint8_t auth_tmp[CHALLENGESIZE];
memcpy((char *)auth_tmp, (char *)cl->authChallenge, CHALLENGESIZE);
vncEncryptBytes(auth_tmp, *passwds);
rfbEncryptBytes(auth_tmp, *passwds);
if (memcmp(auth_tmp, response, len) == 0) {
if(i>=cl->screen->rfbAuthPasswdFirstViewOnly)
if(i>=cl->screen->authPasswdFirstViewOnly)
cl->viewOnly=TRUE;
return(TRUE);
}
}
rfbErr("rfbAuthProcessClientMessage: authentication failed from %s\n",
rfbErr("authProcessClientMessage: authentication failed from %s\n",
cl->host);
return(FALSE);
}
void doNothingWithClient(rfbClientPtr cl)
void rfbDoNothingWithClient(rfbClientPtr cl)
{
}
enum rfbNewClientAction defaultNewClientHook(rfbClientPtr cl)
enum rfbNewClientAction rfbDefaultNewClientHook(rfbClientPtr cl)
{
return RFB_CLIENT_ACCEPT;
}
/*
* Update server's pixel format in rfbScreenInfo structure. This
* Update server's pixel format in screenInfo structure. This
* function is called from rfbGetScreen() and rfbNewFramebuffer().
*/
static void rfbInitServerFormat(rfbScreenInfoPtr rfbScreen, int bitsPerSample)
static void rfbInitServerFormat(rfbScreenInfoPtr screen, int bitsPerSample)
{
rfbPixelFormat* format=&rfbScreen->rfbServerFormat;
rfbPixelFormat* format=&screen->serverFormat;
format->bitsPerPixel = rfbScreen->bitsPerPixel;
format->depth = rfbScreen->depth;
format->bitsPerPixel = screen->bitsPerPixel;
format->depth = screen->depth;
format->bigEndian = rfbEndianTest?FALSE:TRUE;
format->trueColour = TRUE;
rfbScreen->colourMap.count = 0;
rfbScreen->colourMap.is16 = 0;
rfbScreen->colourMap.data.bytes = NULL;
screen->colourMap.count = 0;
screen->colourMap.is16 = 0;
screen->colourMap.data.bytes = NULL;
if (format->bitsPerPixel == 8) {
format->redMax = 7;
@ -548,104 +548,104 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
int width,int height,int bitsPerSample,int samplesPerPixel,
int bytesPerPixel)
{
rfbScreenInfoPtr rfbScreen=malloc(sizeof(rfbScreenInfo));
rfbScreenInfoPtr screen=malloc(sizeof(rfbScreenInfo));
INIT_MUTEX(logMutex);
if(width&3)
rfbErr("WARNING: Width (%d) is not a multiple of 4. VncViewer has problems with that.\n",width);
rfbScreen->autoPort=FALSE;
rfbScreen->rfbClientHead=0;
rfbScreen->rfbPort=5900;
rfbScreen->socketInitDone=FALSE;
rfbScreen->inetdInitDone = FALSE;
rfbScreen->inetdSock=-1;
rfbScreen->udpSock=-1;
rfbScreen->udpSockConnected=FALSE;
rfbScreen->udpPort=0;
rfbScreen->udpClient=0;
rfbScreen->maxFd=0;
rfbScreen->rfbListenSock=-1;
rfbScreen->httpInitDone=FALSE;
rfbScreen->httpEnableProxyConnect=FALSE;
rfbScreen->httpPort=0;
rfbScreen->httpDir=NULL;
rfbScreen->httpListenSock=-1;
rfbScreen->httpSock=-1;
rfbScreen->desktopName = "LibVNCServer";
rfbScreen->rfbAlwaysShared = FALSE;
rfbScreen->rfbNeverShared = FALSE;
rfbScreen->rfbDontDisconnect = FALSE;
rfbScreen->rfbAuthPasswdData = 0;
rfbScreen->rfbAuthPasswdFirstViewOnly = 1;
screen->autoPort=FALSE;
screen->clientHead=0;
screen->port=5900;
screen->socketInitDone=FALSE;
screen->inetdInitDone = FALSE;
screen->inetdSock=-1;
screen->udpSock=-1;
screen->udpSockConnected=FALSE;
screen->udpPort=0;
screen->udpClient=0;
screen->maxFd=0;
screen->listenSock=-1;
screen->httpInitDone=FALSE;
screen->httpEnableProxyConnect=FALSE;
screen->httpPort=0;
screen->httpDir=NULL;
screen->httpListenSock=-1;
screen->httpSock=-1;
screen->desktopName = "LibVNCServer";
screen->alwaysShared = FALSE;
screen->neverShared = FALSE;
screen->dontDisconnect = FALSE;
screen->authPasswdData = 0;
screen->authPasswdFirstViewOnly = 1;
rfbScreen->width = width;
rfbScreen->height = height;
rfbScreen->bitsPerPixel = rfbScreen->depth = 8*bytesPerPixel;
screen->width = width;
screen->height = height;
screen->bitsPerPixel = screen->depth = 8*bytesPerPixel;
rfbScreen->passwordCheck = defaultPasswordCheck;
screen->passwordCheck = rfbDefaultPasswordCheck;
rfbScreen->ignoreSIGPIPE = TRUE;
screen->ignoreSIGPIPE = TRUE;
/* disable progressive updating per default */
rfbScreen->progressiveSliceHeight = 0;
screen->progressiveSliceHeight = 0;
if(!rfbProcessArguments(rfbScreen,argc,argv)) {
free(rfbScreen);
if(!rfbProcessArguments(screen,argc,argv)) {
free(screen);
return 0;
}
#ifdef WIN32
{
DWORD dummy=255;
GetComputerName(rfbScreen->rfbThisHost,&dummy);
GetComputerName(screen->thisHost,&dummy);
}
#else
gethostname(rfbScreen->rfbThisHost, 255);
gethostname(screen->thisHost, 255);
#endif
rfbScreen->paddedWidthInBytes = width*bytesPerPixel;
screen->paddedWidthInBytes = width*bytesPerPixel;
/* format */
rfbInitServerFormat(rfbScreen, bitsPerSample);
rfbInitServerFormat(screen, bitsPerSample);
/* cursor */
rfbScreen->cursorIsDrawn = FALSE;
rfbScreen->dontSendFramebufferUpdate = FALSE;
rfbScreen->cursorX=rfbScreen->cursorY=rfbScreen->underCursorBufferLen=0;
rfbScreen->underCursorBuffer=NULL;
rfbScreen->dontConvertRichCursorToXCursor = FALSE;
rfbScreen->cursor = &myCursor;
INIT_MUTEX(rfbScreen->cursorMutex);
screen->cursorIsDrawn = FALSE;
screen->dontSendFramebufferUpdate = FALSE;
screen->cursorX=screen->cursorY=screen->underCursorBufferLen=0;
screen->underCursorBuffer=NULL;
screen->dontConvertRichCursorToXCursor = FALSE;
screen->cursor = &myCursor;
INIT_MUTEX(screen->cursorMutex);
IF_PTHREADS(rfbScreen->backgroundLoop = FALSE);
IF_PTHREADS(screen->backgroundLoop = FALSE);
rfbScreen->rfbDeferUpdateTime=5;
rfbScreen->maxRectsPerUpdate=50;
screen->deferUpdateTime=5;
screen->maxRectsPerUpdate=50;
/* proc's and hook's */
rfbScreen->kbdAddEvent = defaultKbdAddEvent;
rfbScreen->kbdReleaseAllKeys = doNothingWithClient;
rfbScreen->ptrAddEvent = defaultPtrAddEvent;
rfbScreen->setXCutText = defaultSetXCutText;
rfbScreen->getCursorPtr = defaultGetCursorPtr;
rfbScreen->setTranslateFunction = rfbSetTranslateFunction;
rfbScreen->newClientHook = defaultNewClientHook;
rfbScreen->displayHook = 0;
screen->kbdAddEvent = rfbDefaultKbdAddEvent;
screen->kbdReleaseAllKeys = rfbDoNothingWithClient;
screen->ptrAddEvent = rfbDefaultPtrAddEvent;
screen->setXCutText = rfbDefaultSetXCutText;
screen->getCursorPtr = rfbDefaultGetCursorPtr;
screen->setTranslateFunction = rfbSetTranslateFunction;
screen->newClientHook = rfbDefaultNewClientHook;
screen->displayHook = 0;
/* initialize client list and iterator mutex */
rfbClientListInit(rfbScreen);
rfbClientListInit(screen);
return(rfbScreen);
return(screen);
}
/*
@ -656,7 +656,7 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
* the caller.
*/
void rfbNewFramebuffer(rfbScreenInfoPtr rfbScreen, char *framebuffer,
void rfbNewFramebuffer(rfbScreenInfoPtr screen, char *framebuffer,
int width, int height,
int bitsPerSample, int samplesPerPixel,
int bytesPerPixel)
@ -668,44 +668,44 @@ void rfbNewFramebuffer(rfbScreenInfoPtr rfbScreen, char *framebuffer,
/* Remove the pointer */
rfbUndrawCursor(rfbScreen);
rfbUndrawCursor(screen);
/* Update information in the rfbScreenInfo structure */
/* Update information in the screenInfo structure */
old_format = rfbScreen->rfbServerFormat;
old_format = screen->serverFormat;
if (width & 3)
rfbErr("WARNING: New width (%d) is not a multiple of 4.\n", width);
rfbScreen->width = width;
rfbScreen->height = height;
rfbScreen->bitsPerPixel = rfbScreen->depth = 8*bytesPerPixel;
rfbScreen->paddedWidthInBytes = width*bytesPerPixel;
screen->width = width;
screen->height = height;
screen->bitsPerPixel = screen->depth = 8*bytesPerPixel;
screen->paddedWidthInBytes = width*bytesPerPixel;
<