Commit 13b358fe authored by dscho's avatar dscho

fixed maxRectsPerUpdate with Tight encoding bug; some autoconfing; stderr...

fixed maxRectsPerUpdate with Tight encoding bug; some autoconfing; stderr should not be used in a library (use rfbLog instead)
parent eef408c1
CFLAGS=-g
SUBDIRS=. examples contrib vncterm classes
DIST_SUBDIRS=examples contrib vncterm classes
SUBDIRS=. examples contrib vncterm classes libvncclient test
DIST_SUBDIRS=examples contrib vncterm classes libvncclient test
bin_SCRIPTS = libvncserver-config
......
This diff is collapsed.
This diff is collapsed.
# Makefile.in generated automatically by automake 1.5 from Makefile.am.
# Makefile.in generated by automake 1.6.3 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -12,7 +13,6 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
SHELL = @SHELL@
srcdir = @srcdir@
......@@ -43,9 +43,13 @@ AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
......@@ -55,18 +59,21 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@
AWK = @AWK@
CC = @CC@
CCLD = @CCLD@
CXX = @CXX@
DEPDIR = @DEPDIR@
EXEEXT = @EXEEXT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
RPMSOURCEDIR = @RPMSOURCEDIR@
STRIP = @STRIP@
VERSION = @VERSION@
X_CFLAGS = @X_CFLAGS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
......@@ -75,7 +82,6 @@ X_PRE_LIBS = @X_PRE_LIBS@
am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
EXTRA_DIST = VncViewer.jar index.vnc javaviewer.pseudo_proxy.patch
subdir = classes
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
......@@ -90,29 +96,31 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu classes/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && \
CONFIG_HEADERS= CONFIG_LINKS= \
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
uninstall-info-am:
tags: TAGS
TAGS:
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
@list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
$(mkinstalldirs) "$(distdir)/$$dir"; \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \
|| exit 1; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
......@@ -136,6 +144,7 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
......@@ -143,7 +152,7 @@ mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
......
This diff is collapsed.
......@@ -122,6 +122,8 @@ AC_CONFIG_FILES([Makefile
examples/Makefile
vncterm/Makefile
classes/Makefile
libvncclient/Makefile
test/Makefile
libvncserver.spec
libvncserver-config])
AC_OUTPUT
......
# Makefile.in generated automatically by automake 1.5 from Makefile.am.
# Makefile.in generated by automake 1.6.3 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -12,7 +13,6 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
SHELL = @SHELL@
srcdir = @srcdir@
......@@ -43,9 +43,13 @@ AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
......@@ -55,18 +59,21 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@
AWK = @AWK@
CC = @CC@
CCLD = @CCLD@
CXX = @CXX@
DEPDIR = @DEPDIR@
EXEEXT = @EXEEXT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
RPMSOURCEDIR = @RPMSOURCEDIR@
STRIP = @STRIP@
VERSION = @VERSION@
X_CFLAGS = @X_CFLAGS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
......@@ -75,7 +82,6 @@ X_PRE_LIBS = @X_PRE_LIBS@
am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
CFLAGS = -I ..
LDADD = ../libvncserver.a
......@@ -97,7 +103,6 @@ noinst_PROGRAMS = zippy$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
@HAVE_X_TRUE@am_x11vnc_OBJECTS = x11vnc.$(OBJEXT)
@HAVE_X_FALSE@am_x11vnc_OBJECTS =
x11vnc_OBJECTS = $(am_x11vnc_OBJECTS)
@HAVE_X_TRUE@x11vnc_DEPENDENCIES = ../libvncserver.a
@HAVE_X_FALSE@x11vnc_DEPENDENCIES =
......@@ -114,7 +119,8 @@ CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
depcomp = $(SHELL) $(top_srcdir)/depcomp
@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/x11vnc.Po $(DEPDIR)/zippy.Po
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/x11vnc.Po ./$(DEPDIR)/zippy.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
......@@ -130,9 +136,8 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu contrib/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && \
CONFIG_HEADERS= CONFIG_LINKS= \
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir)
......@@ -140,16 +145,16 @@ install-binPROGRAMS: $(bin_PROGRAMS)
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
; then \
f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f; \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
$(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
rm -f $(DESTDIR)$(bindir)/$$f; \
done
......@@ -172,17 +177,17 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/x11vnc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/zippy.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x11vnc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zippy.Po@am__quote@
distclean-depend:
-rm -rf $(DEPDIR)
-rm -rf ./$(DEPDIR)
.c.o:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$<
$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
.c.obj:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
......@@ -192,53 +197,61 @@ distclean-depend:
CCDEPMODE = @CCDEPMODE@
uninstall-info-am:
ETAGS = etags
ETAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique $(LISP)
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`CDPATH=: && cd $(top_builddir) && pwd` \
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
@list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
$(mkinstalldirs) "$(distdir)/$$dir"; \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \
|| exit 1; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
......@@ -263,6 +276,7 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
......@@ -270,7 +284,7 @@ mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
......
......@@ -414,7 +414,7 @@ void initialize_keycodes() {
void DebugXTestFakeKeyEvent(Display* dpy, KeyCode keysym, Bool down, time_t cur_time)
{
fprintf(stderr,"XTestFakeKeyEvent(dpy,%s(0x%x),%s,CurrentTime)\n",
rfbLog("XTestFakeKeyEvent(dpy,%s(0x%x),%s,CurrentTime)\n",
XKeysymToString(XKeycodeToKeysym(dpy,keysym,0)),keysym,
down?"down":"up");
XTestFakeKeyEvent(dpy,keysym,down,cur_time);
......@@ -500,7 +500,7 @@ static void keyboard(Bool down, KeySym keysym, rfbClientPtr client) {
if (0) {
X_LOCK;
fprintf(stderr,"keyboard(%s,%s(0x%x),client)\n",
rfbLog("keyboard(%s,%s(0x%x),client)\n",
down?"down":"up",XKeysymToString(keysym),(int)keysym);
X_UNLOCK;
}
......@@ -1153,7 +1153,7 @@ void shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h,
xim = XShmCreateImage(dpy, visual, bpp, ZPixmap, NULL, shm, w, h);
if (xim == NULL) {
fprintf(stderr, "XShmCreateImage(%s) failed.\n", name);
rfbLog( "XShmCreateImage(%s) failed.\n", name);
exit(1);
}
......@@ -1163,7 +1163,7 @@ void shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h,
xim->bytes_per_line * xim->height, IPC_CREAT | 0777);
if (shm->shmid == -1) {
fprintf(stderr, "shmget(%s) failed.\n", name);
rfbLog("shmget(%s) failed.\n", name);
perror("shmget");
exit(1);
}
......@@ -1171,7 +1171,7 @@ void shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h,
shm->shmaddr = xim->data = (char *) shmat(shm->shmid, 0, 0);
if (shm->shmaddr == (char *)-1) {
fprintf(stderr, "shmat(%s) failed.\n", name);
rfbLog("shmat(%s) failed.\n", name);
perror("shmat");
exit(1);
}
......@@ -1179,7 +1179,7 @@ void shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h,
shm->readOnly = False;
if (! XShmAttach(dpy, shm)) {
fprintf(stderr, "XShmAttach(%s) failed.\n", name);
rfbLog("XShmAttach(%s) failed.\n", name);
exit(1);
}
......
......@@ -148,7 +148,7 @@ void on_key_press (Bool down,KeySym key,rfbClientPtr cl)
blank_framebuffer(cl->screen->frameBuffer, 0, 0, maxx, maxy);
rfbDrawString(cl->screen,&default8x16Font,20,maxy-20,"Hello, World!",0xffffff);
rfbMarkRectAsModified(cl->screen,0, 0,maxx,maxy);
fprintf (stderr, "Framebuffer blanked\n");
rfbLog("Framebuffer blanked\n");
break;
case XK_p:
case XK_P:
......@@ -156,11 +156,11 @@ void on_key_press (Bool down,KeySym key,rfbClientPtr cl)
/* draw_primary_colors (cl->screen->frameBuffer, 0, 0, maxx, maxy); */
draw_primary_colours_generic_ultrafast (cl->screen, 0, 0, maxx, maxy);
rfbMarkRectAsModified(cl->screen,0, 0,maxx,maxy);
fprintf (stderr, "Primary colors displayed\n");
rfbLog("Primary colors displayed\n");
break;
case XK_Q:
case XK_q:
fprintf (stderr, "Exiting now\n");
rfbLog("Exiting now\n");
exit(0);
case XK_C:
case XK_c:
......@@ -169,7 +169,7 @@ void on_key_press (Bool down,KeySym key,rfbClientPtr cl)
rfbMarkRectAsModified(cl->screen,0, 0,maxx,maxy);
break;
default:
fprintf (stderr, "The %c key was pressed\n", (char) key);
rfbLog("The %c key was pressed\n", (char) key);
}
}
......
......@@ -68,7 +68,7 @@ int get_next_message(char* buffer,int len,single_instance_struct* str,int usecs)
}
buffer[reallen]=0;
#ifdef DEBUG_1INSTANCE
if(reallen!=0) fprintf(stderr,"message received: %s.\n",buffer);
if(reallen!=0) rfbLog("message received: %s.\n",buffer);
#endif
}
......@@ -104,7 +104,7 @@ void send_message(single_instance_struct* str,char* message)
#endif
write(str->fd,message,strlen(message));
#ifdef DEBUG_1INSTANCE
fprintf(stderr,"send: %s => %d(%d)\n",message,i,strlen(message));
rfbLog("send: %s => %d(%d)\n",message,i,strlen(message));
#endif
}
......@@ -118,7 +118,7 @@ single_instance_struct str1 = { "/tmp/1instance" };
void my_dispatcher(char* message)
{
#ifdef DEBUG_1INSTANCE
fprintf(stderr,"Message arrived: %s.\n",message);
rfbLog("Message arrived: %s.\n",message);
#endif
if(!strcmp(message,"quit")) {
delete_control_file(str1);
......
# Makefile.in generated automatically by automake 1.5 from Makefile.am.
# Makefile.in generated by automake 1.6.3 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -12,7 +13,6 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
SHELL = @SHELL@
srcdir = @srcdir@
......@@ -43,9 +43,13 @@ AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
......@@ -55,18 +59,21 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@
AWK = @AWK@
CC = @CC@
CCLD = @CCLD@
CXX = @CXX@
DEPDIR = @DEPDIR@
EXEEXT = @EXEEXT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
RPMSOURCEDIR = @RPMSOURCEDIR@
STRIP = @STRIP@
VERSION = @VERSION@
X_CFLAGS = @X_CFLAGS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
......@@ -75,7 +82,6 @@ X_PRE_LIBS = @X_PRE_LIBS@
am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
CFLAGS = -I.. -g -Wall
@HAVE_LIBPTHREAD_TRUE@BACKGROUND_TEST = blooptest
......@@ -203,13 +209,14 @@ CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
depcomp = $(SHELL) $(top_srcdir)/depcomp
@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/blooptest.Po \
@AMDEP_TRUE@ $(DEPDIR)/colourmaptest.Po $(DEPDIR)/example.Po \
@AMDEP_TRUE@ $(DEPDIR)/fontsel.Po $(DEPDIR)/mac.Po \
@AMDEP_TRUE@ $(DEPDIR)/pnmshow.Po $(DEPDIR)/pnmshow24.Po \
@AMDEP_TRUE@ $(DEPDIR)/regiontest.Po $(DEPDIR)/simple.Po \
@AMDEP_TRUE@ $(DEPDIR)/simple15.Po $(DEPDIR)/storepasswd.Po \
@AMDEP_TRUE@ $(DEPDIR)/vncev.Po
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/blooptest.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/colourmaptest.Po ./$(DEPDIR)/example.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/fontsel.Po ./$(DEPDIR)/mac.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/pnmshow.Po ./$(DEPDIR)/pnmshow24.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/regiontest.Po ./$(DEPDIR)/simple.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/simple15.Po ./$(DEPDIR)/storepasswd.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/vncev.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
......@@ -229,9 +236,7 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu examples/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && \
CONFIG_HEADERS= CONFIG_LINKS= \
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
......@@ -278,27 +283,27 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/blooptest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/colourmaptest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/example.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/fontsel.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/mac.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pnmshow.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pnmshow24.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/regiontest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/simple.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/simple15.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/storepasswd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/vncev.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blooptest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colourmaptest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fontsel.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mac.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pnmshow.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pnmshow24.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regiontest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple15.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/storepasswd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vncev.Po@am__quote@
distclean-depend:
-rm -rf $(DEPDIR)
-rm -rf ./$(DEPDIR)
.c.o:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$<
$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
.c.obj:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
......@@ -308,53 +313,61 @@ distclean-depend:
CCDEPMODE = @CCDEPMODE@
uninstall-info-am:
ETAGS = etags
ETAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique $(LISP)
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`CDPATH=: && cd $(top_builddir) && pwd` \
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
@list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
$(mkinstalldirs) "$(distdir)/$$dir"; \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \
|| exit 1; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
......@@ -378,6 +391,7 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
......@@ -385,7 +399,7 @@ mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
......
......@@ -54,7 +54,7 @@ int main(int argc,char** argv)
rfbScreen = s;
font=rfbLoadConsoleFont(DEFAULTFONT);
if(!font) {
fprintf(stderr,"Couldn't find %s\n",DEFAULTFONT);
rfbLog("Couldn't find %s\n",DEFAULTFONT);
exit(1);
}
......@@ -62,7 +62,7 @@ int main(int argc,char** argv)
rfbProcessEvents(s,900000);
i = rfbSelectBox(s,font,fontlist,10,20,200,300,0xffdfdf,0x602040,2,showFont);
fprintf(stderr,"Selection: %d: %s\n",i,(i>=0)?fontlist[i]:"cancelled");
rfbLog("Selection: %d: %s\n",i,(i>=0)?fontlist[i]:"cancelled");
rfbFreeFont(font);
......
......@@ -493,7 +493,7 @@ refreshCallback(CGRectCount count, const CGRect *rectArray, void *ignore)
rfbClientPtr cl;
int i;
for(i=0,cl=rfbScreen->rfbClientHead;cl;cl=cl->next,i++)
fprintf(stderr,"%02d: %s\n",i,cl->host);
rfbLog("%02d: %s\n",i,cl->host);
} else if(message[0]=='t') {
rfbClientPtr cl;
for(cl=rfbScreen->rfbClientHead;cl;cl=cl->next)
......@@ -556,7 +556,7 @@ int main(int argc,char *argv[])
send_message(&single_instance,message);
exit(0);
} else if(!strcmp(argv[i],"-listclients")) {
fprintf(stderr,"list clients\n");
rfbLog("list clients\n");
send_message(&single_instance,"l");
exit(0);
} else
......
......@@ -36,7 +36,7 @@ int main(int argc,char** argv)
/* get width & height */
sscanf(buffer,"%d %d",&width,&height);
fprintf(stderr,"Got width %d and height %d.\n",width,height);
rfbLog("Got width %d and height %d.\n",width,height);
fgets(buffer,1024,in);
/* vncviewers have problems with widths which are no multiple of 4. */
......
......@@ -40,7 +40,7 @@ int main(int argc,char** argv)
/* get width & height */
sscanf(buffer,"%d %d",&width,&height);
fprintf(stderr,"Got width %d and height %d.\n",width,height);
rfbLog("Got width %d and height %d.\n",width,height);
fgets(buffer,1024,in);
/* vncviewers have problems with widths which are no multiple of 4. */
......
......@@ -63,7 +63,7 @@ void output(rfbScreenInfoPtr s,char* line)
{
rfbDoCopyRect(s,0,0,640,480-lineHeight,0,-lineHeight);
rfbDrawString(s,&default8x16Font,10,lineY,line,0x01);
fprintf(stderr,"%s\n",line);
rfbLog("%s\n",line);
}
void dokey(Bool down,KeySym k,rfbClientPtr cl)
......
This diff is collapsed.
CFLAGS=-g -I.. -I. -Wall
libvncclient_a_SOURCES=cursor.c listen.c rfbproto.c sockets.c vncviewer.c
rfbproto.o: rfbproto.c corre.c hextile.c rre.c tight.c zlib.c
EXTRA_DIST=corre.c hextile.c rre.c tight.c zlib.c
$(libvncclient_a_OBJECTS): ../rfb/rfbclient.h
lib_LIBRARIES=libvncclient.a
client_test_SOURCES=client_test.c
noinst_PROGRAMS=client_test
#client_test_LDADD=libvncclient.a ../libvncserver.a
client_test_LDADD=libvncclient.a
This diff is collapsed.
/* A simple example of an RFB client */
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <rfb/rfbclient.h>
void PrintRect(rfbClient* client, int x, int y, int w, int h) {
rfbClientLog("Received an update for %d,%d,%d,%d.\n",x,y,w,h);
}
void SaveFramebufferAsPGM(rfbClient* client, int x, int y, int w, int h) {
static time_t t=0,t1;
FILE* f;
int i,j;
int bpp=client->format.bitsPerPixel/8;
int row_stride=client->width*bpp;
/* save one picture only if the last is older than 2 seconds */
t1=time(0);
if(t1-t>2)
t=t1;
else
return;
/* assert bpp=4 */
if(bpp!=4) {
rfbClientLog("bpp = %d (!=4)\n",bpp);
return;
}
f=fopen("/tmp/framebuffer.ppm","wb");
fprintf(f,"P6\n# %s\n%d %d\n255\n",client->desktopName,client->width,client->height);
for(j=0;j<client->height*row_stride;j+=row_stride)
for(i=0;i<client->width*bpp;i+=bpp) {
if(client->format.bigEndian) {
fputc(client->frameBuffer[j+i+bpp-1],f);
fputc(client->frameBuffer[j+i+bpp-2],f);
fputc(client->frameBuffer[j+i+bpp-3],f);
} else {
fputc(client->frameBuffer[j+i+bpp+0],f);
fputc(client->frameBuffer[j+i+bpp+1],f);
fputc(client->frameBuffer[j+i+bpp+2],f);
}
}
fclose(f);
}
int
main(int argc, char **argv)
{
int i;
rfbClient* client = rfbGetClient(&argc,argv,8,3,4);
const char* vncServerHost="";
int vncServerPort=5900;
client->GotFrameBufferUpdate = PrintRect;
client->GotFrameBufferUpdate = SaveFramebufferAsPGM;
/* The -listen option is used to make us a daemon process which listens for
incoming connections from servers, rather than actively connecting to a
given server. The -tunnel and -via options are useful to create
connections tunneled via SSH port forwarding. We must test for the
-listen option before invoking any Xt functions - this is because we use
forking, and Xt doesn't seem to cope with forking very well. For -listen
option, when a successful incoming connection has been accepted,
listenForIncomingConnections() returns, setting the listenSpecified
flag. */
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-listen") == 0) {
listenForIncomingConnections(client);
break;
} else {
char* colon=strchr(argv[i],':');
vncServerHost=argv[i];
if(colon) {
*colon=0;
vncServerPort=atoi(colon+1);
} else
vncServerPort=0;
vncServerPort+=5900;
}
}
client->appData.encodingsString="tight";
rfbInitClient(client,vncServerHost,vncServerPort);
while (1) {
if (!HandleRFBServerMessage(client))
break;
}
return 0;
}
......@@ -41,7 +41,7 @@ HandleCoRREBPP (rfbClient* client, int rx, int ry, int rw, int rh)
if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbRREHeader))
return FALSE;
hdr.nSubrects = Swap32IfLE(hdr.nSubrects);
hdr.nSubrects = rfbClientSwap32IfLE(hdr.nSubrects);
if (!ReadFromRFBServer(client, (char *)&pix, sizeof(pix)))
return FALSE;
......
......@@ -45,9 +45,9 @@ listenForIncomingConnections(rfbClient* client)
if ((listenSocket < 0)) exit(1);
fprintf(stderr,"%s -listen: Listening on port %d\n",
rfbClientLog("%s -listen: Listening on port %d\n",
client->programName,client->listenPort);
fprintf(stderr,"%s -listen: Command line errors are not reported until "
rfbClientLog("%s -listen: Command line errors are not reported until "
"a connection comes in.\n", client->programName);
while (TRUE) {
......
This diff is collapsed.
......@@ -40,7 +40,7 @@ HandleRREBPP (rfbClient* client, int rx, int ry, int rw, int rh)
if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbRREHeader))
return FALSE;
hdr.nSubrects = Swap32IfLE(hdr.nSubrects);
hdr.nSubrects = rfbClientSwap32IfLE(hdr.nSubrects);
if (!ReadFromRFBServer(client, (char *)&pix, sizeof(pix)))
return FALSE;
......@@ -54,10 +54,10 @@ HandleRREBPP (rfbClient* client, int rx, int ry, int rw, int rh)
if (!ReadFromRFBServer(client, (char *)&subrect, sz_rfbRectangle))
return FALSE;
subrect.x = Swap16IfLE(subrect.x);
subrect.y = Swap16IfLE(subrect.y);
subrect.w = Swap16IfLE(subrect.w);
subrect.h = Swap16IfLE(subrect.h);
subrect.x = rfbClientSwap16IfLE(subrect.x);
subrect.y = rfbClientSwap16IfLE(subrect.y);
subrect.w = rfbClientSwap16IfLE(subrect.w);
subrect.h = rfbClientSwap16IfLE(subrect.h);
FillRectangle(client, rx+subrect.x, ry+subrect.y, subrect.w, subrect.h, pix);
}
......
......@@ -90,7 +90,7 @@ ReadFromRFBServer(rfbClient* client, char *out, unsigned int n)
}
} else {
if (errorMessageOnReadFailure) {
fprintf(stderr,"VNC server closed connection\n");
rfbClientLog("VNC server closed connection\n");
}
return FALSE;
}
......@@ -120,7 +120,7 @@ ReadFromRFBServer(rfbClient* client, char *out, unsigned int n)
}
} else {
if (errorMessageOnReadFailure) {
fprintf(stderr,"VNC server closed connection\n");
rfbClientLog("VNC server closed connection\n");
}
return FALSE;
}
......@@ -139,7 +139,7 @@ ReadFromRFBServer(rfbClient* client, char *out, unsigned int n)
*/
Bool
WriteExact(rfbClient* client, char *buf, int n)
WriteToRFBServer(rfbClient* client, char *buf, int n)
{
fd_set fds;
int i = 0;
......@@ -163,7 +163,7 @@ WriteExact(rfbClient* client, char *buf, int n)
return FALSE;
}
} else {
fprintf(stderr,"write failed\n");
rfbClientLog("write failed\n");
return FALSE;
}
}
......@@ -178,7 +178,7 @@ WriteExact(rfbClient* client, char *buf, int n)
*/
int
ConnectToTcpAddr(unsigned int host, int port)
ConnectClientToTcpAddr(unsigned int host, int port)
{
int sock;
struct sockaddr_in addr;
......@@ -392,32 +392,32 @@ PrintInHex(char *buf, int len)
str[16] = 0;
fprintf(stderr,"ReadExact: ");
rfbClientLog("ReadExact: ");
for (i = 0; i < len; i++)
{
if ((i % 16 == 0) && (i != 0)) {
fprintf(stderr," ");
rfbClientLog(" ");
}
c = buf[i];
str[i % 16] = (((c > 31) && (c < 127)) ? c : '.');
fprintf(stderr,"%02x ",(unsigned char)c);
rfbClientLog("%02x ",(unsigned char)c);
if ((i % 4) == 3)
fprintf(stderr," ");
rfbClientLog(" ");
if ((i % 16) == 15)
{
fprintf(stderr,"%s\n",str);
rfbClientLog("%s\n",str);
}
}
if ((i % 16) != 0)
{
for (j = i % 16; j < 16; j++)
{
fprintf(stderr," ");
if ((j % 4) == 3) fprintf(stderr," ");
rfbClientLog(" ");
if ((j % 4) == 3) rfbClientLog(" ");
}
str[i % 16] = 0;
fprintf(stderr,"%s\n",str);
rfbClientLog("%s\n",str);
}
fflush(stderr);
......
......@@ -105,7 +105,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
if ((comp_ctl & 1) && zlibStreamActive[stream_id]) {
if (inflateEnd (&zlibStream[stream_id]) != Z_OK &&
zlibStream[stream_id].msg != NULL)
fprintf(stderr, "inflateEnd: %s\n", zlibStream[stream_id].msg);
rfbClientLog("inflateEnd: %s\n", zlibStream[stream_id].msg);
zlibStreamActive[stream_id] = FALSE;
}
comp_ctl >>= 1;
......@@ -135,7 +135,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
#if BPP == 8
if (comp_ctl == rfbTightJpeg) {
fprintf(stderr, "Tight encoding: JPEG is not supported in 8 bpp mode.\n");
rfbClientLog("Tight encoding: JPEG is not supported in 8 bpp mode.\n");
return FALSE;
}
#else
......@@ -146,7 +146,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
/* Quit on unsupported subencoding value. */
if (comp_ctl > rfbTightMaxSubencoding) {
fprintf(stderr, "Tight encoding: bad subencoding value received.\n");
rfbClientLog("Tight encoding: bad subencoding value received.\n");
return FALSE;
}
......@@ -174,7 +174,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
bitsPixel = InitFilterGradientBPP(client, rw, rh);
break;
default:
fprintf(stderr, "Tight encoding: unknown filter code received.\n");
rfbClientLog("Tight encoding: unknown filter code received.\n");
return FALSE;
}
} else {
......@@ -182,7 +182,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
bitsPixel = InitFilterCopyBPP(client, rw, rh);
}
if (bitsPixel == 0) {
fprintf(stderr, "Tight encoding: error receiving palette.\n");
rfbClientLog("Tight encoding: error receiving palette.\n");
return FALSE;
}
......@@ -203,7 +203,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
/* Read the length (1..3 bytes) of compressed data following. */
compressedLen = (int)ReadCompactLen(client);
if (compressedLen <= 0) {
fprintf(stderr, "Incorrect data received from the server.\n");
rfbClientLog("Incorrect data received from the server.\n");
return FALSE;
}
......@@ -217,7 +217,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
err = inflateInit(zs);
if (err != Z_OK) {
if (zs->msg != NULL)
fprintf(stderr, "InflateInit error: %s.\n", zs->msg);
rfbClientLog("InflateInit error: %s.\n", zs->msg);
return FALSE;
}
zlibStreamActive[stream_id] = TRUE;
......@@ -229,7 +229,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
buffer2 = &client->buffer[bufferSize];
if (rowSize > bufferSize) {
/* Should be impossible when BUFFER_SIZE >= 16384 */
fprintf(stderr, "Internal error: incorrect buffer size.\n");
rfbClientLog("Internal error: incorrect buffer size.\n");
return FALSE;
}
......@@ -259,9 +259,9 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
break;
if (err != Z_OK && err != Z_STREAM_END) {
if (zs->msg != NULL) {
fprintf(stderr, "Inflate error: %s.\n", zs->msg);
rfbClientLog("Inflate error: %s.\n", zs->msg);
} else {
fprintf(stderr, "Inflate error: %d.\n", err);
rfbClientLog("Inflate error: %d.\n", err);
}
return FALSE;
}
......@@ -282,7 +282,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
}
if (rowsProcessed != rh) {
fprintf(stderr, "Incorrect number of scan lines after decompression.\n");
rfbClientLog("Incorrect number of scan lines after decompression.\n");
return FALSE;
}
......@@ -545,13 +545,13 @@ DecompressJpegRectBPP(rfbClient* client, int x, int y, int w, int h)
compressedLen = (int)ReadCompactLen(client);
if (compressedLen <= 0) {
fprintf(stderr, "Incorrect data received from the server.\n");
rfbClientLog("Incorrect data received from the server.\n");
return FALSE;
}
compressedData = malloc(compressedLen);
if (compressedData == NULL) {
fprintf(stderr, "Memory allocation error.\n");
rfbClientLog("Memory allocation error.\n");
return FALSE;
}
......@@ -571,7 +571,7 @@ DecompressJpegRectBPP(rfbClient* client, int x, int y, int w, int h)
jpeg_start_decompress(&cinfo);
if (cinfo.output_width != w || cinfo.output_height != h ||
cinfo.output_components != 3) {
fprintf(stderr, "Tight Encoding: Wrong JPEG data received.\n");
rfbClientLog("Tight Encoding: Wrong JPEG data received.\n");
jpeg_destroy_decompress(&cinfo);
free(compressedData);
return FALSE;
......
......@@ -86,7 +86,7 @@ rfbClient* rfbGetClient(int* argc,char** argv,
client->HandleCursorPos = DummyPoint;
client->SoftCursorLockArea = DummyRect;
client->SoftCursorUnlockScreen = Dummy;
client->FramebufferUpdateReceived = DummyRect;
client->GotFrameBufferUpdate = DummyRect;
client->GetPassword = NoPassword;
client->MallocFrameBuffer = MallocFrameBuffer;
client->Bell = Dummy;
......@@ -94,147 +94,30 @@ rfbClient* rfbGetClient(int* argc,char** argv,
return client;
}
void PrintRect(rfbClient* client, int x, int y, int w, int h) {
fprintf(stderr,"Received an update for %d,%d,%d,%d.\n",x,y,w,h);
}
void SaveFramebufferAsPGM(rfbClient* client, int x, int y, int w, int h) {
static time_t t=0,t1;
FILE* f;
int i,j;
int bpp=client->format.bitsPerPixel/8;
int row_stride=client->width*bpp;
/* save one picture only if the last is older than 2 seconds */
t1=time(0);
if(t1-t>2)
t=t1;
else
return;
/* assert bpp=4 */
if(bpp!=4) {
fprintf(stderr,"bpp = %d (!=4)\n",bpp);
return;
}
f=fopen("/tmp/framebuffer.ppm","wb");
fprintf(f,"P6\n# %s\n%d %d\n255\n",client->desktopName,client->width,client->height);
for(j=0;j<client->height*row_stride;j+=row_stride)
for(i=0;i<client->width*bpp;i+=bpp) {
if(client->format.bigEndian) {
fputc(client->frameBuffer[j+i+bpp-1],f);
fputc(client->frameBuffer[j+i+bpp-2],f);
fputc(client->frameBuffer[j+i+bpp-3],f);
} else {
fputc(client->frameBuffer[j+i+bpp+0],f);
fputc(client->frameBuffer[j+i+bpp+1],f);
fputc(client->frameBuffer[j+i+bpp+2],f);
}
}
fclose(f);
}
void
vncEncryptBytes(unsigned char *bytes, char *passwd);
int
main(int argc, char **argv)
Bool rfbInitClient(rfbClient* client,const char* vncServerHost,int vncServerPort)
{
int i;
rfbClient* client = rfbGetClient(&argc,argv,8,3,4);
const char* vncServerHost="";
int vncServerPort=5900;
char buf1[]="pass",buf2[]="pass";
vncEncryptBytes(buf1,buf2);
client->FramebufferUpdateReceived = PrintRect;
client->FramebufferUpdateReceived = SaveFramebufferAsPGM;
/* The -listen option is used to make us a daemon process which listens for
incoming connections from servers, rather than actively connecting to a
given server. The -tunnel and -via options are useful to create
connections tunneled via SSH port forwarding. We must test for the
-listen option before invoking any Xt functions - this is because we use
forking, and Xt doesn't seem to cope with forking very well. For -listen
option, when a successful incoming connection has been accepted,
listenForIncomingConnections() returns, setting the listenSpecified
flag. */
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-listen") == 0) {
listenForIncomingConnections(client);
break;
} else {
char* colon=strchr(argv[i],':');
vncServerHost=argv[i];
if(colon) {
*colon=0;
vncServerPort=atoi(colon+1);
} else
vncServerPort=0;
vncServerPort+=5900;
}
/* TODO:
if (strcmp(argv[i], "-tunnel") == 0 || strcmp(argv[i], "-via") == 0) {
if (!createTunnel(&argc, argv, i))
exit(1);
break;
}
*/
}
/* Call the main Xt initialisation function. It parses command-line options,
generating appropriate resource specs, and makes a connection to the X
display. */
/* TODO: cmdline args
toplevel = XtVaAppInitialize(&appContext, "Vncviewer",
cmdLineOptions, numCmdLineOptions,
&argc, argv, fallback_resources,
XtNborderWidth, 0, NULL);
dpy = XtDisplay(toplevel);
*/
/* Interpret resource specs and process any remaining command-line arguments
(i.e. the VNC server name). If the server name isn't specified on the
command line, getArgsAndResources() will pop up a dialog box and wait
for one to be entered. */
/*
GetArgsAndResources(argc, argv);
*/
/* Unless we accepted an incoming connection, make a TCP connection to the
given VNC server */
if (!client->listenSpecified) {
if (!ConnectToRFBServer(client,vncServerHost, vncServerPort)) exit(1);
if (!ConnectToRFBServer(client,vncServerHost, vncServerPort))
return FALSE;
}
/* Initialise the VNC connection, including reading the password */
if (!InitialiseRFBConnection(client)) exit(1);
if (!InitialiseRFBConnection(client))
return FALSE;
SetFormatAndEncodings(client);
if (!SetFormatAndEncodings(client))
return FALSE;
client->width=client->si.framebufferWidth;
client->height=client->si.framebufferHeight;
client->MallocFrameBuffer(client);
SendFramebufferUpdateRequest(client,0,0,client->width,client->height,FALSE);
if (!SendFramebufferUpdateRequest(client,
0,0,client->width,client->height,FALSE))
return FALSE;
/* Now enter the main loop, processing VNC messages. X events will
automatically be processed whenever the VNC connection is idle. */
while (1) {
if (!HandleRFBServerMessage(client))
break;
}
return 0;
return TRUE;
}
......@@ -60,7 +60,7 @@ HandleZlibBPP (rfbClient* client, int rx, int ry, int rw, int rh)
if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbZlibHeader))
return FALSE;
remaining = Swap32IfLE(hdr.nBytes);
remaining = rfbClientSwap32IfLE(hdr.nBytes);
/* Need to initialize the decompressor state. */
decompStream.next_in = ( Bytef * )client->buffer;
......@@ -75,7 +75,7 @@ HandleZlibBPP (rfbClient* client, int rx, int ry, int rw, int rh)
inflateResult = inflateInit( &decompStream );
if ( inflateResult != Z_OK ) {
fprintf(stderr,
rfbClientLog(
"inflateInit returned error: %d, msg: %s\n",
inflateResult,
decompStream.msg);
......@@ -113,11 +113,11 @@ HandleZlibBPP (rfbClient* client, int rx, int ry, int rw, int rh)
/* We never supply a dictionary for compression. */
if ( inflateResult == Z_NEED_DICT ) {
fprintf(stderr,"zlib inflate needs a dictionary!\n");
rfbClientLog("zlib inflate needs a dictionary!\n");
return FALSE;
}
if ( inflateResult < 0 ) {
fprintf(stderr,
rfbClientLog(
"zlib inflate returned error: %d, msg: %s\n",
inflateResult,
decompStream.msg);
......@@ -129,7 +129,7 @@ HandleZlibBPP (rfbClient* client, int rx, int ry, int rw, int rh)
*/
if (( decompStream.avail_in > 0 ) &&
( decompStream.avail_out <= 0 )) {
fprintf(stderr,"zlib inflate ran out of space!\n");
rfbClientLog("zlib inflate ran out of space!\n");
return FALSE;
}
......@@ -144,7 +144,7 @@ HandleZlibBPP (rfbClient* client, int rx, int ry, int rw, int rh)
}
else {
fprintf(stderr,
rfbClientLog(
"zlib inflate returned error: %d, msg: %s\n",
inflateResult,
decompStream.msg);
......
......@@ -548,7 +548,7 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
INIT_MUTEX(logMutex);
if(width&3)
fprintf(stderr,"WARNING: Width (%d) is not a multiple of 4. VncViewer has problems with that.\n",width);
rfbLog("WARNING: Width (%d) is not a multiple of 4. VncViewer has problems with that.\n",width);
rfbScreen->autoPort=FALSE;
rfbScreen->rfbClientHead=0;
......@@ -816,7 +816,7 @@ void rfbRunEventLoop(rfbScreenInfoPtr rfbScreen, long usec, Bool runInBackground
pthread_create(&listener_thread, NULL, listenerRun, rfbScreen);
return;
#else
fprintf(stderr,"Can't run in background, because I don't have PThreads!\n");
rfbLog("Can't run in background, because I don't have PThreads!\n");
exit(-1);
#endif
}
......
......@@ -39,6 +39,10 @@
#include <rdr/FdInStream.h>
#include <rdr/Exception.h>
extern "C" {
extern void rfbLog(const char *format, ...);
}
using namespace rdr;
enum { DEFAULT_BUF_SIZE = 8192,
......@@ -136,7 +140,7 @@ int FdInStream::checkReadable(int fd, int timeout)
int n = select(fd+1, &rfds, 0, 0, &tv);
if (n != -1 || errno != EINTR)
return n;
fprintf(stderr,"select returned EINTR\n");
rfbLog("select returned EINTR\n");
}
}
......@@ -184,7 +188,7 @@ int FdInStream::readWithTimeoutOrCallback(void* buf, int len)
n = ::read(fd, buf, len);
if (n != -1 || errno != EINTR)
break;
fprintf(stderr,"read returned EINTR\n");
rfbLog("read returned EINTR\n");
}
if (n < 0) throw SystemException("read",errno);
......@@ -192,17 +196,17 @@ int FdInStream::readWithTimeoutOrCallback(void* buf, int len)
if (timing) {
gettimeofday(&after, 0);
// fprintf(stderr,"%d.%06d\n",(after.tv_sec - before.tv_sec),
// rfbLog("%d.%06d\n",(after.tv_sec - before.tv_sec),
// (after.tv_usec - before.tv_usec));
int newTimeWaited = ((after.tv_sec - before.tv_sec) * 10000 +
(after.tv_usec - before.tv_usec) / 100);
int newKbits = n * 8 / 1000;
// if (newTimeWaited == 0) {
// fprintf(stderr,"new kbps infinite t %d k %d\n",
// rfbLog("new kbps infinite t %d k %d\n",
// newTimeWaited, newKbits);
// } else {
// fprintf(stderr,"new kbps %d t %d k %d\n",
// rfbLog("new kbps %d t %d k %d\n",
// newKbits * 10000 / newTimeWaited, newTimeWaited, newKbits);
// }
......
......@@ -20,6 +20,10 @@
#include <rdr/Exception.h>
#include <zlib.h>
extern "C" {
extern void rfbLog(const char *format, ...);
}
using namespace rdr;
enum { DEFAULT_BUF_SIZE = 16384 };
......@@ -65,7 +69,7 @@ void ZlibOutStream::flush()
zs->next_in = start;
zs->avail_in = ptr - start;
// fprintf(stderr,"zos flush: avail_in %d\n",zs->avail_in);
// rfbLog("zos flush: avail_in %d\n",zs->avail_in);
while (zs->avail_in != 0) {
......@@ -74,12 +78,12 @@ void ZlibOutStream::flush()
zs->next_out = underlying->getptr();
zs->avail_out = underlying->getend() - underlying->getptr();
// fprintf(stderr,"zos flush: calling deflate, avail_in %d, avail_out %d\n",
// rfbLog("zos flush: calling deflate, avail_in %d, avail_out %d\n",
// zs->avail_in,zs->avail_out);
int rc = deflate(zs, Z_SYNC_FLUSH);
if (rc != Z_OK) throw Exception("ZlibOutStream: deflate failed");
// fprintf(stderr,"zos flush: after deflate: %d bytes\n",
// rfbLog("zos flush: after deflate: %d bytes\n",
// zs->next_out-underlying->getptr());
underlying->setptr(zs->next_out);
......@@ -92,7 +96,7 @@ void ZlibOutStream::flush()
int ZlibOutStream::overrun(int itemSize, int nItems)
{
// fprintf(stderr,"ZlibOutStream overrun\n");
// rfbLog("ZlibOutStream overrun\n");
if (itemSize > bufSize)
throw Exception("ZlibOutStream overrun: max itemSize exceeded");
......@@ -106,13 +110,13 @@ int ZlibOutStream::overrun(int itemSize, int nItems)
zs->next_out = underlying->getptr();
zs->avail_out = underlying->getend() - underlying->getptr();
// fprintf(stderr,"zos overrun: calling deflate, avail_in %d, avail_out %d\n",
// rfbLog("zos overrun: calling deflate, avail_in %d, avail_out %d\n",
// zs->avail_in,zs->avail_out);
int rc = deflate(zs, 0);
if (rc != Z_OK) throw Exception("ZlibOutStream: deflate failed");
// fprintf(stderr,"zos overrun: after deflate: %d bytes\n",
// rfbLog("zos overrun: after deflate: %d bytes\n",
// zs->next_out-underlying->getptr());
underlying->setptr(zs->next_out);
......@@ -126,7 +130,7 @@ int ZlibOutStream::overrun(int itemSize, int nItems)
} else {
// but didn't consume all the data? try shifting what's left to the
// start of the buffer.
fprintf(stderr,"z out buf not full, but in data not consumed\n");
rfbLog("z out buf not full, but in data not consumed\n");
memmove(start, zs->next_in, ptr - zs->next_in);
offset += zs->next_in - start;
ptr -= zs->next_in - start;
......
......@@ -44,16 +44,16 @@ extern "C"
#ifdef HAVE_LIBPTHREAD
#include <pthread.h>
#if 0 /* debugging */
#define LOCK(mutex) (fprintf(stderr,"%s:%d LOCK(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_lock(&(mutex)))
#define UNLOCK(mutex) (fprintf(stderr,"%s:%d UNLOCK(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_unlock(&(mutex)))
#define LOCK(mutex) (rfbLog("%s:%d LOCK(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_lock(&(mutex)))
#define UNLOCK(mutex) (rfbLog("%s:%d UNLOCK(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_unlock(&(mutex)))
#define MUTEX(mutex) pthread_mutex_t (mutex)
#define INIT_MUTEX(mutex) (fprintf(stderr,"%s:%d INIT_MUTEX(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_init(&(mutex),NULL))
#define TINI_MUTEX(mutex) (fprintf(stderr,"%s:%d TINI_MUTEX(%s)\n",__FILE__,__LINE__,#mutex), pthread_mutex_destroy(&(mutex)))
#define TSIGNAL(cond) (fprintf(stderr,"%s:%d TSIGNAL(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_signal(&(cond)))
#define WAIT(cond,mutex) (fprintf(stderr,"%s:%d WAIT(%s,%s)\n",__FILE__,__LINE__,#cond,#mutex), pthread_cond_wait(&(cond),&(mutex)))
#define INIT_MUTEX(mutex) (rfbLog("%s:%d INIT_MUTEX(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_init(&(mutex),NULL))
#define TINI_MUTEX(mutex) (rfbLog("%s:%d TINI_MUTEX(%s)\n",__FILE__,__LINE__,#mutex), pthread_mutex_destroy(&(mutex)))
#define TSIGNAL(cond) (rfbLog("%s:%d TSIGNAL(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_signal(&(cond)))
#define WAIT(cond,mutex) (rfbLog("%s:%d WAIT(%s,%s)\n",__FILE__,__LINE__,#cond,#mutex), pthread_cond_wait(&(cond),&(mutex)))
#define COND(cond) pthread_cond_t (cond)
#define INIT_COND(cond) (fprintf(stderr,"%s:%d INIT_COND(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_init(&(cond),NULL))
#define TINI_COND(cond) (fprintf(stderr,"%s:%d TINI_COND(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_destroy(&(cond)))
#define INIT_COND(cond) (rfbLog("%s:%d INIT_COND(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_init(&(cond),NULL))
#define TINI_COND(cond) (rfbLog("%s:%d TINI_COND(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_destroy(&(cond)))
#define IF_PTHREADS(x) x
#else
#define LOCK(mutex) pthread_mutex_lock(&(mutex));
......
......@@ -31,10 +31,10 @@
#include <rfb/rfbproto.h>
#include <rfb/keysym.h>
#define Swap16IfLE(s) \
#define rfbClientSwap16IfLE(s) \
(*(char *)&client->endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s))
#define Swap32IfLE(l) \
#define rfbClientSwap32IfLE(l) \
(*(char *)&client->endianTest ? ((((l) & 0xff000000) >> 24) | \
(((l) & 0x00ff0000) >> 8) | \
(((l) & 0x0000ff00) << 8) | \
......@@ -92,7 +92,7 @@ struct _rfbClient;
typedef Bool (*HandleCursorPosProc)(struct _rfbClient* client, int x, int y);
typedef void (*SoftCursorLockAreaProc)(struct _rfbClient* client, int x, int y, int w, int h);
typedef void (*SoftCursorUnlockScreenProc)(struct _rfbClient* client);
typedef void (*FramebufferUpdateReceivedProc)(struct _rfbClient* client, int x, int y, int w, int h);
typedef void (*GotFrameBufferUpdateProc)(struct _rfbClient* client, int x, int y, int w, int h);
typedef char* (*GetPasswordProc)(struct _rfbClient* client);
typedef Bool (*MallocFrameBufferProc)(struct _rfbClient* client);
typedef void (*BellProc)(struct _rfbClient* client);
......@@ -137,7 +137,7 @@ typedef struct _rfbClient {
HandleCursorPosProc HandleCursorPos;
SoftCursorLockAreaProc SoftCursorLockArea;
SoftCursorUnlockScreenProc SoftCursorUnlockScreen;
FramebufferUpdateReceivedProc FramebufferUpdateReceived;
GotFrameBufferUpdateProc GotFrameBufferUpdate;
GetPasswordProc GetPassword;
MallocFrameBufferProc MallocFrameBuffer;
BellProc Bell;
......@@ -155,6 +155,8 @@ extern void listenForIncomingConnections(rfbClient* viewer);
/* rfbproto.c */
extern Bool rfbEnableClientLogging;
extern void rfbClientLog(const char *format, ...);
extern Bool ConnectToRFBServer(rfbClient* client,const char *hostname, int port);
extern Bool InitialiseRFBConnection(rfbClient* client);
extern Bool SetFormatAndEncodings(rfbClient* client);
......@@ -174,13 +176,16 @@ extern void PrintPixelFormat(rfbPixelFormat *format);
extern Bool errorMessageOnReadFailure;
extern Bool ReadFromRFBServer(rfbClient* client, char *out, unsigned int n);
extern Bool WriteExact(rfbClient* client, char *buf, int n);
extern Bool WriteToRFBServer(rfbClient* client, char *buf, int n);
extern int FindFreeTcpPort(void);
extern int ListenAtTcpPort(int port);
extern int ConnectToTcpAddr(unsigned int host, int port);
extern int ConnectClientToTcpAddr(unsigned int host, int port);
extern int AcceptTcpConnection(int listenSock);
extern Bool SetNonBlocking(int sock);
extern Bool StringToIPAddr(const char *str, unsigned int *addr);
extern Bool SameMachine(int sock);
/* vncviewer.c */
rfbClient* rfbGetClient(int* argc,char** argv,int bitsPerSample,int samplesPerPixel,int bytesPerPixel);
Bool rfbInitClient(rfbClient* client,const char* vncServerHost,int vncServerPort);
/* rfb/rfbconfig.h.in. Generated automatically from configure.ac by autoheader. */
/* rfb/rfbconfig.h.in. Generated from configure.ac by autoheader. */
/* Enable 24 bit per pixel in native framebuffer */
#undef ALLOW24BPP
......@@ -6,146 +6,161 @@
/* Enable BackChannel communication */
#undef BACKCHANNEL
/* Define if you have the <arpa/inet.h> header file. */
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define if you don't have `vprintf' but do have `_doprnt.' */
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
#undef HAVE_DOPRNT
/* Define if you have the <fcntl.h> header file. */
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the `ftime' function. */
/* Define to 1 if you have the `ftime' function. */
#undef HAVE_FTIME
/* Define if you have the `gethostbyname' function. */
/* Define to 1 if you have the `gethostbyname' function. */
#undef HAVE_GETHOSTBYNAME
/* Define if you have the `gethostname' function. */
/* Define to 1 if you have the `gethostname' function. */
#undef HAVE_GETHOSTNAME
/* Define if you have the `gettimeofday' function. */
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define if you have the `inet_ntoa' function. */
/* Define to 1 if you have the `inet_ntoa' function. */
#undef HAVE_INET_NTOA
/* Define if you have the <inttypes.h> header file. */
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define if you have the `jpeg' library (-ljpeg). */
/* Define to 1 if you have the `jpeg' library (-ljpeg). */
#undef HAVE_LIBJPEG
/* Define if you have the `nsl' library (-lnsl). */
/* Define to 1 if you have the `nsl' library (-lnsl). */
#undef HAVE_LIBNSL
/* Define if you have the `pthread' library (-lpthread). */
/* Define to 1 if you have the `pthread' library (-lpthread). */
#undef HAVE_LIBPTHREAD
/* Define if you have the `socket' library (-lsocket). */
/* Define to 1 if you have the `socket' library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Define if you have the `z' library (-lz). */
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
/* Define if your system has a working `malloc' function. */
/* Define to 1 if your system has a working `malloc' function. */
#undef HAVE_MALLOC
/* Define if you have the `memmove' function. */
/* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE
/* Define if you have the <memory.h> header file. */
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define if you have the `memset' function. */
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define if you have the `mkfifo' function. */
/* Define to 1 if you have the `mkfifo' function. */
#undef HAVE_MKFIFO
/* Define if you have the <netdb.h> header file. */
/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
/* Define if you have the <netinet/in.h> header file. */
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define if you have the `select' function. */
/* Define to 1 if you have the `select' function. */
#undef HAVE_SELECT
/* Define if you have the `socket' function. */
/* Define to 1 if you have the `socket' function. */
#undef HAVE_SOCKET
/* Define if `stat' has the bug that it succeeds when given the zero-length
file name argument. */
/* Define to 1 if `stat' has the bug that it succeeds when given the
zero-length file name argument. */
#undef HAVE_STAT_EMPTY_STRING_BUG
/* Define if you have the <stdint.h> header file. */
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define if you have the <stdlib.h> header file. */
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define if you have the `strchr' function. */
/* Define to 1 if you have the `strchr' function. */
#undef HAVE_STRCHR
/* Define if you have the `strcspn' function. */
/* Define to 1 if you have the `strcspn' function. */
#undef HAVE_STRCSPN
/* Define if you have the `strdup' function. */
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define if you have the `strerror' function. */
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define if you have the `strftime' function. */
/* Define to 1 if you have the `strftime' function. */
#undef HAVE_STRFTIME
/* Define if you have the <strings.h> header file. */
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define if you have the <string.h> header file. */
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define if you have the `strstr' function. */
/* Define to 1 if you have the `strstr' function. */
#undef HAVE_STRSTR
/* Define if you have the <syslog.h> header file. */
/* Define to 1 if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
/* Define if you have the <sys/socket.h> header file. */
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define if you have the <sys/stat.h> header file. */
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define if you have the <sys/timeb.h> header file. */
/* Define to 1 if you have the <sys/timeb.h> header file. */
#undef HAVE_SYS_TIMEB_H
/* Define if you have the <sys/time.h> header file. */
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define if you have the <sys/types.h> header file. */
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
/* Define if you have the <unistd.h> header file. */
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the `vprintf' function. */
/* Define to 1 if you have the `vprintf' function. */
#undef HAVE_VPRINTF
/* Use zrle compression; needs a c++ compiler */
#undef HAVE_ZRLE
/* Define if `lstat' dereferences a symlink specified with a trailing slash.
*/
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The number of bytes in type char */
#undef SIZEOF_CHAR
......@@ -161,20 +176,20 @@
/* The number of bytes in type void* */
#undef SIZEOF_VOIDP
/* Define if you have the ANSI C header files. */
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if you can safely include both <sys/time.h> and <time.h>. */
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Version number of package */
#undef VERSION
/* Define if your processor stores words with the most significant byte first
(like Motorola and SPARC, unlike Intel and VAX). */
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
/* Define if the X Window System is missing or not being used. */
/* Define to 1 if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING
/* Define to empty if `const' does not conform to ANSI C. */
......
......@@ -602,7 +602,6 @@ sraRegion *sraRgnBBox(const sraRegion *src) {
xmin=hcurr->start;
if(hcurr->end>xmax)
xmax=hcurr->end;
fprintf(stderr,"%d,%d,%d,%d\n",hcurr->start,vcurr->start,hcurr->end,vcurr->end);
hcurr = hcurr->_next;
}
......@@ -761,7 +760,7 @@ Bool sraRgnIteratorNext(sraRectangleIterator* i,sraRect* r)
}
if((i->ptrPos%4)!=2) {
fprintf(stderr,"sraRgnIteratorNext: offset is wrong (%d%%4!=2)\n",i->ptrPos);
rfbLog("sraRgnIteratorNext: offset is wrong (%d%%4!=2)\n",i->ptrPos);
exit(-1);
}
......
......@@ -1214,13 +1214,14 @@ rfbSendFramebufferUpdate(cl, givenUpdateRegion)
fu->type = rfbFramebufferUpdate;
if (nUpdateRegionRects != 0xFFFF) {
if(cl->screen->maxRectsPerUpdate>0
/* Tight encoding counts the rectangles differently */
&& cl->preferredEncoding != rfbEncodingTight
&& nUpdateRegionRects>cl->screen->maxRectsPerUpdate) {
sraRegion* newUpdateRegion = sraRgnBBox(updateRegion);
sraRgnDestroy(updateRegion);
updateRegion = newUpdateRegion;
nUpdateRegionRects = sraRgnCountRects(updateRegion);
}
fu->nRects = Swap16IfLE((uint16_t)(sraRgnCountRects(updateCopyRegion) +
nUpdateRegionRects +
!!sendCursorShape + !!sendCursorPos));
......
CFLAGS=-I.. -g -Wall
noinst_PROGRAMS=tight-1
LDADD = ../libvncserver.a ../libvncclient/libvncclient.a
# Makefile.in generated by automake 1.6.3 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@
AWK = @AWK@
CC = @CC@
CCLD = @CCLD@
CXX = @CXX@
DEPDIR = @DEPDIR@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
RPMSOURCEDIR = @RPMSOURCEDIR@
STRIP = @STRIP@
VERSION = @VERSION@
X_CFLAGS = @X_CFLAGS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
CFLAGS = -I.. -g -Wall
noinst_PROGRAMS = tight-1
LDADD = ../libvncserver.a ../libvncclient/libvncclient.a
subdir = test
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/rfb/rfbconfig.h
CONFIG_CLEAN_FILES =
noinst_PROGRAMS = tight-1$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
tight_1_SOURCES = tight-1.c
tight_1_OBJECTS = tight-1.$(OBJEXT)
tight_1_LDADD = $(LDADD)
tight_1_DEPENDENCIES = ../libvncserver.a ../libvncclient/libvncclient.a
tight_1_LDFLAGS =
DEFS = @DEFS@
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/rfb
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/tight-1.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = tight-1.c
DIST_COMMON = Makefile.am Makefile.in
SOURCES = tight-1.c
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu test/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
tight-1$(EXEEXT): $(tight_1_OBJECTS) $(tight_1_DEPENDENCIES)
@rm -f tight-1$(EXEEXT)
$(LINK) $(tight_1_LDFLAGS) $(tight_1_OBJECTS) $(tight_1_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tight-1.Po@am__quote@
distclean-depend:
-rm -rf ./$(DEPDIR)
.c.o:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
.c.obj:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `cygpath -w $<`
CCDEPMODE = @CCDEPMODE@
uninstall-info-am:
ETAGS = etags
ETAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am
distclean: distclean-am
distclean-am: clean-am distclean-compile distclean-depend \
distclean-generic distclean-tags
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
uninstall-am: uninstall-info-am
.PHONY: GTAGS all all-am check check-am clean clean-generic \
clean-noinstPROGRAMS distclean distclean-compile \
distclean-depend distclean-generic distclean-tags distdir dvi \
dvi-am info info-am install install-am install-data \
install-data-am install-exec install-exec-am install-info \
install-info-am install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic tags uninstall uninstall-am \
uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
......@@ -19,7 +19,7 @@ int main(int argc,char** argv)
for(i=0;i<300;i+=10)
rfbMarkRectAsModified(server,i,j,i+5,j+5);
rfbProcessEvents(server,50);
rfbProcessEvents(server,5000);
}
return(0);
}
......@@ -225,6 +225,8 @@ rfbSendRectEncodingTight(cl, x, y, w, h)
int x_best, y_best, w_best, h_best;
char *fbptr;
rfbSendUpdateBuf(cl);
compressLevel = cl->tightCompressLevel;
qualityLevel = cl->tightQualityLevel;
......@@ -952,8 +954,8 @@ static Bool SendCompressedData(cl, compressedLen)
memcpy(&cl->updateBuf[cl->ublen], &tightAfterBuf[i], portionLen);
cl->ublen += portionLen;
}
portionLen = UPDATE_BUF_SIZE;
cl->rfbBytesSent[rfbEncodingTight] += compressedLen;
return TRUE;
}
......
......@@ -48,7 +48,7 @@ void do_key(Bool down,KeySym keySym,rfbClientPtr cl)
if(keySym<0x100) {
int ret;
//fprintf(stderr,"do_key: %c (0x%lx)\n",(char)keySym,keySym);
//rfbLog("do_key: %c (0x%lx)\n",(char)keySym,keySym);
ret=ioctl(tty_inject_device,TIOCSTI,&keySym);
if(ret<0) {
static char device[64];
......@@ -57,7 +57,7 @@ void do_key(Bool down,KeySym keySym,rfbClientPtr cl)
tty_inject_device=open(device,O_WRONLY);
ret=ioctl(tty_inject_device,TIOCSTI,&keySym);
if(ret<0)
fprintf(stderr,"Couldn't reopen device %s!\n",device);
rfbLog("Couldn't reopen device %s!\n",device);
}
}
}
......@@ -88,7 +88,7 @@ int main(int argc,char **argv)
if(argc>1) {
if((tty=atoi(argv[1]))<1) {
fprintf(stderr,"Usage: %s [tty_number [vnc args]]\n",argv[0]);
rfbLog("Usage: %s [tty_number [vnc args]]\n",argv[0]);
exit(1);
} else {
argv++;
......@@ -100,10 +100,10 @@ int main(int argc,char **argv)
sprintf(tty_device,"/dev/tty%d",tty);
if((tty_inject_device=open(tty_device,O_WRONLY))<0) {
fprintf(stderr,"Couldn't open tty device %s!\n",tty_device);
rfbLog("Couldn't open tty device %s!\n",tty_device);
exit(1);
}
fprintf(stderr,"Using device %s.\n",tty_device);
rfbLog("Using device %s.\n",tty_device);
if(ioctl(tty_inject_device,TIOCGWINSZ,&dimensions)>=0) {
width=dimensions.ws_col;
......@@ -142,7 +142,7 @@ int main(int argc,char **argv)
if(!console->currentlyMarking) {
tty_file=fopen(tty_device,"rb");
if(!tty_file) {
fprintf(stderr,"cannot open device \"%s\"\n",
rfbLog("cannot open device \"%s\"\n",
tty_device);
exit(1);
}
......@@ -166,7 +166,7 @@ int main(int argc,char **argv)
console->x=(i%console->width);
console->y=(i/console->width);
/*
fprintf(stderr,"changes: %d,%d (%d!=%d || %d!=%d)\n",
rfbLog("changes: %d,%d (%d!=%d || %d!=%d)\n",
console->x,console->y,
buffer[4+2*i],console->screenBuffer[i],
buffer[5+2*i],console->attributeBuffer[i]);
......
This diff is collapsed.
......@@ -35,7 +35,7 @@ int main(int argc, char **argv)
if(programArg0<argc) {
int in[2],out[2],err[2],pid;
if(pipe(in)<0 || pipe(out)<0 || pipe(err)<0) {
fprintf(stderr,"Couldn't make pipes!");
rfbLog("Couldn't make pipes!");
return(1);
}
......@@ -118,6 +118,6 @@ int main(int argc, char **argv)
}
}
}
fprintf(stderr,"exit\n");
rfbLog("exit\n");
return(0);
}
......@@ -52,7 +52,7 @@ void vcDrawCursor(vncConsolePtr c)
{
rfbDrawCursor(c->rfbScreen);
if(c->cursorActive && !c->cursorIsDrawn && c->y<c->height && c->x<c->width) {
/* fprintf(stderr,"DrawCursor: %d,%d\n",c->x,c->y); */
/* rfbLog("DrawCursor: %d,%d\n",c->x,c->y); */
vcDrawOrHideCursor(c);
}
}
......@@ -63,7 +63,7 @@ void vcHideCursor(vncConsolePtr c)
if(c->currentlyMarking)
vcUnmark(c);
if(c->cursorIsDrawn) {
/* fprintf(stderr,"HideCursor: %d,%d\n",c->x,c->y); */
/* rfbLog("HideCursor: %d,%d\n",c->x,c->y); */
vcDrawOrHideCursor(c);
}
}
......@@ -158,7 +158,7 @@ void vcScroll(vncConsolePtr c,int lineCount)
if(lineCount==0)
return;
/* fprintf(stderr,"begin scroll\n"); */
/* rfbLog("begin scroll\n"); */
vcHideCursor(c);
c->dontDrawCursor=TRUE;
......@@ -197,7 +197,7 @@ void vcScroll(vncConsolePtr c,int lineCount)
memset(c->attributeBuffer+y1/c->cHeight*c->width,0x07,
(y2-y1)/c->cHeight*c->width);
#endif
/* fprintf(stderr,"end scroll\n"); */
/* rfbLog("end scroll\n"); */
}
void vcCheckCoordinates(vncConsolePtr c)
......@@ -256,7 +256,7 @@ void vcPutCharColour(vncConsolePtr c,unsigned char ch,unsigned char foreColour,u
} while(c->x%8);
break;
default:
fprintf(stderr,"putchar of unknown character: %c(%d).\n",ch,ch);
rfbLog("putchar of unknown character: %c(%d).\n",ch,ch);
vcPutChar(c,' ');
}
} else {
......@@ -420,7 +420,7 @@ void vcPtrAddEventProc(int buttonMask,int x,int y,rfbClientPtr cl)
c->markEnd=pos;
vcToggleMarkCell(c,pos);
} else {
DEBUG(fprintf(stderr,"markStart: %d, markEnd: %d, pos: %d\n",
DEBUG(rfbLog("markStart: %d, markEnd: %d, pos: %d\n",
c->markStart,c->markEnd,pos));
if(c->markEnd!=pos) {
if(c->markEnd<pos) {
......
......@@ -19,7 +19,7 @@ int main(int argc,char **argv)
l=strlen(buffer)-1;
while(l>=0 && buffer[l]=='\n')
buffer[l]=0;
//fprintf(stderr,"%s (%d)",buffer,strlen(buffer));
//rfbLog("%s (%d)",buffer,strlen(buffer));
if(!strcmp(buffer,"quit"))
return(0);
if(!strcmp(buffer,"s"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment