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 CFLAGS=-g
SUBDIRS=. examples contrib vncterm classes SUBDIRS=. examples contrib vncterm classes libvncclient test
DIST_SUBDIRS=examples contrib vncterm classes DIST_SUBDIRS=examples contrib vncterm classes libvncclient test
bin_SCRIPTS = libvncserver-config 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. # Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
...@@ -12,7 +13,6 @@ ...@@ -12,7 +13,6 @@
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
@SET_MAKE@ @SET_MAKE@
SHELL = @SHELL@ SHELL = @SHELL@
srcdir = @srcdir@ srcdir = @srcdir@
...@@ -43,9 +43,13 @@ AUTOCONF = @AUTOCONF@ ...@@ -43,9 +43,13 @@ AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@ AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@ AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@ 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_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA) INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@ transform = @program_transform_name@
...@@ -55,18 +59,21 @@ POST_INSTALL = : ...@@ -55,18 +59,21 @@ POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CCLD = @CCLD@ CCLD = @CCLD@
CXX = @CXX@ CXX = @CXX@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
EXEEXT = @EXEEXT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
RPMSOURCEDIR = @RPMSOURCEDIR@ RPMSOURCEDIR = @RPMSOURCEDIR@
STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
X_CFLAGS = @X_CFLAGS@ X_CFLAGS = @X_CFLAGS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@
...@@ -75,7 +82,6 @@ X_PRE_LIBS = @X_PRE_LIBS@ ...@@ -75,7 +82,6 @@ X_PRE_LIBS = @X_PRE_LIBS@
am__include = @am__include@ am__include = @am__include@
am__quote = @am__quote@ am__quote = @am__quote@
install_sh = @install_sh@ install_sh = @install_sh@
EXTRA_DIST = VncViewer.jar index.vnc javaviewer.pseudo_proxy.patch EXTRA_DIST = VncViewer.jar index.vnc javaviewer.pseudo_proxy.patch
subdir = classes subdir = classes
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
...@@ -90,29 +96,31 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) ...@@ -90,29 +96,31 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && \ cd $(top_srcdir) && \
$(AUTOMAKE) --gnu classes/Makefile $(AUTOMAKE) --gnu classes/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
CONFIG_HEADERS= CONFIG_LINKS= \
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
uninstall-info-am: uninstall-info-am:
tags: TAGS tags: TAGS
TAGS: TAGS:
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = .. top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES) distdir: $(DISTFILES)
@for file in $(DISTFILES); do \ @list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
$(mkinstalldirs) "$(distdir)/$$dir"; \ dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \ fi; \
if test -d $$d/$$file; then \ if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|| exit 1; \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \ else \
test -f $(distdir)/$$file \ test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \
...@@ -136,6 +144,7 @@ install-am: all-am ...@@ -136,6 +144,7 @@ install-am: all-am
installcheck: installcheck-am installcheck: installcheck-am
install-strip: install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \ `test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic: mostlyclean-generic:
...@@ -143,7 +152,7 @@ mostlyclean-generic: ...@@ -143,7 +152,7 @@ mostlyclean-generic:
clean-generic: clean-generic:
distclean-generic: distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* -rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
......
This diff is collapsed.
...@@ -122,6 +122,8 @@ AC_CONFIG_FILES([Makefile ...@@ -122,6 +122,8 @@ AC_CONFIG_FILES([Makefile
examples/Makefile examples/Makefile
vncterm/Makefile vncterm/Makefile
classes/Makefile classes/Makefile
libvncclient/Makefile
test/Makefile
libvncserver.spec libvncserver.spec
libvncserver-config]) libvncserver-config])
AC_OUTPUT 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. # Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
...@@ -12,7 +13,6 @@ ...@@ -12,7 +13,6 @@
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
@SET_MAKE@ @SET_MAKE@
SHELL = @SHELL@ SHELL = @SHELL@
srcdir = @srcdir@ srcdir = @srcdir@
...@@ -43,9 +43,13 @@ AUTOCONF = @AUTOCONF@ ...@@ -43,9 +43,13 @@ AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@ AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@ AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@ 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_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA) INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@ transform = @program_transform_name@
...@@ -55,18 +59,21 @@ POST_INSTALL = : ...@@ -55,18 +59,21 @@ POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CCLD = @CCLD@ CCLD = @CCLD@
CXX = @CXX@ CXX = @CXX@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
EXEEXT = @EXEEXT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
RPMSOURCEDIR = @RPMSOURCEDIR@ RPMSOURCEDIR = @RPMSOURCEDIR@
STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
X_CFLAGS = @X_CFLAGS@ X_CFLAGS = @X_CFLAGS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@
...@@ -75,7 +82,6 @@ X_PRE_LIBS = @X_PRE_LIBS@ ...@@ -75,7 +82,6 @@ X_PRE_LIBS = @X_PRE_LIBS@
am__include = @am__include@ am__include = @am__include@
am__quote = @am__quote@ am__quote = @am__quote@
install_sh = @install_sh@ install_sh = @install_sh@
CFLAGS = -I .. CFLAGS = -I ..
LDADD = ../libvncserver.a LDADD = ../libvncserver.a
...@@ -97,7 +103,6 @@ noinst_PROGRAMS = zippy$(EXEEXT) ...@@ -97,7 +103,6 @@ noinst_PROGRAMS = zippy$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
@HAVE_X_TRUE@am_x11vnc_OBJECTS = x11vnc.$(OBJEXT) @HAVE_X_TRUE@am_x11vnc_OBJECTS = x11vnc.$(OBJEXT)
@HAVE_X_FALSE@am_x11vnc_OBJECTS =
x11vnc_OBJECTS = $(am_x11vnc_OBJECTS) x11vnc_OBJECTS = $(am_x11vnc_OBJECTS)
@HAVE_X_TRUE@x11vnc_DEPENDENCIES = ../libvncserver.a @HAVE_X_TRUE@x11vnc_DEPENDENCIES = ../libvncserver.a
@HAVE_X_FALSE@x11vnc_DEPENDENCIES = @HAVE_X_FALSE@x11vnc_DEPENDENCIES =
...@@ -114,7 +119,8 @@ CPPFLAGS = @CPPFLAGS@ ...@@ -114,7 +119,8 @@ CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
LIBS = @LIBS@ LIBS = @LIBS@
depcomp = $(SHELL) $(top_srcdir)/depcomp 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) \ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
...@@ -130,9 +136,8 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) ...@@ -130,9 +136,8 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && \ cd $(top_srcdir) && \
$(AUTOMAKE) --gnu contrib/Makefile $(AUTOMAKE) --gnu contrib/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
CONFIG_HEADERS= CONFIG_LINKS= \ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
install-binPROGRAMS: $(bin_PROGRAMS) install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL) @$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir) $(mkinstalldirs) $(DESTDIR)$(bindir)
...@@ -140,16 +145,16 @@ install-binPROGRAMS: $(bin_PROGRAMS) ...@@ -140,16 +145,16 @@ install-binPROGRAMS: $(bin_PROGRAMS)
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \ if test -f $$p \
; then \ ; then \
f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f"; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \
else :; fi; \ else :; fi; \
done done
uninstall-binPROGRAMS: uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL) @$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \ @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"; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
rm -f $(DESTDIR)$(bindir)/$$f; \ rm -f $(DESTDIR)$(bindir)/$$f; \
done done
...@@ -172,17 +177,17 @@ mostlyclean-compile: ...@@ -172,17 +177,17 @@ mostlyclean-compile:
distclean-compile: distclean-compile:
-rm -f *.tab.c -rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/x11vnc.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@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zippy.Po@am__quote@
distclean-depend: distclean-depend:
-rm -rf $(DEPDIR) -rm -rf ./$(DEPDIR)
.c.o: .c.o:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
.c.obj: .c.obj:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
...@@ -192,53 +197,61 @@ distclean-depend: ...@@ -192,53 +197,61 @@ distclean-depend:
CCDEPMODE = @CCDEPMODE@ CCDEPMODE = @CCDEPMODE@
uninstall-info-am: uninstall-info-am:
ETAGS = etags
ETAGSFLAGS =
tags: TAGS tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \ unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \ done | \
$(AWK) ' { files[$$0] = 1; } \ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \ END { for (i in files) print i; }'`; \
mkid -fID $$unique $(LISP) mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP) $(TAGS_FILES) $(LISP)
tags=; \ tags=; \
here=`pwd`; \ here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \ unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \ done | \
$(AWK) ' { files[$$0] = 1; } \ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \ END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| etags $(ETAGS_ARGS) $$tags $$unique $(LISP) || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS: GTAGS:
here=`CDPATH=: && cd $(top_builddir) && pwd` \ here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \ && cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here && gtags -i $(GTAGS_ARGS) $$here
distclean-tags: distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = .. top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES) distdir: $(DISTFILES)
@for file in $(DISTFILES); do \ @list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
$(mkinstalldirs) "$(distdir)/$$dir"; \ dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \ fi; \
if test -d $$d/$$file; then \ if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|| exit 1; \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \ else \
test -f $(distdir)/$$file \ test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \
...@@ -263,6 +276,7 @@ install-am: all-am ...@@ -263,6 +276,7 @@ install-am: all-am
installcheck: installcheck-am installcheck: installcheck-am
install-strip: install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \ `test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic: mostlyclean-generic:
...@@ -270,7 +284,7 @@ mostlyclean-generic: ...@@ -270,7 +284,7 @@ mostlyclean-generic:
clean-generic: clean-generic:
distclean-generic: distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* -rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
......
...@@ -414,7 +414,7 @@ void initialize_keycodes() { ...@@ -414,7 +414,7 @@ void initialize_keycodes() {
void DebugXTestFakeKeyEvent(Display* dpy, KeyCode keysym, Bool down, time_t cur_time) 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, XKeysymToString(XKeycodeToKeysym(dpy,keysym,0)),keysym,
down?"down":"up"); down?"down":"up");
XTestFakeKeyEvent(dpy,keysym,down,cur_time); XTestFakeKeyEvent(dpy,keysym,down,cur_time);
...@@ -500,7 +500,7 @@ static void keyboard(Bool down, KeySym keysym, rfbClientPtr client) { ...@@ -500,7 +500,7 @@ static void keyboard(Bool down, KeySym keysym, rfbClientPtr client) {
if (0) { if (0) {
X_LOCK; 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); down?"down":"up",XKeysymToString(keysym),(int)keysym);
X_UNLOCK; X_UNLOCK;
} }
...@@ -1153,7 +1153,7 @@ void shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h, ...@@ -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); xim = XShmCreateImage(dpy, visual, bpp, ZPixmap, NULL, shm, w, h);
if (xim == NULL) { if (xim == NULL) {
fprintf(stderr, "XShmCreateImage(%s) failed.\n", name); rfbLog( "XShmCreateImage(%s) failed.\n", name);
exit(1); exit(1);
} }
...@@ -1163,7 +1163,7 @@ void shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h, ...@@ -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); xim->bytes_per_line * xim->height, IPC_CREAT | 0777);
if (shm->shmid == -1) { if (shm->shmid == -1) {
fprintf(stderr, "shmget(%s) failed.\n", name); rfbLog("shmget(%s) failed.\n", name);
perror("shmget"); perror("shmget");
exit(1); exit(1);
} }
...@@ -1171,7 +1171,7 @@ void shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h, ...@@ -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); shm->shmaddr = xim->data = (char *) shmat(shm->shmid, 0, 0);
if (shm->shmaddr == (char *)-1) { if (shm->shmaddr == (char *)-1) {
fprintf(stderr, "shmat(%s) failed.\n", name); rfbLog("shmat(%s) failed.\n", name);
perror("shmat"); perror("shmat");
exit(1); exit(1);
} }
...@@ -1179,7 +1179,7 @@ void shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h, ...@@ -1179,7 +1179,7 @@ void shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h,
shm->readOnly = False; shm->readOnly = False;
if (! XShmAttach(dpy, shm)) { if (! XShmAttach(dpy, shm)) {
fprintf(stderr, "XShmAttach(%s) failed.\n", name); rfbLog("XShmAttach(%s) failed.\n", name);
exit(1); exit(1);
} }
......
...@@ -148,7 +148,7 @@ void on_key_press (Bool down,KeySym key,rfbClientPtr cl) ...@@ -148,7 +148,7 @@ void on_key_press (Bool down,KeySym key,rfbClientPtr cl)
blank_framebuffer(cl->screen->frameBuffer, 0, 0, maxx, maxy); blank_framebuffer(cl->screen->frameBuffer, 0, 0, maxx, maxy);
rfbDrawString(cl->screen,&default8x16Font,20,maxy-20,"Hello, World!",0xffffff); rfbDrawString(cl->screen,&default8x16Font,20,maxy-20,"Hello, World!",0xffffff);
rfbMarkRectAsModified(cl->screen,0, 0,maxx,maxy); rfbMarkRectAsModified(cl->screen,0, 0,maxx,maxy);
fprintf (stderr, "Framebuffer blanked\n"); rfbLog("Framebuffer blanked\n");
break; break;
case XK_p: case XK_p:
case XK_P: case XK_P:
...@@ -156,11 +156,11 @@ void on_key_press (Bool down,KeySym key,rfbClientPtr cl) ...@@ -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_colors (cl->screen->frameBuffer, 0, 0, maxx, maxy); */
draw_primary_colours_generic_ultrafast (cl->screen, 0, 0, maxx, maxy); draw_primary_colours_generic_ultrafast (cl->screen, 0, 0, maxx, maxy);
rfbMarkRectAsModified(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; break;
case XK_Q: case XK_Q:
case XK_q: case XK_q:
fprintf (stderr, "Exiting now\n"); rfbLog("Exiting now\n");
exit(0); exit(0);
case XK_C: case XK_C:
case XK_c: case XK_c:
...@@ -169,7 +169,7 @@ void on_key_press (Bool down,KeySym key,rfbClientPtr cl) ...@@ -169,7 +169,7 @@ void on_key_press (Bool down,KeySym key,rfbClientPtr cl)
rfbMarkRectAsModified(cl->screen,0, 0,maxx,maxy); rfbMarkRectAsModified(cl->screen,0, 0,maxx,maxy);
break; break;
default: 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) ...@@ -68,7 +68,7 @@ int get_next_message(char* buffer,int len,single_instance_struct* str,int usecs)
} }
buffer[reallen]=0; buffer[reallen]=0;
#ifdef DEBUG_1INSTANCE #ifdef DEBUG_1INSTANCE
if(reallen!=0) fprintf(stderr,"message received: %s.\n",buffer); if(reallen!=0) rfbLog("message received: %s.\n",buffer);
#endif #endif
} }
...@@ -104,7 +104,7 @@ void send_message(single_instance_struct* str,char* message) ...@@ -104,7 +104,7 @@ void send_message(single_instance_struct* str,char* message)
#endif #endif
write(str->fd,message,strlen(message)); write(str->fd,message,strlen(message));
#ifdef DEBUG_1INSTANCE #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 #endif
} }
...@@ -118,7 +118,7 @@ single_instance_struct str1 = { "/tmp/1instance" }; ...@@ -118,7 +118,7 @@ single_instance_struct str1 = { "/tmp/1instance" };
void my_dispatcher(char* message) void my_dispatcher(char* message)
{ {
#ifdef DEBUG_1INSTANCE #ifdef DEBUG_1INSTANCE
fprintf(stderr,"Message arrived: %s.\n",message); rfbLog("Message arrived: %s.\n",message);
#endif #endif
if(!strcmp(message,"quit")) { if(!strcmp(message,"quit")) {
delete_control_file(str1); 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. # Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
...@@ -12,7 +13,6 @@ ...@@ -12,7 +13,6 @@
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
@SET_MAKE@ @SET_MAKE@
SHELL = @SHELL@ SHELL = @SHELL@
srcdir = @srcdir@ srcdir = @srcdir@
...@@ -43,9 +43,13 @@ AUTOCONF = @AUTOCONF@ ...@@ -43,9 +43,13 @@ AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@ AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@ AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@ 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_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA) INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@ transform = @program_transform_name@
...@@ -55,18 +59,21 @@ POST_INSTALL = : ...@@ -55,18 +59,21 @@ POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CCLD = @CCLD@ CCLD = @CCLD@
CXX = @CXX@ CXX = @CXX@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
EXEEXT = @EXEEXT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
RPMSOURCEDIR = @RPMSOURCEDIR@ RPMSOURCEDIR = @RPMSOURCEDIR@
STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
X_CFLAGS = @X_CFLAGS@ X_CFLAGS = @X_CFLAGS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@
...@@ -75,7 +82,6 @@ X_PRE_LIBS = @X_PRE_LIBS@ ...@@ -75,7 +82,6 @@ X_PRE_LIBS = @X_PRE_LIBS@
am__include = @am__include@ am__include = @am__include@
am__quote = @am__quote@ am__quote = @am__quote@
install_sh = @install_sh@ install_sh = @install_sh@
CFLAGS = -I.. -g -Wall CFLAGS = -I.. -g -Wall
@HAVE_LIBPTHREAD_TRUE@BACKGROUND_TEST = blooptest @HAVE_LIBPTHREAD_TRUE@BACKGROUND_TEST = blooptest
...@@ -203,13 +209,14 @@ CPPFLAGS = @CPPFLAGS@ ...@@ -203,13 +209,14 @@ CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
LIBS = @LIBS@ LIBS = @LIBS@
depcomp = $(SHELL) $(top_srcdir)/depcomp depcomp = $(SHELL) $(top_srcdir)/depcomp
@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/blooptest.Po \ am__depfiles_maybe = depfiles
@AMDEP_TRUE@ $(DEPDIR)/colourmaptest.Po $(DEPDIR)/example.Po \ @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/blooptest.Po \
@AMDEP_TRUE@ $(DEPDIR)/fontsel.Po $(DEPDIR)/mac.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/colourmaptest.Po ./$(DEPDIR)/example.Po \
@AMDEP_TRUE@ $(DEPDIR)/pnmshow.Po $(DEPDIR)/pnmshow24.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/fontsel.Po ./$(DEPDIR)/mac.Po \
@AMDEP_TRUE@ $(DEPDIR)/regiontest.Po $(DEPDIR)/simple.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/pnmshow.Po ./$(DEPDIR)/pnmshow24.Po \
@AMDEP_TRUE@ $(DEPDIR)/simple15.Po $(DEPDIR)/storepasswd.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/regiontest.Po ./$(DEPDIR)/simple.Po \
@AMDEP_TRUE@ $(DEPDIR)/vncev.Po @AMDEP_TRUE@ ./$(DEPDIR)/simple15.Po ./$(DEPDIR)/storepasswd.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/vncev.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
...@@ -229,9 +236,7 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) ...@@ -229,9 +236,7 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && \ cd $(top_srcdir) && \
$(AUTOMAKE) --gnu examples/Makefile $(AUTOMAKE) --gnu examples/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
CONFIG_HEADERS= CONFIG_LINKS= \
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
clean-noinstPROGRAMS: clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
...@@ -278,27 +283,27 @@ mostlyclean-compile: ...@@ -278,27 +283,27 @@ mostlyclean-compile:
distclean-compile: distclean-compile:
-rm -f *.tab.c -rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/blooptest.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)/colourmaptest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/example.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)/fontsel.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/mac.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)/pnmshow.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pnmshow24.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)/regiontest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/simple.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)/simple15.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/storepasswd.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)/vncev.Po@am__quote@
distclean-depend: distclean-depend:
-rm -rf $(DEPDIR) -rm -rf ./$(DEPDIR)
.c.o: .c.o:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
.c.obj: .c.obj:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
...@@ -308,53 +313,61 @@ distclean-depend: ...@@ -308,53 +313,61 @@ distclean-depend:
CCDEPMODE = @CCDEPMODE@ CCDEPMODE = @CCDEPMODE@
uninstall-info-am: uninstall-info-am:
ETAGS = etags
ETAGSFLAGS =
tags: TAGS tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \ unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \ done | \
$(AWK) ' { files[$$0] = 1; } \ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \ END { for (i in files) print i; }'`; \
mkid -fID $$unique $(LISP) mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP) $(TAGS_FILES) $(LISP)
tags=; \ tags=; \
here=`pwd`; \ here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \ unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \ done | \
$(AWK) ' { files[$$0] = 1; } \ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \ END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| etags $(ETAGS_ARGS) $$tags $$unique $(LISP) || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
GTAGS: GTAGS:
here=`CDPATH=: && cd $(top_builddir) && pwd` \ here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \ && cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here && gtags -i $(GTAGS_ARGS) $$here
distclean-tags: distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = .. top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES) distdir: $(DISTFILES)
@for file in $(DISTFILES); do \ @list='$(DISTFILES)'; for file in $$list; do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
$(mkinstalldirs) "$(distdir)/$$dir"; \ dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \ fi; \
if test -d $$d/$$file; then \ if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|| exit 1; \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \ else \
test -f $(distdir)/$$file \ test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \
...@@ -378,6 +391,7 @@ install-am: all-am ...@@ -378,6 +391,7 @@ install-am: all-am
installcheck: installcheck-am installcheck: installcheck-am
install-strip: install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \ `test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic: mostlyclean-generic:
...@@ -385,7 +399,7 @@ mostlyclean-generic: ...@@ -385,7 +399,7 @@ mostlyclean-generic:
clean-generic: clean-generic:
distclean-generic: distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* -rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
......
...@@ -54,7 +54,7 @@ int main(int argc,char** argv) ...@@ -54,7 +54,7 @@ int main(int argc,char** argv)
rfbScreen = s; rfbScreen = s;
font=rfbLoadConsoleFont(DEFAULTFONT); font=rfbLoadConsoleFont(DEFAULTFONT);
if(!font) { if(!font) {
fprintf(stderr,"Couldn't find %s\n",DEFAULTFONT); rfbLog("Couldn't find %s\n",DEFAULTFONT);
exit(1); exit(1);
} }
...@@ -62,7 +62,7 @@ int main(int argc,char** argv) ...@@ -62,7 +62,7 @@ int main(int argc,char** argv)
rfbProcessEvents(s,900000); rfbProcessEvents(s,900000);
i = rfbSelectBox(s,font,fontlist,10,20,200,300,0xffdfdf,0x602040,2,showFont); 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); rfbFreeFont(font);
......
...@@ -493,7 +493,7 @@ refreshCallback(CGRectCount count, const CGRect *rectArray, void *ignore) ...@@ -493,7 +493,7 @@ refreshCallback(CGRectCount count, const CGRect *rectArray, void *ignore)
rfbClientPtr cl; rfbClientPtr cl;
int i; int i;
for(i=0,cl=rfbScreen->rfbClientHead;cl;cl=cl->next,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') { } else if(message[0]=='t') {
rfbClientPtr cl; rfbClientPtr cl;
for(cl=rfbScreen->rfbClientHead;cl;cl=cl->next) for(cl=rfbScreen->rfbClientHead;cl;cl=cl->next)
...@@ -556,7 +556,7 @@ int main(int argc,char *argv[]) ...@@ -556,7 +556,7 @@ int main(int argc,char *argv[])
send_message(&single_instance,message); send_message(&single_instance,message);
exit(0); exit(0);
} else if(!strcmp(argv[i],"-listclients")) { } else if(!strcmp(argv[i],"-listclients")) {
fprintf(stderr,"list clients\n"); rfbLog("list clients\n");
send_message(&single_instance,"l"); send_message(&single_instance,"l");
exit(0); exit(0);
} else } else
......
...@@ -36,7 +36,7 @@ int main(int argc,char** argv) ...@@ -36,7 +36,7 @@ int main(int argc,char** argv)
/* get width & height */ /* get width & height */
sscanf(buffer,"%d %d",&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); fgets(buffer,1024,in);
/* vncviewers have problems with widths which are no multiple of 4. */ /* vncviewers have problems with widths which are no multiple of 4. */
......
...@@ -40,7 +40,7 @@ int main(int argc,char** argv) ...@@ -40,7 +40,7 @@ int main(int argc,char** argv)
/* get width & height */ /* get width & height */
sscanf(buffer,"%d %d",&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); fgets(buffer,1024,in);
/* vncviewers have problems with widths which are no multiple of 4. */ /* vncviewers have problems with widths which are no multiple of 4. */
......
...@@ -63,7 +63,7 @@ void output(rfbScreenInfoPtr s,char* line) ...@@ -63,7 +63,7 @@ void output(rfbScreenInfoPtr s,char* line)
{ {
rfbDoCopyRect(s,0,0,640,480-lineHeight,0,-lineHeight); rfbDoCopyRect(s,0,0,640,480-lineHeight,0,-lineHeight);
rfbDrawString(s,&default8x16Font,10,lineY,line,0x01); rfbDrawString(s,&default8x16Font,10,lineY,line,0x01);
fprintf(stderr,"%s\n",line); rfbLog("%s\n",line);
} }
void dokey(Bool down,KeySym k,rfbClientPtr cl) 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) ...@@ -41,7 +41,7 @@ HandleCoRREBPP (rfbClient* client, int rx, int ry, int rw, int rh)
if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbRREHeader)) if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbRREHeader))
return FALSE; return FALSE;
hdr.nSubrects = Swap32IfLE(hdr.nSubrects); hdr.nSubrects = rfbClientSwap32IfLE(hdr.nSubrects);
if (!ReadFromRFBServer(client, (char *)&pix, sizeof(pix))) if (!ReadFromRFBServer(client, (char *)&pix, sizeof(pix)))
return FALSE; return FALSE;
......
...@@ -45,9 +45,9 @@ listenForIncomingConnections(rfbClient* client) ...@@ -45,9 +45,9 @@ listenForIncomingConnections(rfbClient* client)
if ((listenSocket < 0)) exit(1); 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); 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); "a connection comes in.\n", client->programName);
while (TRUE) { while (TRUE) {
......
This diff is collapsed.
...@@ -40,7 +40,7 @@ HandleRREBPP (rfbClient* client, int rx, int ry, int rw, int rh) ...@@ -40,7 +40,7 @@ HandleRREBPP (rfbClient* client, int rx, int ry, int rw, int rh)
if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbRREHeader)) if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbRREHeader))
return FALSE; return FALSE;
hdr.nSubrects = Swap32IfLE(hdr.nSubrects); hdr.nSubrects = rfbClientSwap32IfLE(hdr.nSubrects);
if (!ReadFromRFBServer(client, (char *)&pix, sizeof(pix))) if (!ReadFromRFBServer(client, (char *)&pix, sizeof(pix)))
return FALSE; return FALSE;
...@@ -54,10 +54,10 @@ HandleRREBPP (rfbClient* client, int rx, int ry, int rw, int rh) ...@@ -54,10 +54,10 @@ HandleRREBPP (rfbClient* client, int rx, int ry, int rw, int rh)
if (!ReadFromRFBServer(client, (char *)&subrect, sz_rfbRectangle)) if (!ReadFromRFBServer(client, (char *)&subrect, sz_rfbRectangle))
return FALSE; return FALSE;
subrect.x = Swap16IfLE(subrect.x); subrect.x = rfbClientSwap16IfLE(subrect.x);
subrect.y = Swap16IfLE(subrect.y); subrect.y = rfbClientSwap16IfLE(subrect.y);
subrect.w = Swap16IfLE(subrect.w); subrect.w = rfbClientSwap16IfLE(subrect.w);
subrect.h = Swap16IfLE(subrect.h); subrect.h = rfbClientSwap16IfLE(subrect.h);
FillRectangle(client, rx+subrect.x, ry+subrect.y, subrect.w, subrect.h, pix); 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) ...@@ -90,7 +90,7 @@ ReadFromRFBServer(rfbClient* client, char *out, unsigned int n)
} }
} else { } else {
if (errorMessageOnReadFailure) { if (errorMessageOnReadFailure) {
fprintf(stderr,"VNC server closed connection\n"); rfbClientLog("VNC server closed connection\n");
} }
return FALSE; return FALSE;
} }
...@@ -120,7 +120,7 @@ ReadFromRFBServer(rfbClient* client, char *out, unsigned int n) ...@@ -120,7 +120,7 @@ ReadFromRFBServer(rfbClient* client, char *out, unsigned int n)
} }
} else { } else {
if (errorMessageOnReadFailure) { if (errorMessageOnReadFailure) {
fprintf(stderr,"VNC server closed connection\n"); rfbClientLog("VNC server closed connection\n");
} }
return FALSE; return FALSE;
} }
...@@ -139,7 +139,7 @@ ReadFromRFBServer(rfbClient* client, char *out, unsigned int n) ...@@ -139,7 +139,7 @@ ReadFromRFBServer(rfbClient* client, char *out, unsigned int n)
*/ */
Bool Bool
WriteExact(rfbClient* client, char *buf, int n) WriteToRFBServer(rfbClient* client, char *buf, int n)
{ {
fd_set fds; fd_set fds;
int i = 0; int i = 0;
...@@ -163,7 +163,7 @@ WriteExact(rfbClient* client, char *buf, int n) ...@@ -163,7 +163,7 @@ WriteExact(rfbClient* client, char *buf, int n)
return FALSE; return FALSE;
} }
} else { } else {
fprintf(stderr,"write failed\n"); rfbClientLog("write failed\n");
return FALSE; return FALSE;
} }
} }
...@@ -178,7 +178,7 @@ WriteExact(rfbClient* client, char *buf, int n) ...@@ -178,7 +178,7 @@ WriteExact(rfbClient* client, char *buf, int n)
*/ */
int int
ConnectToTcpAddr(unsigned int host, int port) ConnectClientToTcpAddr(unsigned int host, int port)
{ {
int sock; int sock;
struct sockaddr_in addr; struct sockaddr_in addr;
...@@ -392,32 +392,32 @@ PrintInHex(char *buf, int len) ...@@ -392,32 +392,32 @@ PrintInHex(char *buf, int len)
str[16] = 0; str[16] = 0;
fprintf(stderr,"ReadExact: "); rfbClientLog("ReadExact: ");
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
if ((i % 16 == 0) && (i != 0)) { if ((i % 16 == 0) && (i != 0)) {
fprintf(stderr," "); rfbClientLog(" ");
} }
c = buf[i]; c = buf[i];
str[i % 16] = (((c > 31) && (c < 127)) ? c : '.'); str[i % 16] = (((c > 31) && (c < 127)) ? c : '.');
fprintf(stderr,"%02x ",(unsigned char)c); rfbClientLog("%02x ",(unsigned char)c);
if ((i % 4) == 3) if ((i % 4) == 3)
fprintf(stderr," "); rfbClientLog(" ");
if ((i % 16) == 15) if ((i % 16) == 15)
{ {
fprintf(stderr,"%s\n",str); rfbClientLog("%s\n",str);
} }
} }
if ((i % 16) != 0) if ((i % 16) != 0)
{ {
for (j = i % 16; j < 16; j++) for (j = i % 16; j < 16; j++)
{ {
fprintf(stderr," "); rfbClientLog(" ");
if ((j % 4) == 3) fprintf(stderr," "); if ((j % 4) == 3) rfbClientLog(" ");
} }
str[i % 16] = 0; str[i % 16] = 0;
fprintf(stderr,"%s\n",str); rfbClientLog("%s\n",str);
} }
fflush(stderr); fflush(stderr);
......
...@@ -105,7 +105,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh) ...@@ -105,7 +105,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
if ((comp_ctl & 1) && zlibStreamActive[stream_id]) { if ((comp_ctl & 1) && zlibStreamActive[stream_id]) {
if (inflateEnd (&zlibStream[stream_id]) != Z_OK && if (inflateEnd (&zlibStream[stream_id]) != Z_OK &&
zlibStream[stream_id].msg != NULL) 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; zlibStreamActive[stream_id] = FALSE;
} }
comp_ctl >>= 1; comp_ctl >>= 1;
...@@ -135,7 +135,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh) ...@@ -135,7 +135,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
#if BPP == 8 #if BPP == 8
if (comp_ctl == rfbTightJpeg) { 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; return FALSE;
} }
#else #else
...@@ -146,7 +146,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh) ...@@ -146,7 +146,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
/* Quit on unsupported subencoding value. */ /* Quit on unsupported subencoding value. */
if (comp_ctl > rfbTightMaxSubencoding) { if (comp_ctl > rfbTightMaxSubencoding) {
fprintf(stderr, "Tight encoding: bad subencoding value received.\n"); rfbClientLog("Tight encoding: bad subencoding value received.\n");
return FALSE; return FALSE;
} }
...@@ -174,7 +174,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh) ...@@ -174,7 +174,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
bitsPixel = InitFilterGradientBPP(client, rw, rh); bitsPixel = InitFilterGradientBPP(client, rw, rh);
break; break;
default: default:
fprintf(stderr, "Tight encoding: unknown filter code received.\n"); rfbClientLog("Tight encoding: unknown filter code received.\n");
return FALSE; return FALSE;
} }
} else { } else {
...@@ -182,7 +182,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh) ...@@ -182,7 +182,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
bitsPixel = InitFilterCopyBPP(client, rw, rh); bitsPixel = InitFilterCopyBPP(client, rw, rh);
} }
if (bitsPixel == 0) { if (bitsPixel == 0) {
fprintf(stderr, "Tight encoding: error receiving palette.\n"); rfbClientLog("Tight encoding: error receiving palette.\n");
return FALSE; return FALSE;
} }
...@@ -203,7 +203,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh) ...@@ -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. */ /* Read the length (1..3 bytes) of compressed data following. */
compressedLen = (int)ReadCompactLen(client); compressedLen = (int)ReadCompactLen(client);
if (compressedLen <= 0) { if (compressedLen <= 0) {
fprintf(stderr, "Incorrect data received from the server.\n"); rfbClientLog("Incorrect data received from the server.\n");
return FALSE; return FALSE;
} }
...@@ -217,7 +217,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh) ...@@ -217,7 +217,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
err = inflateInit(zs); err = inflateInit(zs);
if (err != Z_OK) { if (err != Z_OK) {
if (zs->msg != NULL) if (zs->msg != NULL)
fprintf(stderr, "InflateInit error: %s.\n", zs->msg); rfbClientLog("InflateInit error: %s.\n", zs->msg);
return FALSE; return FALSE;
} }
zlibStreamActive[stream_id] = TRUE; zlibStreamActive[stream_id] = TRUE;
...@@ -229,7 +229,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh) ...@@ -229,7 +229,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
buffer2 = &client->buffer[bufferSize]; buffer2 = &client->buffer[bufferSize];
if (rowSize > bufferSize) { if (rowSize > bufferSize) {
/* Should be impossible when BUFFER_SIZE >= 16384 */ /* Should be impossible when BUFFER_SIZE >= 16384 */
fprintf(stderr, "Internal error: incorrect buffer size.\n"); rfbClientLog("Internal error: incorrect buffer size.\n");
return FALSE; return FALSE;
} }
...@@ -259,9 +259,9 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh) ...@@ -259,9 +259,9 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
break; break;
if (err != Z_OK && err != Z_STREAM_END) { if (err != Z_OK && err != Z_STREAM_END) {
if (zs->msg != NULL) { if (zs->msg != NULL) {
fprintf(stderr, "Inflate error: %s.\n", zs->msg); rfbClientLog("Inflate error: %s.\n", zs->msg);
} else { } else {
fprintf(stderr, "Inflate error: %d.\n", err); rfbClientLog("Inflate error: %d.\n", err);
} }
return FALSE; return FALSE;
} }
...@@ -282,7 +282,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh) ...@@ -282,7 +282,7 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
} }
if (rowsProcessed != 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; return FALSE;
} }
...@@ -545,13 +545,13 @@ DecompressJpegRectBPP(rfbClient* client, int x, int y, int w, int h) ...@@ -545,13 +545,13 @@ DecompressJpegRectBPP(rfbClient* client, int x, int y, int w, int h)
compressedLen = (int)ReadCompactLen(client); compressedLen = (int)ReadCompactLen(client);
if (compressedLen <= 0) { if (compressedLen <= 0) {
fprintf(stderr, "Incorrect data received from the server.\n"); rfbClientLog("Incorrect data received from the server.\n");
return FALSE; return FALSE;
} }
compressedData = malloc(compressedLen); compressedData = malloc(compressedLen);
if (compressedData == NULL) { if (compressedData == NULL) {
fprintf(stderr, "Memory allocation error.\n"); rfbClientLog("Memory allocation error.\n");
return FALSE; return FALSE;
} }
...@@ -571,7 +571,7 @@ DecompressJpegRectBPP(rfbClient* client, int x, int y, int w, int h) ...@@ -571,7 +571,7 @@ DecompressJpegRectBPP(rfbClient* client, int x, int y, int w, int h)
jpeg_start_decompress(&cinfo); jpeg_start_decompress(&cinfo);
if (cinfo.output_width != w || cinfo.output_height != h || if (cinfo.output_width != w || cinfo.output_height != h ||
cinfo.output_components != 3) { 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); jpeg_destroy_decompress(&cinfo);
free(compressedData); free(compressedData);
return FALSE; return FALSE;
......
...@@ -86,7 +86,7 @@ rfbClient* rfbGetClient(int* argc,char** argv, ...@@ -86,7 +86,7 @@ rfbClient* rfbGetClient(int* argc,char** argv,
client->HandleCursorPos = DummyPoint; client->HandleCursorPos = DummyPoint;
client->SoftCursorLockArea = DummyRect; client->SoftCursorLockArea = DummyRect;
client->SoftCursorUnlockScreen = Dummy; client->SoftCursorUnlockScreen = Dummy;
client->FramebufferUpdateReceived = DummyRect; client->GotFrameBufferUpdate = DummyRect;
client->GetPassword = NoPassword; client->GetPassword = NoPassword;
client->MallocFrameBuffer = MallocFrameBuffer; client->MallocFrameBuffer = MallocFrameBuffer;
client->Bell = Dummy; client->Bell = Dummy;
...@@ -94,147 +94,30 @@ rfbClient* rfbGetClient(int* argc,char** argv, ...@@ -94,147 +94,30 @@ rfbClient* rfbGetClient(int* argc,char** argv,
return client; return client;
} }
void PrintRect(rfbClient* client, int x, int y, int w, int h) { Bool rfbInitClient(rfbClient* client,const char* vncServerHost,int vncServerPort)
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)
{ {
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 /* Unless we accepted an incoming connection, make a TCP connection to the
given VNC server */ given VNC server */
if (!client->listenSpecified) { 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 */ /* 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->width=client->si.framebufferWidth;
client->height=client->si.framebufferHeight; client->height=client->si.framebufferHeight;
client->MallocFrameBuffer(client); 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 return TRUE;
automatically be processed whenever the VNC connection is idle. */
while (1) {
if (!HandleRFBServerMessage(client))
break;
}
return 0;
} }
...@@ -60,7 +60,7 @@ HandleZlibBPP (rfbClient* client, int rx, int ry, int rw, int rh) ...@@ -60,7 +60,7 @@ HandleZlibBPP (rfbClient* client, int rx, int ry, int rw, int rh)
if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbZlibHeader)) if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbZlibHeader))
return FALSE; return FALSE;
remaining = Swap32IfLE(hdr.nBytes); remaining = rfbClientSwap32IfLE(hdr.nBytes);
/* Need to initialize the decompressor state. */ /* Need to initialize the decompressor state. */
decompStream.next_in = ( Bytef * )client->buffer; decompStream.next_in = ( Bytef * )client->buffer;
...@@ -75,7 +75,7 @@ HandleZlibBPP (rfbClient* client, int rx, int ry, int rw, int rh) ...@@ -75,7 +75,7 @@ HandleZlibBPP (rfbClient* client, int rx, int ry, int rw, int rh)
inflateResult = inflateInit( &decompStream ); inflateResult = inflateInit( &decompStream );
if ( inflateResult != Z_OK ) { if ( inflateResult != Z_OK ) {
fprintf(stderr, rfbClientLog(
"inflateInit returned error: %d, msg: %s\n", "inflateInit returned error: %d, msg: %s\n",
inflateResult, inflateResult,
decompStream.msg); decompStream.msg);
...@@ -113,11 +113,11 @@ HandleZlibBPP (rfbClient* client, int rx, int ry, int rw, int rh) ...@@ -113,11 +113,11 @@ HandleZlibBPP (rfbClient* client, int rx, int ry, int rw, int rh)
/* We never supply a dictionary for compression. */ /* We never supply a dictionary for compression. */
if ( inflateResult == Z_NEED_DICT ) { if ( inflateResult == Z_NEED_DICT ) {
fprintf(stderr,"zlib inflate needs a dictionary!\n"); rfbClientLog("zlib inflate needs a dictionary!\n");
return FALSE; return FALSE;
} }
if ( inflateResult < 0 ) { if ( inflateResult < 0 ) {
fprintf(stderr, rfbClientLog(
"zlib inflate returned error: %d, msg: %s\n", "zlib inflate returned error: %d, msg: %s\n",
inflateResult, inflateResult,
decompStream.msg); decompStream.msg);
...@@ -129,7 +129,7 @@ HandleZlibBPP (rfbClient* client, int rx, int ry, int rw, int rh) ...@@ -129,7 +129,7 @@ HandleZlibBPP (rfbClient* client, int rx, int ry, int rw, int rh)
*/ */
if (( decompStream.avail_in > 0 ) && if (( decompStream.avail_in > 0 ) &&
( decompStream.avail_out <= 0 )) { ( decompStream.avail_out <= 0 )) {
fprintf(stderr,"zlib inflate ran out of space!\n"); rfbClientLog("zlib inflate ran out of space!\n");
return FALSE; return FALSE;
} }
...@@ -144,7 +144,7 @@ HandleZlibBPP (rfbClient* client, int rx, int ry, int rw, int rh) ...@@ -144,7 +144,7 @@ HandleZlibBPP (rfbClient* client, int rx, int ry, int rw, int rh)
} }
else { else {
fprintf(stderr, rfbClientLog(
"zlib inflate returned error: %d, msg: %s\n", "zlib inflate returned error: %d, msg: %s\n",
inflateResult, inflateResult,
decompStream.msg); decompStream.msg);
......
...@@ -548,7 +548,7 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv, ...@@ -548,7 +548,7 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
INIT_MUTEX(logMutex); INIT_MUTEX(logMutex);
if(width&3) 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->autoPort=FALSE;
rfbScreen->rfbClientHead=0; rfbScreen->rfbClientHead=0;
...@@ -816,7 +816,7 @@ void rfbRunEventLoop(rfbScreenInfoPtr rfbScreen, long usec, Bool runInBackground ...@@ -816,7 +816,7 @@ void rfbRunEventLoop(rfbScreenInfoPtr rfbScreen, long usec, Bool runInBackground
pthread_create(&listener_thread, NULL, listenerRun, rfbScreen); pthread_create(&listener_thread, NULL, listenerRun, rfbScreen);
return; return;
#else #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); exit(-1);
#endif #endif
} }
......
...@@ -39,6 +39,10 @@ ...@@ -39,6 +39,10 @@
#include <rdr/FdInStream.h> #include <rdr/FdInStream.h>
#include <rdr/Exception.h> #include <rdr/Exception.h>
extern "C" {
extern void rfbLog(const char *format, ...);
}
using namespace rdr; using namespace rdr;
enum { DEFAULT_BUF_SIZE = 8192, enum { DEFAULT_BUF_SIZE = 8192,
...@@ -136,7 +140,7 @@ int FdInStream::checkReadable(int fd, int timeout) ...@@ -136,7 +140,7 @@ int FdInStream::checkReadable(int fd, int timeout)
int n = select(fd+1, &rfds, 0, 0, &tv); int n = select(fd+1, &rfds, 0, 0, &tv);
if (n != -1 || errno != EINTR) if (n != -1 || errno != EINTR)
return n; return n;
fprintf(stderr,"select returned EINTR\n"); rfbLog("select returned EINTR\n");
} }
} }
...@@ -184,7 +188,7 @@ int FdInStream::readWithTimeoutOrCallback(void* buf, int len) ...@@ -184,7 +188,7 @@ int FdInStream::readWithTimeoutOrCallback(void* buf, int len)
n = ::read(fd, buf, len); n = ::read(fd, buf, len);
if (n != -1 || errno != EINTR) if (n != -1 || errno != EINTR)
break; break;
fprintf(stderr,"read returned EINTR\n"); rfbLog("read returned EINTR\n");
} }
if (n < 0) throw SystemException("read",errno); if (n < 0) throw SystemException("read",errno);
...@@ -192,17 +196,17 @@ int FdInStream::readWithTimeoutOrCallback(void* buf, int len) ...@@ -192,17 +196,17 @@ int FdInStream::readWithTimeoutOrCallback(void* buf, int len)
if (timing) { if (timing) {
gettimeofday(&after, 0); 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)); // (after.tv_usec - before.tv_usec));
int newTimeWaited = ((after.tv_sec - before.tv_sec) * 10000 + int newTimeWaited = ((after.tv_sec - before.tv_sec) * 10000 +
(after.tv_usec - before.tv_usec) / 100); (after.tv_usec - before.tv_usec) / 100);
int newKbits = n * 8 / 1000; int newKbits = n * 8 / 1000;
// if (newTimeWaited == 0) { // if (newTimeWaited == 0) {
// fprintf(stderr,"new kbps infinite t %d k %d\n", // rfbLog("new kbps infinite t %d k %d\n",
// newTimeWaited, newKbits); // newTimeWaited, newKbits);
// } else { // } 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); // newKbits * 10000 / newTimeWaited, newTimeWaited, newKbits);
// } // }
......
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
#include <rdr/Exception.h> #include <rdr/Exception.h>
#include <zlib.h> #include <zlib.h>
extern "C" {
extern void rfbLog(const char *format, ...);
}
using namespace rdr; using namespace rdr;
enum { DEFAULT_BUF_SIZE = 16384 }; enum { DEFAULT_BUF_SIZE = 16384 };
...@@ -65,7 +69,7 @@ void ZlibOutStream::flush() ...@@ -65,7 +69,7 @@ void ZlibOutStream::flush()
zs->next_in = start; zs->next_in = start;
zs->avail_in = ptr - 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) { while (zs->avail_in != 0) {
...@@ -74,12 +78,12 @@ void ZlibOutStream::flush() ...@@ -74,12 +78,12 @@ void ZlibOutStream::flush()
zs->next_out = underlying->getptr(); zs->next_out = underlying->getptr();
zs->avail_out = underlying->getend() - 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); // zs->avail_in,zs->avail_out);
int rc = deflate(zs, Z_SYNC_FLUSH); int rc = deflate(zs, Z_SYNC_FLUSH);
if (rc != Z_OK) throw Exception("ZlibOutStream: deflate failed"); 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()); // zs->next_out-underlying->getptr());
underlying->setptr(zs->next_out); underlying->setptr(zs->next_out);
...@@ -92,7 +96,7 @@ void ZlibOutStream::flush() ...@@ -92,7 +96,7 @@ void ZlibOutStream::flush()
int ZlibOutStream::overrun(int itemSize, int nItems) int ZlibOutStream::overrun(int itemSize, int nItems)
{ {
// fprintf(stderr,"ZlibOutStream overrun\n"); // rfbLog("ZlibOutStream overrun\n");
if (itemSize > bufSize) if (itemSize > bufSize)
throw Exception("ZlibOutStream overrun: max itemSize exceeded"); throw Exception("ZlibOutStream overrun: max itemSize exceeded");
...@@ -106,13 +110,13 @@ int ZlibOutStream::overrun(int itemSize, int nItems) ...@@ -106,13 +110,13 @@ int ZlibOutStream::overrun(int itemSize, int nItems)
zs->next_out = underlying->getptr(); zs->next_out = underlying->getptr();
zs->avail_out = underlying->getend() - 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); // zs->avail_in,zs->avail_out);
int rc = deflate(zs, 0); int rc = deflate(zs, 0);
if (rc != Z_OK) throw Exception("ZlibOutStream: deflate failed"); 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()); // zs->next_out-underlying->getptr());
underlying->setptr(zs->next_out); underlying->setptr(zs->next_out);
...@@ -126,7 +130,7 @@ int ZlibOutStream::overrun(int itemSize, int nItems) ...@@ -126,7 +130,7 @@ int ZlibOutStream::overrun(int itemSize, int nItems)
} else { } else {
// but didn't consume all the data? try shifting what's left to the // but didn't consume all the data? try shifting what's left to the
// start of the buffer. // 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); memmove(start, zs->next_in, ptr - zs->next_in);
offset += zs->next_in - start; offset += zs->next_in - start;
ptr -= zs->next_in - start; ptr -= zs->next_in - start;
......
...@@ -44,16 +44,16 @@ extern "C" ...@@ -44,16 +44,16 @@ extern "C"
#ifdef HAVE_LIBPTHREAD #ifdef HAVE_LIBPTHREAD
#include <pthread.h> #include <pthread.h>
#if 0 /* debugging */ #if 0 /* debugging */
#define LOCK(mutex) (fprintf(stderr,"%s:%d LOCK(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_lock(&(mutex))) #define LOCK(mutex) (rfbLog("%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 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 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 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) (fprintf(stderr,"%s:%d TINI_MUTEX(%s)\n",__FILE__,__LINE__,#mutex), pthread_mutex_destroy(&(mutex))) #define TINI_MUTEX(mutex) (rfbLog("%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 TSIGNAL(cond) (rfbLog("%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 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 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 INIT_COND(cond) (rfbLog("%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 TINI_COND(cond) (rfbLog("%s:%d TINI_COND(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_destroy(&(cond)))
#define IF_PTHREADS(x) x #define IF_PTHREADS(x) x
#else #else
#define LOCK(mutex) pthread_mutex_lock(&(mutex)); #define LOCK(mutex) pthread_mutex_lock(&(mutex));
......
...@@ -31,10 +31,10 @@ ...@@ -31,10 +31,10 @@
#include <rfb/rfbproto.h> #include <rfb/rfbproto.h>
#include <rfb/keysym.h> #include <rfb/keysym.h>
#define Swap16IfLE(s) \ #define rfbClientSwap16IfLE(s) \
(*(char *)&client->endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s)) (*(char *)&client->endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s))
#define Swap32IfLE(l) \ #define rfbClientSwap32IfLE(l) \
(*(char *)&client->endianTest ? ((((l) & 0xff000000) >> 24) | \ (*(char *)&client->endianTest ? ((((l) & 0xff000000) >> 24) | \
(((l) & 0x00ff0000) >> 8) | \ (((l) & 0x00ff0000) >> 8) | \
(((l) & 0x0000ff00) << 8) | \ (((l) & 0x0000ff00) << 8) | \
...@@ -92,7 +92,7 @@ struct _rfbClient; ...@@ -92,7 +92,7 @@ struct _rfbClient;
typedef Bool (*HandleCursorPosProc)(struct _rfbClient* client, int x, int y); 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 (*SoftCursorLockAreaProc)(struct _rfbClient* client, int x, int y, int w, int h);
typedef void (*SoftCursorUnlockScreenProc)(struct _rfbClient* client); 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 char* (*GetPasswordProc)(struct _rfbClient* client);
typedef Bool (*MallocFrameBufferProc)(struct _rfbClient* client); typedef Bool (*MallocFrameBufferProc)(struct _rfbClient* client);
typedef void (*BellProc)(struct _rfbClient* client); typedef void (*BellProc)(struct _rfbClient* client);
...@@ -137,7 +137,7 @@ typedef struct _rfbClient { ...@@ -137,7 +137,7 @@ typedef struct _rfbClient {
HandleCursorPosProc HandleCursorPos; HandleCursorPosProc HandleCursorPos;
SoftCursorLockAreaProc SoftCursorLockArea; SoftCursorLockAreaProc SoftCursorLockArea;
SoftCursorUnlockScreenProc SoftCursorUnlockScreen; SoftCursorUnlockScreenProc SoftCursorUnlockScreen;
FramebufferUpdateReceivedProc FramebufferUpdateReceived; GotFrameBufferUpdateProc GotFrameBufferUpdate;
GetPasswordProc GetPassword; GetPasswordProc GetPassword;
MallocFrameBufferProc MallocFrameBuffer; MallocFrameBufferProc MallocFrameBuffer;
BellProc Bell; BellProc Bell;
...@@ -155,6 +155,8 @@ extern void listenForIncomingConnections(rfbClient* viewer); ...@@ -155,6 +155,8 @@ extern void listenForIncomingConnections(rfbClient* viewer);
/* rfbproto.c */ /* rfbproto.c */
extern Bool rfbEnableClientLogging;
extern void rfbClientLog(const char *format, ...);
extern Bool ConnectToRFBServer(rfbClient* client,const char *hostname, int port); extern Bool ConnectToRFBServer(rfbClient* client,const char *hostname, int port);
extern Bool InitialiseRFBConnection(rfbClient* client); extern Bool InitialiseRFBConnection(rfbClient* client);
extern Bool SetFormatAndEncodings(rfbClient* client); extern Bool SetFormatAndEncodings(rfbClient* client);
...@@ -174,13 +176,16 @@ extern void PrintPixelFormat(rfbPixelFormat *format); ...@@ -174,13 +176,16 @@ extern void PrintPixelFormat(rfbPixelFormat *format);
extern Bool errorMessageOnReadFailure; extern Bool errorMessageOnReadFailure;
extern Bool ReadFromRFBServer(rfbClient* client, char *out, unsigned int n); 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 FindFreeTcpPort(void);
extern int ListenAtTcpPort(int port); 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 int AcceptTcpConnection(int listenSock);
extern Bool SetNonBlocking(int sock); extern Bool SetNonBlocking(int sock);
extern Bool StringToIPAddr(const char *str, unsigned int *addr); extern Bool StringToIPAddr(const char *str, unsigned int *addr);
extern Bool SameMachine(int sock); 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 */ /* Enable 24 bit per pixel in native framebuffer */
#undef ALLOW24BPP #undef ALLOW24BPP
...@@ -6,146 +6,161 @@ ...@@ -6,146 +6,161 @@
/* Enable BackChannel communication */ /* Enable BackChannel communication */
#undef BACKCHANNEL #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 #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 #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 #undef HAVE_FCNTL_H
/* Define if you have the `ftime' function. */ /* Define to 1 if you have the `ftime' function. */
#undef HAVE_FTIME #undef HAVE_FTIME
/* Define if you have the `gethostbyname' function. */ /* Define to 1 if you have the `gethostbyname' function. */
#undef HAVE_GETHOSTBYNAME #undef HAVE_GETHOSTBYNAME
/* Define if you have the `gethostname' function. */ /* Define to 1 if you have the `gethostname' function. */
#undef HAVE_GETHOSTNAME #undef HAVE_GETHOSTNAME
/* Define if you have the `gettimeofday' function. */ /* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY #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 #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 #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 #undef HAVE_LIBJPEG
/* Define if you have the `nsl' library (-lnsl). */ /* Define to 1 if you have the `nsl' library (-lnsl). */
#undef HAVE_LIBNSL #undef HAVE_LIBNSL
/* Define if you have the `pthread' library (-lpthread). */ /* Define to 1 if you have the `pthread' library (-lpthread). */
#undef HAVE_LIBPTHREAD #undef HAVE_LIBPTHREAD
/* Define if you have the `socket' library (-lsocket). */ /* Define to 1 if you have the `socket' library (-lsocket). */
#undef HAVE_LIBSOCKET #undef HAVE_LIBSOCKET
/* Define if you have the `z' library (-lz). */ /* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ #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 #undef HAVE_MALLOC
/* Define if you have the `memmove' function. */ /* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE #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 #undef HAVE_MEMORY_H
/* Define if you have the `memset' function. */ /* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET #undef HAVE_MEMSET
/* Define if you have the `mkfifo' function. */ /* Define to 1 if you have the `mkfifo' function. */
#undef HAVE_MKFIFO #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 #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 #undef HAVE_NETINET_IN_H
/* Define if you have the `select' function. */ /* Define to 1 if you have the `select' function. */
#undef HAVE_SELECT #undef HAVE_SELECT
/* Define if you have the `socket' function. */ /* Define to 1 if you have the `socket' function. */
#undef HAVE_SOCKET #undef HAVE_SOCKET
/* Define if `stat' has the bug that it succeeds when given the zero-length /* Define to 1 if `stat' has the bug that it succeeds when given the
file name argument. */ zero-length file name argument. */
#undef HAVE_STAT_EMPTY_STRING_BUG #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 #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 #undef HAVE_STDLIB_H
/* Define if you have the `strchr' function. */ /* Define to 1 if you have the `strchr' function. */
#undef HAVE_STRCHR #undef HAVE_STRCHR
/* Define if you have the `strcspn' function. */ /* Define to 1 if you have the `strcspn' function. */
#undef HAVE_STRCSPN #undef HAVE_STRCSPN
/* Define if you have the `strdup' function. */ /* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP #undef HAVE_STRDUP
/* Define if you have the `strerror' function. */ /* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR #undef HAVE_STRERROR
/* Define if you have the `strftime' function. */ /* Define to 1 if you have the `strftime' function. */
#undef HAVE_STRFTIME #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 #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 #undef HAVE_STRING_H
/* Define if you have the `strstr' function. */ /* Define to 1 if you have the `strstr' function. */
#undef HAVE_STRSTR #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 #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 #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 #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 #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 #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 #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 #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 #undef HAVE_UNISTD_H
/* Define if you have the `vprintf' function. */ /* Define to 1 if you have the `vprintf' function. */
#undef HAVE_VPRINTF #undef HAVE_VPRINTF
/* Use zrle compression; needs a c++ compiler */ /* Use zrle compression; needs a c++ compiler */
#undef HAVE_ZRLE #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 #undef LSTAT_FOLLOWS_SLASHED_SYMLINK
/* Name of package */ /* Name of package */
#undef 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 */ /* The number of bytes in type char */
#undef SIZEOF_CHAR #undef SIZEOF_CHAR
...@@ -161,20 +176,20 @@ ...@@ -161,20 +176,20 @@
/* The number of bytes in type void* */ /* The number of bytes in type void* */
#undef SIZEOF_VOIDP #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 #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 #undef TIME_WITH_SYS_TIME
/* Version number of package */ /* Version number of package */
#undef VERSION #undef VERSION
/* Define if your processor stores words with the most significant byte first /* Define to 1 if your processor stores words with the most significant byte
(like Motorola and SPARC, unlike Intel and VAX). */ first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN #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 #undef X_DISPLAY_MISSING
/* Define to empty if `const' does not conform to ANSI C. */ /* Define to empty if `const' does not conform to ANSI C. */
......
...@@ -602,7 +602,6 @@ sraRegion *sraRgnBBox(const sraRegion *src) { ...@@ -602,7 +602,6 @@ sraRegion *sraRgnBBox(const sraRegion *src) {
xmin=hcurr->start; xmin=hcurr->start;
if(hcurr->end>xmax) if(hcurr->end>xmax)
xmax=hcurr->end; xmax=hcurr->end;
fprintf(stderr,"%d,%d,%d,%d\n",hcurr->start,vcurr->start,hcurr->end,vcurr->end);
hcurr = hcurr->_next; hcurr = hcurr->_next;
} }
...@@ -761,7 +760,7 @@ Bool sraRgnIteratorNext(sraRectangleIterator* i,sraRect* r) ...@@ -761,7 +760,7 @@ Bool sraRgnIteratorNext(sraRectangleIterator* i,sraRect* r)
} }
if((i->ptrPos%4)!=2) { 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); exit(-1);
} }
......
...@@ -1214,16 +1214,17 @@ rfbSendFramebufferUpdate(cl, givenUpdateRegion) ...@@ -1214,16 +1214,17 @@ rfbSendFramebufferUpdate(cl, givenUpdateRegion)
fu->type = rfbFramebufferUpdate; fu->type = rfbFramebufferUpdate;
if (nUpdateRegionRects != 0xFFFF) { if (nUpdateRegionRects != 0xFFFF) {
if(cl->screen->maxRectsPerUpdate>0 if(cl->screen->maxRectsPerUpdate>0
/* Tight encoding counts the rectangles differently */
&& cl->preferredEncoding != rfbEncodingTight
&& nUpdateRegionRects>cl->screen->maxRectsPerUpdate) { && nUpdateRegionRects>cl->screen->maxRectsPerUpdate) {
sraRegion* newUpdateRegion = sraRgnBBox(updateRegion); sraRegion* newUpdateRegion = sraRgnBBox(updateRegion);
sraRgnDestroy(updateRegion); sraRgnDestroy(updateRegion);
updateRegion = newUpdateRegion; updateRegion = newUpdateRegion;
nUpdateRegionRects = sraRgnCountRects(updateRegion); nUpdateRegionRects = sraRgnCountRects(updateRegion);
} }
fu->nRects = Swap16IfLE((uint16_t)(sraRgnCountRects(updateCopyRegion) + fu->nRects = Swap16IfLE((uint16_t)(sraRgnCountRects(updateCopyRegion) +
nUpdateRegionRects + nUpdateRegionRects +
!!sendCursorShape + !!sendCursorPos)); !!sendCursorShape + !!sendCursorPos));
} else { } else {
fu->nRects = 0xFFFF; fu->nRects = 0xFFFF;
} }
......
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) ...@@ -19,7 +19,7 @@ int main(int argc,char** argv)
for(i=0;i<300;i+=10) for(i=0;i<300;i+=10)
rfbMarkRectAsModified(server,i,j,i+5,j+5); rfbMarkRectAsModified(server,i,j,i+5,j+5);
rfbProcessEvents(server,50); rfbProcessEvents(server,5000);
} }
return(0); return(0);
} }
...@@ -225,6 +225,8 @@ rfbSendRectEncodingTight(cl, x, y, w, h) ...@@ -225,6 +225,8 @@ rfbSendRectEncodingTight(cl, x, y, w, h)
int x_best, y_best, w_best, h_best; int x_best, y_best, w_best, h_best;
char *fbptr; char *fbptr;
rfbSendUpdateBuf(cl);
compressLevel = cl->tightCompressLevel; compressLevel = cl->tightCompressLevel;
qualityLevel = cl->tightQualityLevel; qualityLevel = cl->tightQualityLevel;
...@@ -952,8 +954,8 @@ static Bool SendCompressedData(cl, compressedLen) ...@@ -952,8 +954,8 @@ static Bool SendCompressedData(cl, compressedLen)
memcpy(&cl->updateBuf[cl->ublen], &tightAfterBuf[i], portionLen); memcpy(&cl->updateBuf[cl->ublen], &tightAfterBuf[i], portionLen);
cl->ublen += portionLen; cl->ublen += portionLen;
} }
portionLen = UPDATE_BUF_SIZE;
cl->rfbBytesSent[rfbEncodingTight] += compressedLen; cl->rfbBytesSent[rfbEncodingTight] += compressedLen;
return TRUE; return TRUE;
} }
......
...@@ -48,7 +48,7 @@ void do_key(Bool down,KeySym keySym,rfbClientPtr cl) ...@@ -48,7 +48,7 @@ void do_key(Bool down,KeySym keySym,rfbClientPtr cl)
if(keySym<0x100) { if(keySym<0x100) {
int ret; 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); ret=ioctl(tty_inject_device,TIOCSTI,&keySym);
if(ret<0) { if(ret<0) {
static char device[64]; static char device[64];
...@@ -57,7 +57,7 @@ void do_key(Bool down,KeySym keySym,rfbClientPtr cl) ...@@ -57,7 +57,7 @@ void do_key(Bool down,KeySym keySym,rfbClientPtr cl)
tty_inject_device=open(device,O_WRONLY); tty_inject_device=open(device,O_WRONLY);
ret=ioctl(tty_inject_device,TIOCSTI,&keySym); ret=ioctl(tty_inject_device,TIOCSTI,&keySym);
if(ret<0) 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) ...@@ -88,7 +88,7 @@ int main(int argc,char **argv)
if(argc>1) { if(argc>1) {
if((tty=atoi(argv[1]))<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); exit(1);
} else { } else {
argv++; argv++;
...@@ -100,10 +100,10 @@ int main(int argc,char **argv) ...@@ -100,10 +100,10 @@ int main(int argc,char **argv)
sprintf(tty_device,"/dev/tty%d",tty); sprintf(tty_device,"/dev/tty%d",tty);
if((tty_inject_device=open(tty_device,O_WRONLY))<0) { 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); 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) { if(ioctl(tty_inject_device,TIOCGWINSZ,&dimensions)>=0) {
width=dimensions.ws_col; width=dimensions.ws_col;
...@@ -142,7 +142,7 @@ int main(int argc,char **argv) ...@@ -142,7 +142,7 @@ int main(int argc,char **argv)
if(!console->currentlyMarking) { if(!console->currentlyMarking) {
tty_file=fopen(tty_device,"rb"); tty_file=fopen(tty_device,"rb");
if(!tty_file) { if(!tty_file) {
fprintf(stderr,"cannot open device \"%s\"\n", rfbLog("cannot open device \"%s\"\n",
tty_device); tty_device);
exit(1); exit(1);
} }
...@@ -166,7 +166,7 @@ int main(int argc,char **argv) ...@@ -166,7 +166,7 @@ int main(int argc,char **argv)
console->x=(i%console->width); console->x=(i%console->width);
console->y=(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, console->x,console->y,
buffer[4+2*i],console->screenBuffer[i], buffer[4+2*i],console->screenBuffer[i],
buffer[5+2*i],console->attributeBuffer[i]); buffer[5+2*i],console->attributeBuffer[i]);
......
This diff is collapsed.
...@@ -35,7 +35,7 @@ int main(int argc, char **argv) ...@@ -35,7 +35,7 @@ int main(int argc, char **argv)
if(programArg0<argc) { if(programArg0<argc) {
int in[2],out[2],err[2],pid; int in[2],out[2],err[2],pid;
if(pipe(in)<0 || pipe(out)<0 || pipe(err)<0) { if(pipe(in)<0 || pipe(out)<0 || pipe(err)<0) {
fprintf(stderr,"Couldn't make pipes!"); rfbLog("Couldn't make pipes!");
return(1); return(1);
} }
...@@ -118,6 +118,6 @@ int main(int argc, char **argv) ...@@ -118,6 +118,6 @@ int main(int argc, char **argv)
} }
} }
} }
fprintf(stderr,"exit\n"); rfbLog("exit\n");
return(0); return(0);
} }
...@@ -52,7 +52,7 @@ void vcDrawCursor(vncConsolePtr c) ...@@ -52,7 +52,7 @@ void vcDrawCursor(vncConsolePtr c)
{ {
rfbDrawCursor(c->rfbScreen); rfbDrawCursor(c->rfbScreen);
if(c->cursorActive && !c->cursorIsDrawn && c->y<c->height && c->x<c->width) { 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); vcDrawOrHideCursor(c);
} }
} }
...@@ -63,7 +63,7 @@ void vcHideCursor(vncConsolePtr c) ...@@ -63,7 +63,7 @@ void vcHideCursor(vncConsolePtr c)
if(c->currentlyMarking) if(c->currentlyMarking)
vcUnmark(c); vcUnmark(c);
if(c->cursorIsDrawn) { if(c->cursorIsDrawn) {
/* fprintf(stderr,"HideCursor: %d,%d\n",c->x,c->y); */ /* rfbLog("HideCursor: %d,%d\n",c->x,c->y); */
vcDrawOrHideCursor(c); vcDrawOrHideCursor(c);
} }
} }
...@@ -158,7 +158,7 @@ void vcScroll(vncConsolePtr c,int lineCount) ...@@ -158,7 +158,7 @@ void vcScroll(vncConsolePtr c,int lineCount)
if(lineCount==0) if(lineCount==0)
return; return;
/* fprintf(stderr,"begin scroll\n"); */ /* rfbLog("begin scroll\n"); */
vcHideCursor(c); vcHideCursor(c);
c->dontDrawCursor=TRUE; c->dontDrawCursor=TRUE;
...@@ -197,7 +197,7 @@ void vcScroll(vncConsolePtr c,int lineCount) ...@@ -197,7 +197,7 @@ void vcScroll(vncConsolePtr c,int lineCount)
memset(c->attributeBuffer+y1/c->cHeight*c->width,0x07, memset(c->attributeBuffer+y1/c->cHeight*c->width,0x07,
(y2-y1)/c->cHeight*c->width); (y2-y1)/c->cHeight*c->width);
#endif #endif
/* fprintf(stderr,"end scroll\n"); */ /* rfbLog("end scroll\n"); */
} }
void vcCheckCoordinates(vncConsolePtr c) void vcCheckCoordinates(vncConsolePtr c)
...@@ -256,7 +256,7 @@ void vcPutCharColour(vncConsolePtr c,unsigned char ch,unsigned char foreColour,u ...@@ -256,7 +256,7 @@ void vcPutCharColour(vncConsolePtr c,unsigned char ch,unsigned char foreColour,u
} while(c->x%8); } while(c->x%8);
break; break;
default: default:
fprintf(stderr,"putchar of unknown character: %c(%d).\n",ch,ch); rfbLog("putchar of unknown character: %c(%d).\n",ch,ch);
vcPutChar(c,' '); vcPutChar(c,' ');
} }
} else { } else {
...@@ -420,7 +420,7 @@ void vcPtrAddEventProc(int buttonMask,int x,int y,rfbClientPtr cl) ...@@ -420,7 +420,7 @@ void vcPtrAddEventProc(int buttonMask,int x,int y,rfbClientPtr cl)
c->markEnd=pos; c->markEnd=pos;
vcToggleMarkCell(c,pos); vcToggleMarkCell(c,pos);
} else { } 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)); c->markStart,c->markEnd,pos));
if(c->markEnd!=pos) { if(c->markEnd!=pos) {
if(c->markEnd<pos) { if(c->markEnd<pos) {
......
...@@ -19,7 +19,7 @@ int main(int argc,char **argv) ...@@ -19,7 +19,7 @@ int main(int argc,char **argv)
l=strlen(buffer)-1; l=strlen(buffer)-1;
while(l>=0 && buffer[l]=='\n') while(l>=0 && buffer[l]=='\n')
buffer[l]=0; buffer[l]=0;
//fprintf(stderr,"%s (%d)",buffer,strlen(buffer)); //rfbLog("%s (%d)",buffer,strlen(buffer));
if(!strcmp(buffer,"quit")) if(!strcmp(buffer,"quit"))
return(0); return(0);
if(!strcmp(buffer,"s")) 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