vtgrab-0.1.8.orig/0040777000175000017500000000000007341024332013012 5ustar riskoriskovtgrab-0.1.8.orig/Makefile.in0100664000175000017500000002620407200557761015071 0ustar riskorisko# Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 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. 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 DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CC = @CC@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ bin_PROGRAMS = rvc rvcd twiglet rvc_SOURCES = rvc.c rvcd_SOURCES = rvcd.c xfree86.c twiglet_SOURCES = nrvc.c simple_panel.c twiglet_LDFLAGS = -lncurses docdir = $(datadir)/doc/$(PACKAGE) doc_DATA = doc/rvc CFLAGS = -D_GNU_SOURCE -Wall -W -O2 EXTRA_DIST = BUGS doc/rvc.sgml doc/README rvc.h xfree86.h simple_panel.h TODO Makefile.am twiglet.1 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = vtgrab.spec PROGRAMS = $(bin_PROGRAMS) DEFS = @DEFS@ -I. -I$(srcdir) -I. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ rvc_OBJECTS = rvc.o rvc_LDADD = $(LDADD) rvc_DEPENDENCIES = rvc_LDFLAGS = rvcd_OBJECTS = rvcd.o xfree86.o rvcd_LDADD = $(LDADD) rvcd_DEPENDENCIES = rvcd_LDFLAGS = twiglet_OBJECTS = nrvc.o simple_panel.o twiglet_LDADD = $(LDADD) twiglet_DEPENDENCIES = COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ DATA = $(doc_DATA) DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \ Makefile.am Makefile.in NEWS TODO aclocal.m4 config.h.in configure \ configure.in install-sh missing mkinstalldirs vtgrab.spec.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best SOURCES = $(rvc_SOURCES) $(rvcd_SOURCES) $(twiglet_SOURCES) OBJECTS = $(rvc_OBJECTS) $(rvcd_OBJECTS) $(twiglet_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status $(ACLOCAL_M4): configure.in cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) config.h: stamp-h @if test ! -f $@; then \ rm -f stamp-h; \ $(MAKE) stamp-h; \ else :; fi stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=config.h \ $(SHELL) ./config.status @echo timestamp > stamp-h 2> /dev/null $(srcdir)/config.h.in: $(srcdir)/stamp-h.in @if test ! -f $@; then \ rm -f $(srcdir)/stamp-h.in; \ $(MAKE) $(srcdir)/stamp-h.in; \ else :; fi $(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOHEADER) @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null mostlyclean-hdr: clean-hdr: distclean-hdr: -rm -f config.h maintainer-clean-hdr: vtgrab.spec: $(top_builddir)/config.status vtgrab.spec.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-binPROGRAMS: clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) distclean-binPROGRAMS: maintainer-clean-binPROGRAMS: install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) list='$(bin_PROGRAMS)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ done .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: rvc: $(rvc_OBJECTS) $(rvc_DEPENDENCIES) @rm -f rvc $(LINK) $(rvc_LDFLAGS) $(rvc_OBJECTS) $(rvc_LDADD) $(LIBS) rvcd: $(rvcd_OBJECTS) $(rvcd_DEPENDENCIES) @rm -f rvcd $(LINK) $(rvcd_LDFLAGS) $(rvcd_OBJECTS) $(rvcd_LDADD) $(LIBS) twiglet: $(twiglet_OBJECTS) $(twiglet_DEPENDENCIES) @rm -f twiglet $(LINK) $(twiglet_LDFLAGS) $(twiglet_OBJECTS) $(twiglet_LDADD) $(LIBS) install-docDATA: $(doc_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(docdir) @list='$(doc_DATA)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(docdir)/$$p"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(docdir)/$$p; \ else if test -f $$p; then \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(docdir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(docdir)/$$p; \ fi; fi; \ done uninstall-docDATA: @$(NORMAL_UNINSTALL) list='$(doc_DATA)'; for p in $$list; do \ rm -f $(DESTDIR)$(docdir)/$$p; \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist -rm -rf $(distdir) GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst dc_install_base=`cd $(distdir)/=inst && pwd`; \ cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) dist -rm -rf $(distdir) @banner="$(distdir).tar.gz is ready for distribution"; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes" dist: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) distdir: $(DISTFILES) -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) $(mkinstalldirs) $(distdir)/doc @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am all-recursive-am: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive install-exec-am: install-binPROGRAMS install-exec: install-exec-am install-data-am: install-docDATA install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-binPROGRAMS uninstall-docDATA uninstall: uninstall-am all-am: Makefile $(PROGRAMS) $(DATA) config.h all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(docdir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \ mostlyclean-compile mostlyclean-tags \ mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-tags \ clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \ distclean-tags distclean-generic clean-am distclean: distclean-am -rm -f config.status maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \ maintainer-clean-compile maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am -rm -f config.status .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile uninstall-docDATA install-docDATA tags \ mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \ distdir info-am info dvi-am dvi check check-am installcheck-am \ installcheck all-recursive-am install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean %: %.sgml @echo Use dbtohtml to make $@ # 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: vtgrab-0.1.8.orig/doc/0040775000175000017500000000000007200557761013570 5ustar riskoriskovtgrab-0.1.8.orig/doc/rvc.sgml0100664000175000017500000006771007200536412015244 0ustar riskorisko VNC"> ]>
The RVC Protocol (draft 6!) Tim Waugh
twaugh@redhat.com
Introduction Throughout this document, a virtual console refers to the active console of a machine; I acknowledge that for some configurations that doesn't mean anything. On Linux machines with virtual consoles configured, there are effectively several consoles, all multiplexed through the same display adapter. The operator can switch between them at will, and some may be graphical while others are textual. RVC (remote virtual console) is a protocol for remote access to a computer's active virtual text console, and is based on RFB. It allows a client to watch and control changes to the text console of a machine on which an RVC server is running. Like RFB, RVC makes the client stateless, meaning that a client can disconnect and reconnect without affecting the actual console on the server machine.
Viewing The viewing side of the protocol is split into three types of update, based on common tasks for virtual consoles: writing text at the cursor position, scrolling, and other arbitrary updates to characters at certain positions on the screen (as well as cursor position changes). In addition, the server can report when the machine has switched to a virtual console that is in a graphical mode, in order for the client to be able to use RFB to get updates for that console. Since different virtual consoles may have different sizes, the server can report a console size change; the client may however request that the server just sends the bottom left rectangle of a console that is too large to display in its entirety. Unlike RFB, RVC is not demand-driven by the client; the server will send incremental updates as and when they happen. However, the client can request a full screen update explicitly. Since text consoles are not nearly as big as graphical ones, bandwidth considerations don't warrant quite the same concern as with RFB. However, the client can specify (at the beginning of the connection) a maximum rate at which incremental updates are sent.
Controlling There is provision in the RVC protocol for the client to control the console at the server (but the server may or may not allow it). This allows the console input to come from the RVC client instead of (or as well as) an operator situated at the console. The model is of raw terminal input: characters are read from the console at the client end in raw mode, and written in raw mode at the server end. This results in some differences between using an RVC client and standing in front of the console, but it probably a lot easier to implement on a lot of platforms.
Representation of text display The console representation is heavily biased towards the format of Linux's /dev/vcsan. The console is just a rectangular array of characters (one byte each), each of which has an associated attribute byte. In addition there is a cursor which may be placed over any of the characters.
RVC Protocol The RVC protocol, like the RFB protocol, can operate over any reliable transport. RVC also has an initial handshaking phase. The initial handshaking for RVC consists of ProtocolVersion, Authentication, ServerInitialisation and ClientInitialisation messages. Both sides of the protocol send ProtocolVersion; the feature set to use is negotiated in the initialisation messages. The messages begin with a message-type byte followed by message-specific data. However, the message formats and their message types differ significantly from those in the RFB protocol. The messages are in network byte order.
Handshake messages
ProtocolVersion The server first sends the client a ProtocolVersion message, to which the client responds with a similar message detailing the protocol to actually use. Minor increments in the version number should be feature additions (new messages/features) that the server may optionally provide. Versions of the protocol that differ in major number are probably not compatible with one another. The ProtocolVersion message is the same as in RFB: 12 ASCII bytes. For RVC, they are as follows. ProtocolVersion No. of bytes Value 12 "RVC 001.000\n" (hex 52 56 43 20 30 30 31 30 30 0a)
<literal>Authentication</literal> The Authentication message is just the same as in RFB. <literal>Authentication</literal> No. of bytes Type Value Description 4 uint32_t authentication-scheme: 0 connection failed 1 no authentication 2 VNC authentication
This is followed by data specific to the authentication-scheme: connection failed---for some reason the connection failed. This is followed by an ASCII string describing why. <emphasis>connection failed</emphasis> No. of bytes Type Value Description 4 uint32_t reason-length reason-length uint8_t[] reason-string
For connection-based transports, the server closes the connection after sending this message.
no authentication---no authentication is needed and the protocol continues to ServerInitialisation. VNC authentication---VNC authentication is to be used. This is adequately described in the RFB protocol description and is not covered here.
<literal>ServerInitialisation</literal> The RVC server advertises to the client which features it can provide using the ServerInitialisation message. <literal>ServerInitialisation</literal> No. of bytes Type Value Description 1 uint8_t 0 message-type 1 uint8_t num-features num-features uint8_t[] feature-list
Features that can appear in the feature-list are: Features Feature Description 0 Key message 1 Pointer message 2 Incremental rectangle updates 3 Incremental scroll updates 4 Clear screen updates 5 Console cropping 6 Console switch reporting 7 Console display locking 8 Console input locking 9 Shareable session 10 VNC server integration 11 Console switching 12 Console pushing
<literal>ClientInitialisation</literal> The ClientInitialisation is a response to the ServerInitialisation message. <literal>ClientInitialisation</literal> No. of bytes Type Value Description 1 uint8_t 255 message-type 3 uint8_t[] Padding 4 uint32_t Minimum incremental update period (ms) 1 uint8_t Rows 1 uint8_t Columns 1 uint8_t 0 Special flags 1 uint8_t num-features num-features uint8_t[] features-requested
The client specifies the minimum amount of time between unsolicited incremental updates in milliseconds. It also specifies the number of rows and columns that it has. This information is only needed if the console cropping feature is used. The features-requested array refers to the features advertised in the ServerInitialisation message; if num-features exceeds the number of features advertised, the excess are ignored. A zero value for a feature request means that the feature must not be used; a value of 1 means that it may be used. If the console pushing feature is in use, the server and client swap roles, and the original client must send the original server a ServerInitialisation message, which may not advertise the console pushing feature.
Client-originated messages
<literal>FullUpdateRequest</literal> In order to request a full console update, the client uses this message. Incremental updates not covering the entire console area will not be sent by the server until it receives and responds to this message. <literal>FullUpdateRequest</literal> No. of bytes Type Value Description 1 uint8_t 254 message-type
<literal>Key</literal> If the Key feature is in use, the client can send a key to the RVC server. <literal>Key</literal> No. of bytes Type Value Description 1 uint8_t 253 message-type 1 uint8_t key
<literal>Pointer</literal> If the Pointer feature is in use, the client can send a pointer event to the RVC server. <literal>Pointer</literal> No. of bytes Type Value Description 1 uint8_t 252 message-type 1 uint8_t x position 1 uint8_t y position 1 uint8_t button-mask
The x and y positions are zero-based, from the top left hand corner. The current state of buttons 1 to 8 are represented by bits 0 to 7 of button-mask respectively, 0 meaning up, 1 meaning down.
<literal>SwitchRequest</literal> A SwitchRequest can be used to try to change the active console. If successful, a Switch message will be generated (if allowed). Note that if the active console is under programmatic control, the switch request may silently fail. <literal>SwitchRequest</literal> No. of bytes Type Value Description 1 uint8_t 251 message-type 1 uint8_t virtual console number
<literal>Terminate</literal> A Terminate message causes the server to go back to its initial state (awaiting ProtocolVersion), if the connection is still valid. <literal>Terminate</literal> No. of bytes Type Value Description 1 uint8_t 128 message-type
Server-originated messages
<literal>IncrementalUpdate</literal> If the incremental update feature is not in use, any IncrementalUpdate messages must cover the entire console area. <literal>IncrementalUpdate</literal> No. of bytes Type Value Description 1 uint8_t 1 message-type 1 uint8_t update-type: 0 rectangle 1 scroll 2 clear 2 uint16_t n content-length n uint8_t[] contents
A client must support rectangle type updates. Other types of update will only be sent if the corresponding feature is in use. The header is followed by type-specific data. For rectangle updates the header is followed by: <literal>rectangle</literal> No. of bytes Type Value Description 1 uint8_t x offset 1 uint8_t y offset 1 uint8_t rows 1 uint8_t columns 1 uint8_t x position 1 uint8_t y position 2*rows*columns uint8_t[] contents
The contents are sent in rows, with the first byte of a (row,column) entry being the character at that position, and the second being the attributes. The attribute byte takes the form of VGA text mode character attributes.
For scroll updates the header is followed by: <literal>scroll</literal> No. of bytes Type Value Description 1 uint8_t lines to scroll
For clear updates nothing else follows the header. The intent of a clear update is to tell the client to clear its terminal.
<literal>Switch</literal> If the console switch reporting feature is in use, this message may be sent. <literal>Switch</literal> No. of bytes Type Value Description 1 uint8_t 2 message-type 1 uint8_t virtual console number 2 uint16_t port number 1 uint8_t mode (0 for text)
The port number is one on which an RFB server is accepting connections for that display, or zero if there is no such server.
<literal>Terminate</literal> A Terminate message causes the client to go back to its initial state (send ProtocolVersion), if the connection is still valid. <literal>Terminate</literal> No. of bytes Type Value Description 1 uint8_t 128 message-type
vtgrab-0.1.8.orig/doc/README0100664000175000017500000000006007160131232014423 0ustar riskoriskoUse db2ps or db2html to view DocBook documents. vtgrab-0.1.8.orig/README0100664000175000017500000000220107160365303013665 0ustar riskoriskovtgrab is a program to copy the foreground terminal of one machine to another, in order to allow remote monitoring. This may not be the program you are looking for! This is quite a specialist tool, and screen may well be more appropriate for most uses! In this package is: - an RVC server (rvcd) - a console client (rvc) - an ncurses-based client (twiglet) You can use it like this: # ssh root@observed 'rvcd :6100 > /dev/null 2>&1 &' $ twiglet observed:6100 The server needs to run as root on the observed machine. The console client also needs to run as root. The eventual aim is to be able to use this in a teaching environment in such a way that whatever is on the student's screen can be seen by the tutor, including graphics. If you have vncserver installed on the client machine, and x0rfbserver installed on the server machine (with a patch to make it accept --stealth as an argument), you will be able to monitor and control X sessions too. For x0rfbserver, see the RPMS I made at: You'll need the rfb package for x0rfbserver, and it depends on xclass (also in that directory). Tim. */ vtgrab-0.1.8.orig/stamp-h.in0100664000175000017500000000001207200557760014711 0ustar riskoriskotimestamp vtgrab-0.1.8.orig/AUTHORS0100664000175000017500000000003607156133111014054 0ustar riskoriskoTim Waugh vtgrab-0.1.8.orig/COPYING0100664000175000017500000004312707137571002014053 0ustar riskorisko GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. vtgrab-0.1.8.orig/ChangeLog0100664000175000017500000001145407200557627014600 0ustar riskorisko2000-11-03 Tim Waugh * doc/rvc.sgml: Draft 6. Now includes clear updates. * rvc.h: Update. * nrvc.c (do_clear): New function. Implement clear updates. (handle_update): Use it. (syntax): Optional hostname for tty host-spec. (main): Implement it. * rvcd.c (server_loop): Re-open console if VT_GETSTATE fails. This allows rvcd to continue when things like kudzu are running. (incr_update): Only use scroll if the feature is in use. (clear_update): New function. Implement clear updates. (incr_update): Use it. 2000-11-02 Tim Waugh * configure.in: Version 0.1.7. 2000-11-02 Tim Waugh * rvcd.c (server): Zero in_use array. (incr_update): Debug logging. (main): Use 9600 baud, as it's more reliable. (scroll_update): New function. Implement scroll updates. (incr_update): Use it. (incr_update): Smarter single-line updates. * nrvc.c (do_scroll): New function. Implement scroll updates. (handle_update): Use it. (handle_update): Bug-fix for partial line updates. 2000-10-10 Tim Waugh * configure.in: Version 0.1.6. 2000-10-05 Tim Waugh * nrvc.c (terminate): New function. Do tty setup. (client): Use it. (main): Likewise. * rvcd.c (server_loop): Cap delay at a sensible amount. Do tty setup and draining. 2000-09-27 Tim Waugh * xfree86.c (grab_cookie): Use 'xauth -f authfile nlist | xauth nmerge -' instead of 'xauth -f authfile extract - display | xauth merge -'. This should be more reliable. 2000-09-17 Tim Waugh * configure.in: Version 0.1.5. 2000-09-17 Tim Waugh * nrvc.c: Switch round the order of including signal.h and curses.h. Now it compiles on Red Hat Linux 6.2 systems. 2000-09-17 Tim Waugh * configure.in: Version 0.1.4. 2000-09-17 Tim Waugh * nrvc.c (handle_update): Resize pad when necessary. (create_display_panel): New function. (client): Create display panel first. (update_display_panel): Make sloppiness dependent on window size. * rvc.c (send_key): Use unsigned char for message. * rvcd.c (server_loop): Only send an update if in text mode. (send_switch): Only track XFree86 on switches to non-text mode virtual terminals. 2000-09-15 Tim Waugh * configure.in: Version 0.1.3. * rvc.h: Define Msg_Terminate. * rvcd.c (handle_input): Handle Msg_Terminate. (server_loop): Resend Switch if x0rfbserver died. (server_loop): Send full updates even if we don't think anything changed. * simple_panel.h (bottom_panel): Declare. * simple_panel.c (update_panels): touchwin needs to be called for pads too. (bottom_panel): Implement. * nrvc.c: Don't use Feature_Crop. (update_display_panel): New function. Handle panning around. (handle_update): Use it. (client_loop): Don't create panel for stdscr as we now use a simple_pad for it. (try_vncviewer): Return the PID. (handle_switch): Kill any vncviewer process that we spawned. (client_loop): Handle Msg_Terminate. (send_switch_request): Request full update too. 2000-09-14 Tim Waugh * simple_panel.h: New file. * simple_panel.c: New file. * nrvc.c (sigint): New function. (client_loop): SIGINT handling. (client): Handle SIGINT. * rvcd.c (server_loop): Signal safety. 2000-09-13 Tim Waugh * nrvc.c (handle_switch): Change status bar delay to two seconds. (main_menu): Cleaner exit. 2000-09-13 Tim Waugh * configure.in: Version 0.1.2. 2000-09-13 Tim Waugh * xfree86.h: Interface for xfree86.c. * xfree86.c: New file for tracking XFree86-controlled consoles. * rvcd.c (incr_update): New function implementing incremental updates. (is_a_console): New function. (open_named_console): New function. (open_console): New function. (do_switch): New function implementing SwitchRequest message. (handle_input): Use it. (send_switch): New function implementing Switch message. (server_loop): Modifications for send_switch and incr_update. (syntax): Corrections. (main): Persistent TCP server. * rvc.h: Draft 4 incorporates some of the corrections here. * rvc.c (syntax): Corrections. * nrvc.c: New file. 2000-08-11 Tim Waugh * vtgrab.c (VERSION): Version 0.1.1 (devel). * First shot at RVC implementation. Many changes. 2000-07-28 Tim Waugh * vtgrab.c (VERSION): Version 0.1.0 (devel). * doc/rvc.sgml: Added. * doc/README: Added. 2000-07-27 Tim Waugh (VERSION): Version 0.0.1 (stable). 2000-07-27 Tim Waugh * vtgrab.c (server): Open with O_NOCTTY. (client): Likewise. (server): Use KDGETMODE instead of VT_GETMODE. (server): mode is now a long. (client): mode is now a long. vtgrab-0.1.8.orig/INSTALL0100644000175000017500000001722707133036363014053 0ustar riskoriskoBasic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. vtgrab-0.1.8.orig/Makefile.am0100664000175000017500000000060307164103455015047 0ustar riskoriskobin_PROGRAMS = rvc rvcd twiglet rvc_SOURCES = rvc.c rvcd_SOURCES = rvcd.c xfree86.c twiglet_SOURCES = nrvc.c simple_panel.c twiglet_LDFLAGS = -lncurses docdir=$(datadir)/doc/$(PACKAGE) doc_DATA = doc/rvc CFLAGS = -D_GNU_SOURCE -Wall -W -O2 EXTRA_DIST = BUGS doc/rvc.sgml doc/README rvc.h xfree86.h simple_panel.h \ TODO Makefile.am twiglet.1 %: %.sgml @echo Use dbtohtml to make $@ vtgrab-0.1.8.orig/NEWS0100664000175000017500000000017407156133111013506 0ustar riskoriskoNEWS ---- vtgrab is undergoing heavy development, in order to implement RVC. See the doc directory for more information. vtgrab-0.1.8.orig/TODO0100664000175000017500000000123007170574605013506 0ustar riskoriskoGeneral: - This stuff needs to work over a serial line, and currently it doesn't do too well. It needs better synchronisation. When I tried it out I kept losing characters.. - Don't use automake any more since it can't handle non-recursive make - Write a program to push a console screen from the client to the server(s) - Locking RVCD: - Handle Feature_Crop and Feature_IncRectangle simultaneously - Handle Feature_Push - Mouse support - Track console switches (for XFree86 tracking) all the time. - Lose X authority after use NRVC: - Write INSTALL - Handle SIGWINCH - Mouse support RVC: - VNC integration - Handle Control-C etc - Handle Terminate vtgrab-0.1.8.orig/aclocal.m40100664000175000017500000001045407200557703014660 0ustar riskoriskodnl aclocal.m4 generated automatically by aclocal 1.4 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. # Like AC_CONFIG_HEADER, but automatically create stamp file. AC_DEFUN(AM_CONFIG_HEADER, [AC_PREREQ([2.12]) AC_CONFIG_HEADER([$1]) dnl When config.status generates a header, we must update the stamp-h file. dnl This file resides in the same directory as the config header dnl that is generated. We must strip everything past the first ":", dnl and everything past the last "/". AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, <>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, <>; do case " <<$>>CONFIG_HEADERS " in *" <<$>>am_file "*<<)>> echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx ;; esac am_indx=`expr "<<$>>am_indx" + 1` done<<>>dnl>>) changequote([,]))]) # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. # serial 1 dnl Usage: dnl AM_INIT_AUTOMAKE(package,version, [no-define]) AC_DEFUN(AM_INIT_AUTOMAKE, [AC_REQUIRE([AC_PROG_INSTALL]) PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] AC_SUBST(VERSION) dnl test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi ifelse([$3],, AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) AC_REQUIRE([AM_SANITY_CHECK]) AC_REQUIRE([AC_ARG_PROGRAM]) dnl FIXME This is truly gross. missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AC_REQUIRE([AC_PROG_MAKE_SET])]) # # Check to make sure that the build environment is sane. # AC_DEFUN(AM_SANITY_CHECK, [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "[$]*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "[$]*" != "X $srcdir/configure conftestfile" \ && test "[$]*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "[$]2" = conftestfile ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi rm -f conftest* AC_MSG_RESULT(yes)]) dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) dnl The program must properly implement --version. AC_DEFUN(AM_MISSING_PROG, [AC_MSG_CHECKING(for working $2) # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if ($2 --version) < /dev/null > /dev/null 2>&1; then $1=$2 AC_MSG_RESULT(found) else $1="$3/missing $2" AC_MSG_RESULT(missing) fi AC_SUBST($1)]) vtgrab-0.1.8.orig/config.h.in0100664000175000017500000000344507156133305015043 0ustar riskorisko/* config.h.in. Generated automatically from configure.in by autoheader. */ /* Define to empty if the keyword does not work. */ #undef const /* Define if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to `int' if doesn't define. */ #undef pid_t /* Define to `unsigned' if doesn't define. */ #undef size_t /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define if you have the select function. */ #undef HAVE_SELECT /* Define if you have the strcspn function. */ #undef HAVE_STRCSPN /* Define if you have the strdup function. */ #undef HAVE_STRDUP /* Define if you have the strstr function. */ #undef HAVE_STRSTR /* Define if you have the strtoul function. */ #undef HAVE_STRTOUL /* Define if you have the header file. */ #undef HAVE_DIRENT_H /* Define if you have the header file. */ #undef HAVE_FCNTL_H /* Define if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if you have the header file. */ #undef HAVE_NDIR_H /* Define if you have the header file. */ #undef HAVE_SYS_DIR_H /* Define if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define if you have the header file. */ #undef HAVE_SYS_KD_H /* Define if you have the header file. */ #undef HAVE_SYS_NDIR_H /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define if you have the header file. */ #undef HAVE_SYS_VT_H /* Define if you have the header file. */ #undef HAVE_UNISTD_H /* Name of package */ #undef PACKAGE /* Version number of package */ #undef VERSION vtgrab-0.1.8.orig/configure0100775000175000017500000020213207200557704014724 0ustar riskorisko#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=rvcd.c # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ac_exeext= ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:559: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 echo "configure:612: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "$*" != "X $srcdir/configure conftestfile" \ && test "$*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { echo "configure: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" 1>&2; exit 1; } fi test "$2" = conftestfile ) then # Ok. : else { echo "configure: error: newly created file is older than distributed files! Check your system clock" 1>&2; exit 1; } fi rm -f conftest* echo "$ac_t""yes" 1>&6 if test "$program_transform_name" = s,x,x,; then program_transform_name= else # Double any \ or $. echo might interpret backslashes. cat <<\EOF_SED > conftestsed s,\\,\\\\,g; s,\$,$$,g EOF_SED program_transform_name="`echo $program_transform_name|sed -f conftestsed`" rm -f conftestsed fi test "$program_prefix" != NONE && program_transform_name="s,^,${program_prefix},; $program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" # sed with no file args requires a program. test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 echo "configure:669: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftestmake <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftestmake fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$ac_t""yes" 1>&6 SET_MAKE= else echo "$ac_t""no" 1>&6 SET_MAKE="MAKE=${MAKE-make}" fi PACKAGE=vtgrab VERSION=0.1.8 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } fi cat >> confdefs.h <> confdefs.h <&6 echo "configure:715: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (aclocal --version) < /dev/null > /dev/null 2>&1; then ACLOCAL=aclocal echo "$ac_t""found" 1>&6 else ACLOCAL="$missing_dir/missing aclocal" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 echo "configure:728: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoconf --version) < /dev/null > /dev/null 2>&1; then AUTOCONF=autoconf echo "$ac_t""found" 1>&6 else AUTOCONF="$missing_dir/missing autoconf" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 echo "configure:741: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (automake --version) < /dev/null > /dev/null 2>&1; then AUTOMAKE=automake echo "$ac_t""found" 1>&6 else AUTOMAKE="$missing_dir/missing automake" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 echo "configure:754: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoheader --version) < /dev/null > /dev/null 2>&1; then AUTOHEADER=autoheader echo "$ac_t""found" 1>&6 else AUTOHEADER="$missing_dir/missing autoheader" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 echo "configure:767: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (makeinfo --version) < /dev/null > /dev/null 2>&1; then MAKEINFO=makeinfo echo "$ac_t""found" 1>&6 else MAKEINFO="$missing_dir/missing makeinfo" echo "$ac_t""missing" 1>&6 fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:784: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:814: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" break fi done IFS="$ac_save_ifs" if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$ac_dir/$ac_word" "$@" shift ac_cv_prog_CC="$@" fi fi fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then case "`uname -s`" in *win32* | *WIN32*) # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:865: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="cl" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi ;; esac fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:897: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF #line 908 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else ac_cv_prog_cc_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:939: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo "configure:944: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes else GCC= fi ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 echo "configure:972: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 if test "$ac_test_CFLAGS" = set; then CFLAGS="$ac_save_CFLAGS" elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 echo "configure:1010: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> int main() { DIR *dirp = 0; ; return 0; } EOF if { (eval echo configure:1023: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 echo "configure:1048: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 LIBS="$LIBS -ldir" else echo "$ac_t""no" 1>&6 fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 echo "configure:1089: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 LIBS="$LIBS -lx" else echo "$ac_t""no" 1>&6 fi fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:1131: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1169: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 echo "configure:1211: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF if { (eval echo configure:1291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_header_stdc=no fi rm -fr conftest* fi fi fi echo "$ac_t""$ac_cv_header_stdc" 1>&6 if test $ac_cv_header_stdc = yes; then cat >> confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 echo "configure:1315: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #ifndef WEXITSTATUS #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main() { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF if { (eval echo configure:1336: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_sys_wait_h=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 if test $ac_cv_header_sys_wait_h = yes; then cat >> confdefs.h <<\EOF #define HAVE_SYS_WAIT_H 1 EOF fi for ac_hdr in fcntl.h sys/ioctl.h sys/time.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:1360: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1370: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 { echo "configure: error: I can't seem to find some needed C library headers. " 1>&2; exit 1; } fi done for ac_hdr in sys/vt.h sys/kd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:1403: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1413: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 { echo "configure: error: I need some kernel header files. " 1>&2; exit 1; } fi done for ac_hdr in inttypes.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:1446: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1456: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 { echo "configure: error: I need a newer C library. " 1>&2; exit 1; } fi done echo $ac_n "checking for working const""... $ac_c" 1>&6 echo "configure:1487: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } ; return 0; } EOF if { (eval echo configure:1541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_c_const=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_c_const" 1>&6 if test $ac_cv_c_const = no; then cat >> confdefs.h <<\EOF #define const EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 echo "configure:1562: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_pid_t=yes else rm -rf conftest* ac_cv_type_pid_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_pid_t" 1>&6 if test $ac_cv_type_pid_t = no; then cat >> confdefs.h <<\EOF #define pid_t int EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 echo "configure:1595: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_size_t=yes else rm -rf conftest* ac_cv_type_size_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_size_t" 1>&6 if test $ac_cv_type_size_t = no; then cat >> confdefs.h <<\EOF #define size_t unsigned EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 echo "configure:1628: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include int main() { struct tm *tp; ; return 0; } EOF if { (eval echo configure:1642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_time=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_header_time" 1>&6 if test $ac_cv_header_time = yes; then cat >> confdefs.h <<\EOF #define TIME_WITH_SYS_TIME 1 EOF fi if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 echo "configure:1665: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then rm -rf conftest* ac_cv_prog_gcc_traditional=yes else rm -rf conftest* ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then rm -rf conftest* ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 echo "configure:1711: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_func_memcmp_clean=no fi rm -fr conftest* fi fi echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" for ac_func in select strcspn strdup strstr strtoul do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:1749: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:1777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 DEFS=-DHAVE_CONFIG_H # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "Makefile vtgrab.spec config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@PACKAGE@%$PACKAGE%g s%@VERSION@%$VERSION%g s%@ACLOCAL@%$ACLOCAL%g s%@AUTOCONF@%$AUTOCONF%g s%@AUTOMAKE@%$AUTOMAKE%g s%@AUTOHEADER@%$AUTOHEADER%g s%@MAKEINFO@%$MAKEINFO%g s%@SET_MAKE@%$SET_MAKE%g s%@CC@%$CC%g s%@CPP@%$CPP%g s%@LIBOBJS@%$LIBOBJS%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' ac_dC='\3' ac_dD='%g' # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='\([ ]\)%\1#\2define\3' ac_uC=' ' ac_uD='\4%g' # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_eB='$%\1#\2define\3' ac_eC=' ' ac_eD='%g' if test "${CONFIG_HEADERS+set}" != set; then EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac echo creating $ac_file rm -f conftest.frag conftest.in conftest.out ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` cat $ac_file_inputs > conftest.in EOF # Transform confdefs.h into a sed script conftest.vals that substitutes # the proper values into config.h.in to produce config.h. And first: # Protect against being on the right side of a sed subst in config.status. # Protect against being in an unquoted here document in config.status. rm -f conftest.vals cat > conftest.hdr <<\EOF s/[\\&%]/\\&/g s%[\\$`]%\\&%g s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp s%ac_d%ac_u%gp s%ac_u%ac_e%gp EOF sed -n -f conftest.hdr confdefs.h > conftest.vals rm -f conftest.hdr # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >> conftest.vals <<\EOF s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% EOF # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. rm -f conftest.tail while : do ac_lines=`grep -c . conftest.vals` # grep -c gives empty output for an empty file on some AIX systems. if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi # Write a limited-size here document to conftest.frag. echo ' cat > conftest.frag <> $CONFIG_STATUS sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS echo 'CEOF sed -f conftest.frag conftest.in > conftest.out rm -f conftest.in mv conftest.out conftest.in ' >> $CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail rm -f conftest.vals mv conftest.tail conftest.vals done rm -f conftest.vals cat >> $CONFIG_STATUS <<\EOF rm -f conftest.frag conftest.h echo "/* $ac_file. Generated automatically by configure. */" > conftest.h cat conftest.in >> conftest.h rm -f conftest.in if cmp -s $ac_file conftest.h 2>/dev/null; then echo "$ac_file is unchanged" rm -f conftest.h else # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" fi rm -f $ac_file mv conftest.h $ac_file fi fi; done EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 vtgrab-0.1.8.orig/configure.in0100664000175000017500000000154607200557653015337 0ustar riskoriskodnl Process this file with autoconf to produce a configure script. AC_INIT(rvcd.c) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(vtgrab, 0.1.8) dnl Checks for programs. AC_PROG_CC dnl Checks for libraries. dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h, , AC_MSG_ERROR( I can't seem to find some needed C library headers. ) ) AC_CHECK_HEADERS(sys/vt.h sys/kd.h, , AC_MSG_ERROR( I need some kernel header files. ) ) AC_CHECK_HEADERS(inttypes.h, , AC_MSG_ERROR( I need a newer C library. ) ) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_FUNC_MEMCMP AC_CHECK_FUNCS(select strcspn strdup strstr strtoul) AC_OUTPUT(Makefile vtgrab.spec) vtgrab-0.1.8.orig/install-sh0100755000175000017500000001273607133036363015026 0ustar riskorisko#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 vtgrab-0.1.8.orig/missing0100755000175000017500000001421307133036363014411 0ustar riskorisko#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997 Free Software Foundation, Inc. # Franc,ois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing - GNU libit 0.0" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 vtgrab-0.1.8.orig/mkinstalldirs0100755000175000017500000000132207133036363015615 0ustar riskorisko#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here vtgrab-0.1.8.orig/vtgrab.spec.in0100664000175000017500000000276007170573776015605 0ustar riskoriskoSummary: A remote console viewer. Name: vtgrab Version: @VERSION@ Release: 1 License: GPL Group: Applications/System URL: http://people.redhat.com/twaugh/%{name}/ Source0: ftp://people.redhat.com/twaugh/%{name}/devel/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot %description Using vtgrab you can observe and control the console of a remote machine. %package server Summary: A console server for vtgrab. Group: Applications/System PreReq: ed, initscripts %description server This is the RVC server for vtgrab. %prep %setup -q -n %{name}-%{version} %build %configure make CFLAGS="$RPM_OPT_FLAGS" %install rm -rf %{buildroot} mkdir -p %{buildroot}/sbin mkdir -p %{buildroot}/%{_bindir} mkdir -p %{buildroot}/%{_mandir}/man1 install -m 755 twiglet %{buildroot}/%{_bindir}/twiglet install -m 755 rvc %{buildroot}/%{_bindir}/rvc install -m 644 twiglet.1 %{buildroot}/%{_mandir}/man1/twiglet.1 install -m 755 rvcd %{buildroot}/sbin/rvcd %clean rm -rf %{buildroot} %files %defattr(-,root,root) %doc README COPYING BUGS NEWS %{_bindir}/twiglet %{_mandir}/*/* %files server /sbin/rvcd %post server # This is specific to Red Hat Linux 7. # /bin/ed -s /etc/rc.d/rc.sysinit << EOF # 566,570m182 # 187a # [ -x /sbin/rvcd ] && ( /sbin/rvcd /dev/ttyS0 > /dev/null 2>&1 & ) # # . # wq # EOF %postun server # This is specific to Red Hat Linux 7. # /bin/ed -s /etc/rc.d/rc.sysinit << EOF # 183,187m573 # 183,184d # wq # EOF %changelog * Mon Sep 25 2000 Tim Waugh - Created vtgrab-0.1.8.orig/rvc.c0100664000175000017500000002212607162446003013752 0ustar riskorisko/* * vtgrab - grab the foreground console for display on another machine * Copyright (C) 2000 Tim Waugh * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "rvc.h" #define KEY 1 /* Features we want to make use of, if offered */ static uint8_t wishlist[] = { Feature_Crop, #if KEY Feature_Key, #endif }; static uint8_t in_use[256]; static struct termios saved_attributes; static void reset_input_mode (void) { tcsetattr (STDIN_FILENO, TCSANOW, &saved_attributes); } static void set_input_mode (void) { struct termios tattr; /* Make sure stdin is a terminal. */ if (!isatty (STDIN_FILENO)) { fprintf (stderr, "Not a terminal.\n"); exit (1); } /* Save the terminal attributes so we can restore them later. */ tcgetattr (STDIN_FILENO, &saved_attributes); atexit (reset_input_mode); /* Set the funny terminal mode. */ tcgetattr (STDIN_FILENO, &tattr); tattr.c_lflag &= ~(ICANON|ECHO); /* Clear ICANON and ECHO. */ tattr.c_cc[VMIN] = 1; tattr.c_cc[VTIME] = 0; tcsetattr (STDIN_FILENO, TCSAFLUSH, &tattr); } static int vlog (const char *reason, va_list ap) { const size_t chunk = 1000; static int allocated; static char *buf; int needed; if (!buf) { buf = malloc (chunk); if (!buf) return 1; allocated = chunk; } for (;;) { needed = vsnprintf (buf, allocated, reason, ap); if (needed < allocated) break; free (buf); allocated = chunk * ((needed / chunk) + 1); buf = malloc (allocated); if (!buf) return 1; } /* Maybe one day we'll syslog it */ fprintf (stderr, "%s", buf); return 0; } static int log (const char *reason, ...) { va_list vl; va_start (vl, reason); vlog (reason, vl); va_end (vl); return 0; } static int write_exact (int fd, const void *buffer, size_t len) { const char *buf = buffer; while (len) { ssize_t put = write (fd, buf, len); if (put < 0) return put; len -= put; buf += put; } fflush (NULL); return 0; } static int read_exact (int fd, void *buffer, size_t len) { char *buf = buffer; while (len) { ssize_t got = read (fd, buf, len); if (got <= 0) return 1; len -= got; buf += got; } return 0; } static void skip (int fd, int n) { static unsigned char scratch[256]; assert (n < 256); read_exact (fd, scratch, n); } static int send_key (int fd) { unsigned char keymsg[2]; keymsg[0] = Msg_Key; if (read (STDIN_FILENO, &keymsg[1], 1) < 1) return 1; write_exact (fd, keymsg, sizeof (keymsg)); return 0; } static int client_loop (int fd, FILE *f) { unsigned char *contents = NULL; int allocated = 0; for (;;) { uint8_t message_type; uint8_t update_type; uint16_t len; fd_set readfds; rewind (f); FD_ZERO (&readfds); FD_SET (fd, &readfds); if (in_use[Feature_Key]) FD_SET (STDIN_FILENO, &readfds); select (fd + 1, &readfds, NULL, NULL, NULL); if (FD_ISSET (STDIN_FILENO, &readfds)) { send_key (fd); } if (!FD_ISSET (fd, &readfds)) continue; if (read_exact (fd, &message_type, 1)) { exit (0); } switch (message_type) { case Msg_IncrementalUpdate: //log ("< IncrementalUpdate\n"); break; case Msg_Switch: log ("< Switch\n"); if (!in_use[Feature_Switch]) log ("Not in use: Switch\n"); skip (fd, 4); continue; } read_exact (fd, &update_type, 1); read_exact (fd, &len, 2); len = ntohs (len); if (allocated < len) { if (contents) free (contents); contents = malloc (len); allocated = len; } if (!contents) exit (1); read_exact (fd, contents, len); if (contents[0] == 0 && contents[1] == 0) fwrite (contents + 2, 1, len - 2, f); else if (!in_use[Feature_IncRectangle]) log ("Not in use: Incremental Rectangle Updates\n"); else log ("Not implemented: Incremental Rectangle Updates\n"); fflush (f); } } static int client (int fd) { const size_t protverlen = 12; char protocol_version[13]; uint32_t auth; uint8_t num_features, i; char *p, *end, *features; unsigned long their_major; struct ClientInitialisation_fixedpart ci; struct vt_stat vtstat; char fgcons[100]; FILE *vcsa; int c = open ("/dev/console", O_RDONLY | O_NOCTTY); if (c == -1) { perror ("/dev/console"); exit (1); } if (ioctl (c, VT_GETSTATE, &vtstat)) { perror ("VT_GETSTATE"); exit (1); } close (c); sprintf (fgcons, "/dev/vcsa%d", vtstat.v_active); vcsa = fopen (fgcons, "r+"); if (!vcsa) { fprintf (stderr, "Error opening %s\n", fgcons); exit (1); } /** * Receive ProtocolVersion **/ memset (protocol_version, 0, protverlen + 1); if (read_exact (fd, protocol_version, protverlen)) return log ("Problem receiving ProtocolVersion\n"); p = protocol_version + 4; try_again: their_major = strtoul (p, &end, 10); if (p == end || strncmp (protocol_version, RVC_PROTOCOL_VERSION, 4) || protocol_version[7] != '.' || protocol_version[protverlen - 1] != '\n') { unsigned int i; log ("Garbled communications: \"%s\"\n", protocol_version); for (i = 1; i < protverlen - 1; i++) { size_t match = protverlen - i; if (match > 4) match = 4; if (!strncmp (protocol_version + i, RVC_PROTOCOL_VERSION, 4)) { memmove (protocol_version, protocol_version + i, protverlen - i); if (read_exact (fd, protocol_version + protverlen - i, i)) break; log ("Restarting with: \"%s\"\n", protocol_version); goto try_again; } } return log ("Garbled ProtocolVersion\n"); } /** * Send ProtocolVersion **/ if (write_exact (fd, RVC_PROTOCOL_VERSION, protverlen)) return log ("Problem sending ProtocolVersion\n"); /** * Receive Authentication **/ if (read_exact (fd, &auth, 4)) return log ("Problem receiving Authentication\n"); auth = ntohl (auth); if (auth != 1) return log ("Connection problem\n"); /** * Receive ServerInitialisation **/ if (read_exact (fd, &num_features, 1)) return log ("Problem receiving ServerInitialisation\n"); features = malloc (num_features); if (!features) { free (features); return log ("Out of memory during ServerInitialisation\n"); } if (read_exact (fd, features, num_features)) return log ("Problem receiving feature list\n"); /** * Send ClientInitialisation **/ ci.updatems = 0; ci.rows = 25; ci.cols = 80; fread (&ci.rows, 1, 1, vcsa); fread (&ci.cols, 1, 1, vcsa); ci.pad1 = ci.pad2 = ci.pad3 = ci.pad4 = 0; ci.num_features = num_features; if (write_exact (fd, &ci, sizeof (ci))) return log ("Problem sending ClientInitialisation\n"); for (i = 0; i < num_features; i++) { uint8_t feature = features[i]; unsigned int j; features[i] = 0; for (j = 0; j < sizeof (wishlist); j++) { if (wishlist[j] == feature) { features[i] = 1; log ("In use: %d\n", feature); break; } } in_use[feature] = features[i]; } if (write_exact (fd, features, num_features)) return log ("Problem sending num-features\n"); if (in_use[Feature_Key]) set_input_mode (); return client_loop (fd, vcsa); } static void syntax (void) { printf ("Usage: rvc :\n" " rvc \n" " rvc --version\n" " rvc --help\n"); } static int connect_to (const char *name) { char *host, *p, *end; struct hostent *h; struct sockaddr_in sin; unsigned long port; int s; host = strdup (name); if (!host) { fprintf (stderr, "Out of memory\n"); exit (1); } p = strrchr (host, ':'); if (!p) { syntax (); exit (1); } *p++ = '\0'; if (!*host) { syntax (); exit (1); } h = gethostbyname (host); if (!h || !*h->h_addr_list) { fprintf (stderr, "unknown host %s\n", host); exit (1); } memcpy (&sin.sin_addr.s_addr, *h->h_addr_list, h->h_length); port = strtoul (p, &end, 10); if (p == end) { syntax (); exit (1); } sin.sin_port = htons (port); sin.sin_family = AF_INET; s = socket (PF_INET, SOCK_STREAM, 0); if (s < 0) { perror ("socket"); exit (1); } if (connect (s, &sin, sizeof (sin)) < 0) { perror ("connect"); exit (1); } return s; } int main (int argc, char **argv) { int fd; if (argc < 2) { syntax (); exit (1); } if (!strcmp (argv[1], "--version")) { printf ("RVC (vtgrab %s)\n", VERSION); exit (0); } if (!strcmp (argv[1], "--help")) { syntax (); exit (0); } if ((fd = open (argv[1], O_RDWR)) == -1) fd = connect_to (argv[1]); return client (fd); } vtgrab-0.1.8.orig/rvcd.c0100664000175000017500000004453007200550476014124 0ustar riskorisko/* * vtgrab - grab the foreground console for display on another machine * Copyright (C) 2000 Tim Waugh * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * This is the RVC server. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "rvc.h" #include "xfree86.h" /* set to zero for production */ #define DEBUG 1 static uint8_t features[] = { Feature_Crop, Feature_Key, Feature_IncRectangle, Feature_IncScroll, Feature_SwitchRequest, Feature_Switch, Feature_Clear, }; static uint8_t in_use[256]; static int ready_to_respawn; static int minor; static struct vt_stat vtstat; static int go; static int vlog (const char *reason, va_list ap) { const size_t chunk = 1000; static int allocated; static char *buf; int needed; if (!buf) { buf = malloc (chunk); if (!buf) return 1; allocated = chunk; } for (;;) { needed = vsnprintf (buf, allocated, reason, ap); if (needed < allocated) break; free (buf); allocated = chunk * ((needed / chunk) + 1); buf = malloc (allocated); if (!buf) return 1; } /* Maybe one day we'll syslog it */ fprintf (stderr, "%s", buf); return 0; } static int log (const char *reason, ...) { va_list vl; va_start (vl, reason); vlog (reason, vl); va_end (vl); return 0; } static int write_exact (int fd, const void *buffer, size_t len) { const char *buf = buffer; while (len) { ssize_t put = write (fd, buf, len); if (put < 0) return put; len -= put; buf += put; } fflush (NULL); return 0; } static int read_exact (int fd, void *buffer, size_t len) { char *buf = buffer; while (len) { ssize_t got = read (fd, buf, len); if (got <= 0) return 1; len -= got; buf += got; } return 0; } static int full_update (int fd, unsigned char *contents, size_t size, uint8_t rows, uint8_t cols) { int newfd = dup (fd); FILE *f = fdopen (newfd, "r+"); unsigned char header[6]; uint16_t content_length = size + 2; if (!f) return 1; header[0] = Msg_IncrementalUpdate; header[1] = UpdateType_Rectangle; if (in_use[Feature_Crop]) { unsigned char *cropped, *p, *q; content_length = 4 + (rows * cols * 2); cropped = malloc (content_length); if (!cropped) { fclose (f); return 1; } cropped[0] = rows; cropped[1] = cols; if (contents[2] < cols) cropped[2] = contents[2]; else cropped[2] = cols - 1; if ((int)contents[3] > ((int)contents[0] - (int)rows)) cropped[3] = contents[3] - ((int)contents[0] - (int)rows); else cropped[3] = 0; for (p = cropped + 4; p < cropped + content_length; p += 2) { p[0] = ' '; p[1] = '\7'; } p = contents + size - 2 * contents[1]; q = cropped + content_length - 2 * cropped[1]; if (contents[0] < rows) rows = contents[0]; if (contents[1] < cols) cols = contents[1]; for (; rows; rows--) { unsigned char *r = p, *s = q; uint8_t i; for (i = 0; i < cols; i++) { *s++ = *r++; *s++ = *r++; } p -= 2 * contents[1]; q -= 2 * cropped[1]; } size = content_length; content_length += 2; // for offsets content_length = htons (content_length); memcpy (header + 2, &content_length, 2); header[4] = header[5] = 0; // offsets fwrite (header, 6, 1, f); fwrite (cropped, size, 1, f); fclose (f); free (cropped); return 0; } content_length = htons (content_length); memcpy (header + 2, &content_length, 2); header[4] = header[5] = 0; // offsets fwrite (header, 6, 1, f); fwrite (contents, size, 1, f); fclose (f); return 0; } static int scroll_update (FILE *f, uint8_t lines) { uint8_t message[5]; message[0] = Msg_IncrementalUpdate; message[1] = UpdateType_Scroll; message[2] = 0; message[3] = 1; message[4] = lines; fwrite (message, sizeof (message), 1, f); return 0; } static int clear_update (FILE *f) { uint8_t message[4]; message[0] = Msg_IncrementalUpdate; message[1] = UpdateType_Clear; message[2] = 0; message[3] = 0; fwrite (message, sizeof (message), 1, f); return 0; } static int incr_update (int fd, unsigned char *last, unsigned char *contents, size_t size, uint8_t rows, uint8_t cols) { int newfd; FILE *f; unsigned char header[10]; uint16_t content_length; uint8_t first_changed, last_changed, i; int rowsize = 2 * contents[1]; static int did_clear_last_time = 0; if (in_use[Feature_Crop]) // Easier just to do a full screen update for this. return full_update (fd, contents, size, rows, cols); log ("> IncrUpdate\n"); newfd = dup (fd); f = fdopen (newfd, "r+"); if (!f) return 1; rows = contents[0]; // Compare line by line for (i = 0; i < rows; i++) if (memcmp (contents + 4 + i * rowsize, last + 4 + i * rowsize, rowsize)) break; first_changed = i; for (i = rows - 1; i > first_changed; i--) if (memcmp (contents + 4 + i * rowsize, last + 4 + i * rowsize, rowsize)) break; last_changed = i; // Look for scrolls if (in_use[Feature_IncScroll] && contents[3] == rows - 1) { uint8_t tryscrl, num; for (tryscrl = 1; tryscrl < rows - 1; tryscrl++) { const int min = 5; uint8_t *old = last + 4 + tryscrl * rowsize; uint8_t *new = contents + 4; for (num = rows - 1 - tryscrl; num >= min; num--) if (!memcmp (old, new, num * rowsize)) break; if (num >= min) break; } // Wahey! log ("? Scroll %d: %d, %d\n", tryscrl, first_changed, last_changed); if (tryscrl < rows - 1 && tryscrl < (last_changed - first_changed)) { log ("> Scroll %d\n", tryscrl); scroll_update (f, tryscrl); // Mess with scr so that left-overs get dealt with. memcpy (contents + 4, last + 4 + tryscrl * rowsize, (rows - tryscrl) * rowsize); memset (contents + 4 + (rows - tryscrl) * rowsize, 0, tryscrl * rowsize); goto out; } } // A clear update might be faster. if (in_use[Feature_Clear]) { int nonempty = 0, row; for (row = 0; row < rows; row++) { int c; for (c = 0; c < rowsize; c += 2) if (contents[4 + row * rowsize + c] != ' ' || contents[5 + row * rowsize + c] != '\7') break; if (c < rowsize) nonempty++; } if (!did_clear_last_time && nonempty < (last_changed - first_changed + 1)) { // It's worth our while. size_t c; log ("> Clear\n"); did_clear_last_time = 1; clear_update (f); // Mess with scr so that left-overs get dealt with. for (c = 4; c < size; c += 2) { contents[c] = ' '; contents[c + 1] = '\7'; } goto out; } did_clear_last_time = 0; } header[0] = Msg_IncrementalUpdate; header[1] = UpdateType_Rectangle; // If it's just one line, be smarter. if (first_changed == last_changed) { uint8_t firstx, lastx; uint8_t *cp = contents + 4 + first_changed * rowsize; uint8_t *lp = last + 4 + first_changed * rowsize; for (firstx = 0; firstx < contents[1]; firstx++) if (memcmp (cp + firstx * 2, lp + firstx * 2, 2)) break; for (lastx = contents[1] - 1; lastx > firstx; lastx--) if (memcmp (cp + lastx * 2, lp + lastx * 2, 2)) break; size = (lastx - firstx + 1) * 2; header[2] = 0; header[3] = 6 + (lastx - firstx + 1) * 2; header[4] = firstx; } else { size = (last_changed - first_changed + 1) * rowsize; header[4] = 0; // x offset } content_length = 6 + size; content_length = htons (content_length); memcpy (header + 2, &content_length, 2); header[5] = first_changed; // y offset header[6] = last_changed - first_changed + 1; header[7] = contents[1]; header[8] = contents[2]; header[9] = contents[3]; fwrite (header, 10, 1, f); fwrite (contents + 4 + first_changed * rowsize + 2 * header[4], size, 1, f); out: fclose (f); return 0; } static void skip (int fd, int n) { static unsigned char scratch[256]; assert (n < 256); read_exact (fd, scratch, n); } static int do_key (char key) { char tty[16]; int fd; sprintf (tty, "/dev/tty%d", vtstat.v_active); fd = open (tty, O_RDONLY | O_NOCTTY); ioctl (fd, TIOCSTI, &key); close (fd); return 0; } static int is_a_console (int fd) { char arg = 0; return (ioctl(fd, KDGKBTYPE, &arg) == 0 && ((arg == KB_101) || (arg == KB_84))); } static int open_named_console (const char *tty) { int fd = open (tty, O_RDWR | O_NOCTTY); if (fd == -1) { fd = open (tty, O_RDONLY | O_NOCTTY); if (fd == -1) { fd = open (tty, O_WRONLY | O_NOCTTY); if (fd == -1) return -1; } } if (is_a_console (fd)) return fd; close (fd); return -1; } static int open_console (void) { int fd = open_named_console ("/dev/tty"); if (fd == -1) fd = open_named_console ("/dev/tty0"); if (fd == -1) fd = open_named_console ("/dev/console"); return fd; } static int do_switch (unsigned char switchmsg) { int cons = switchmsg; int fd = open_console (); ioctl (fd, VT_ACTIVATE, cons); close (fd); return 0; } static int handle_input (int fd) { uint8_t message_type; char keymsg; char switchmsg; if (read_exact (fd, &message_type, 1)) { log ("Problem receiving input\n"); return -1; } switch (message_type) { case Msg_Terminate: log ("< Terminate\n"); return -1; case Msg_FullUpdateRequest: log ("< FullUpdateRequest\n"); return 1; case Msg_Key: log ("< Key\n"); if (read (fd, &keymsg, 1) < 1) return -1; if (!in_use[Feature_Key]) log ("Not in use!\n"); else do_key (keymsg); break; case Msg_SwitchRequest: log ("< SwitchRequest\n"); if (read (fd, &switchmsg, 1) < 1) return -1; if (!in_use[Feature_SwitchRequest]) log ("Not in use!\n"); else do_switch (switchmsg); break; case Msg_Pointer: log ("< Pointer\n"); skip (fd, 3); if (!in_use[Feature_Pointer]) log ("Not in use!\n"); break; default: log ("Invalid message type %d\n", message_type); return -1; } return 0; } static int send_switch (int fd, char mode) { unsigned short port; uint8_t switchmsg[5]; if (mode != KD_TEXT) vt_switched_to (vtstat.v_active); port = port_for_console (vtstat.v_active); switchmsg[0] = Msg_Switch; switchmsg[1] = vtstat.v_active; port = htons (port); memcpy (switchmsg + 2, &port, 2); switchmsg[4] = mode; return write_exact (fd, switchmsg, sizeof (switchmsg)); } static void handle_sigalrm (int sig __attribute__ ((unused))) { ready_to_respawn = 1; } static int server_loop (int fd, uint32_t delay, uint8_t rows, uint8_t cols) { const size_t MAX_CONTENTS = 100000; long mode; char fgcons[100]; struct timeval tv; unsigned char *contents = malloc (MAX_CONTENTS); unsigned char *last = calloc (MAX_CONTENTS, 1); int console = open_console (); int do_full_update = 1; unsigned short last_vt = 0; struct sigaction sigalrm; sigalrm.sa_handler = handle_sigalrm; sigalrm.sa_flags = SA_RESTART; sigaction (SIGALRM, &sigalrm, NULL); if (console == -1) { perror ("no console access"); exit (1); } /* Minimum 50ms between updates */ if (delay < 50) delay = 50; /* Cap delay at a sensible amount */ if (delay > 100000) delay = 100000; if (!contents || !last) { printf ("Memory squeeze\n"); exit (1); } ready_to_respawn = 1; for (;;) { fd_set readfds; ssize_t size = 0; sigset_t set; int c; FD_ZERO (&readfds); FD_SET (fd, &readfds); tv.tv_sec = 0; tv.tv_usec = delay * 1000; switch (select (fd + 1, &readfds, NULL, NULL, &tv)) { case 0: // timeout break; case -1: // probably interrupted break; default: if (FD_ISSET (fd, &readfds)) { switch (handle_input (fd)) { case 0: continue; case 1: do_full_update = 1; break; default: goto out; } } } sigemptyset (&set); sigaddset (&set, SIGCHLD); sigaddset (&set, SIGALRM); sigprocmask (SIG_BLOCK, &set, NULL); while (reapees) { reap_child (); reapees--; } if (ready_to_respawn) { do_respawn (); ready_to_respawn = 0; alarm (5); } sigprocmask (SIG_UNBLOCK, &set, NULL); if (ioctl (console, VT_GETSTATE, &vtstat)) { perror ("VT_GETSTATE"); close (console); console = open_console (); continue; exit (1); } sprintf (fgcons, "/dev/tty%d", vtstat.v_active); c = open (fgcons, O_RDONLY | O_NOCTTY); if (c == -1) { perror (fgcons); exit (1); } if (ioctl (c, KDGETMODE, &mode)) { perror ("KDGETMODE"); exit (1); } close (c); sprintf (fgcons, "/dev/vcsa%d", vtstat.v_active); if (in_use[Feature_Switch] && (last_vt != vtstat.v_active)) send_switch (fd, mode); if (mode == KD_TEXT) { c = open (fgcons, O_RDONLY | O_NOCTTY); if (c == -1) { perror (fgcons); exit (1); } size = read (c, contents, MAX_CONTENTS); close (c); if (do_full_update) { full_update (fd, contents, size, rows, cols); memcpy (last, contents, size); } else if (memcmp (last, contents, size)) { incr_update (fd, last, contents, size, rows, cols); memcpy (last, contents, size); } } else if (size) { size = 0; memset (last, 0, MAX_CONTENTS); } go = 1; do_full_update = 0; last_vt = vtstat.v_active; } out: close (console); /** * Drain the input **/ sleep (1); if (isatty (fd)) tcflush (fd, TCIOFLUSH); else { int flags; fcntl (fd, F_GETFL, &flags); flags |= O_NONBLOCK; fcntl (fd, F_SETFL, &flags); while (read (fd, contents, MAX_CONTENTS) > 0) ; flags &= ~O_NONBLOCK; fcntl (fd, F_SETFL, &flags); } return 0; } static int server (int fd) { const size_t protverlen = 12; char protocol_version[13]; unsigned long our_major, their_major; uint32_t auth; uint8_t num_features, i; char *p, *end, *buf; struct ClientInitialisation_fixedpart ci; /** * Send ProtocolVersion **/ if (write_exact (fd, RVC_PROTOCOL_VERSION, protverlen)) return log ("Problem sending ProtocolVersion\n"); /** * Receive ProtocolVersion **/ memset (protocol_version, 0, protverlen + 1); if (read_exact (fd, protocol_version, protverlen)) return log ("Problem receiving ProtocolVersion\n"); p = protocol_version + 4; try_again: their_major = strtoul (p, &end, 10); if (p == end || strncmp (protocol_version, RVC_PROTOCOL_VERSION, 4) || protocol_version[7] != '.' || protocol_version[protverlen - 1] != '\n') { unsigned int i; log ("Garbled communications: \"%s\"\n", protocol_version); for (i = 1; i < protverlen - 1; i++) { size_t match = protverlen - i; if (match > 4) match = 4; if (!strncmp (protocol_version + i, RVC_PROTOCOL_VERSION, 4)) { memmove (protocol_version, protocol_version + i, protverlen - i); if (read_exact (fd, protocol_version + protverlen - i, i)) break; log ("Restarting with: \"%s\"\n", protocol_version); goto try_again; } } return log ("Garbled ProtocolVersion\n"); } p = RVC_PROTOCOL_VERSION + 4; our_major = strtoul (p, &end, 10); assert (p != end); p = protocol_version + 8; minor = strtoul (p, &end, 10); if (p == end) return log ("Garbled ProtocolVersion\n"); if (our_major != their_major) return log ("Incompatible ProtocolVersion\n"); log ("Using ProtocolVersion %s", protocol_version); /** * Send Authentication **/ auth = htonl (AuthNoAuth); if (write_exact (fd, &auth, 4)) return log ("Problem sending Authentication\n"); /** * ServerInitialisation **/ num_features = sizeof (features); if (write_exact (fd, &num_features, 1)) return log ("Problem sending ServerInitialisation\n"); if (write_exact (fd, features, num_features)) return log ("Problem sending ServerInitialisation\n"); /** * ClientInitialisation **/ if (read_exact (fd, &ci, sizeof (ci))) return log ("Problem receiving ClientInitialisation\n"); log ("updatems: %d\n", ci.updatems); log ("rows: %d\n", ci.rows); log ("cols: %d\n", ci.cols); buf = malloc (ci.num_features); if (!buf) return log ("Out of memory while receiving " "ClientInitialisation\n"); if (read_exact (fd, buf, num_features)) { free (buf); return log ("Problem receiving feature list\n"); } memset (in_use, 0, sizeof (in_use)); for (i = 0; i < sizeof (features); i++) { if (buf[i]) { in_use[features[i]] = 1; log ("In use: %d\n", features[i]); } } return server_loop (fd, ci.updatems, ci.rows, ci.cols); } static void syntax (void) { fprintf (stderr, "Usage: rvcd :\n" " rvcd \n" " rvcd --help\n" " rvcd --syntax\n"); } int main (int argc, char **argv) { int fd; int s = -1; if (argc < 2) { syntax (); exit (1); } if (!strcmp (argv[1], "--help")) { syntax (); exit (0); } if (!strcmp (argv[1], "--version")) { printf ("RVCD (vtgrab %s)\n", VERSION); exit (0); } if ((fd = open (argv[1], O_RDWR | O_NOCTTY)) == -1) { struct sockaddr_in sin; unsigned long port; char *start, *end; int on = 1; if (argv[1][0] != ':') { perror (argv[1]); exit (1); } start = argv[1] + 1; port = strtoul (start, &end, 10); if (start == end) { syntax (); exit (1); } sin.sin_family = AF_INET; sin.sin_addr.s_addr = INADDR_ANY; sin.sin_port = htons (port); s = socket (PF_INET, SOCK_STREAM, 0); if (s < 0) { perror ("socket"); exit (1); } setsockopt (s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on)); if (bind (s, (struct sockaddr *) &sin, sizeof (sin))) { perror ("bind"); close (s); exit (1); } if (listen (s, 1)) { perror ("listen"); close (s); } fd = accept (s, NULL, NULL); if (fd == -1) { perror ("accept"); close (s); exit (1); } } else if (isatty (fd)) { /* Need to set raw mode */ struct termios tios; tcgetattr (fd, &tios); cfmakeraw (&tios); cfsetospeed (&tios, B9600); cfsetispeed (&tios, B9600); tcsetattr (fd, TCSANOW, &tios); tcflush (fd, TCIOFLUSH); } xfree86_init (); for (;;) { server (fd); if (s != -1) { fd = accept (s, NULL, NULL); if (fd == -1) { perror ("accept"); close (s); exit (1); } } } return 0; } vtgrab-0.1.8.orig/xfree86.c0100664000175000017500000002164307164371731014461 0ustar riskorisko/* The task is to locate the X server associated with a tty, figure * out which display it is, and grab a valid MIT cookie for it. */ #include #include #include #include #include #include #include #include #include #include #include #include #include int reapees = 0; static struct consolemap { unsigned long console; unsigned long display; char *authority_file; pid_t controlling_pid; pid_t minion_pid; unsigned short port; struct consolemap *next; } *consoles; static size_t readzt (FILE *f, char *buf, size_t size) { size_t i; for (i = 0; i < size; i++) { int ch = fgetc (f); if (ch == EOF) break; if ((buf[i] = ch) == '\0') break; } if (i < size) buf[i] = '\0'; return i; } static void handle_sigchld (int s __attribute__ ((unused))) { fprintf (stderr, "Got SIGCHLD\n"); reapees++; return; } static void forget (struct consolemap *forget_me) { struct consolemap *c, **prev = &consoles; for (c = *prev; c; prev = &(*prev)->next, c = c->next) { if (c == forget_me) { *prev = c->next; break; } } } int reap_child (void) { pid_t dead; int status; struct consolemap *c, **prev = &consoles; dead = waitpid (0, &status, WNOHANG); if (dead == -1) return 1; fprintf (stderr, "Reaping %d\n", dead); for (c = *prev; c; prev = &(*prev)->next, c = c->next) { if (c->minion_pid == dead) { *prev = c->next; free (c); break; } } return 0; } static int grab_cookie (struct consolemap *cons) { int status; pid_t extract, merge; int fildes[2]; int null; char display[20]; char *path, *oldpath; size_t pathlen, x11len; /* Get /usr/X11R6/bin into the path */ const char *x11 = "/usr/X11R6/bin/:"; oldpath = getenv ("PATH"); pathlen = strlen (oldpath); x11len = strlen (x11); path = malloc (pathlen + x11len + 1); if (!path) return 1; memcpy (path, x11, x11len); memcpy (path + x11len, oldpath, pathlen); path[x11len + pathlen] = '\0'; sprintf (display, ":%lu", cons->display); null = open ("/dev/null", O_RDWR); if (null == -1) { free (path); return 1; } if (pipe (fildes)) { free (path); return 1; } fflush (NULL); merge = fork (); if (merge == -1) { free (path); return 1; } if (merge == 0) { /* Child */ alarm (0); close (STDIN_FILENO); close (STDOUT_FILENO); close (STDERR_FILENO); dup (fildes[0]); /* stdin */ dup (null); /* stdout */ dup (null); /* stderr */ close (null); close (fildes[0]); close (fildes[1]); setenv ("PATH", path, 1); execlp ("xauth", "xauth", "nmerge", "-", NULL); exit (1); } close (fildes[0]); extract = fork (); if (extract == -1) { free (path); close (fildes[1]); close (null); wait (NULL); return 1; } if (extract == 0) { /* Child */ alarm (0); close (STDIN_FILENO); close (STDOUT_FILENO); close (STDERR_FILENO); dup (null); /* stdin */ dup (fildes[1]); /* stdout */ dup (null); /* stderr */ close (null); close (fildes[1]); setenv ("PATH", path, 1); execlp ("xauth", "xauth", "-f", cons->authority_file, "nlist", NULL); exit (1); } close (null); close (fildes[1]); waitpid (extract, &status, 0); if (WEXITSTATUS (status)) { wait (NULL); fprintf (stderr, "nlist failed with %d\n", WEXITSTATUS (status)); return 1; } waitpid (merge, &status, 0); if (WEXITSTATUS (status)) { fprintf (stderr, "nmerge failed with %d\n", WEXITSTATUS (status)); return 1; } return 0; } static pid_t exec_minion (struct consolemap *cons) { char display[20]; pid_t minion; int fildes[2]; int null; FILE *f; char *line; ssize_t linelen; sprintf (display, ":%lu", cons->display); null = open ("/dev/null", O_RDWR); if (null == -1) return -1; if (pipe (fildes)) { close (null); return -1; } minion = fork (); if (minion == -1) { close (null); return minion; } if (minion == 0) { /* Child */ alarm (0); setenv ("DISPLAY", display, 1); close (STDIN_FILENO); close (STDOUT_FILENO); close (STDERR_FILENO); dup (null); /* stdin */ dup (null); /* stdout */ dup (fildes[1]); /* stderr */ close (null); close (fildes[0]); close (fildes[1]); execlp ("x0rfbserver", "x0rfbserver", "--stealth", NULL); exit (1); } close (null); close (fildes[1]); cons->minion_pid = minion; cons->port = 5900; f = fdopen (fildes[0], "r"); line = NULL; linelen = 0; getline (&line, &linelen, f); fclose (f); if (line && strstr (line, "port")) { char *p = line; char *end; unsigned long d; p += strcspn (p, "0123456789"); d = strtoul (p, &end, 0); if (p != end) cons->port = d; } return minion; } static int use_display (struct consolemap *cons) { grab_cookie (cons); cons->minion_pid = exec_minion (cons); return cons->minion_pid == -1 ? 1 : 0; } static int already_haunted (pid_t pid) { struct consolemap *c; for (c = consoles; c; c = c->next) if (c->controlling_pid == pid) return 1; return 0; } static int create_minion (struct consolemap *cons) { DIR *d; struct dirent *dent; int failed = 1; cons->minion_pid = -1; d = opendir ("/proc"); if (!d) { perror ("/proc"); return failed; } for (dent = readdir (d); dent; dent = readdir (d)) { char cmdline[PATH_MAX]; char program[PATH_MAX]; char arg[PATH_MAX]; char *authority_file = NULL; unsigned long display = 0; unsigned long controlling_pid; char *p; FILE *fcmdline; if (!isdigit (dent->d_name[0])) continue; if (strlen (dent->d_name) + sizeof ("/proc/cmdline") >= PATH_MAX) continue; sprintf (cmdline, "/proc/%s/cmdline", dent->d_name); fcmdline = fopen (cmdline, "r"); if (!fcmdline) continue; if (readzt (fcmdline, program, sizeof (program)) == sizeof (program)) { fclose (fcmdline); continue; } p = strrchr (program, '/'); if (p) p++; else p = program; if (strcmp (p, "X") && strncmp (p, "XF86", 4)) { fclose (fcmdline); continue; } controlling_pid = strtoul (dent->d_name, &p, 10); if (dent->d_name == p) { fclose (fcmdline); continue; } if (already_haunted (controlling_pid)) { fclose (fcmdline); continue; } /* Hunt for -auth and a display number */ while (!feof (fcmdline)) { if (readzt (fcmdline, arg, sizeof (arg)) == sizeof (arg)) continue; if (!authority_file && !strcmp (arg, "-auth")) { if (readzt (fcmdline, arg, sizeof (arg)) == sizeof (arg)) continue; authority_file = strdup (arg); } else if (!display && arg[0] == ':') { unsigned long d; char *end; d = strtoul (arg + 1, &end, 10); if (arg + 1 == end) continue; display = d; } } if (!authority_file) { /* Use ~/.Xauthority */ struct stat st; struct passwd *pw; size_t len; if (fstat (fileno (fcmdline), &st)) { fclose (fcmdline); continue; } pw = getpwuid (st.st_uid); if (!pw) { fclose (fcmdline); continue; } len = sizeof ("/.Xauthority") + 1; len += strlen (pw->pw_dir); authority_file = malloc (len); if (!authority_file) { fclose (fcmdline); continue; } sprintf (authority_file, "%s/.Xauthority", pw->pw_dir); } fclose (fcmdline); cons->controlling_pid = controlling_pid; cons->display = display; if (cons->authority_file) free (cons->authority_file); cons->authority_file = authority_file; if (!use_display (cons)) { failed = 0; break; } } closedir (d); return failed; } static int is_child (pid_t pid) { int status = 0; int wpid; if (pid == -1) return 0; wpid = waitpid (pid, &status, WNOHANG); if (wpid == pid) return 0; if (wpid == -1) return 0; return 1; } static int do_switch (struct consolemap *c, unsigned long console) { if (c && is_child (c->minion_pid)) /* We already know about this one. */ return 0; if (!c) { c = malloc (sizeof (struct consolemap)); if (!c) return 0; c->console = console; c->authority_file = NULL; } else forget (c); if (!create_minion (c)) { c->next = consoles; consoles = c; } else free (c); return 0; } int dump_debug (void) { struct consolemap *c; for (c = consoles; c; c = c->next) { printf ("\nConsole %lu:\n", c->console); printf ("%d is :%lu, served by %d on port %d\n", c->controlling_pid, c->display, c->minion_pid, c->port); } return 0; } int vt_switched_to (unsigned long console) { struct consolemap *c; for (c = consoles; c; c = c->next) { if (c->console == console) break; } return do_switch (c, console); } int do_respawn (void) { struct consolemap *c; for (c = consoles; c; c = c->next) do_switch (c, c->console); return 0; } int xfree86_init (void) { struct sigaction chld; chld.sa_handler = handle_sigchld; sigemptyset (&chld.sa_mask); chld.sa_flags = SA_NOCLDSTOP | SA_RESTART; sigaction (SIGCHLD, &chld, NULL); return 0; } unsigned short port_for_console (unsigned long console) { struct consolemap *c; for (c = consoles; c; c = c->next) { if (c->console == console && is_child (c->minion_pid)) return c->port; } return 0; } vtgrab-0.1.8.orig/nrvc.c0100664000175000017500000005264507200557040014136 0ustar riskorisko/* * vtgrab - grab the foreground console for display on another machine * Copyright (C) 2000 Tim Waugh * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * This is an RVC client, based on ncurses. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // On some systems, signal.h and curses.h don't get on if _GNU_SOURCE #undef ERR #include #include "rvc.h" #include "simple_panel.h" #define DEBUG 0 static uint8_t wishlist[] = { Feature_Key, Feature_IncRectangle, Feature_IncScroll, Feature_SwitchRequest, Feature_Switch, Feature_Clear, }; static int caught_break = 0; static int colourmap[8][8]; static char *remote_host = NULL; static uint8_t in_use[256]; static int keyboard_control = 0; static int (*menu) (int fd, int key) = NULL; static PANEL *status_pnl = NULL; static int status_pnl_expired; static PANEL *display = NULL; static int display_pminrow, display_pmincol; static int escape_key = '\001'; // ^A static int escape_escape_key = '\001'; // ^A static int log (char *fmt __attribute__ ((unused)), ...) { return 0; } static int write_exact (int fd, const void *buffer, size_t len) { const char *buf = buffer; while (len) { ssize_t put = write (fd, buf, len); if (put < 0) return put; len -= put; buf += put; } return 0; } static int read_exact (int fd, void *buffer, size_t len) { char *buf = buffer; while (len) { ssize_t got = read (fd, buf, len); if (got <= 0) return 1; len -= got; buf += got; } return 0; } static int send_key (int fd, char key) { int xfd = dup (fd); FILE *f = fdopen (xfd, "r+"); if (!f) return 1; fputc (Msg_Key, f); fputc (key, f); fclose (f); return 0; } static int request_full_update (int fd) { uint8_t msg = Msg_FullUpdateRequest; return write_exact (fd, &msg, 1); } static int send_switchrequest (int fd, int switchto) { int xfd = dup (fd); FILE *f = fdopen (xfd, "r+"); if (!f) return 1; fputc (Msg_SwitchRequest, f); fputc (switchto, f); return fclose (f); } static int vt_menu (int fd, int key) { static WINDOW *wnd; static PANEL *pnl; int height = 3, width = 25; int switchto = -1; if (!wnd) { int startx, starty; int y, x; getmaxyx (stdscr, y, x); starty = (y - height) / 2; startx = (x - width) / 2; wnd = newwin (height, width, starty, startx); if (!wnd) return 1; pnl = new_panel (wnd); box (wnd, ACS_VLINE, ACS_HLINE); y = 1; wmove (wnd, y, 2); wprintw (wnd, "Press a function key"); wmove (wnd, y, width - 2); update_panels (); doupdate (); return 0; } switch (key) { case '\033': switchto = 0; break; default: if (key > KEY_F0 && key < KEY_F0 + 64) switchto = key - KEY_F0; else if (key > '0' && key <= '9') switchto = key - '0'; else { beep (); return 0; } break; } del_panel (pnl); delwin (wnd); pnl = NULL; wnd = NULL; menu = NULL; update_panels (); doupdate (); if (!switchto) return 0; send_switchrequest (fd, switchto); return 0; } static int main_menu (int fd, int key) { static WINDOW *wnd; static PANEL *pnl; static int selection; int height = 9, width = 28, nselect = 5; if (!wnd) { int startx, starty; int y, x; getmaxyx (stdscr, y, x); starty = (y - height) / 2; startx = (x - width) / 2; wnd = newwin (height, width, starty, startx); if (!wnd) return 1; pnl = new_panel (wnd); box (wnd, ACS_VLINE, ACS_HLINE); y = 2; wmove (wnd, y++, 3); wprintw (wnd, "Send "); if (iscntrl (escape_key)) wprintw (wnd, "Control-"); if ((escape_key & 0x1f) == (escape_escape_key & 0x1f)) { wattron (wnd, A_UNDERLINE); wprintw (wnd, "%c", 'A' - 1 + (escape_key & 0x1f)); wattroff (wnd, A_UNDERLINE); } else { wprintw (wnd, "%c (", 'A' - 1 + (escape_key & 0x1f)); wattron (wnd, A_UNDERLINE); wprintw (wnd, "%s%c", iscntrl (escape_escape_key) ? "^" : "", 'A' - 1 + (escape_escape_key & 0x1f)); wattroff (wnd, A_UNDERLINE); wprintw (wnd, ")"); } wmove (wnd, y++, 3); wattron (wnd, A_UNDERLINE); wprintw (wnd, "E"); wattroff (wnd, A_UNDERLINE); wprintw (wnd, "xit main menu"); wmove (wnd, y, 3); wattron (wnd, A_UNDERLINE); wprintw (wnd, "K"); wattroff (wnd, A_UNDERLINE); wprintw (wnd, "eyboard control"); wmove (wnd, y++, width - 5); wprintw (wnd, "%s", keyboard_control ? " On" : "Off"); wmove (wnd, y++, 3); wprintw (wnd, "Switch "); wattron (wnd, A_UNDERLINE); wprintw (wnd, "v"); wattroff (wnd, A_UNDERLINE); wprintw (wnd, "irtual terminal"); wmove (wnd, y++, 3); wprintw (wnd, "E"); wattron (wnd, A_UNDERLINE); wprintw (wnd, "x"); wattroff (wnd, A_UNDERLINE); wprintw (wnd, "it viewer"); selection = 0; wmove (wnd, 2 + selection, 2); wprintw (wnd, ">"); wmove (wnd, 2 + selection, width - 2); update_panels (); doupdate (); return 0; } switch (key) { case KEY_UP: wmove (wnd, 2 + selection, 2); wprintw (wnd, " "); selection--; selection += nselect; selection %= nselect; wmove (wnd, 2 + selection, 2); wprintw (wnd, ">"); wmove (wnd, 2 + selection, width - 2); break; case KEY_DOWN: wmove (wnd, 2 + selection, 2); wprintw (wnd, " "); selection++; selection %= nselect; wmove (wnd, 2 + selection, 2); wprintw (wnd, ">"); wmove (wnd, 2 + selection, width - 2); break; default: // shortcuts switch (key) { default: if (key != escape_escape_key) goto out; selection = 0; break; case '\033': case 'e': selection = 1; break; case 'k': selection = 2; break; case 'v': selection = 3; break; case 'x': selection = 4; break; } // fall-through case '\r': case '\n': del_panel (pnl); delwin (wnd); pnl = NULL; wnd = NULL; menu = NULL; switch (selection) { case 0: // Send control-A send_key (fd, escape_key); break; case 1: // Exit main menu break; case 2: // Keyboard control keyboard_control = !keyboard_control; break; case 3: menu = vt_menu; (*menu) (fd, key); break; case 4: // Exit viewer update_panels (); doupdate (); exit (0); } break; } out: update_panels (); doupdate (); return 0; } static void update_display_panel (void) { int slop; WINDOW *wnd = panel_window (display); int curx, cury, maxx, maxy, pmaxx, pmaxy; getyx (wnd, cury, curx); getmaxyx (wnd, pmaxy, pmaxx); getmaxyx (stdscr, maxy, maxx); slop = maxy / 3; if (curx < display_pmincol) { display_pmincol = curx - slop; if (display_pmincol < 0) display_pmincol = 0; } if (curx >= (display_pmincol + maxx)) { display_pmincol = curx - maxx + slop; if ((display_pmincol + maxx) > pmaxx) display_pmincol = pmaxx - maxx; } if (cury < display_pminrow) { display_pminrow = cury - slop; if (display_pminrow < 0) display_pminrow = 0; } if (cury >= (display_pminrow + maxy)) { display_pminrow = cury - maxy + slop; if ((display_pminrow + maxy) > pmaxy) display_pminrow = pmaxy - maxy; } panel_is_pad (display, display_pminrow, display_pmincol, 0, 0, maxy, maxx); } static int create_display_panel (int lines, int cols) { WINDOW *wnd = newpad (lines, cols); if (!wnd) return 1; werase (wnd); display = new_panel (wnd); if (!display) return 1; bottom_panel (display); display_pmincol = 0; display_pminrow = 0; return 0; } static int do_scroll (uint8_t lines) { WINDOW *wnd = panel_window (display); scrollok (wnd, 1); wscrl (wnd, lines); update_display_panel (); update_panels (); doupdate (); scrollok (wnd, 0); return 0; } static int do_clear (void) { WINDOW *wnd = panel_window (display); werase (wnd); update_display_panel (); update_panels (); return 0; } static int handle_update (int fd) { static uint8_t *contents = NULL; static uint16_t allocated = 0; WINDOW *wnd; uint8_t header[3]; uint8_t update_type; uint16_t content_length; uint8_t x, y; if (read_exact (fd, header, 3)) return 1; update_type = header[0]; memcpy (&content_length, &header[1], 2); content_length = ntohs (content_length); if (allocated < content_length) { if (contents) free (contents); allocated = content_length; contents = malloc (allocated); if (!contents) { allocated = 0; return 1; } } if (read_exact (fd, contents, content_length)) return 1; if (display && update_type == UpdateType_Scroll) return do_scroll (contents[0]); if (display && update_type == UpdateType_Clear) return do_clear (); if (update_type != UpdateType_Rectangle) return 1; if (!display) { if (contents[0] || contents[1]) // Need full update return 1; wnd = newpad (contents[2], contents[3]); if (!wnd) return 1; } if (!contents[0] && !contents[1]) { if (display) { int y, x; wnd = panel_window (display); getmaxyx (wnd, y, x); if (contents[2] > y || contents[3] > x) { wresize (wnd, contents[2], contents[3]); werase (wnd); wmove (wnd, 0, 0); } } else { if (create_display_panel (contents[2], contents[3])) return 1; } } wnd = panel_window (display); for (y = 0; y < contents[2]; y++) { uint8_t *p; p = contents + 6; p += y * 2 * contents[3]; for (x = 0; x < contents[3] && (6 + 2 * y * contents[3] + 2 * x + 1) < content_length; x++) { uint8_t attrbyte = p[2 * x + 1]; int attr = 0; int fg, bg; if (attrbyte & 0x80) attr |= A_BLINK; if (attrbyte & 0x08) attr |= A_BOLD; fg = attrbyte & 7; bg = (attrbyte >> 4) & 7; attr |= COLOR_PAIR (colourmap[bg][fg]); wattrset (wnd, attr); mvwaddch (wnd, y + contents[1], x + contents[0], p[2 * x]); } } wattrset (wnd, A_NORMAL); wmove (wnd, contents[5], contents[4]); update_display_panel (); update_panels (); doupdate (); return 0; } static void sigalrm (int sig __attribute__ ((unused))) { // Clean up status bar status_pnl_expired = 1; } static void sigint (int sig __attribute__ ((unused))) { caught_break++; } static pid_t try_vncviewer (unsigned short port) { char *param; pid_t pid; int null; if (!remote_host) return 1; param = malloc (strlen (remote_host) + 20); if (!param) return 1; sprintf (param, "%s:%d", remote_host, port - 5900); null = open ("/dev/null", O_RDWR); pid = fork (); if (pid == -1) return pid; if (!pid) { // Child. close (0); close (1); close (2); dup (null); dup (null); dup (null); execlp ("vncviewer", "vncviewer", param, NULL); exit (1); } close (null); free (param); return pid; } static int handle_switch (int fd) { static int last_mode = 0; static int first = 1; static pid_t vncviewer = -1; WINDOW *wnd; uint8_t switchmsg[4]; uint16_t port; char status_bar[100]; int len; if (read_exact (fd, switchmsg, sizeof (switchmsg))) return 1; if (!display) return 0; memcpy (&port, &switchmsg[1], 2); port = ntohs (port); if (first) { first = 0; strcpy (status_bar, "Press Control-A for menu"); } else sprintf (status_bar, "tty%d (mode %d)", (int) switchmsg[0], (int) switchmsg[3]); len = strlen (status_bar); if (status_pnl) { wnd = panel_window (status_pnl); del_panel (status_pnl); delwin (wnd); status_pnl = NULL; } wnd = newwin (1, len, 0, 0); status_pnl = new_panel (wnd); wattron (wnd, A_REVERSE); mvwprintw (wnd, 0, 0, "%s", status_bar); curs_set (0); if (vncviewer != -1) { switch (waitpid (vncviewer, NULL, WNOHANG)) { case 0: // still running kill (vncviewer, SIGTERM); waitpid (vncviewer, NULL, 0); vncviewer = -1; break; default: // exited case -1: // wrong pid vncviewer = -1; break; } } if (switchmsg[3]) { WINDOW *dwnd = panel_window (display); werase (dwnd); mvwprintw (dwnd, 2, 2, "%s", "It is not possible to display this terminal " "as text."); if (port) { mvwprintw (dwnd, 3, 2, "Use vncviewer to view display :%d.", port - 5900); vncviewer = try_vncviewer (port); } wmove (dwnd, 0, 0); update_display_panel (); } update_panels (); doupdate (); status_pnl_expired = 0; alarm (2); if (last_mode != 0 && switchmsg[3] == 0) request_full_update (fd); last_mode = switchmsg[3]; return 0; } static int handle_input (int fd) { if (menu) { int key = getch(); (*menu) (fd, key); } else { char key; if (read_exact (STDIN_FILENO, &key, 1)) return 1; if (key == escape_key) { menu = main_menu; (*menu) (fd, key); } else { if (keyboard_control) send_key (fd, key); return 0; } } return 0; } static int client_loop (int fd) { int switch_no_update = 0; int ret = 0; for (;;) { unsigned char msg; struct timeval tv; fd_set readfds; int sretcode; if (status_pnl_expired) { if (status_pnl) { WINDOW *wnd = panel_window (status_pnl); del_panel (status_pnl); delwin (wnd); curs_set (1); update_panels (); doupdate (); } status_pnl = NULL; status_pnl_expired = 0; } // Clean up any vncviewers that are lying around waitpid (-1, NULL, WNOHANG); FD_ZERO (&readfds); FD_SET (STDIN_FILENO, &readfds); FD_SET (fd, &readfds); tv.tv_sec = 1; tv.tv_usec = 0; sretcode = select (fd + 1, &readfds, NULL, NULL, &tv); if (!sretcode || (sretcode == -1 && errno == EINTR)) { /* Timeout. */ sigset_t set; sigemptyset (&set); sigaddset (&set, SIGINT); sigprocmask (SIG_BLOCK, &set, NULL); while (caught_break) { if (keyboard_control) send_key (fd, '\3'); caught_break--; } sigprocmask (SIG_UNBLOCK, &set, NULL); if (switch_no_update) request_full_update (fd); continue; } if (FD_ISSET (STDIN_FILENO, &readfds)) handle_input (fd); if (!(FD_ISSET (fd, &readfds))) continue; /* Now handle input from the RVC server. */ if (read_exact (fd, &msg, 1)) { ret = 1; break; } if (msg == Msg_Terminate) break; switch (msg) { case Msg_IncrementalUpdate: handle_update (fd); switch_no_update = 0; break; case Msg_Switch: handle_switch (fd); switch_no_update = 1; break; default: log ("Unknown message type 0x%02x\n", msg); break; } } return 0; } static void do_colourmap_setup (int high, int background) { int i; for (i = 0; i < 7; i++) colourmap[high][i] = high * 8 + i; colourmap[high][7] = 0; init_pair (colourmap[high][0x0], COLOR_BLACK, background); init_pair (colourmap[high][0x1], COLOR_BLUE, background); init_pair (colourmap[high][0x2], COLOR_GREEN, background); init_pair (colourmap[high][0x3], COLOR_CYAN, background); init_pair (colourmap[high][0x4], COLOR_RED, background); init_pair (colourmap[high][0x5], COLOR_MAGENTA, background); init_pair (colourmap[high][0x6], COLOR_YELLOW, background); } void setup_colours (void) { start_color (); assert (COLOR_PAIRS >= (8 * 8)); do_colourmap_setup (0, COLOR_BLACK); do_colourmap_setup (1, COLOR_BLUE); do_colourmap_setup (2, COLOR_GREEN); do_colourmap_setup (3, COLOR_CYAN); do_colourmap_setup (4, COLOR_RED); do_colourmap_setup (5, COLOR_MAGENTA); do_colourmap_setup (6, COLOR_YELLOW); do_colourmap_setup (7, COLOR_CYAN); } static void terminate (int fd) { uint8_t trm = Msg_Terminate; write (fd, &trm, sizeof (trm)); } static int client (int fd) { const size_t protverlen = 12; char protocol_version[13]; uint32_t auth; uint8_t num_features, i; char *p, *end, *features; unsigned long their_major; struct ClientInitialisation_fixedpart ci; struct sigaction alrm; struct sigaction sint; initscr (); atexit ((void(*)(void))endwin); cbreak (); noecho (); nonl (); intrflush (stdscr, FALSE); keypad (stdscr, TRUE); setup_colours (); alrm.sa_handler = sigalrm; alrm.sa_flags = 0; sigaction (SIGALRM, &alrm, NULL); sint.sa_handler = sigint; sint.sa_flags = 0; sigaction (SIGINT, &sint, NULL); /** * Terminate any preexisting connection **/ if (isatty (fd)) terminate (fd); /** * Receive ProtocolVersion **/ memset (protocol_version, 0, protverlen + 1); if (read_exact (fd, protocol_version, protverlen)) return log ("Problem receiving ProtocolVersion\n"); p = protocol_version + 4; try_again: their_major = strtoul (p, &end, 10); if (p == end || strncmp (protocol_version, RVC_PROTOCOL_VERSION, 4) || protocol_version[7] != '.' || protocol_version[protverlen - 1] != '\n') { unsigned int i; log ("Garbled communications: \"%s\"\n", protocol_version); for (i = 1; i < protverlen - 1; i++) { size_t match = protverlen - i; if (match > 4) match = 4; if (!strncmp (protocol_version + i, RVC_PROTOCOL_VERSION, 4)) { memmove (protocol_version, protocol_version + i, protverlen - i); if (read_exact (fd, protocol_version + protverlen - i, i)) break; log ("Restarting with: \"%s\"\n", protocol_version); goto try_again; } } return log ("Garbled ProtocolVersion\n"); } /** * Send ProtocolVersion **/ if (write_exact (fd, RVC_PROTOCOL_VERSION, protverlen)) return log ("Problem sending ProtocolVersion\n"); /** * Receive Authentication **/ if (read_exact (fd, &auth, 4)) return log ("Problem receiving Authentication\n"); auth = ntohl (auth); if (auth != 1) return log ("Connection problem\n"); /** * Receive ServerInitialisation **/ if (read_exact (fd, &num_features, 1)) return log ("Problem receiving ServerInitialisation\n"); features = malloc (num_features); if (!features) { free (features); return log ("Out of memory during ServerInitialisation\n"); } if (read_exact (fd, features, num_features)) return log ("Problem receiving feature list\n"); /** * Send ClientInitialisation **/ ci.updatems = 0; getmaxyx (stdscr, ci.rows, ci.cols); create_display_panel (ci.rows, ci.cols); ci.pad1 = ci.pad2 = ci.pad3 = ci.pad4 = 0; ci.num_features = num_features; if (write_exact (fd, &ci, sizeof (ci))) return log ("Problem sending ClientInitialisation\n"); for (i = 0; i < num_features; i++) { uint8_t feature = features[i]; unsigned int j; features[i] = 0; for (j = 0; j < sizeof (wishlist); j++) { if (wishlist[j] == feature) { features[i] = 1; log ("In use: %d\n", feature); break; } } in_use[feature] = features[i]; } if (write_exact (fd, features, num_features)) return log ("Problem sending num-features\n"); return client_loop (fd); } int syntax (void) { fprintf (stderr, "Usage: nrvc :\n" " nrvc [host]\n" " nrvc --help\n" " nrvc --version\n"); return 0; } static int connect_to (const char *name) { char *host, *p, *end; struct hostent *h; struct sockaddr_in sin; unsigned long port; int s; host = strdup (name); if (!host) { fprintf (stderr, "Out of memory\n"); exit (1); } p = strrchr (host, ':'); if (!p) { syntax (); exit (1); } *p++ = '\0'; if (!*host) { syntax (); exit (1); } remote_host = strdup (host); h = gethostbyname (host); if (!h || !*h->h_addr_list) { fprintf (stderr, "unknown host %s\n", host); exit (1); } memcpy (&sin.sin_addr.s_addr, *h->h_addr_list, h->h_length); port = strtoul (p, &end, 10); if (p == end) { syntax (); exit (1); } sin.sin_port = htons (port); sin.sin_family = AF_INET; s = socket (PF_INET, SOCK_STREAM, 0); if (s < 0) { perror ("socket"); exit (1); } if (connect (s, &sin, sizeof (sin)) < 0) { perror ("connect"); exit (1); } return s; } static int interpret_escape (const char **esc) { int key = ERR; const char *p = *esc; if (*p == '^') { key = *++p & 0x1f; p++; } else key = *p++; *esc = p; return key; } static int interpret_escapes (const char *esc) { int escape = interpret_escape (&esc); int escape_escape = interpret_escape (&esc); if (escape == ERR || escape_escape == ERR) { syntax (); exit (1); } escape_key = escape; escape_escape_key = escape_escape; return 0; } int main (int argc, char *argv[]) { int fd; /* Options */ for (;;) { static struct option long_options[] = { {"control", 0, 0, 'c'}, {"escape", 1, 0, 'e'}, {"help", 0, 0, 'h'}, {"version", 0, 0, 'v'}, {0, 0, 0, 0} }; int c = getopt_long (argc, argv, "ce:", long_options, NULL); if (c == -1) break; switch (c) { case 'h': syntax (); exit (0); case 'v': printf ("ncurses-based RVC (vtgrab %s)\n", VERSION); exit (0); case 'c': keyboard_control = 1; break; case 'e': interpret_escapes (optarg); break; } } if (argc - optind < 1 || argc - optind > 2) { syntax (); exit (1); } if ((fd = open (argv[optind], O_RDWR)) == -1) fd = connect_to (argv[optind]); else { /* Need to set raw mode */ struct termios tios; tcgetattr (fd, &tios); cfmakeraw (&tios); cfsetospeed (&tios, B9600); cfsetispeed (&tios, B9600); tcsetattr (fd, TCSANOW, &tios); tcflush (fd, TCIOFLUSH); if (argc - optind == 2) remote_host = argv[optind + 1]; } if (isatty (fd)) { int safe; for (safe = 100; safe > 0; safe--) terminate (fd); } return client (fd); } vtgrab-0.1.8.orig/simple_panel.c0100664000175000017500000000460507160360457015640 0ustar riskorisko/* * vtgrab - grab the foreground console for display on another machine * Copyright (C) 2000 Tim Waugh * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * This file contains a simple reimplementation of ncurses's panel, * with the advatnage of being able to interoperate with pads. It * doesn't, oever, cope well with overlapping panels. */ #include #include #include "simple_panel.h" static PANEL *panels; void update_panels (void) { PANEL *p = panels; while (p) { touchwin (p->wnd); if (p->is_pad) pnoutrefresh (p->wnd, p->pminrow, p->pmincol, p->sminrow, p->smincol, p->smaxrow, p->smaxcol); else wnoutrefresh (p->wnd); p = p->above; } } PANEL *new_panel (WINDOW *wnd) { PANEL **pp, *newp = malloc (sizeof (PANEL)); if (!newp) return NULL; newp->above = NULL; newp->wnd = wnd; newp->is_pad = 0; pp = &panels; while (*pp) pp = &(*pp)->above; *pp = newp; return newp; } void panel_is_pad (PANEL *pan, int pminrow, int pmincol, int sminrow, int smincol, int smaxrow, int smaxcol) { pan->is_pad = 1; pan->pminrow = pminrow; pan->pmincol = pmincol; pan->sminrow = sminrow; pan->smincol = smincol; pan->smaxrow = smaxrow; pan->smaxcol = smaxcol; } static int do_del_panel (PANEL *pan) { PANEL *p; if (panels == pan) { panels = panels->above; return 0; } p = panels; while (p->above) { if (p->above == pan) { p->above = pan->above; return 0; } p = p->above; } return 1; } int del_panel (PANEL *pan) { int ret = do_del_panel (pan); free (pan); return ret; } WINDOW *panel_window (PANEL *pan) { return pan->wnd; } int bottom_panel (PANEL *pan) { do_del_panel (pan); pan->above = panels; panels = pan; return 0; } vtgrab-0.1.8.orig/BUGS0100664000175000017500000000007507160455001013472 0ustar riskorisko- Snarfing the X authority doesn't seem to work reliably yet vtgrab-0.1.8.orig/rvc.h0100664000175000017500000000365707200536465013774 0ustar riskorisko/* * vtgrab - grab the foreground console for display on another machine * Copyright (C) 2000 Tim Waugh * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * This file contains definitions needed for RVC communications. */ #define RVC_PROTOCOL_VERSION "RVC 001.000\n" enum authentication_schemes { AuthFailed = 0, AuthNoAuth = 1, AuthVNC = 2 }; enum features { Feature_Key = 0, Feature_Pointer = 1, Feature_IncRectangle = 2, Feature_IncScroll = 3, Feature_Clear = 4, Feature_Crop = 5, Feature_Switch = 6, Feature_DisplayLock = 7, Feature_InputLock = 8, Feature_Shareable = 9, Feature_VNCIntegration = 10, Feature_SwitchRequest = 11, Feature_Push = 12, }; enum server_messages { Msg_ServerInit = 0, Msg_IncrementalUpdate = 1, Msg_Switch = 2, Msg_Terminate = 128, }; enum client_messages { Msg_ClientInit = 255, Msg_FullUpdateRequest = 254, Msg_Key = 253, Msg_Pointer = 252, Msg_SwitchRequest = 251, Msg_PushStart = 250, Msg_PushStop = 249, }; enum updatetypes { UpdateType_Rectangle = 0, UpdateType_Scroll = 1, UpdateType_Clear = 2, }; struct ClientInitialisation_fixedpart { uint8_t message_type; uint8_t pad1; uint8_t pad2; uint8_t pad3; uint32_t updatems; uint8_t rows; uint8_t cols; uint8_t pad4; uint8_t num_features; }; vtgrab-0.1.8.orig/xfree86.h0100664000175000017500000000223207157675443014470 0ustar riskorisko/* * vtgrab - grab the foreground console for display on another machine * Copyright (C) 2000 Tim Waugh * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * This file contains definitions needed for RVC communications. */ extern int reapees; extern int xfree86_init (void); extern int reap_child (void); extern int vt_switched_to (unsigned long console); extern int do_respawn (void); extern unsigned short port_for_console (unsigned long console); extern int dump_debug (void); vtgrab-0.1.8.orig/simple_panel.h0100664000175000017500000000274007160360172015635 0ustar riskorisko/* * vtgrab - grab the foreground console for display on another machine * Copyright (C) 2000 Tim Waugh * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * This file contains a simple reimplementation of ncurses's panel, * with the advatnage of being able to interoperate with pads. It * doesn't, oever, cope well with overlapping panels. */ typedef struct panel { WINDOW *wnd; int is_pad; int pminrow; int pmincol; int sminrow; int smincol; int smaxrow; int smaxcol; struct panel *above; } PANEL; extern void update_panels (void); extern PANEL *new_panel (WINDOW *); extern void panel_is_pad (PANEL *, int pminrow, int pmincol, int sminrow, int smincol, int smaxrow, int smaxcol); extern int del_panel (PANEL *); extern WINDOW *panel_window (PANEL *); extern int bottom_panel (PANEL *); vtgrab-0.1.8.orig/twiglet.10100664000175000017500000000470607200557534014566 0ustar riskorisko.\" -*-Nroff-*- .\" Copyright 2000 Red Hat, Inc. .TH TWIGLET 1 "20 Sep 2000" "VTGRAB" "User's Manual" .SH NAME twiglet \- observe or control an RVC-enabled machine's console .SH SYNOPSIS .B twiglet [\fIOPTION\fR]... \fIhost-specification\fR .fi .SH DESCRIPTION twiglet is a program for controlling another machine's console. It works using the RVC protocol, and an RVC server (such as rvcd(1)) must be running on the machine to be observed. Using twiglet, the a best effort attempt is made to duplicate the screen contents of the observed machine. If the machine is displaying a virtual text console, the text on the console is rendered in the terminal in which twiglet runs. If the machine is displaying an X session, and the RVC server supports VNC integration, twiglet will open a window that contains the current contents of the X display. It is also possible to control the observed machine in various ways. With keyboard control enabled (and with support from the RVC server), keys may be sent to the observed machine in text console mode almost as if they were typed from the keyboard. Twiglet also supports switching virtual console on the observed machine. Finally, if VNC integration is available, the X display can be manipulated almost as if the user were at the console. The intended use for twiglet is in training and teaching environments. The idea is that there are student machines and a control machine (which the trainer or teacher would be using), with a serial line attached to each student machine. The trainer or teacher can then analyse the students' attempts to complete tasks, and help them out (showing them how to finish it) without needed to push them aside to get to the keyboard. This client is written using ncurses(3X). .SH OPTIONS .TP \fB\--help\fR display a help message and exit successfully .TP \fB\--version\fR display a version number and exit successfully .TP \fB\-c\fR, \fB\--control\fR control the remote machine rather than just observing it .TP \fB\-e\fR \fIxy\fR, \fB\--escape\fR \fIxy\fR set the escape character and the escape escape character (like screen(1)) .PP The \fIhost-specification\fR takes one of the following forms: .TP \fIhost\fR:\fIport\fR to connect to an RVC server over TCP .TP \fItty\fR [\fIhost\fR] to communicate with an RVC server over a tty (for example a serial line); the optional hostname is for VNC integration .SH BUGS I'm sure there are bugs, but I don't know what they are. .SH AUTHOR Tim Waugh