snarf-7.0.orig/0040755000175000001440000000000007144125643012465 5ustar mvelauserssnarf-7.0.orig/Makefile.in0100644000175000001440000003477607144125643014550 0ustar mvelausers# 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@ CPP = @CPP@ HERROR = @HERROR@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ U = @U@ VERSION = @VERSION@ AUTOMAKE_OPTIONS = foreign ansi2knr bin_PROGRAMS = snarf snarf_SOURCES = ftp.c ftp.h http.c http.h llist.c llist.h options.c options.h snarf.c url.c url.h util.c util.h gopher.c gopher.h EXTRA_snarf_SOURCES = herror.c snarf_LDADD = @HERROR@ snarf_DEPENDENCIES = @HERROR@ man_MANS = snarf.1 EXTRA_DIST = urls snarf.1 snarf-2.prj herror.c snarf.spec ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = snarf.spec PROGRAMS = $(bin_PROGRAMS) DEFS = @DEFS@ -I. -I$(srcdir) -I. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ ANSI2KNR = @ANSI2KNR@ snarf_OBJECTS = ftp$U.o http$U.o llist$U.o options$U.o snarf$U.o \ url$U.o util$U.o gopher$U.o snarf_LDFLAGS = CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ man1dir = $(mandir)/man1 MANS = $(man_MANS) NROFF = nroff DIST_COMMON = README ./stamp-h.in COPYING ChangeLog INSTALL Makefile.am \ Makefile.in TODO acconfig.h aclocal.m4 ansi2knr.1 ansi2knr.c \ config.h.in configure configure.in install-sh missing mkinstalldirs \ snarf.spec.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best SOURCES = $(snarf_SOURCES) $(EXTRA_snarf_SOURCES) OBJECTS = $(snarf_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) --foreign --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) acconfig.h 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: snarf.spec: $(top_builddir)/config.status snarf.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: mostlyclean-krextra: clean-krextra: -rm -f ansi2knr distclean-krextra: maintainer-clean-krextra: ansi2knr: ansi2knr.o $(LINK) ansi2knr.o $(LIBS) ansi2knr.o: $(CONFIG_HEADER) mostlyclean-kr: -rm -f *_.c clean-kr: distclean-kr: maintainer-clean-kr: snarf: $(snarf_OBJECTS) $(snarf_DEPENDENCIES) @rm -f snarf $(LINK) $(snarf_LDFLAGS) $(snarf_OBJECTS) $(snarf_LDADD) $(LIBS) ftp_.c: ftp.c $(ANSI2KNR) $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ftp.c; then echo $(srcdir)/ftp.c; else echo ftp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ftp_.c gopher_.c: gopher.c $(ANSI2KNR) $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/gopher.c; then echo $(srcdir)/gopher.c; else echo gopher.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > gopher_.c herror_.c: herror.c $(ANSI2KNR) $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/herror.c; then echo $(srcdir)/herror.c; else echo herror.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > herror_.c http_.c: http.c $(ANSI2KNR) $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/http.c; then echo $(srcdir)/http.c; else echo http.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > http_.c llist_.c: llist.c $(ANSI2KNR) $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/llist.c; then echo $(srcdir)/llist.c; else echo llist.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > llist_.c options_.c: options.c $(ANSI2KNR) $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/options.c; then echo $(srcdir)/options.c; else echo options.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > options_.c snarf_.c: snarf.c $(ANSI2KNR) $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/snarf.c; then echo $(srcdir)/snarf.c; else echo snarf.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > snarf_.c url_.c: url.c $(ANSI2KNR) $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/url.c; then echo $(srcdir)/url.c; else echo url.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > url_.c util_.c: util.c $(ANSI2KNR) $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/util.c; then echo $(srcdir)/util.c; else echo util.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > util_.c ftp_.o gopher_.o herror_.o http_.o llist_.o options_.o snarf_.o url_.o \ util_.o : $(ANSI2KNR) install-man1: $(mkinstalldirs) $(DESTDIR)$(man1dir) @list='$(man1_MANS)'; \ l2='$(man_MANS)'; for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ done uninstall-man1: @list='$(man1_MANS)'; \ l2='$(man_MANS)'; for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ rm -f $(DESTDIR)$(man1dir)/$$inst; \ done install-man: $(MANS) @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-man1 uninstall-man: @$(NORMAL_UNINSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 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) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done ftp.o: ftp.c config.h http.h url.h util.h ftp.h options.h gopher.o: gopher.c config.h url.h gopher.h options.h util.h http.h http.o: http.c config.h url.h http.h options.h util.h llist.h llist.o: llist.c config.h llist.h options.o: options.c config.h options.h util.h url.h snarf.o: snarf.c config.h options.h llist.h url.h http.h ftp.h gopher.h \ util.h url.o: url.c config.h url.h util.h util.o: util.c util.h url.h config.h options.h 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-man 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-man uninstall: uninstall-am all-am: Makefile $(ANSI2KNR) $(PROGRAMS) $(MANS) config.h all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 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-krextra mostlyclean-kr \ mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-krextra \ clean-kr clean-tags clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \ distclean-krextra distclean-kr 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-krextra \ maintainer-clean-kr 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 mostlyclean-krextra distclean-krextra \ clean-krextra maintainer-clean-krextra mostlyclean-kr distclean-kr \ clean-kr maintainer-clean-kr install-man1 uninstall-man1 install-man \ uninstall-man 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 rpm: make dist mv snarf-@VERSION@.tar.gz /usr/src/redhat/SOURCES rpm -bb snarf.spec # 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: snarf-7.0.orig/README0100644000175000001440000000352106613470660013345 0ustar mvelausersThis program is FREE SOFTWARE. See the file COPYING for details. ================== snarf version 2.0 October 1, 1998 ================== Description ----------- Snarf is a utility I wrote to retrieve documents via the http and ftp protocols. It supports http redirect, http and ftp resume, http and ftp authentication, and other neat things. Usage ----- To use snarf to download a file from an url, type "snarf ". This will transfer the file from the remote location to your computer. You can have as many URLs on the command line as you want: "snarf " will download three files. By default, it saves the file with the same name it had on the remote system; if you want to change this, you can do "snarf " and it will save your URL to the filename you provide. To use the HTTP proxy feature, set the SNARF_PROXY, HTTP_PROXY, or FTP_PROXY environment variables to the address of your proxy, such as "proxy.mycompany.de:1080". If you run snarf without any arguments, it prints some usage information. Notes ----- I wrote this in three days four years ago and it was majorly klugy, but it worked, and pretty niftily. I rewrote it from scratch over the past few days and I'm pleased to say that it's much nicer and cleaner inside, and this cleanliness has made it easy to add some features I always wanted to add to the old version. Version 2.0.3: This version has a configure option of "--with-guess-winsize". This feature uses ioctl to determine what your operating system things the width of your terminal is. It's not enabled by default, because I don't know how well it works on all platforms. It's safe to enable on Linux and Solaris. If you manage to get it to work somewhere else, let me know. Email: xach@xach.com Snail mail: Zachary Beane, 17 Talmadge Rd., Waite, ME 04492, USA snarf-7.0.orig/stamp-h.in0100644000175000001440000000001207144123624014351 0ustar mvelauserstimestamp snarf-7.0.orig/COPYING0100644000175000001440000004307006611763175013527 0ustar mvelausers GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, 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., 675 Mass Ave, Cambridge, MA 02139, 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. snarf-7.0.orig/ChangeLog0100644000175000001440000001235507144124405014235 0ustar mvelausers2000-08-08 Zach Beane * Made 7.0 release. * Fixed 3 longstanding annoying bugs: - HTTP redirects were mistakenly converted to lowercase, causing confusing 404s - HTTP redirects were always treated as new HTTP URLs, when it's legal to redirect to a FTP URL. - snarf sent extra stuff between REST and RETR for FTP, which confused some servers (Thanks to Steinar Gunderson for annoying me into fixing this bug). Snarf still does not handle relative redirecton. 2000-01-17 Zach Beane * Made 2.0.9 release. * util.c (dump_data): After dumping the data (or encountering an error), close the socket. This will need to change when we do HTTP/1.1 and keepalive, but for now it can behave this way. This fixed a bug where finished transfers would just hang waiting for "226 Transfer Complete" from the server in an ftp session. 1999-07-28 Zachary Beane * Makefile.am (EXTRA_DIST): Added snarf.spec. Now rpm -ta snarf-m.n.tar.gz will work. * Made 2.0.8 release. * http.c (http_transfer): Fixed stupid bug I introduced by fixing a previous stupid bug. If you had transferred over half the file, resuming download would mistakenly tell you you already had all of it. 1999-07-27 Zachary Beane * Made 2.0.7 release. * Added '--help' flag and changed usage printing. * http.c (http_transfer): Fixed puzzling problem with http-resume that didn't detect properly that we had the whole file. * util.c (progress_init): Add rsrc to the progress struct, so we can print the whole progress line every time with the magic of \r. Now features continuous kb/sec meter! * ftp.c (ftp_transfer): Used the top-secret (to me, anyway) FTP "SIZE" command. This fixed a bug in determining the file's size when resuming. 1999-06-09 Zachary Beane * util.c (progress_update): The things you learn when you try extreme cases. Large files would overflow an int in progress_update, causing it to spew hashes like mad. Changed to unsigned long int, problem fixed. * snarf.c (main): Added check for lone '--version' option. 1999-06-08 Zachary Beane * Made 2.0.6 release. * http.c (http_transfer): Fixed stupid segfault caused when the server doesn't return a header. * util.c (dump_data): Changed progress bars so they also resume, instead of starting from the beginning every time. * http.c (get_request): Added referer spoofing (uses the value from the SNARF_HTTP_REFERER environment variable). 1998-11-16 Zachary Beane * Made 2.0.5 release. * http.c (http_transfer): prompt for proxy password if not specified. * Added patch from Elrond to do proper conditional inclusion of herror.c. Elrond is very, very smart. * Converted warn, error, etc. into one function. Removed all debug printing. * snarf.c (main): Greatly simplified main arg processing loop. Also did some general cleanup. 1998-11-12 Zachary Beane * Made 2.0.4 rerelease, only change being the included herror.c. I'm a bad boy for not bumping the version number. * Makefile.am: Fixed a problem with herror.c not going into the dist tarball. 1998-11-10 Zachary Beane * Made 2.0.4 release. * http.c (get_request): Figured in for proxy passwords. * url.c (get_password): Fixed a problem with raw url strings without slashes. (get_username): Ditto. 1998-11-04 Zachary Beane * http.c (http_transfer): Correctly set the size of the file to be transfered, thus fixing dump_data's inability to recognize when we had all of a HTTP-transferred file. * util.c (progress_update): Moved redrawing of the right-bracket so it only updates when a has is printed. 1998-10-20 Zachary Beane * snarf-2.prj: Fixed a potential FPE problem if the transfer time is 0 seconds. Only affected alphas. 1998-10-19 Zachary Beane * Made 2.0.3 release * util.c (dump_data): Fixed no-resume not getting honored. Also fixed http resume bug that caused failure when less than half the file was getting re-transmitted. * Progress bars are a little nicer now, with stderr buffered. 1998-10-18 Zachary Beane * snarf-2.prj: Fixed some progress code. 1998-10-17 Zachary Beane * snarf-2.prj: Added tests for strerror for SunOS 4.1.3 1998-10-16 Zachary Beane * More testing. Sorry for this junky changelog! * Converted to use PRCS instead of CVS, testing. 1998-10-15 Zachary Beane * Fixed a problem that would show up if you had more than 10 HTTP urls on the command line (bad redirect-loop catching logic). * Added John Bley's agent patches. Now you can pretend to be using some other strange browser. * Caused errors to make snarf return nonzero. 1998-10-12 Zachary Beane * Made HTTP header matching case-insensitive. * Fixed progress bar FPE on small documents, with help from Elrond. * Changed progress initialization so that there are more cases where progress bars aren't printed. Also added -p option to force progress bar printing. * Added LATEST: "snarf LATEST" always downloads the latest version of snarf from www.xach.com. * Added jlbec's dynamic socks5 linking patch. snarf-7.0.orig/INSTALL0100644000175000001440000000075306611763175013526 0ustar mvelausersInstalling snarf ---------------- First of all, run "./configure". This will build a Makefile for you. If you are root, just type "make". If it compiles without any errors, type "make install". As I don't think I use any terribly system-specific stuff, it should be able to compile on just about anything. In case of trouble... --------------------- Send email to me (xach@mint.net) describing the type of system you are on and the error message you are getting. snarf-7.0.orig/Makefile.am0100644000175000001440000000077606747667207014547 0ustar mvelausers AUTOMAKE_OPTIONS = foreign ansi2knr bin_PROGRAMS = snarf snarf_SOURCES = \ ftp.c \ ftp.h \ http.c \ http.h \ llist.c \ llist.h \ options.c\ options.h\ snarf.c \ url.c \ url.h \ util.c \ util.h \ gopher.c \ gopher.h EXTRA_snarf_SOURCES = \ herror.c snarf_LDADD = @HERROR@ snarf_DEPENDENCIES = @HERROR@ man_MANS = snarf.1 EXTRA_DIST = urls snarf.1 snarf-2.prj herror.c snarf.spec rpm: make dist mv snarf-@VERSION@.tar.gz /usr/src/redhat/SOURCES rpm -bb snarf.spec snarf-7.0.orig/TODO0100644000175000001440000000155206624172517013161 0ustar mvelausers TODO -*- text -*- * Fix memory leaks. Not critical but sloppy and embarrassing. * Add an interactive shell-like interface. Type in urls, it downloads them. Should be handy for piping ("echo url | snarf") and others. Use your imagination. * Maybe add an RC file. * remove dependance on vfprintf. * Port to win32 (make more portable in general) * SSL borrowed from curl * better browser-style URL guessing * Improve password handling; cache username/hostname pairs and re-use passwords. Don't prompt if the password is cached. * Use keepalive for http and re-use sessions for ftp if grabbing multiple files from the same host. * Add more & nicer output to progress code, most requested: ETA * Fix non-ansi stuff. Automake seems to be screwing up its invocation of ansi2knr. I don't know why, yet, so stick with ANSI compilers if possible. snarf-7.0.orig/acconfig.h0100644000175000001440000000043606612521522014402 0ustar mvelausers#undef PACKAGE #undef VERSION #undef PROTOTYPES #undef socklen_t #undef ssize_t /* Use ioctl() to determine window width */ #undef GUESS_WINSIZE /* Don't print progress bars by default */ #undef PROGRESS_DEFAULT_OFF /* Define whether to build in SOCKS 5 support */ #undef USE_SOCKS5 snarf-7.0.orig/aclocal.m40100644000175000001440000001645507144123620014326 0ustar mvelausersdnl 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. # 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)]) # 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([,]))]) # serial 1 AC_DEFUN(AM_C_PROTOTYPES, [AC_REQUIRE([AM_PROG_CC_STDC]) AC_REQUIRE([AC_PROG_CPP]) AC_MSG_CHECKING([for function prototypes]) if test "$am_cv_prog_cc_stdc" != no; then AC_MSG_RESULT(yes) AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes]) U= ANSI2KNR= else AC_MSG_RESULT(no) U=_ ANSI2KNR=./ansi2knr # Ensure some checks needed by ansi2knr itself. AC_HEADER_STDC AC_CHECK_HEADERS(string.h) fi AC_SUBST(U)dnl AC_SUBST(ANSI2KNR)dnl ]) # serial 1 # @defmac AC_PROG_CC_STDC # @maindex PROG_CC_STDC # @ovindex CC # If the C compiler in not in ANSI C mode by default, try to add an option # to output variable @code{CC} to make it so. This macro tries various # options that select ANSI C on some system or another. It considers the # compiler to be in ANSI C mode if it handles function prototypes correctly. # # If you use this macro, you should check after calling it whether the C # compiler has been set to accept ANSI C; if not, the shell variable # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source # code in ANSI C, you can make an un-ANSIfied copy of it by using the # program @code{ansi2knr}, which comes with Ghostscript. # @end defmac AC_DEFUN(AM_PROG_CC_STDC, [AC_REQUIRE([AC_PROG_CC]) AC_BEFORE([$0], [AC_C_INLINE]) AC_BEFORE([$0], [AC_C_CONST]) dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require dnl a magic option to avoid problems with ANSI preprocessor commands dnl like #elif. dnl FIXME: can't do this because then AC_AIX won't work due to a dnl circular dependency. dnl AC_BEFORE([$0], [AC_PROG_CPP]) AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) AC_CACHE_VAL(am_cv_prog_cc_stdc, [am_cv_prog_cc_stdc=no ac_save_CC="$CC" # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" AC_TRY_COMPILE( [#include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; ], [ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ], [am_cv_prog_cc_stdc="$ac_arg"; break]) done CC="$ac_save_CC" ]) if test -z "$am_cv_prog_cc_stdc"; then AC_MSG_RESULT([none needed]) else AC_MSG_RESULT($am_cv_prog_cc_stdc) fi case "x$am_cv_prog_cc_stdc" in x|xno) ;; *) CC="$CC $am_cv_prog_cc_stdc" ;; esac ]) snarf-7.0.orig/ansi2knr.10100644000175000001440000000277106763261425014307 0ustar mvelausers.TH ANSI2KNR 1 "19 Jan 1996" .SH NAME ansi2knr \- convert ANSI C to Kernighan & Ritchie C .SH SYNOPSIS .I ansi2knr [--varargs] input_file [output_file] .SH DESCRIPTION If no output_file is supplied, output goes to stdout. .br There are no error messages. .sp .I ansi2knr recognizes function definitions by seeing a non-keyword identifier at the left margin, followed by a left parenthesis, with a right parenthesis as the last character on the line, and with a left brace as the first token on the following line (ignoring possible intervening comments). It will recognize a multi-line header provided that no intervening line ends with a left or right brace or a semicolon. These algorithms ignore whitespace and comments, except that the function name must be the first thing on the line. .sp The following constructs will confuse it: .br - Any other construct that starts at the left margin and follows the above syntax (such as a macro or function call). .br - Some macros that tinker with the syntax of the function header. .sp The --varargs switch is obsolete, and is recognized only for backwards compatibility. The present version of .I ansi2knr will always attempt to convert a ... argument to va_alist and va_dcl. .SH AUTHOR L. Peter Deutsch wrote the original ansi2knr and continues to maintain the current version; most of the code in the current version is his work. ansi2knr also includes contributions by Francois Pinard and Jim Avera . snarf-7.0.orig/ansi2knr.c0100644000175000001440000004063006763261425014365 0ustar mvelausers/* Copyright (C) 1989, 1997, 1998 Aladdin Enterprises. All rights reserved. */ /*$Id: ansi2knr.c,v 1.10 1998/12/02 12:42:23 tromey Exp $*/ /* Convert ANSI C function definitions to K&R ("traditional C") syntax */ /* ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. No author or distributor accepts responsibility to anyone for the consequences of using it or for whether it serves any particular purpose or works at all, unless he says so in writing. Refer to the GNU General Public License (the "GPL") for full details. Everyone is granted permission to copy, modify and redistribute ansi2knr, but only under the conditions described in the GPL. A copy of this license is supposed to have been given to you along with ansi2knr so you can know your rights and responsibilities. It should be in a file named COPYLEFT, or, if there is no file named COPYLEFT, a file named COPYING. Among other things, the copyright notice and this notice must be preserved on all copies. We explicitly state here what we believe is already implied by the GPL: if the ansi2knr program is distributed as a separate set of sources and a separate executable file which are aggregated on a storage medium together with another program, this in itself does not bring the other program under the GPL, nor does the mere fact that such a program or the procedures for constructing it invoke the ansi2knr executable bring any other part of the program under the GPL. */ /* * Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]] * --filename provides the file name for the #line directive in the output, * overriding input_file (if present). * If no input_file is supplied, input is read from stdin. * If no output_file is supplied, output goes to stdout. * There are no error messages. * * ansi2knr recognizes function definitions by seeing a non-keyword * identifier at the left margin, followed by a left parenthesis, * with a right parenthesis as the last character on the line, * and with a left brace as the first token on the following line * (ignoring possible intervening comments), except that a line * consisting of only * identifier1(identifier2) * will not be considered a function definition unless identifier2 is * the word "void". ansi2knr will recognize a multi-line header provided * that no intervening line ends with a left or right brace or a semicolon. * These algorithms ignore whitespace and comments, except that * the function name must be the first thing on the line. * The following constructs will confuse it: * - Any other construct that starts at the left margin and * follows the above syntax (such as a macro or function call). * - Some macros that tinker with the syntax of the function header. */ /* * The original and principal author of ansi2knr is L. Peter Deutsch * . Other authors are noted in the change history * that follows (in reverse chronological order): lpd 1998-11-09 added further hack to recognize identifier(void) as being a procedure lpd 1998-10-23 added hack to recognize lines consisting of identifier1(identifier2) as *not* being procedures lpd 1997-12-08 made input_file optional; only closes input and/or output file if not stdin or stdout respectively; prints usage message on stderr rather than stdout; adds --filename switch (changes suggested by ) lpd 1996-01-21 added code to cope with not HAVE_CONFIG_H and with compilers that don't understand void, as suggested by Tom Lane lpd 1996-01-15 changed to require that the first non-comment token on the line following a function header be a left brace, to reduce sensitivity to macros, as suggested by Tom Lane lpd 1995-06-22 removed #ifndefs whose sole purpose was to define undefined preprocessor symbols as 0; changed all #ifdefs for configuration symbols to #ifs lpd 1995-04-05 changed copyright notice to make it clear that including ansi2knr in a program does not bring the entire program under the GPL lpd 1994-12-18 added conditionals for systems where ctype macros don't handle 8-bit characters properly, suggested by Francois Pinard ; removed --varargs switch (this is now the default) lpd 1994-10-10 removed CONFIG_BROKETS conditional lpd 1994-07-16 added some conditionals to help GNU `configure', suggested by Francois Pinard ; properly erase prototype args in function parameters, contributed by Jim Avera ; correct error in writeblanks (it shouldn't erase EOLs) lpd 1989-xx-xx original version */ /* Most of the conditionals here are to make ansi2knr work with */ /* or without the GNU configure machinery. */ #if HAVE_CONFIG_H # include #endif #include #include #if HAVE_CONFIG_H /* For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h). This will define HAVE_CONFIG_H and so, activate the following lines. */ # if STDC_HEADERS || HAVE_STRING_H # include # else # include # endif #else /* not HAVE_CONFIG_H */ /* Otherwise do it the hard way */ # ifdef BSD # include # else # ifdef VMS extern int strlen(), strncmp(); # else # include # endif # endif #endif /* not HAVE_CONFIG_H */ #if STDC_HEADERS # include #else /* malloc and free should be declared in stdlib.h, but if you've got a K&R compiler, they probably aren't. */ # ifdef MSDOS # include # else # ifdef VMS extern char *malloc(); extern void free(); # else extern char *malloc(); extern int free(); # endif # endif #endif /* * The ctype macros don't always handle 8-bit characters correctly. * Compensate for this here. */ #ifdef isascii # undef HAVE_ISASCII /* just in case */ # define HAVE_ISASCII 1 #else #endif #if STDC_HEADERS || !HAVE_ISASCII # define is_ascii(c) 1 #else # define is_ascii(c) isascii(c) #endif #define is_space(c) (is_ascii(c) && isspace(c)) #define is_alpha(c) (is_ascii(c) && isalpha(c)) #define is_alnum(c) (is_ascii(c) && isalnum(c)) /* Scanning macros */ #define isidchar(ch) (is_alnum(ch) || (ch) == '_') #define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_') /* Forward references */ char *skipspace(); int writeblanks(); int test1(); int convert1(); /* The main program */ int main(argc, argv) int argc; char *argv[]; { FILE *in = stdin; FILE *out = stdout; char *filename = 0; #define bufsize 5000 /* arbitrary size */ char *buf; char *line; char *more; char *usage = "Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]\n"; /* * In previous versions, ansi2knr recognized a --varargs switch. * If this switch was supplied, ansi2knr would attempt to convert * a ... argument to va_alist and va_dcl; if this switch was not * supplied, ansi2knr would simply drop any such arguments. * Now, ansi2knr always does this conversion, and we only * check for this switch for backward compatibility. */ int convert_varargs = 1; while ( argc > 1 && argv[1][0] == '-' ) { if ( !strcmp(argv[1], "--varargs") ) { convert_varargs = 1; argc--; argv++; continue; } if ( !strcmp(argv[1], "--filename") && argc > 2 ) { filename = argv[2]; argc -= 2; argv += 2; continue; } fprintf(stderr, "Unrecognized switch: %s\n", argv[1]); fprintf(stderr, usage); exit(1); } switch ( argc ) { default: fprintf(stderr, usage); exit(0); case 3: out = fopen(argv[2], "w"); if ( out == NULL ) { fprintf(stderr, "Cannot open output file %s\n", argv[2]); exit(1); } /* falls through */ case 2: in = fopen(argv[1], "r"); if ( in == NULL ) { fprintf(stderr, "Cannot open input file %s\n", argv[1]); exit(1); } if ( filename == 0 ) filename = argv[1]; /* falls through */ case 1: break; } if ( filename ) fprintf(out, "#line 1 \"%s\"\n", filename); buf = malloc(bufsize); line = buf; while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL ) { test: line += strlen(line); switch ( test1(buf) ) { case 2: /* a function header */ convert1(buf, out, 1, convert_varargs); break; case 1: /* a function */ /* Check for a { at the start of the next line. */ more = ++line; f: if ( line >= buf + (bufsize - 1) ) /* overflow check */ goto wl; if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL ) goto wl; switch ( *skipspace(more, 1) ) { case '{': /* Definitely a function header. */ convert1(buf, out, 0, convert_varargs); fputs(more, out); break; case 0: /* The next line was blank or a comment: */ /* keep scanning for a non-comment. */ line += strlen(line); goto f; default: /* buf isn't a function header, but */ /* more might be. */ fputs(buf, out); strcpy(buf, more); line = buf; goto test; } break; case -1: /* maybe the start of a function */ if ( line != buf + (bufsize - 1) ) /* overflow check */ continue; /* falls through */ default: /* not a function */ wl: fputs(buf, out); break; } line = buf; } if ( line != buf ) fputs(buf, out); free(buf); if ( out != stdout ) fclose(out); if ( in != stdin ) fclose(in); return 0; } /* Skip over space and comments, in either direction. */ char * skipspace(p, dir) register char *p; register int dir; /* 1 for forward, -1 for backward */ { for ( ; ; ) { while ( is_space(*p) ) p += dir; if ( !(*p == '/' && p[dir] == '*') ) break; p += dir; p += dir; while ( !(*p == '*' && p[dir] == '/') ) { if ( *p == 0 ) return p; /* multi-line comment?? */ p += dir; } p += dir; p += dir; } return p; } /* * Write blanks over part of a string. * Don't overwrite end-of-line characters. */ int writeblanks(start, end) char *start; char *end; { char *p; for ( p = start; p < end; p++ ) if ( *p != '\r' && *p != '\n' ) *p = ' '; return 0; } /* * Test whether the string in buf is a function definition. * The string may contain and/or end with a newline. * Return as follows: * 0 - definitely not a function definition; * 1 - definitely a function definition; * 2 - definitely a function prototype (NOT USED); * -1 - may be the beginning of a function definition, * append another line and look again. * The reason we don't attempt to convert function prototypes is that * Ghostscript's declaration-generating macros look too much like * prototypes, and confuse the algorithms. */ int test1(buf) char *buf; { register char *p = buf; char *bend; char *endfn; int contin; if ( !isidfirstchar(*p) ) return 0; /* no name at left margin */ bend = skipspace(buf + strlen(buf) - 1, -1); switch ( *bend ) { case ';': contin = 0 /*2*/; break; case ')': contin = 1; break; case '{': return 0; /* not a function */ case '}': return 0; /* not a function */ default: contin = -1; } while ( isidchar(*p) ) p++; endfn = p; p = skipspace(p, 1); if ( *p++ != '(' ) return 0; /* not a function */ p = skipspace(p, 1); if ( *p == ')' ) return 0; /* no parameters */ /* Check that the apparent function name isn't a keyword. */ /* We only need to check for keywords that could be followed */ /* by a left parenthesis (which, unfortunately, is most of them). */ { static char *words[] = { "asm", "auto", "case", "char", "const", "double", "extern", "float", "for", "if", "int", "long", "register", "return", "short", "signed", "sizeof", "static", "switch", "typedef", "unsigned", "void", "volatile", "while", 0 }; char **key = words; char *kp; int len = endfn - buf; while ( (kp = *key) != 0 ) { if ( strlen(kp) == len && !strncmp(kp, buf, len) ) return 0; /* name is a keyword */ key++; } } { char *id = p; int len; /* * Check for identifier1(identifier2) and not * identifier1(void). */ while ( isidchar(*p) ) p++; len = p - id; p = skipspace(p, 1); if ( *p == ')' && (len != 4 || strncmp(id, "void", 4)) ) return 0; /* not a function */ } /* * If the last significant character was a ), we need to count * parentheses, because it might be part of a formal parameter * that is a procedure. */ if (contin > 0) { int level = 0; for (p = skipspace(buf, 1); *p; p = skipspace(p + 1, 1)) level += (*p == '(' ? 1 : *p == ')' ? -1 : 0); if (level > 0) contin = -1; } return contin; } /* Convert a recognized function definition or header to K&R syntax. */ int convert1(buf, out, header, convert_varargs) char *buf; FILE *out; int header; /* Boolean */ int convert_varargs; /* Boolean */ { char *endfn; register char *p; /* * The breaks table contains pointers to the beginning and end * of each argument. */ char **breaks; unsigned num_breaks = 2; /* for testing */ char **btop; char **bp; char **ap; char *vararg = 0; /* Pre-ANSI implementations don't agree on whether strchr */ /* is called strchr or index, so we open-code it here. */ for ( endfn = buf; *(endfn++) != '('; ) ; top: p = endfn; breaks = (char **)malloc(sizeof(char *) * num_breaks * 2); if ( breaks == 0 ) { /* Couldn't allocate break table, give up */ fprintf(stderr, "Unable to allocate break table!\n"); fputs(buf, out); return -1; } btop = breaks + num_breaks * 2 - 2; bp = breaks; /* Parse the argument list */ do { int level = 0; char *lp = NULL; char *rp; char *end = NULL; if ( bp >= btop ) { /* Filled up break table. */ /* Allocate a bigger one and start over. */ free((char *)breaks); num_breaks <<= 1; goto top; } *bp++ = p; /* Find the end of the argument */ for ( ; end == NULL; p++ ) { switch(*p) { case ',': if ( !level ) end = p; break; case '(': if ( !level ) lp = p; level++; break; case ')': if ( --level < 0 ) end = p; else rp = p; break; case '/': p = skipspace(p, 1) - 1; break; default: ; } } /* Erase any embedded prototype parameters. */ if ( lp ) writeblanks(lp + 1, rp); p--; /* back up over terminator */ /* Find the name being declared. */ /* This is complicated because of procedure and */ /* array modifiers. */ for ( ; ; ) { p = skipspace(p - 1, -1); switch ( *p ) { case ']': /* skip array dimension(s) */ case ')': /* skip procedure args OR name */ { int level = 1; while ( level ) switch ( *--p ) { case ']': case ')': level++; break; case '[': case '(': level--; break; case '/': p = skipspace(p, -1) + 1; break; default: ; } } if ( *p == '(' && *skipspace(p + 1, 1) == '*' ) { /* We found the name being declared */ while ( !isidfirstchar(*p) ) p = skipspace(p, 1) + 1; goto found; } break; default: goto found; } } found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' ) { if ( convert_varargs ) { *bp++ = "va_alist"; vararg = p-2; } else { p++; if ( bp == breaks + 1 ) /* sole argument */ writeblanks(breaks[0], p); else writeblanks(bp[-1] - 1, p); bp--; } } else { while ( isidchar(*p) ) p--; *bp++ = p+1; } p = end; } while ( *p++ == ',' ); *bp = p; /* Make a special check for 'void' arglist */ if ( bp == breaks+2 ) { p = skipspace(breaks[0], 1); if ( !strncmp(p, "void", 4) ) { p = skipspace(p+4, 1); if ( p == breaks[2] - 1 ) { bp = breaks; /* yup, pretend arglist is empty */ writeblanks(breaks[0], p + 1); } } } /* Put out the function name and left parenthesis. */ p = buf; while ( p != endfn ) putc(*p, out), p++; /* Put out the declaration. */ if ( header ) { fputs(");", out); for ( p = breaks[0]; *p; p++ ) if ( *p == '\r' || *p == '\n' ) putc(*p, out); } else { for ( ap = breaks+1; ap < bp; ap += 2 ) { p = *ap; while ( isidchar(*p) ) putc(*p, out), p++; if ( ap < bp - 1 ) fputs(", ", out); } fputs(") ", out); /* Put out the argument declarations */ for ( ap = breaks+2; ap <= bp; ap += 2 ) (*ap)[-1] = ';'; if ( vararg != 0 ) { *vararg = 0; fputs(breaks[0], out); /* any prior args */ fputs("va_dcl", out); /* the final arg */ fputs(bp[0], out); } else fputs(breaks[0], out); } free((char *)breaks); return 0; } snarf-7.0.orig/config.h.in0100644000175000001440000000235306747405673014524 0ustar mvelausers/* config.h.in. Generated automatically from configure.in by autoheader. */ /* Define to empty if the keyword does not work. */ #undef const /* Define to `long' if doesn't define. */ #undef off_t /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS #undef PACKAGE #undef VERSION #undef PROTOTYPES #undef socklen_t #undef ssize_t /* Use ioctl() to determine window width */ #undef GUESS_WINSIZE /* Don't print progress bars by default */ #undef PROGRESS_DEFAULT_OFF /* Define whether to build in SOCKS 5 support */ #undef USE_SOCKS5 /* Define if you have the gettimeofday function. */ #undef HAVE_GETTIMEOFDAY /* Define if you have the strdup function. */ #undef HAVE_STRDUP /* Define if you have the strerror function. */ #undef HAVE_STRERROR /* Define if you have the header file. */ #undef HAVE_STDARG_H /* Define if you have the header file. */ #undef HAVE_STRING_H /* Define if you have the header file. */ #undef HAVE_STRINGS_H /* Define if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Name of package */ #undef PACKAGE /* Version number of package */ #undef VERSION /* Define if compiler has function prototypes */ #undef PROTOTYPES snarf-7.0.orig/configure0100755000175000001440000024635207144123620014376 0ustar mvelausers#! /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: ac_help="$ac_help --with-socks5=[shared/static] add socks5 support [default=static]" ac_help="$ac_help --with-progress-default-off progress bars default to off" ac_help="$ac_help --with-guess-winsize use ioctl to guess terminal width" # 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= # 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 VERSION=7.0 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:565: 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:618: 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:675: 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=snarf VERSION=$VERSION 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:721: 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:734: 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:747: 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:760: 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:773: 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:795: 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:825: 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:876: 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:908: 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 919 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:924: \"$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:950: 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:955: 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:983: 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 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 echo "configure:1018: checking for ${CC-cc} option to accept ANSI C" >&5 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else am_cv_prog_cc_stdc=no ac_save_CC="$CC" # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" cat > conftest.$ac_ext < #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main() { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } EOF if { (eval echo configure:1071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_prog_cc_stdc="$ac_arg"; break else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* done CC="$ac_save_CC" fi if test -z "$am_cv_prog_cc_stdc"; then echo "$ac_t""none needed" 1>&6 else echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6 fi case "x$am_cv_prog_cc_stdc" in x|xno) ;; *) CC="$CC $am_cv_prog_cc_stdc" ;; esac echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:1095: 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:1116: \"$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:1133: \"$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:1150: \"$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 function prototypes""... $ac_c" 1>&6 echo "configure:1177: checking for function prototypes" >&5 if test "$am_cv_prog_cc_stdc" != no; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF #define PROTOTYPES 1 EOF U= ANSI2KNR= else echo "$ac_t""no" 1>&6 U=_ ANSI2KNR=./ansi2knr # Ensure some checks needed by ansi2knr itself. echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 echo "configure:1190: 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:1203: \"$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:1270: \"$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 for ac_hdr in string.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:1297: 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:1307: \"$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 fi done fi echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 echo "configure:1339: checking for ${CC-cc} option to accept ANSI C" >&5 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else am_cv_prog_cc_stdc=no ac_save_CC="$CC" # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" cat > conftest.$ac_ext < #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main() { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } EOF if { (eval echo configure:1392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_prog_cc_stdc="$ac_arg"; break else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* done CC="$ac_save_CC" fi if test -z "$am_cv_prog_cc_stdc"; then echo "$ac_t""none needed" 1>&6 else echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6 fi case "x$am_cv_prog_cc_stdc" in x|xno) ;; *) CC="$CC $am_cv_prog_cc_stdc" ;; esac echo $ac_n "checking for working const""... $ac_c" 1>&6 echo "configure:1416: 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:1470: \"$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 # 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:1502: 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 for socket""... $ac_c" 1>&6 echo "configure:1556: checking for socket" >&5 if eval "test \"`echo '$''{'ac_cv_func_socket'+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 socket(); 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_socket) || defined (__stub___socket) choke me #else socket(); #endif ; return 0; } EOF if { (eval echo configure:1584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socket=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_socket=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 echo "configure:1602: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | 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="-lsocket $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="-lsocket $LIBS" else echo "$ac_t""no" 1>&6 fi fi echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 echo "configure:1644: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+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 gethostbyname(); 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_gethostbyname) || defined (__stub___gethostbyname) choke me #else gethostbyname(); #endif ; return 0; } EOF if { (eval echo configure:1672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_gethostbyname=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 echo "configure:1690: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | 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="-lnsl $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="-lnsl $LIBS" else echo "$ac_t""no" 1>&6 fi fi echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 echo "configure:1732: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+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 gethostbyname(); 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_gethostbyname) || defined (__stub___gethostbyname) choke me #else gethostbyname(); #endif ; return 0; } EOF if { (eval echo configure:1760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_gethostbyname=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname in -lresolv""... $ac_c" 1>&6 echo "configure:1778: checking for gethostbyname in -lresolv" >&5 ac_lib_var=`echo resolv'_'gethostbyname | 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="-lresolv $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="-lresolv $LIBS" else echo "$ac_t""no" 1>&6 fi fi echo $ac_n "checking for strerror""... $ac_c" 1>&6 echo "configure:1820: checking for strerror" >&5 if eval "test \"`echo '$''{'ac_cv_func_strerror'+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 strerror(); 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_strerror) || defined (__stub___strerror) choke me #else strerror(); #endif ; return 0; } EOF if { (eval echo configure:1848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strerror=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_strerror=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'strerror`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 echo $ac_n "checking for strerror in -l44bsd""... $ac_c" 1>&6 echo "configure:1866: checking for strerror in -l44bsd" >&5 ac_lib_var=`echo 44bsd'_'strerror | 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="-l44bsd $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="-l44bsd $LIBS" else echo "$ac_t""no" 1>&6 fi fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 echo "configure:1909: 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:1922: \"$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:1989: \"$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 for ac_hdr in strings.h \ stdarg.h \ sys/ioctl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:2019: 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:2029: \"$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 fi done SOCKS5= # Check whether --with-socks5 or --without-socks5 was given. if test "${with_socks5+set}" = set; then withval="$with_socks5" : fi if test "x$with_socks5" = "xshared"; then echo $ac_n "checking for SOCKSgethostbyname in -lsocks5_sh""... $ac_c" 1>&6 echo "configure:2065: checking for SOCKSgethostbyname in -lsocks5_sh" >&5 ac_lib_var=`echo socks5_sh'_'SOCKSgethostbyname | 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="-lsocks5_sh $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 SOCKS5=socks5_sh else echo "$ac_t""no" 1>&6 SOCKS5= fi fi if test "x$with_socks5" != "x"; then if test "x$SOCKS5" = "x"; then if test "x$with_socks5" = "xyes"; then with_socks5=static fi if test "x$with_socks5" = "xstatic"; then echo $ac_n "checking whether the compiler supports "-static"""... $ac_c" 1>&6 echo "configure:2114: checking whether the compiler supports "-static"" >&5 save_libs=$LIBS LIBS="$LIBS -static" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* static=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* LIBS=$save_libs;static=no fi rm -f conftest* echo "$ac_t""$static" 1>&6 fi echo $ac_n "checking for SOCKSgethostbyname in -lsocks5""... $ac_c" 1>&6 echo "configure:2138: checking for SOCKSgethostbyname in -lsocks5" >&5 ac_lib_var=`echo socks5'_'SOCKSgethostbyname | 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="-lsocks5 $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 SOCKS5=socks5 else echo "$ac_t""no" 1>&6 { echo "configure: error: *** Can't build socksified snarf (SOCKS5 library not found) ***" 1>&2; exit 1; } fi fi ac_safe=`echo "socks.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for socks.h""... $ac_c" 1>&6 echo "configure:2181: checking for socks.h" >&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:2191: \"$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 cat >> confdefs.h <<\EOF #define USE_SOCKS5 1 EOF LIBS="$LIBS -lsocks5" else echo "$ac_t""no" 1>&6 { echo "configure: error: *** Can't build socksified snarf (SOCKS5 header file not found) ***" 1>&2; exit 1; } fi fi # Check whether --with-progress_default_off or --without-progress_default_off was given. if test "${with_progress_default_off+set}" = set; then withval="$with_progress_default_off" : fi # Check whether --with-guess_winsize or --without-guess_winsize was given. if test "${with_guess_winsize+set}" = set; then withval="$with_guess_winsize" : fi if test "x$with_progress_default_off" = "xyes"; then cat >> confdefs.h <<\EOF #define PROGRESS_DEFAULT_OFF 1 EOF fi if test "x$with_guess_winsize" = "xyes"; then cat >> confdefs.h <<\EOF #define GUESS_WINSIZE 1 EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 echo "configure:2248: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_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])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_off_t=yes else rm -rf conftest* ac_cv_type_off_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_off_t" 1>&6 if test $ac_cv_type_off_t = no; then cat >> confdefs.h <<\EOF #define off_t long EOF fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 echo "configure:2282: checking for ssize_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ssize_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])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_ssize_t=yes else rm -rf conftest* ac_cv_type_ssize_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_ssize_t" 1>&6 if test $ac_cv_type_ssize_t = no; then cat >> confdefs.h <<\EOF #define ssize_t long EOF fi echo "#include " >> confdefs.h echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 echo "configure:2317: checking for socklen_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_socklen_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])socklen_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_socklen_t=yes else rm -rf conftest* ac_cv_type_socklen_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_socklen_t" 1>&6 if test $ac_cv_type_socklen_t = no; then cat >> confdefs.h <<\EOF #define socklen_t int EOF fi grep -v '^#include $' confdefs.h > confdefs.h.new && \ mv confdefs.h.new confdefs.h for ac_func in strerror gettimeofday strdup do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:2356: 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:2384: \"$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 HERROR= echo $ac_n "checking for herror""... $ac_c" 1>&6 echo "configure:2411: checking for herror" >&5 if eval "test \"`echo '$''{'ac_cv_func_herror'+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 herror(); 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_herror) || defined (__stub___herror) choke me #else herror(); #endif ; return 0; } EOF if { (eval echo configure:2439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_herror=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_herror=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'herror`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 HERROR=herror.o; fi 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 snarf.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%@U@%$U%g s%@ANSI2KNR@%$ANSI2KNR%g s%@HERROR@%$HERROR%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 snarf-7.0.orig/configure.in0100644000175000001440000000533507144123521014772 0ustar mvelausersdnl Process this file with autoconf to produce a configure script. dnl This is elrond's optional library check AC_DEFUN(FP_CHECK_OPT_LIB, [AC_CHECK_FUNC([$2], :, AC_CHECK_LIB($@)dnl )dnl ])dnl AC_INIT() VERSION=7.0 AM_INIT_AUTOMAKE(snarf, $VERSION) AM_CONFIG_HEADER(config.h) AC_SUBST(VERSION) dnl Checks for programs. AC_PROG_CC AM_C_PROTOTYPES AM_PROG_CC_STDC AC_C_CONST AC_PROG_INSTALL dnl Checks for libraries. FP_CHECK_OPT_LIB(socket, socket, LIBS="-lsocket $LIBS") FP_CHECK_OPT_LIB(nsl, gethostbyname, LIBS="-lnsl $LIBS") FP_CHECK_OPT_LIB(resolv, gethostbyname, LIBS="-lresolv $LIBS") dnl SunOS 4.1.x needs the following for strerror FP_CHECK_OPT_LIB(44bsd, strerror, LIBS="-l44bsd $LIBS") dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(strings.h \ stdarg.h \ sys/ioctl.h) dnl Checks for socks5 build SOCKS5= AC_ARG_WITH(socks5,[ --with-socks5=[shared/static] add socks5 support [default=static]],,) if test "x$with_socks5" = "xshared"; then AC_CHECK_LIB(socks5_sh, SOCKSgethostbyname, SOCKS5=socks5_sh, SOCKS5=) fi if test "x$with_socks5" != "x"; then if test "x$SOCKS5" = "x"; then if test "x$with_socks5" = "xyes"; then with_socks5=static fi if test "x$with_socks5" = "xstatic"; then AC_MSG_CHECKING(whether the compiler supports "-static") save_libs=$LIBS LIBS="$LIBS -static" AC_TRY_LINK(,,static=yes,[LIBS=$save_libs;static=no]) AC_MSG_RESULT($static) fi AC_CHECK_LIB(socks5, SOCKSgethostbyname, SOCKS5=socks5, AC_MSG_ERROR(*** Can't build socksified snarf (SOCKS5 library not found) ***)) fi AC_CHECK_HEADER(socks.h, [AC_DEFINE(USE_SOCKS5) LIBS="$LIBS -lsocks5"], AC_MSG_ERROR(*** Can't build socksified snarf (SOCKS5 header file not found) ***)) fi AC_ARG_WITH(progress_default_off,[ --with-progress-default-off progress bars default to off],,) AC_ARG_WITH(guess_winsize, [ --with-guess-winsize use ioctl to guess terminal width],,) if test "x$with_progress_default_off" = "xyes"; then AC_DEFINE(PROGRESS_DEFAULT_OFF) fi if test "x$with_guess_winsize" = "xyes"; then AC_DEFINE(GUESS_WINSIZE) fi dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_OFF_T AC_CHECK_TYPE(ssize_t, long) echo "#include " >> confdefs.h AC_CHECK_TYPE(socklen_t, int) grep -v '^#include $' confdefs.h > confdefs.h.new && \ mv confdefs.h.new confdefs.h dnl Checks for library functions. AC_CHECK_FUNCS(strerror gettimeofday strdup) HERROR= AC_CHECK_FUNC(herror,,[HERROR=herror.o;AC_SUBST(HERROR)]) AC_OUTPUT(Makefile snarf.spec) snarf-7.0.orig/install-sh0100755000175000001440000001272106611763175014477 0ustar mvelausers#! /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=: 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 snarf-7.0.orig/missing0100755000175000001440000001421306763261425014067 0ustar mvelausers#! /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 snarf-7.0.orig/mkinstalldirs0100755000175000001440000000132206763261425015273 0ustar mvelausers#! /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 snarf-7.0.orig/snarf.spec.in0100644000175000001440000000105506750075535015063 0ustar mvelausersSummary: Snarf Name: snarf Version: @VERSION@ Release: 1 Copyright: GPL Group: Networking/Utilities Source: ftp.mint.net:/pub/snarf/snarf-@VERSION@.tar.gz Buildroot: /tmp %description Snarf is a non-interactive client for several network protocols. %prep %setup %build mkdir -p $RPM_BUILD_ROOT/usr/bin mkdir -p $RPM_BUILD_ROOT/usr/man/man1 mkdir -p $RPM_BUILD_ROOT/usr/doc ./configure --enable-guess-winsize --prefix=$RPM_BUILD_ROOT/usr make CFLAGS="$RPM_OPT_FLAGS" %install make install %files %doc COPYING README /usr/bin/snarf /usr/man/man1/snarf.1 snarf-7.0.orig/ftp.c0100644000175000001440000002611007144113534013413 0ustar mvelausers/* -*- mode: C; c-basic-offset: 8; indent-tabs-mode: nil; tab-width: 8 -*- */ #include #include #include #include #include #include #include #include #ifdef HAVE_STDARG_H # include #endif #include #ifdef USE_SOCKS5 #define SOCKS #include #endif #include #include "http.h" #include "util.h" #include "url.h" #include "ftp.h" #include "options.h" void close_quit(int sock) { if(sock) { write(sock, "QUIT\r\n", 6); close(sock); } } static void ftp_set_defaults(UrlResource *rsrc, Url *u) { if( !u->port ) u->port = 21; if( !u->username ) u->username = strdup("anonymous"); if( !u->password ) u->password = strdup("snarf@"); if( !rsrc->outfile ) { if( u->file ) rsrc->outfile = strdup(u->file); else rsrc->outfile = strdup("ftpindex.txt"); } } void send_control(int sock, char *string, ...) { va_list args; char *line = NULL; char *newline; char *s = NULL; line = safe_strdup(string); va_start(args, string); s = va_arg(args, char *); while( s ) { newline = strconcat(line, s, NULL); safe_free(line); line = newline; s = va_arg(args, char *); } va_end(args); write(sock, line, strlen(line)); safe_free(line); } char * get_line(UrlResource *rsrc, int control) { int bytes_read = 0; char *end; char buf[BUFSIZE+1]; while( (bytes_read = read(control, buf, BUFSIZE)) ) { if( rsrc->options & OPT_VERBOSE ) fwrite(buf, 1, bytes_read, stderr); if( (buf[0] == '4' || buf[0] == '5') && !((rsrc->options & (OPT_VERBOSE | OPT_QUIET))) ) { fwrite(buf, 1, bytes_read, stderr); return NULL; } /* in case there's a partial read */ buf[bytes_read] = '\0'; if( buf[bytes_read - 1] == '\n' ) buf[bytes_read - 1] = '\0'; if( buf[bytes_read - 2] == '\r' ) buf[bytes_read - 2] = '\0'; if( isdigit(buf[0]) && buf[3] == ' ' ) { return strdup(buf); } /* skip to last line of possibly multiple line input */ if( (end = strrchr(buf, '\n')) ) { end++; if( isdigit(end[0]) && end[3] == ' ' ) return strdup(end); } } return NULL; } static int check_numeric(const char *numeric, const char *buf) { return( (buf[0] == numeric[0]) && (buf[1] == numeric[1]) && (buf[2] == numeric[2]) ); } /* cheesy I know */ int sock_init(struct sockaddr_in *sa, int control) { socklen_t i; int sock; if( (sock = socket(AF_INET, SOCK_STREAM, 0)) < 0 ) { perror("socket"); return(0); } i = sizeof(*sa); getsockname (control, (struct sockaddr *)sa, &i) ; sa->sin_port = 0 ; /* let system choose a port */ if (bind (sock, (struct sockaddr *)sa, sizeof (*sa)) < 0) { perror("bind"); return 0; } return sock; } int get_passive_sock(UrlResource *rsrc, int control) { unsigned char *addr; struct sockaddr_in sa; int sock; int x; char *line, *orig_line; send_control(control, "PASV\r\n", NULL); if( !((line = get_line(rsrc, control)) && check_numeric("227", line)) ) { safe_free(line); return 0; } orig_line = line; if( strlen(line) < 4 ) { safe_free(line); return 0; } if( !(sock = sock_init(&sa, control)) ) return -1; /* skip the numeric response */ line += 4; /* then find the digits */ while( !(isdigit(*line)) ) line++; /* ugliness from snarf 1.x */ sa.sin_family = AF_INET; addr = (unsigned char *)&sa.sin_addr; for(x = 0; x < 4; x++) { addr[x] = atoi(line); line = strchr(line,',') + 1; } addr = (unsigned char *)&sa.sin_port ; addr[0] = atoi(line); line = strchr(line,',') + 1; addr[1] = atoi(line); if( connect(sock, (struct sockaddr *)&sa, sizeof(sa)) < 0 ) { safe_free(orig_line); perror("connect"); return -1; } safe_free(orig_line); return sock; } int get_sock(UrlResource *rsrc, int control) { struct sockaddr_in sa; unsigned char *addr; unsigned char *port; char *line; char port_string[BUFSIZE]; unsigned int sock; socklen_t i; if(! (sock = sock_init(&sa, control)) ) return 0; if ( listen(sock, 0) < 0 ) { perror("listen"); return 0; } i = sizeof(sa); getsockname(sock, (struct sockaddr *)&sa, &i); addr = (unsigned char *)(&sa.sin_addr.s_addr); port = (unsigned char *)(&sa.sin_port); sprintf(port_string, "PORT %d,%d,%d,%d,%d,%d\r\n", addr[0], addr[1], addr[2], addr[3], port[0],(unsigned char)port[1]); send_control(control, port_string, NULL); if( !((line = get_line(rsrc, control)) && check_numeric("200", line)) ) { safe_free(line); return 0; } safe_free(line); return sock; } /* I'm going to go to hell for not doing proper cleanup. */ int ftp_transfer(UrlResource *rsrc) { Url *u = NULL; FILE *out = NULL; char *line = NULL; int sock = 0; int data_sock = 0; int passive = 1; int retval = 0; u = rsrc->url; /* first of all, if this is proxied, just pass it off to the http module, since that's how we support proxying. */ rsrc->proxy = get_proxy("FTP_PROXY"); if( rsrc->proxy ) { return http_transfer(rsrc); } ftp_set_defaults(rsrc, u); if( !(sock = tcp_connect(u->host, u->port)) ) return 0; if( !(line = get_line(rsrc, sock)) ) return 0; if( !check_numeric("220", line) ) { safe_free(line); report(ERR, "bad server greeting: %s"); return 0; } send_control(sock, "USER ", u->username, "\r\n", NULL); if( !(line = get_line(rsrc, sock)) ) return 0; /* do the password dance */ if( !check_numeric("230", line) ) { if( !check_numeric("331", line)) { safe_free(line); report(ERR, "bad/unexpected response: %s", line); return 0; } else { safe_free(line); send_control(sock, "PASS ", u->password, "\r\n", NULL); if( !((line = get_line(rsrc, sock)) && check_numeric("230", line)) ) { safe_free(line); report(ERR, "login failed"); return 0; } safe_free(line); } } /* set binmode */ send_control(sock, "TYPE I\r\n", NULL); if( !(line = get_line(rsrc, sock)) ) return 0; safe_free(line); if( u->path ) { send_control(sock, "CWD ", u->path, "\r\n", NULL); if( !((line = get_line(rsrc, sock)) && check_numeric("250", line)) ) { safe_free(line); close_quit(sock); return 0; } safe_free(line); } /* finally, the good stuff */ /* get a socket for reading. try passive first. */ if( ! (rsrc->options & OPT_ACTIVE) ) { if( (data_sock = get_passive_sock(rsrc, sock)) == -1 ) return 0; } if( !data_sock ) { if( (data_sock = get_sock(rsrc, sock)) < 1 ) return 0; else passive = 0; } if (u->file) { send_control(sock, "SIZE ", u->file, "\r\n", NULL); line = get_line(rsrc, sock); if (line && check_numeric("213", line)) { rsrc->outfile_size = atoi(line + 3); } else { rsrc->outfile_size = 0; } } /* handle resume */ if( rsrc->outfile_offset && (rsrc->options & OPT_RESUME) ) { char numstring[BUFSIZE]; /* ugly hack */ sprintf(numstring, "%ld", (long int )rsrc->outfile_offset); send_control(sock, "REST ", numstring, "\r\n", NULL); if( !((line = get_line(rsrc, sock)) && check_numeric("350", line)) ) { safe_free(line); close_quit(sock); report(ERR, "server does not support FTP resume, " "try again without -r"); return 0; } safe_free(line); } if (u->file) send_control(sock, "RETR ", u->file, "\r\n", NULL); else send_control(sock, "NLST\r\n", NULL); if( !((line = get_line(rsrc, sock)) && (check_numeric("150", line) || check_numeric("125", line))) ) { safe_free(line); close_quit(sock); return 0; } if( !passive ) data_sock = accept(data_sock, NULL, NULL); /* rsrc->outfile_size = guess_file_size(line); */ safe_free(line); if( ! (out = open_outfile(rsrc)) ) { report(ERR, "opening %s: %s", rsrc->outfile, strerror(errno)); close_quit(sock); return 0; } retval = dump_data(rsrc, data_sock, out); line = get_line(rsrc, sock); /* 226 Transfer complete */ safe_free(line); send_control(sock, "QUIT\r\n", NULL); line = get_line(rsrc, sock); /* 221 Goodbye */ safe_free(line); fclose(out); close(sock); close(data_sock); return retval; } snarf-7.0.orig/ftp.h0100644000175000001440000000031706612371655013432 0ustar mvelausers/* -*- mode: C; c-basic-offset: 8; indent-tabs-mode: nil; tab-width: 8 -*- */ #include "url.h" #ifndef FTP_H #define FTP_H #ifdef PROTOTYPES int ftp_transfer(UrlResource *); #endif #endif /* FTP_H */ snarf-7.0.orig/http.c0100644000175000001440000003302707144123332013603 0ustar mvelausers/* -*- mode: C; c-basic-offset: 8; indent-tabs-mode: nil; tab-width: 8 -*- */ #include #include #include #include #include #include #include #include "url.h" #include "http.h" #include "options.h" #include "util.h" #include "llist.h" extern int default_opts; int redirect_count = 0; #define REDIRECT_MAX 10 #define USER_AGENT "snarf/" VERSION " (http://www.xach.com/snarf)" #define MOZILLA_USER_AGENT "Mozilla/4.0 (X11; Unix; Hi-mom)" #define MSIE_USER_AGENT "Mozilla/4.0 (Compatible; MSIE 4.0)" typedef struct _HttpHeader HttpHeader; typedef struct _HttpHeaderEntry HttpHeaderEntry; struct _HttpHeader { List *header_list; }; struct _HttpHeaderEntry { char *key; char *value; }; static HttpHeader * make_http_header(char *r) { HttpHeader *h = NULL; HttpHeaderEntry *he = NULL; char *s = NULL; char *raw_header = NULL; char *raw_header_head = NULL; raw_header = strdup(r); /* Track this to free at the end */ raw_header_head = raw_header; h = malloc(sizeof(HttpHeader)); h->header_list = list_new(); /* Skip the first line: "HTTP/1.X NNN Comment\r?\n" */ s = raw_header; while (*s != '\0' && *s != '\r' && *s != '\n') { s++; } while (*s != '\0' && isspace(*s)) { s++; } raw_header = s; s = strstr(raw_header, ": "); while (s) { /* Set ':' to '\0' to terminate the key */ *s++ = '\0'; he = malloc(sizeof(HttpHeaderEntry)); he->key = strdup(raw_header); /* Make it lowercase so we can lookup case-insensitive */ string_lowercase(he->key); /* Now get the value */ s++; raw_header = s; while (*s != '\0' && *s != '\r' && *s != '\n') { s++; } *s++ = '\0'; he->value = strdup(raw_header); list_append(h->header_list, he); /* Go to the next line */ while (*s != '\0' && isspace(*s)) { s++; } raw_header = s; s = strstr(raw_header, ": "); } free(raw_header_head); return h; } static void free_http_header(HttpHeader *h) { List *l; List *l1; HttpHeaderEntry *he; if (h == NULL) { return; } l = h->header_list; while (l && l->data) { he = l->data; free(he->key); free(he->value); free(l->data); l = l->next; } l = h->header_list; while (l) { l1 = l->next; free(l); l = l1; } } static char * get_header_value(char *key, HttpHeader *header) { char *value = NULL; char *retval = NULL; List *l = NULL; HttpHeaderEntry *he = NULL; l = header->header_list; while (l && l->data) { he = l->data; if (strcmp(he->key, key) == 0) { return strdup(he->value); } l = l->next; } return NULL; } static char * get_raw_header(int fd) { char *header = NULL; char buf[BUFSIZE]; /* this whole function is pathetic. please rewrite it for me. */ int bytes_read = 0; int total_read = 0; header = strdup(""); buf[0] = buf[1] = buf[2] = '\0'; while( (bytes_read = read(fd, buf, 1)) ) { total_read += bytes_read; header = strconcat(header, buf, NULL); if( total_read > 1) { if( strcmp(header + (total_read - 2), "\n\n") == 0 ) break; } if( total_read > 3 ) { if( strcmp(header + (total_read - 4), "\r\n\r\n") == 0 ) break; } } return header; } static char * get_request(UrlResource *rsrc) { char *request = NULL; char *auth = NULL; char buf[BUFSIZE]; Url *u; off_t file_size; u = rsrc->url; request = strconcat("GET ", u->path, u->file, " HTTP/1.0\r\n", "Host: ", u->host, "\r\n", NULL); if( u->username && u->password ) { auth = strconcat( u->username, ":", u->password, NULL); auth = base64(auth, strlen(auth)); request = strconcat(request, "Authorization: Basic ", auth, "\r\n", NULL); } if( rsrc->proxy_username && rsrc->proxy_password ) { auth = strconcat( rsrc->proxy_username, ":", rsrc->proxy_password, NULL); auth = base64(auth, strlen(auth)); request = strconcat(request, "Proxy-Authorization: Basic ", auth, "\r\n", NULL); } if( (rsrc->options & OPT_RESUME) && (file_size = get_file_size(rsrc->outfile)) ) { sprintf(buf, "%ld-", (long int )file_size); request = strconcat(request, "Range: bytes=", buf, "\r\n", NULL); } /* Use user's SNARF_HTTP_USER_AGENT env. var if present, as they might want to spoof some discriminant sites. (Or just increase the hit count for their favorite browser.) Alternately, use Mozilla or MSIE's User-Agent strings based on options set. */ request = strconcat(request, "User-Agent: ", NULL); if (getenv("SNARF_HTTP_USER_AGENT")) { request = strconcat(request, getenv("SNARF_HTTP_USER_AGENT"), NULL); } else if (rsrc->options & OPT_BE_MOZILLA) { request = strconcat(request, MOZILLA_USER_AGENT, NULL); } else if (rsrc->options & OPT_BE_MSIE) { request = strconcat(request, MSIE_USER_AGENT, NULL); } else { /* let snarf be snarf :-) */ request = strconcat(request, USER_AGENT, NULL); } /* This CRLF pair closes the User-Agent key-value set. */ request = strconcat(request, "\r\n", NULL); /* If SNARF_HTTP_REFERER is set, spoof it. */ if (getenv("SNARF_HTTP_REFERER")) { request = strconcat(request, "Referer: ", getenv("SNARF_HTTP_REFERER"), "\r\n", NULL); } request = strconcat(request, "\r\n", NULL); return request; } int http_transfer(UrlResource *rsrc) { FILE *out = NULL; Url *u = NULL; Url *proxy_url = NULL; Url *redir_u = NULL; char *request = NULL; char *raw_header = NULL; HttpHeader *header = NULL; char *len_string = NULL; char *new_location = NULL; char buf[BUFSIZE]; int sock = 0; ssize_t bytes_read = 0; int retval = 0; int i; /* make sure we haven't recursed too much */ if( redirect_count > REDIRECT_MAX ) { report(ERR, "redirection max count exceeded " "(looping redirect?)"); redirect_count = 0; return 0; } /* make sure everything's initialized to something useful */ u = rsrc->url; if( ! *(u->host) ) { report(ERR, "no host specified"); return 0; } /* fill in proxyness */ if( !rsrc->proxy ) { rsrc->proxy = get_proxy("HTTP_PROXY"); } if( !rsrc->outfile ) { if( u->file ) rsrc->outfile = strdup(u->file); else rsrc->outfile = strdup("index.html"); } if( !u->path ) u->path = strdup("/"); if( !u->file ) u->file = strdup(""); /* funny looking */ if( !u->port ) u->port = 80; rsrc->options |= default_opts; /* send the request to either the proxy or the remote host */ if( rsrc->proxy ) { proxy_url = url_new(); url_init(proxy_url, rsrc->proxy); if( !proxy_url->port ) proxy_url->port = 80; if( !proxy_url->host ) { report(ERR, "bad proxy `%s'", rsrc->proxy); return 0; } if( proxy_url->username ) rsrc->proxy_username = strdup(proxy_url->username); if( proxy_url->password ) rsrc->proxy_password = strdup(proxy_url->password); /* Prompt for proxy password if not specified */ if( proxy_url->username && !proxy_url->password ) { char *prompt = NULL; prompt = strconcat("Password for proxy ", proxy_url->username, "@", proxy_url->host, ": ", NULL); proxy_url->password = strdup(getpass(prompt)); free(prompt); } if( ! (sock = tcp_connect(proxy_url->host, proxy_url->port)) ) return 0; u->path = strdup(""); u->file = strdup(u->full_url); request = get_request(rsrc); write(sock, request, strlen(request)); } else /* no proxy */ { if( ! (sock = tcp_connect(u->host, u->port)) ) return 0; request = get_request(rsrc); write(sock, request, strlen(request)); } out = open_outfile(rsrc); if( !out ) { report(ERR, "opening %s: %s", rsrc->outfile, strerror(errno)); return 0; } /* check to see if it returned a HTTP 1.x response */ memset(buf, '\0', 5); bytes_read = read(sock, buf, 8); if( bytes_read == 0 ) { close(sock); return 0; } if( ! (buf[0] == 'H' && buf[1] == 'T' && buf[2] == 'T' && buf[3] == 'P') ) { if ((rsrc->options & OPT_RESUME) && rsrc->outfile_offset) { report(WARN, "server does not support resume, " "try again" " with -n (no resume)"); retval = 0; goto cleanup; } write(fileno(out), buf, bytes_read); } else { /* skip the header */ buf[bytes_read] = '\0'; raw_header = get_raw_header(sock); raw_header = strconcat(buf, raw_header, NULL); header = make_http_header(raw_header); if (rsrc->options & OPT_VERBOSE) { fwrite(raw_header, 1, strlen(raw_header), stderr); } /* check for redirects */ new_location = get_header_value("location", header); if (raw_header[9] == '3' && new_location ) { redir_u = url_new(); /* make sure we still send user/password along */ redir_u->username = safe_strdup(u->username); redir_u->password = safe_strdup(u->password); url_init(redir_u, new_location); rsrc->url = redir_u; redirect_count++; retval = transfer(rsrc); goto cleanup; } if (raw_header[9] == '4' || raw_header[9] == '5') { for(i = 0; raw_header[i] && raw_header[i] != '\n'; i++); raw_header[i] = '\0'; report(ERR, "HTTP error from server: %s", raw_header); retval = 0; goto cleanup; } len_string = get_header_value("content-length", header); if (len_string) rsrc->outfile_size = (off_t )atoi(len_string); if (get_header_value("content-range", header)) rsrc->outfile_size += rsrc->outfile_offset; if( (!rsrc->outfile_size) && (rsrc->options & OPT_RESUME) && !(rsrc->options & OPT_NORESUME) && rsrc->outfile_offset ) { report(WARN, "unable to determine remote file size, try again" " with -n (no resume)"); retval = 0; goto cleanup; } } if( ! dump_data(rsrc, sock, out) ) retval = 0; else retval = 1; cleanup: free_http_header(header); close(sock); fclose(out); return retval; } snarf-7.0.orig/http.h0100644000175000001440000000034406612371655013620 0ustar mvelausers/* -*- mode: C; c-basic-offset: 8; indent-tabs-mode: nil; tab-width: 8 -*- */ #include "url.h" #ifndef HTTP_H #define HTTP_H #ifdef PROTOTYPES int http_transfer(UrlResource *); #endif /* PROTOTYPES */ #endif /* HTTP_H */ snarf-7.0.orig/llist.c0100644000175000001440000000115007144113534013746 0ustar mvelausers/* -*- mode: C; c-basic-offset: 8; indent-tabs-mode: nil; tab-width: 8 -*- */ #include "config.h" #include #include #include "llist.h" List * list_new(void) { List *new_list; new_list = malloc(sizeof(List)); new_list->data = NULL; new_list->next = NULL; return new_list; } List * list_append(List *l, void *data) { if (l->data == NULL) { l->data = data; return l; } while (l->next) { l = l->next; } l->next = list_new(); l->next->data = data; l->next->next = NULL; } snarf-7.0.orig/llist.h0100644000175000001440000000052707144113534013762 0ustar mvelausers/* -*- mode: C; c-basic-offset: 8; indent-tabs-mode: nil; tab-width: 8 -*- */ #ifndef LLIST_H #define LLIST_H typedef struct _List List; struct _List { void *data; List *next; }; /* Funcs */ #ifdef PROTOTYPES List * list_new(void); List * list_append(List *, void *); #endif /* PROTOTYPES */ #endif /* LLIST_H */ snarf-7.0.orig/options.c0100644000175000001440000000465606747405673014350 0ustar mvelausers/* -*- mode: C; c-basic-offset: 8; indent-tabs-mode: nil; tab-width: 8 -*- */ #include "config.h" #include "options.h" #include "util.h" int default_opts; extern int debug_enabled; unsigned char set_options(unsigned char opts, char *optstring) { int i; for(i = 0; optstring[i]; i++) { switch (optstring[i]) { case '-': break; case 'r': opts |= OPT_RESUME; break; case 'R': default_opts |= OPT_RESUME; break; /* lame, I know, but needed because resume is auto-set, and disabling is not. */ case 'n': opts |= OPT_NORESUME; break; case 'N': opts |= OPT_NORESUME; case 'v': opts |= OPT_VERBOSE; break; case 'V': default_opts |= OPT_VERBOSE; break; case 'z': opts |= OPT_BE_MOZILLA; break; case 'Z': default_opts |= OPT_BE_MOZILLA; break; case 'm': opts |= OPT_BE_MSIE; break; case 'M': default_opts |= OPT_BE_MSIE; break; case 'a': opts |= OPT_ACTIVE; break; case 'A': default_opts |= OPT_ACTIVE; break; case 'q': opts |= OPT_QUIET; break; case 'Q': default_opts |= OPT_QUIET; break; case 'p': opts |= OPT_PROGRESS; break; case 'P': default_opts |= OPT_PROGRESS; break; case 'd': debug_enabled = !debug_enabled; break; default: report(WARN, "unknown option `%c', ignoring", optstring[i]); } } return opts; } snarf-7.0.orig/options.h0100644000175000001440000000133006747405673014337 0ustar mvelausers/* -*- mode: C; c-basic-offset: 8; indent-tabs-mode: nil; tab-width: 8 -*- */ #ifndef OPTIONS_H #define OPTIONS_H #define OPT_RESUME (1 << 0) #define OPT_VERBOSE (1 << 1) #define OPT_QUIET (1 << 2) #define OPT_ACTIVE (1 << 3) /* For FTP only */ #define OPT_NORESUME (1 << 4) /* see comments in option.c about this lameness */ #define OPT_PROGRESS (1 << 5) /* for python aka markus fleck */ #define OPT_BE_MOZILLA (1 << 6) /* To act like Mozilla */ #define OPT_BE_MSIE (1 << 7) /* To act like MSIE */ /* Funcs */ #ifdef PROTOTYPES unsigned char set_options(unsigned char, char *); #endif /* PROTOTYPES */ extern int default_opts; #endif /* OPTIONS_H */ snarf-7.0.orig/snarf.c0100644000175000001440000001616707144123445013750 0ustar mvelausers/* -*- mode: C; c-basic-offset: 8; indent-tabs-mode: nil; tab-width: 8 -*- */ /* This program and all accompanying files are copyright 1998 Zachary * Beane . They come with NO WARRANTY; see the file COPYING * for details. * * This program is licensed to you under the terms of the GNU General * Public License. You should have recieved a copy of it with this * program; if you did not, you can view the terms at http://www.gnu.org/. * */ #include "config.h" #include #include #include #include #include "options.h" #include "llist.h" #include "url.h" #include "http.h" #include "ftp.h" #include "gopher.h" #include "util.h" #define LATEST_URL "http://www.xach.com/snarf/snarf-latest.tar.gz" #ifdef PROGRESS_DEFAULT_OFF #define PROGRESS_SETTING "off" #else #define PROGRESS_SETTING "on" #endif static void usage(int verbose) { if (!verbose) { fprintf(stderr, "Use `snarf --help' for help\n"); exit(1); } printf("This is snarf, version %s\n", VERSION); printf("usage: snarf [OPTIONS] URL [OUTFILE] ...\n"); printf("Options:\n" " -a Force active FTP (default is passive)\n" " -v Verbose; print anything the server sends\n" " -q Don't print progress bars (compiled default is %s)\n" " -p Force printing of progress bars (overrides -q)\n" " -r Resume downloading a partially transferred file\n" " -n Ignore '-r' and transfer file in its entirety\n" " -m Spoof MSIE user-agent string\n" " -z Spoof Navigator user-agent string\n" "\n" "Lowercase option letters only affect the URLs that " "immediately follow them.\n" "If you give an option in caps, it will be the " "default option for all URLs\nthat follow it.\n" "\n" "If you specify the outfile as '-', the file will be " "printed to standard\noutput as it downloads.\n" "\n" "You can have as many URLs and outfiles as you want\n" "\n" "You can specify a username and password for ftp or " "http authentication. The\nformat is:\n" "\n" " ftp://username:password@host/\n" "\n" "If you don't specify a password, you will be prompted " "for one.\n" "\n" "snarf checks the SNARF_PROXY, FTP_PROXY, GOPHER_PROXY, " "HTTP_PROXY, and PROXY\nenvironment variables.\n" "\n" "snarf is free software and has NO WARRANTY. See the file " "COPYING for details.\n", PROGRESS_SETTING); exit(1); } int main(int argc, char *argv[]) { List *arglist = NULL; UrlResource *rsrc = NULL; Url *u = NULL; int retval = 0; int i; arglist = list_new(); rsrc = url_resource_new(); if(argc < 2) { fprintf(stderr, "snarf: not enough arguments\n"); usage(0); /* usage() exits */ } if (strcmp(argv[1], "--version") == 0) { printf("snarf %s\n", VERSION); exit(0); } if (strcmp(argv[1], "--help") == 0) { usage(1); } for(i = 1; --argc; i++) { if( strcmp(argv[i], "LATEST") == 0 ) { u = url_new(); if( !url_init(u, LATEST_URL) ) { report(ERR, "`%s' is not a valid URL"); continue; } rsrc->url = u; continue; } /* options */ if( argv[i][0] == '-' && argv[i][1] ) { if( rsrc->url ) { list_append(arglist, rsrc); rsrc = url_resource_new(); } rsrc->options = set_options(rsrc->options, argv[i]); continue; } /* everything else */ if( !rsrc->url ) { u = url_new(); if( !url_init(u, argv[i]) ) { report(ERR, "bad url `%s'", argv[i]); continue; } rsrc->url = u; } else if( is_probably_an_url(argv[i]) ) { list_append(arglist, rsrc); rsrc = url_resource_new(); u = url_new(); if( !url_init(u, argv[i]) ) { report(ERR, "bad url `%s'", argv[i]); continue; } rsrc->url = u; } else { if( rsrc->outfile ) report(WARN, "ignoring `%s' for outfile", argv[i]); else rsrc->outfile = strdup(argv[i]); } } if( rsrc->url ) { list_append(arglist, rsrc); } if (arglist->data == NULL) { fprintf(stderr, "snarf: not enough arguments\n"); usage(0); } /* walk through the arglist and output and do that thing you do so well */ while (arglist != NULL) { rsrc = arglist->data; arglist = arglist->next; u = rsrc->url; if( !rsrc->outfile && u->file ) rsrc->outfile = strdup(u->file); if( rsrc->outfile ) { rsrc->outfile_offset = get_file_size(rsrc->outfile); if (rsrc->outfile_offset && !(rsrc->options & OPT_NORESUME)) { fprintf(stderr, "setting resume on " "existing file `%s' at %ld bytes\n", rsrc->outfile, rsrc->outfile_offset); rsrc->options |= OPT_RESUME; } } if (u->username && !u->password) { char *prompt = NULL; prompt = strconcat("Password for ", u->username, "@", u->host, ": ", NULL); u->password = strdup(getpass(prompt)); free(prompt); } i = transfer(rsrc); if (i == 0) retval++; url_resource_destroy(rsrc); } return retval; } snarf-7.0.orig/url.c0100644000175000001440000001572606623700010013427 0ustar mvelausers/* -*- mode: C; c-basic-offset: 8; indent-tabs-mode: nil; tab-width: 8 -*- */ #include "config.h" #include #include #ifdef HAVE_STRINGS_H #include #endif #include #include "url.h" #include "util.h" /* void safe_free(void *ptr) { if( ptr ) { debug("safe_free [%p]", ptr); free(ptr); ptr = NULL; } } */ int is_probably_an_url(char *string) { if( strstr(string, "://") ) return 1; return 0; } static char * get_service_type(char *string, Url *u) { /* fixme: what if the string isn't at the beginning of the *string? */ if( strstr(string, "http://") ) { string += 7; /* skip past that part */ u->service_type = SERVICE_HTTP; return string; } if( strstr(string, "ftp://") ) { string += 6; u->service_type = SERVICE_FTP; return string; } if( strstr(string, "gopher://") ) { string += 9; u->service_type = SERVICE_GOPHER; return string; } if( strncasecmp(string, "www", 3) == 0 ) { u->service_type = SERVICE_HTTP; u->full_url = strconcat("http://", u->full_url, NULL); return string; } if( strncasecmp(string, "ftp", 3) == 0 ) { u->service_type = SERVICE_FTP; u->full_url = strconcat("ftp://", u->full_url, NULL); return string; } /* default to browser-style serviceless http URL */ u->full_url = strconcat("http://", u->full_url, NULL); u->service_type = SERVICE_HTTP; return string; } static char * get_username(char *string, Url *u) { int i; char *username; char *at; char *slash; at = strchr(string, '@'); slash = strchr(string, '/'); if( (!at) || (slash && (at >= slash)) ) return string; for( i = 0; string[i] && string[i] != ':' && string[i] != '@' && string[i] != '/'; i++); if( string[i] != '@' && string[i] != ':' ) { return string; } username = malloc(i); memcpy(username, string, i + 1); username[i] = '\0'; string += i + 1; u->username = username; return string; } static char * get_password(char *string, Url *u) { int i; char *password; char *at; char *slash; at = strchr(string, '@'); slash = strchr(string, '/'); if( (!at) || (slash && (at >= slash)) ) return string; /* skipping to the end of the host portion. this is kinda messy for the (rare) cases where someone has a slash and/or at in their password. It's not perfect; but it catches easy cases. If you know of a better way to do this, be my guest. I do not feel a particular paternal instinct towards my ugly code. I guess that applies to this whole program. */ for(i = 0 ; string[i] != '@'; i++); password = malloc(i); /* and finally, get the password portion */ memcpy(password, string, i); password[i] = '\0'; string += i + 1; u->password = password; return string; } static char * get_hostname(char *url, Url *u) { char *hostname; int i; /* skip to end, slash, or port colon */ for( i = 0; url[i] && url[i] != '/' && url[i] != ':'; i++ ); hostname = malloc(i + 1); memcpy(hostname, url, i); hostname[i] = '\0'; /* if there's a port */ if(url[i] == ':') url += i + 1; else url += i; u->host = hostname; return url; } static char * get_port(char *url, Url *u) { char *port_string; int i; for(i = 0; isdigit(url[i]); i++); if(i == 0) return url; port_string = malloc(i + 1); memcpy(port_string, url, i + 1); port_string[i] = '\0'; url += i; u->port = atoi(port_string); return url; } static char * get_path(char *url, Url *u) { int i; char *path; /* find where the last slash is */ for(i = strlen(url); i > 0 && url[i] != '/'; i--); if(url[i] != '/') return url; path = malloc(i + 2); memcpy(path, url, i + 1); path[i] = '/'; path[i + 1] = '\0'; url += i + 1; u->path = path; return url; } static char * get_file(char *string, Url *u) { char *file; if( !string[0] ) return NULL; file = malloc(strlen(string) + 1); memcpy(file, string, strlen(string) + 1); u->file = file; return string; } Url * url_new(void) { Url *new_url; new_url = malloc(sizeof(Url)); new_url->full_url = NULL; new_url->service_type = 0; new_url->username = NULL; new_url->password = NULL; new_url->host = NULL; new_url->port = 0; new_url->path = NULL; new_url->file = NULL; return new_url; } void url_destroy(Url *u) { if( !u ) return; safe_free(u->full_url); safe_free(u->username); safe_free(u->password); safe_free(u->host); safe_free(u->path); safe_free(u->file); } UrlResource * url_resource_new(void) { UrlResource *new_resource; new_resource = malloc(sizeof(UrlResource)); new_resource->url = NULL; new_resource->outfile = NULL; new_resource->proxy = NULL; new_resource->proxy_username = NULL; new_resource->proxy_password = NULL; new_resource->options = 0; new_resource->outfile_size = 0; new_resource->outfile_offset = 0; return new_resource; } void url_resource_destroy(UrlResource *rsrc) { if( !rsrc ) return; if(rsrc->url) url_destroy(rsrc->url); safe_free(rsrc->outfile); free(rsrc); } Url * url_init(Url *u, char *string) { char *sp; /* since we're going to walk through string, use a copy instead. */ sp = string; u->full_url = (char *)strdup(string); if( ! (sp = get_service_type(sp, u)) ) return 0; /* only get username/password if they are not null, allows us to handle redirects properly */ if( !u->username ) sp = get_username(sp, u); if( !u->password ) sp = get_password(sp, u); sp = get_hostname(sp, u); if( ! (u->host && *(u->host)) ) return NULL; sp = get_port(sp, u); sp = get_path(sp, u); sp = get_file(sp, u); return u; } snarf-7.0.orig/url.h0100644000175000001440000000205706747405673013455 0ustar mvelausers/* -*- mode: C; c-basic-offset: 8; indent-tabs-mode: nil; tab-width: 8 -*- */ #ifndef URL_H #define URL_H #include #include #include typedef struct _UrlResource UrlResource; typedef struct _Url Url; struct _Url { char *full_url; int service_type; char *username; char *password; char *host; int port; char *path; char *file; }; struct _UrlResource { Url *url; char *outfile; char *proxy; char *proxy_username; char *proxy_password; unsigned char options; off_t outfile_size; off_t outfile_offset; }; /* Service types */ enum url_services { SERVICE_HTTP = 1, SERVICE_FTP, SERVICE_GOPHER, SERVICE_FINGER }; /* Error string */ extern char *url_error; /* Funcs */ #ifdef PROTOTYPES Url *url_new(void); void url_destroy(Url *); Url *url_init(Url *, char *); UrlResource *url_resource_new(void); void url_resource_destroy(UrlResource *); int is_probably_an_url(char *); #endif /* PROTOTYPES */ #endif /* URL_H */ snarf-7.0.orig/util.c0100644000175000001440000003103407144120767013606 0ustar mvelausers/* -*- mode: C; c-basic-offset: 8; indent-tabs-mode: nil; tab-width: 8 -*- */ #include "util.h" #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_SOCKS5 #define SOCKS #include #endif #if (defined(HAVE_SYS_IOCTL_H) && defined(GUESS_WINSIZE)) /* Needed for SunOS */ #ifndef BSD_COMP #define BSD_COMP #endif #include #endif #include #include #include #include "url.h" #include "options.h" char output_buf[BUFSIZ]; #ifndef HAVE_STRERROR extern int sys_nerr; extern char *sys_errlist[]; const char * strerror(int index) { if( (index > 0) && (index <= sys_nerr) ) { return sys_errlist[index]; } else if(index==0) { return "No error"; } else { return "Unknown error"; } } #endif /* !HAVE_STRERROR */ void repchar(FILE *fp, char ch, int count) { while(count--) fputc(ch, fp); } int guess_winsize() { #if (defined(HAVE_SYS_IOCTL_H) && defined(GUESS_WINSIZE)) int width; struct winsize ws; if( ioctl(STDERR_FILENO, TIOCGWINSZ, &ws) == -1 || ws.ws_col == 0 ) width = 79; else width = ws.ws_col - 1; return width; #else return 79; #endif /* defined(HAVE_SYS_IOCTL_H) && defined(GUESS_WINSIZE) */ } double double_time(void) { #ifdef HAVE_GETTIMEOFDAY struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec + (tv.tv_usec / 1000000.00); #else return time(); #endif } char * string_lowercase(char *string) { char *start = string; if( string == NULL ) return NULL; while( *string ) { *string = tolower(*string); string++; } return start; } char * get_proxy(const char *firstchoice) { char *proxy; char *help; if( (proxy = getenv(firstchoice)) ) return proxy; help = safe_strdup(firstchoice); string_lowercase(help); proxy = getenv(help); safe_free(help); if( proxy ) return proxy; if( (proxy = getenv("SNARF_PROXY")) ) return proxy; if( (proxy = getenv("PROXY")) ) return proxy; return NULL; } int dump_data(UrlResource *rsrc, int sock, FILE *out) { int out_fd = fileno(out); Progress *p = NULL; int bytes_read = 0; ssize_t written = 0; char buf[BUFSIZE]; /* if we already have all of it */ if( !(rsrc->options & OPT_NORESUME) ) { if( rsrc->outfile_size && (rsrc->outfile_offset >= rsrc->outfile_size) ) { report(WARN, "you already have all of `%s', skipping", rsrc->outfile); close(sock); return 0; } } p = progress_new(); progress_init(p, rsrc, rsrc->outfile_size); if (!(rsrc->options & OPT_NORESUME)) { progress_update(p, rsrc->outfile_offset); p->offset = rsrc->outfile_offset; } while( (bytes_read = read(sock, buf, BUFSIZE)) ) { progress_update(p, bytes_read); written = write(out_fd, buf, bytes_read); if( written == -1 ) { perror("write"); close(sock); return 0; } } close(sock); progress_destroy(p); return 1; } off_t get_file_size(const char *file) { struct stat file_info; if( !(file || *file) ) return 0; if( file[0] == '-' ) return 0; if( stat(file, &file_info) == -1 ) return 0; else return(file_info.st_size); } int debug_enabled = 0; Progress * progress_new(void) { Progress *new_progress; new_progress = malloc(sizeof(Progress)); new_progress->tty = 0; new_progress->length = 0; new_progress->current = 0; new_progress->offset = 0; new_progress->overflow = 0; new_progress->max_hashes= 0; new_progress->cur_hashes= 0; new_progress->start_time = double_time(); return new_progress; } int progress_init(Progress *p, UrlResource *rsrc, long int len) { char *filename = NULL; int win_width = 0; int total_units = 0; if( !p ) return 0; p->rsrc = rsrc; #ifndef PROGRESS_DEFAULT_OFF if( rsrc->options & OPT_PROGRESS ) { p->tty = 1; } else { if( (!isatty(2)) || (rsrc->outfile[0] == '-') || (rsrc->options & OPT_QUIET) ) { p->tty = 0; return 1; } else { p->tty = 1; } } #else if( rsrc->options & OPT_PROGRESS ) p->tty = 1; else { p->tty = 0; return 1; } #endif /* PROGRESS_DEFAULT_OFF */ win_width = guess_winsize(); if( win_width > 30 ) total_units = win_width - (30 + 9 + 16); else { /* the window is pathetically narrow; bail */ total_units = 20; } p->length = len; /* buffering stderr: no flicker! yay! */ setbuf(stderr, (char *)&output_buf); fprintf(stderr, "%s (", rsrc->url->full_url); if( total_units && len ) { p->length = len; p->max_hashes = total_units; fprintf(stderr, "%dK", (int )(len / 1024)); } else { fprintf(stderr, "unknown size"); } fprintf(stderr, ")\n"); p->current = 0; filename = strdup(rsrc->outfile); if( strlen(filename) > 24 ) filename[24] = '\0'; fprintf(stderr, "%-25s[", filename); if( p->length ) repchar(stderr, ' ', p->max_hashes); else fputc('+', stderr); fprintf(stderr, "] %7dK", (int )p->current); fflush(stderr); return 1; } void progress_update(Progress * p, long int increment) { unsigned int units; char *anim = "-\\|/"; if( !(p->tty) ) return; p->current += increment; if (strlen(p->rsrc->outfile) > 24) { p->rsrc->outfile[24] = '\0'; } fprintf(stderr, "\r"); fprintf(stderr, "%-25s [", p->rsrc->outfile); if( p->length ) { float percent_done = (float )p->current / p->length; double elapsed; float rate; units = percent_done * p->max_hashes; if( units ) repchar(stderr, '#', units); repchar(stderr, ' ', p->max_hashes - units); fprintf(stderr, "] "); fprintf(stderr, "%7dK", (int )(p->current / 1024)); elapsed = double_time() - p->start_time; if (elapsed) rate = ((p->current - p->offset) / elapsed) / 1024; else rate = 0; /* The first few runs give extra-high values, so skip them */ if (rate > 999999) rate = 0; fprintf(stderr, " | %7.2fK/s", rate); } else { /* length is unknown, so just draw a little spinny thingy */ fprintf(stderr, "%c]", anim[p->frame++ % 4]); fprintf(stderr, " %7dK", (int )(p->current / 1024)); } fflush(stderr); return; } void progress_destroy(Progress *p) { double elapsed = 0; double kbytes; if( p && (!p->tty) ) return; elapsed = double_time() - p->start_time; fprintf(stderr, "\n"); if( elapsed ) { kbytes = ((float )(p->current - p->offset) / elapsed) / 1024.0; fprintf(stderr, "%ld bytes transferred " "in %.2f sec (%.2fk/sec)\n", p->current - p->offset, elapsed, kbytes); } else { fprintf(stderr, "%ld bytes transferred " "in less than a second\n", p->current); } fflush(stderr); safe_free(p); } /* taken from glib */ char * strconcat (const char *string1, ...) { unsigned int l; va_list args; char *s; char *concat; l = 1 + strlen (string1); va_start (args, string1); s = va_arg (args, char *); while( s ) { l += strlen (s); s = va_arg (args, char *); } va_end (args); concat = malloc(l); concat[0] = 0; strcat (concat, string1); va_start (args, string1); s = va_arg (args, char *); while (s) { strcat (concat, s); s = va_arg (args, char *); } va_end (args); return concat; } /* written by lauri alanko */ char * base64(char *bin, int len) { char *buf= (char *)malloc((len+2)/3*4+1); int i=0, j=0; char BASE64_END = '='; char base64_table[64]= "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789+/"; while( j < len - 2 ) { buf[i++]=base64_table[bin[j]>>2]; buf[i++]=base64_table[((bin[j]&3)<<4)|(bin[j+1]>>4)]; buf[i++]=base64_table[((bin[j+1]&15)<<2)|(bin[j+2]>>6)]; buf[i++]=base64_table[bin[j+2]&63]; j+=3; } switch ( len - j ) { case 1: buf[i++] = base64_table[bin[j]>>2]; buf[i++] = base64_table[(bin[j]&3)<<4]; buf[i++] = BASE64_END; buf[i++] = BASE64_END; break; case 2: buf[i++] = base64_table[bin[j] >> 2]; buf[i++] = base64_table[((bin[j] & 3) << 4) | (bin[j + 1] >> 4)]; buf[i++] = base64_table[(bin[j + 1] & 15) << 2]; buf[i++] = BASE64_END; break; case 0: break; } buf[i]='\0'; return buf; } void report(enum report_levels lev, char *format, ...) { switch( lev ) { case DEBUG: fprintf(stderr, "debug: "); break; case WARN: fprintf(stderr, "warning: "); break; case ERR: fprintf(stderr, "error: "); break; default: break; } if( format ) { va_list args; va_start(args, format); vfprintf(stderr, format, args); va_end(args); fprintf(stderr, "\n"); } } int tcp_connect(char *remote_host, int port) { struct hostent *host; struct sockaddr_in sa; int sock_fd; if((host = (struct hostent *)gethostbyname(remote_host)) == NULL) { herror(remote_host); return 0; } /* get the socket */ if((sock_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { perror("socket"); return 0; } /* connect the socket, filling in the important stuff */ sa.sin_family = AF_INET; sa.sin_port = htons(port); memcpy(&sa.sin_addr, host->h_addr,host->h_length); if(connect(sock_fd, (struct sockaddr *)&sa, sizeof(sa)) < 0){ perror(remote_host); return 0; } return sock_fd; } #ifndef HAVE_STRDUP char * strdup(const char *s) { char *new_string = NULL; if (s == NULL) return NULL; new_string = malloc(strlen(s) + 1); strcpy(new_string, s); return new_string; } #endif /* HAVE_STRDUP */ int transfer(UrlResource *rsrc) { int i; switch (rsrc->url->service_type) { case SERVICE_HTTP: i = http_transfer(rsrc); break; case SERVICE_FTP: i = ftp_transfer(rsrc); break; case SERVICE_GOPHER: i = gopher_transfer(rsrc); break; default: report(ERR, "bad url: %s", rsrc->url->full_url); } return i; } snarf-7.0.orig/util.h0100644000175000001440000000354407144120751013611 0ustar mvelausers/* -*- mode: C; c-basic-offset: 8; indent-tabs-mode: nil; tab-width: 8 -*- */ #include #include #include "url.h" #include "config.h" #ifndef UTIL_H #define UTIL_H typedef struct _Progress Progress; struct _Progress { unsigned char tty; /* if we have a tty */ long int length; /* total length */ long int current; /* current position */ long int offset; /* if we're resuming, save the offset */ int max_hashes; /* max number of hashes to print */ int cur_hashes; /* total hashes printed so far*/ int overflow; /* save the remainder */ unsigned char frame; /* frame for the spinny animation */ double start_time; /* for calculating k/sec */ UrlResource *rsrc; /* Info such as file name and offset */ }; enum report_levels { DEBUG, WARN, ERR }; #ifdef PROTOTYPES Progress *progress_new(void); int progress_init(Progress *, UrlResource *, long int); void progress_update(Progress *, long int); void progress_destroy(Progress *); double double_time(void); char *string_lowercase(char *); char *get_proxy(const char *); int dump_data(UrlResource *, int, FILE *); char *strconcat(const char *, ...); char *base64(char *, int); void report(enum report_levels, char *, ...); int tcp_connect(char *, int); off_t get_file_size(const char *); void repchar(FILE *fp, char ch, int count); int transfer(UrlResource *rsrc); #ifndef HAVE_STRDUP char *strdup(const char *s); #endif #endif /* PROTOTYPES */ extern int debug_enabled; #define open_outfile(x) (((x)->outfile[0] == '-') ? stdout : real_open_outfile(x)) #define real_open_outfile(x) (((x)->options & OPT_RESUME && !((x)->options & OPT_NORESUME)) ? (fopen((x)->outfile, "a")) : (fopen((x)->outfile, "w"))) #define safe_free(x) if(x) free(x) #define safe_strdup(x) ( (x) ? strdup(x) : NULL ) #define BUFSIZE (5*2048) #endif snarf-7.0.orig/gopher.c0100644000175000001440000000331606623700010014101 0ustar mvelausers/* -*- mode: C; c-basic-offset: 8; indent-tabs-mode: nil; tab-width: 8 -*- */ #include "config.h" #include #include #include #include #include "url.h" #include "gopher.h" #include "options.h" #include "util.h" #include "http.h" int gopher_transfer(UrlResource *rsrc) { Url *u = NULL; int sock = 0; FILE *out = NULL; char *request = NULL; u = rsrc->url; /* initialize various things */ rsrc->proxy = get_proxy("GOPHER_PROXY"); if( rsrc->proxy ) { return http_transfer(rsrc); } if( !u->path ) u->path = strdup(""); else if( strlen(u->path) > 1 ) u->path = strdup(u->path + 2); /* fixme: mem leak skip the leading slash */ if( !u->file ) u->file = strdup(""); if( !u->port ) u->port = 70; if( !rsrc->outfile ) rsrc->outfile = strdup("gopherindex.txt"); sock = tcp_connect(u->host, u->port); if( !sock ) return 0; request = strconcat(u->path, u->file, "\r\n", NULL); if( !request ) return 0; out = open_outfile(rsrc); if( !out ) { report(ERR, "opening %s: %s", rsrc->outfile, strerror(errno)); close(sock); return 0; } write(sock, request, strlen(request)); /* never know the size of a gopher file */ return dump_data(rsrc, sock, out); } snarf-7.0.orig/gopher.h0100644000175000001440000000027606612371655014131 0ustar mvelausers/* -*- mode: C; c-basic-offset: 8; indent-tabs-mode: nil; tab-width: 8 -*- */ #ifndef GOPHER_H #define GOPHER_H #ifdef PROTOTYPES int gopher_transfer(UrlResource *rsrc); #endif #endif snarf-7.0.orig/herror.c0100644000175000001440000000177606635752373014154 0ustar mvelausers/* -*- mode: C; c-basic-offset: 8; indent-tabs-mode: nil; tab-width: 8 -*- */ #include "config.h" #include #include #include #include #include #include char *h_errlist[] = { "Error 0", "Unknown host", "Host name lookup failure", "Unknown server error", "No address associated with name", }; int h_nerr = 5; /* * herror -- * print the error indicated by the h_errno value. */ void herror(s) const char *s; { struct iovec iov[4]; register struct iovec *v = iov; int error = h_errno; if (s && *s) { v->iov_base = (char *)s; v->iov_len = strlen(s); v++; v->iov_base = ": "; v->iov_len = 2; v++; } v->iov_base = ((unsigned int)(error) < h_nerr) ? h_errlist[error] : "Unknown error"; v->iov_len = strlen(v->iov_base); v++; v->iov_base = "\n"; v->iov_len = 1; writev(STDERR_FILENO, iov, (v - iov) + 1); } char * hstrerror(err) int err; { return ((unsigned int)(err) < h_nerr) ? h_errlist[err] : "Unknown error"; } snarf-7.0.orig/urls0100644000175000001440000000065406611763175013405 0ustar mvelausers-*- text -*- Here's a list of URLs to try to download, as sort of a test suite. 1. ftp://cs-pub.bu.edu/ This site fails on the PASV command, so it's handy to test the PORT fallback stuff. 2. ftp://koobera.math.uic.edu/ This uses anonftpd on what I think is a VMS host. It doesn't ask for a password, it just gives a 230 reply straight away. It does not support REST (ftp resume) either. An all-together wacked-out server. snarf-7.0.orig/snarf.10100644000175000001440000000730607040623205013653 0ustar mvelausers.\" $Id: snarf.1 1.4 Tue, 08 Jun 1999 16:00:34 -0400 xach $ .TH snarf 1 "17 Jun 2000" .IX snarf .SH NAME snarf - Simple Non-interactive All-purpose Resource Fetcher .SH SYNOPSIS .B snarf .RB [ -avqprzm ] .B URL .RB [ outfile ] .B ... .PP .SH DESCRIPTION Retrieves data from a variety of protocols, namely .BR http , .BR ftp , and .BR gopher . .SH USAGE .B snarf is invoked with any number of URLs and outfiles. If an outfile is not specified, snarf preserves the remote file name when saving. .PP For example, .B snarf http://foo.bar.com/images/face.gif will retrieve the file ``face.gif'' to the local system. In the event that there is no filename (the url ends in a slash), the data is retrieved and stored in the file .B index.html for http URLs, .B ftpindex.txt for ftp URLs, or .B gopherindex.txt for gopher URLs. Using a dash, "-", as the outfile causes .B snarf to send its output to stdout rather than a file. .PP To log in to an ftp server or website that requires a username and password, use the syntax http://username:password@site.com/. If you omit the password, you will be prompted for it. .PP Snarf has a built-in option to download the latest version of itself; simply run .B snarf .BR LATEST . .SS OPTIONS .TP .I "\-a" Causes snarf to use "active" ftp. By default, snarf uses passive ftp, and, if the server does not support it, falls back to active ftp. Using the \-a option will avoid the initial passive attempt. .TP .I "\-r" Resumes an interrupted ftp or http transfer by checking if there is a local file with the same name as the remote file, and starting the transfer at the end of the local file and continuing until finished. This option only works with HTTP servers that understand HTTP/1.1 and ftp servers that support the REST command. snarf uses this option automatically if the outfile already exists. .TP .I "\-n" Don't resume; ignore the outfile if it exists and re-transfer it in its entirety. .TP .I "\-q" Don't print progress bars. .TP .I "\-p" Forces printing of progress bars. Snarf has a compile-time option for whether progress bars print by default or not. The \-p option overrides the \-q option. In addition, if progress bars are enabled by default, snarf suppresses them when standard output is not a terminal. Using .I \-p will override this behavior. .TP .I "\-v" Prints all messages that come from the server to stderr. .TP .I "\-z" Send a user-agent string similar to what Netscape Navigator 4.0 uses. .TP .I "\-m" Send a user-agent string similar to what Microsoft Internet Explorer uses. .PP Each option only affects the URL that immediately follows it. To have an option affect all URLs that follow it, use an uppercase letter for the option, e.g. \-Q instead of \-q. .SH ENVIRONMENT Snarf checks several environment variables when deciding what to use for a proxy. It checks a service-specific variable first, then .BR SNARF_PROXY , then .BR PROXY . .PP The service-specific variables are .BR HTTP_PROXY , .BR FTP_PROXY , and .BR GOPHER_PROXY . .PP Snarf also checks the .B SNARF_HTTP_USER_AGENT environment variable and will use it when reporting its user-agent string to an HTTP server. In the same spirit, it also uses the .B SNARF_HTTP_REFERER environment variable to spoof a Referer to the web server. .SH BUGS Bugs? What bugs? If you find 'em, report 'em. .SH AUTHOR Copyright (C) 2000 Zachary Beane (xach@xach.com) .\" Permission to use, copy, modify and distribute this software and its .\" documentation for any purpose and without fee is hereby granted, provided .\" that the above copyright notice appear in all copies and that both that .\" copyright notice and this permission notice appear in supporting .\" documentation. This software is provided "as is" without express or .\" implied warranty. snarf-7.0.orig/snarf-2.prj0100644000175000001440000000333707040623410014443 0ustar mvelausers;; -*- Prcs -*- (Created-By-Prcs-Version 1 2 14) (Project-Description "") (Project-Version snarf-2 0 34) (Parent-Version snarf-2 0 33) (Version-Log "") (New-Version-Log "") (Checkin-Time "Mon, 17 Jan 2000 09:28:24 -0500") (Checkin-Login xach) (Populate-Ignore ()) (Project-Keywords) (Files ;; This is a comment. Fill in files here. ;; For example: (prcs/checkout.cc ()) ;; Files added by populate at Fri, 16 Oct 1998 20:33:33 -0400, ;; to version 0.0(w), by xach: (util.h (snarf-2/0_util.h 1.9 644)) (util.c (snarf-2/1_util.c 1.14 644)) (urls (snarf-2/2_urls 1.1 644)) (url.h (snarf-2/3_url.h 1.4 644)) (url.c (snarf-2/4_url.c 1.4 644)) (snarf.spec.in (snarf-2/5_snarf.spec 1.3 644)) (snarf.1 (snarf-2/6_snarf.1 1.5 644)) (snarf.c (snarf-2/7_snarf.c 1.12 644)) (options.h (snarf-2/8_options.h 1.3 644)) (options.c (snarf-2/9_options.c 1.3 644)) (llist.h (snarf-2/10_llist.h 1.2 644)) (install-sh (snarf-2/11_install-sh 1.1 755)) (llist.c (snarf-2/12_llist.c 1.1 644)) (http.h (snarf-2/13_http.h 1.2 644)) (http.c (snarf-2/14_http.c 1.9 644)) (herror.c (snarf-2/15_herror.c 1.2 644)) (gopher.h (snarf-2/16_gopher.h 1.2 644)) (gopher.c (snarf-2/17_gopher.c 1.3 644)) (ftp.h (snarf-2/18_ftp.h 1.2 644)) (ftp.c (snarf-2/19_ftp.c 1.6 644)) (configure.in (snarf-2/20_configure. 1.15 644)) (config.h.in (snarf-2/21_config.h.i 1.9 644)) (autogen.sh (snarf-2/22_autogen.sh 1.1 755)) (acconfig.h (snarf-2/23_acconfig.h 1.3 644)) (TODO (snarf-2/24_TODO 1.4 644)) (README (snarf-2/25_README 1.3 644)) (Makefile.am (snarf-2/26_Makefile.a 1.5 644)) (INSTALL (snarf-2/27_INSTALL 1.1 644)) (ChangeLog (snarf-2/28_ChangeLog 1.22 644)) (COPYING (snarf-2/29_COPYING 1.1 644)) ) (Merge-Parents) (New-Merge-Parents) snarf-7.0.orig/snarf.spec0100644000175000001440000000104107144125617014444 0ustar mvelausersSummary: Snarf Name: snarf Version: 7.0 Release: 1 Copyright: GPL Group: Networking/Utilities Source: ftp.mint.net:/pub/snarf/snarf-7.0.tar.gz Buildroot: /tmp %description Snarf is a non-interactive client for several network protocols. %prep %setup %build mkdir -p $RPM_BUILD_ROOT/usr/bin mkdir -p $RPM_BUILD_ROOT/usr/man/man1 mkdir -p $RPM_BUILD_ROOT/usr/doc ./configure --enable-guess-winsize --prefix=$RPM_BUILD_ROOT/usr make CFLAGS="$RPM_OPT_FLAGS" %install make install %files %doc COPYING README /usr/bin/snarf /usr/man/man1/snarf.1