Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
libvncserver
Commits
598c460c
Commit
598c460c
authored
Aug 19, 2002
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unwarn compilation
parent
fde8958d
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
927 additions
and
924 deletions
+927
-924
Makefile
Makefile
+2
-2
auth.c
auth.c
+1
-1
cursor.c
cursor.c
+2
-2
example.c
example.c
+7
-7
httpd.c
httpd.c
+2
-2
main.c
main.c
+5
-3
pnmshow.c
pnmshow.c
+1
-1
rfb.h
rfb.h
+7
-6
rfbserver.c
rfbserver.c
+8
-0
sraRegion.c
sraRegion.c
+829
-829
sraRegion.h
sraRegion.h
+60
-60
tight.c
tight.c
+2
-11
vncauth.c
vncauth.c
+1
-0
No files found.
Makefile
View file @
598c460c
...
...
@@ -2,7 +2,7 @@ INCLUDES=-I.
VNCSERVERLIB
=
-L
.
-lvncserver
-L
/usr/local/lib
-lz
-ljpeg
# for Solaris
#
CC=gcc
CC
=
gcc
#EXTRALIBS=-lsocket -lnsl -L/usr/X/lib
# for FreeBSD
...
...
@@ -16,7 +16,7 @@ VNCSERVERLIB=-L. -lvncserver -L/usr/local/lib -lz -ljpeg
# The code for 3 Bytes/Pixel is not very efficient!
FLAG24
=
-DALLOW24BPP
OPTFLAGS
=
-g
-Wall
OPTFLAGS
=
-g
-Wall
-pedantic
#OPTFLAGS=-O2 -Wall
CFLAGS
=
$(OPTFLAGS)
$(PTHREADDEF)
$(FLAG24)
$(INCLUDES)
$(EXTRAINCLUDES)
-DBACKCHANNEL
RANLIB
=
ranlib
...
...
auth.c
View file @
598c460c
...
...
@@ -84,7 +84,7 @@ rfbAuthProcessClientMessage(cl)
return
;
}
if
(
!
cl
->
screen
->
passwordCheck
(
cl
,
response
,
CHALLENGESIZE
))
{
if
(
!
cl
->
screen
->
passwordCheck
(
cl
,
(
const
char
*
)
response
,
CHALLENGESIZE
))
{
rfbLog
(
"rfbAuthProcessClientMessage: password check failed
\n
"
);
authResult
=
Swap32IfLE
(
rfbVncAuthFailed
);
if
(
WriteExact
(
cl
,
(
char
*
)
&
authResult
,
4
)
<
0
)
{
...
...
cursor.c
View file @
598c460c
...
...
@@ -143,7 +143,7 @@ rfbSendCursorShape(cl)
bpp2
=
cl
->
format
.
bitsPerPixel
/
8
;
(
*
cl
->
translateFn
)(
cl
->
translateLookupTable
,
&
(
cl
->
screen
->
rfbServerFormat
),
&
cl
->
format
,
pCursor
->
richSource
,
&
cl
->
format
,
(
char
*
)
pCursor
->
richSource
,
&
cl
->
updateBuf
[
cl
->
ublen
],
pCursor
->
width
*
bpp1
,
pCursor
->
width
,
pCursor
->
height
);
...
...
@@ -241,7 +241,7 @@ rfbCursorPtr rfbMakeXCursor(int width,int height,char* cursorString,char* maskSt
for
(
i
=
0
,
bit
=
0x80
;
i
<
width
;
i
++
,
bit
=
(
bit
&
1
)
?
0x80
:
bit
>>
1
,
cp
++
)
if
(
*
cp
!=
' '
)
cursor
->
mask
[
j
*
w
+
i
/
8
]
|=
bit
;
}
else
cursor
->
mask
=
(
unsigned
char
*
)
rfbMakeMaskForXCursor
(
width
,
height
,
cursor
->
source
);
cursor
->
mask
=
(
unsigned
char
*
)
rfbMakeMaskForXCursor
(
width
,
height
,
(
char
*
)
cursor
->
source
);
return
(
cursor
);
}
...
...
example.c
View file @
598c460c
...
...
@@ -79,14 +79,14 @@ enum rfbNewClientAction newclient(rfbClientPtr cl)
void
newframebuffer
(
rfbScreenInfoPtr
screen
,
int
width
,
int
height
)
{
char
*
oldfb
,
*
newfb
;
unsigned
char
*
oldfb
,
*
newfb
;
maxx
=
width
;
maxy
=
height
;
oldfb
=
screen
->
frameBuffer
;
newfb
=
(
char
*
)
malloc
(
maxx
*
maxy
*
bpp
);
oldfb
=
(
unsigned
char
*
)
screen
->
frameBuffer
;
newfb
=
(
unsigned
char
*
)
malloc
(
maxx
*
maxy
*
bpp
);
initBuffer
(
newfb
);
rfbNewFramebuffer
(
screen
,
newfb
,
maxx
,
maxy
,
8
,
3
,
bpp
);
rfbNewFramebuffer
(
screen
,
(
char
*
)
newfb
,
maxx
,
maxy
,
8
,
3
,
bpp
);
free
(
oldfb
);
/*** FIXME: Re-install cursor. ***/
...
...
@@ -133,7 +133,7 @@ void doptr(int buttonMask,int x,int y,rfbClientPtr cl)
int
i
,
j
,
x1
,
x2
,
y1
,
y2
;
if
(
cd
->
oldButton
==
buttonMask
)
{
/* draw a line */
drawline
(
cl
->
screen
->
frameBuffer
,
cl
->
screen
->
paddedWidthInBytes
,
bpp
,
drawline
(
(
unsigned
char
*
)
cl
->
screen
->
frameBuffer
,
cl
->
screen
->
paddedWidthInBytes
,
bpp
,
x
,
y
,
cd
->
oldx
,
cd
->
oldy
);
rfbMarkRectAsModified
(
cl
->
screen
,
x
,
y
,
cd
->
oldx
,
cd
->
oldy
);
}
else
{
/* draw a point (diameter depends on button) */
...
...
@@ -174,7 +174,7 @@ void dokey(Bool down,KeySym key,rfbClientPtr cl)
else
if
(
key
==
XK_Page_Up
)
{
if
(
cl
->
screen
->
cursorIsDrawn
)
rfbUndrawCursor
(
cl
->
screen
);
initBuffer
(
cl
->
screen
->
frameBuffer
);
initBuffer
(
(
unsigned
char
*
)
cl
->
screen
->
frameBuffer
);
rfbMarkRectAsModified
(
cl
->
screen
,
0
,
0
,
maxx
,
maxy
);
}
else
if
(
key
==
XK_Up
)
{
if
(
maxx
<
1024
)
{
...
...
@@ -283,7 +283,7 @@ int main(int argc,char** argv)
rfbScreen
->
newClientHook
=
newclient
;
rfbScreen
->
httpDir
=
"./classes"
;
initBuffer
(
rfbScreen
->
frameBuffer
);
initBuffer
(
(
unsigned
char
*
)
rfbScreen
->
frameBuffer
);
rfbDrawString
(
rfbScreen
,
&
radonFont
,
20
,
100
,
"Hello, World!"
,
0xffffff
);
/* This call creates a mask and then a cursor: */
...
...
httpd.c
View file @
598c460c
...
...
@@ -22,6 +22,7 @@
*/
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#ifdef WIN32
#include <winsock.h>
...
...
@@ -68,7 +69,6 @@ FILE* httpFP = NULL;
static
char
buf
[
BUF_SIZE
];
static
size_t
buf_filled
=
0
;
/*
* httpInitSockets sets up the TCP socket to listen for HTTP connections.
*/
...
...
@@ -303,7 +303,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
/* Open the file */
if
((
fd
=
fopen
(
fullFname
,
"r"
))
<
=
0
)
{
if
((
fd
=
fopen
(
fullFname
,
"r"
))
=
=
0
)
{
rfbLogPerror
(
"httpProcessInput: open"
);
WriteExact
(
&
cl
,
NOT_FOUND_STR
,
strlen
(
NOT_FOUND_STR
));
httpCloseSock
(
rfbScreen
);
...
...
main.c
View file @
598c460c
...
...
@@ -32,7 +32,9 @@
#include "rfb.h"
#include "sraRegion.h"
#ifdef HAVE_PTHREADS
MUTEX
(
logMutex
);
#endif
int
rfbEnableLogging
=
1
;
...
...
@@ -380,11 +382,11 @@ void defaultSetXCutText(char* text, int len, rfbClientPtr cl)
/* TODO: add a nice VNC or RFB cursor */
#if defined(WIN32) || defined(sparc)
#if defined(WIN32) || defined(sparc)
|| !defined(NO_STRICT_ANSI)
static
rfbCursor
myCursor
=
{
"
\000\102\044\030\044\102\000
"
,
"
\347\347\176\074\176\347\347
"
,
(
unsigned
char
*
)
"
\000\102\044\030\044\102\000
"
,
(
unsigned
char
*
)
"
\347\347\176\074\176\347\347
"
,
8
,
7
,
3
,
3
,
0
,
0
,
0
,
0xffff
,
0xffff
,
0xffff
,
...
...
pnmshow.c
View file @
598c460c
...
...
@@ -12,7 +12,7 @@ int main(int argc,char** argv)
{
FILE
*
in
=
stdin
;
int
i
,
j
,
k
,
width
,
height
,
paddedWidth
;
unsigned
char
buffer
[
1024
];
char
buffer
[
1024
];
rfbScreenInfoPtr
rfbScreen
;
if
(
argc
>
1
)
{
...
...
rfb.h
View file @
598c460c
...
...
@@ -45,12 +45,9 @@ typedef CARD32 Pixel;
/* typedef CARD32 KeySym; */
typedef
unsigned
long
KeySym
;
#define SIGNED signed
/* for some strange reason, "typedef signed char Bool;" yields a four byte
signed int on IRIX, but only for rfbserver.o!!! */
#ifdef Bool
#undef Bool
#endif
#define Bool signed char
typedef
signed
char
Bool
;
#undef FALSE
#define FALSE 0
#undef TRUE
...
...
@@ -90,6 +87,10 @@ typedef unsigned long KeySym;
#include <sys/endian.h>
#endif
#ifdef __sgi__
typedef
int
socklen_t
;
#endif
#ifndef _BYTE_ORDER
#define _BYTE_ORDER __BYTE_ORDER
#endif
...
...
rfbserver.c
View file @
598c460c
...
...
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "rfb.h"
#include "sraRegion.h"
#ifdef WIN32
...
...
@@ -76,7 +77,9 @@ void rfbIncrClientRef(rfbClientPtr cl) {}
void
rfbDecrClientRef
(
rfbClientPtr
cl
)
{}
#endif
#ifdef HAVE_PTHREADS
MUTEX
(
rfbClientListMutex
);
#endif
struct
rfbClientIterator
{
rfbClientPtr
next
;
...
...
@@ -86,6 +89,11 @@ struct rfbClientIterator {
void
rfbClientListInit
(
rfbScreenInfoPtr
rfbScreen
)
{
if
(
sizeof
(
Bool
)
!=
1
)
{
/* a sanity check */
fprintf
(
stderr
,
"Bool's size is not 1 (%d)!
\n
"
,
sizeof
(
Bool
));
exit
(
1
);
}
rfbScreen
->
rfbClientHead
=
NULL
;
INIT_MUTEX
(
rfbClientListMutex
);
}
...
...
sraRegion.c
View file @
598c460c
sraRegion.h
View file @
598c460c
tight.c
View file @
598c460c
...
...
@@ -429,12 +429,7 @@ ExtendSolidArea(cl, x, y, w, h, colorValue, x_ptr, y_ptr, w_ptr, h_ptr)
*
w_ptr
+=
cx
-
(
*
x_ptr
+
*
w_ptr
);
}
static
Bool
CheckSolidTile
(
cl
,
x
,
y
,
w
,
h
,
colorPtr
,
needSameColor
)
rfbClientPtr
cl
;
int
x
,
y
,
w
,
h
;
CARD32
*
colorPtr
;
Bool
needSameColor
;
static
Bool
CheckSolidTile
(
rfbClientPtr
cl
,
int
x
,
int
y
,
int
w
,
int
h
,
CARD32
*
colorPtr
,
Bool
needSameColor
)
{
switch
(
cl
->
screen
->
rfbServerFormat
.
bitsPerPixel
)
{
case
32
:
...
...
@@ -449,11 +444,7 @@ CheckSolidTile(cl, x, y, w, h, colorPtr, needSameColor)
#define DEFINE_CHECK_SOLID_FUNCTION(bpp) \
\
static Bool \
CheckSolidTile##bpp(cl, x, y, w, h, colorPtr, needSameColor) \
rfbClientPtr cl; \
int x, y, w, h; \
CARD32 *colorPtr; \
Bool needSameColor; \
CheckSolidTile##bpp(rfbClientPtr cl, int x, int y, int w, int h, CARD32* colorPtr, Bool needSameColor) \
{ \
CARD##bpp *fbptr; \
CARD##bpp colorValue; \
...
...
vncauth.c
View file @
598c460c
...
...
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment