diff options
Diffstat (limited to 'Build/source/libs/zziplib/zziplib-0.13.59/bins')
18 files changed, 2931 insertions, 0 deletions
diff --git a/Build/source/libs/zziplib/zziplib-0.13.59/bins/Makefile.am b/Build/source/libs/zziplib/zziplib-0.13.59/bins/Makefile.am new file mode 100644 index 00000000000..a65b939f0ca --- /dev/null +++ b/Build/source/libs/zziplib/zziplib-0.13.59/bins/Makefile.am @@ -0,0 +1,42 @@ +AUTOMAKE_OPTIONS = 1.4 foreign +AUTOTOOL_VERSION=autoconf-2.52 automake-1.5 libtool-1.4.2 +DEFAULT_INCLUDES = # nothing - no default of -I. -I$(srcdir) +DEFS = @DEFS@ -I$(top_builddir) -I$(top_srcdir) # also for automake 1.4 + +bin_PROGRAMS = zzcat zzdir zzxorcat zzxordir zzxorcopy \ + unzzip unzzipdir unzzipcat unzzipcat-seeko \ + unzzipdir-mem unzzipcat-mem unzip-mem +noinst_PROGRAMS = zziptest zzobfuscated zzip +aclocaldir = $(datadir)/aclocal +aclocal_DATA = zziplib.m4 +# +VERSION_INFO=@VERSION_INFO@ +RELEASE_INFO=@RELEASE_INFO@ +THREAD_SAFE=@THREAD_SAFE@ +# + +WCC10_CLEAN = *.obj *.lk1 *.mk1 *.mk *.sym *.tgt + +EXTRA_DIST = $(aclocal_DATA) +CLEANFILES = $(WCC10_CLEAN) + +unzzip_LDADD = ../zzip/libzzip.la @RESOLVES@ -lz +zzip_LDADD = ../zzip/libzzip.la @RESOLVES@ -lz +zziptest_LDADD = ../zzip/libzzip.la @RESOLVES@ -lz +zzcat_LDADD = ../zzip/libzzip.la @RESOLVES@ -lz +zzdir_LDADD = ../zzip/libzzip.la @RESOLVES@ -lz +zzxorcat_LDADD = ../zzip/libzzip.la @RESOLVES@ -lz +zzxordir_LDADD = ../zzip/libzzip.la @RESOLVES@ -lz +zzobfuscated_LDADD = ../zzip/libzzip.la @RESOLVES@ -lz + +# these use the simplified mmapped disk version +unzzipdir_LDADD = ../zzip/libzzipmmapped.la @RESOLVES@ -lz +unzzipcat_LDADD = ../zzip/libzzipmmapped.la @RESOLVES@ -lz +unzzipdir_mem_LDADD = ../zzip/libzzipmmapped.la @RESOLVES@ -lz +unzzipcat_mem_LDADD = ../zzip/libzzipmmapped.la @RESOLVES@ -lz +unzip_mem_LDADD = ../zzip/libzzipmmapped.la @RESOLVES@ -lz +# and this uses the simplified fseeko stdio version +unzzipcat_seeko_LDADD = ../zzip/libzzipfseeko.la @RESOLVES@ -lz + +../zzip/libzzip.la : @top_srcdir@/zzip/*.c + (cd ../zzip && $(MAKE) `basename $@`) diff --git a/Build/source/libs/zziplib/zziplib-0.13.59/bins/Makefile.in b/Build/source/libs/zziplib/zziplib-0.13.59/bins/Makefile.in new file mode 100644 index 00000000000..737bae7aba0 --- /dev/null +++ b/Build/source/libs/zziplib/zziplib-0.13.59/bins/Makefile.in @@ -0,0 +1,757 @@ +# Makefile.in generated by automake 1.11 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +bin_PROGRAMS = zzcat$(EXEEXT) zzdir$(EXEEXT) zzxorcat$(EXEEXT) \ + zzxordir$(EXEEXT) zzxorcopy$(EXEEXT) unzzip$(EXEEXT) \ + unzzipdir$(EXEEXT) unzzipcat$(EXEEXT) unzzipcat-seeko$(EXEEXT) \ + unzzipdir-mem$(EXEEXT) unzzipcat-mem$(EXEEXT) \ + unzip-mem$(EXEEXT) +noinst_PROGRAMS = zziptest$(EXEEXT) zzobfuscated$(EXEEXT) \ + zzip$(EXEEXT) +subdir = bins +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_compile_check_sizeof.m4 \ + $(top_srcdir)/m4/ac_set_default_paths_system.m4 \ + $(top_srcdir)/m4/ac_sys_largefile_sensitive.m4 \ + $(top_srcdir)/m4/acx_restrict.m4 \ + $(top_srcdir)/m4/ax_cflags_gcc_option.m4 \ + $(top_srcdir)/m4/ax_cflags_no_writable_strings.m4 \ + $(top_srcdir)/m4/ax_cflags_strict_prototypes.m4 \ + $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ + $(top_srcdir)/m4/ax_check_aligned_access_required.m4 \ + $(top_srcdir)/m4/ax_configure_args.m4 \ + $(top_srcdir)/m4/ax_create_pkgconfig_info.m4 \ + $(top_srcdir)/m4/ax_enable_builddir_uname.m4 \ + $(top_srcdir)/m4/ax_expand_prefix.m4 \ + $(top_srcdir)/m4/ax_maintainer_mode_auto_silent.m4 \ + $(top_srcdir)/m4/ax_not_enable_frame_pointer.m4 \ + $(top_srcdir)/m4/ax_pax_tar.m4 \ + $(top_srcdir)/m4/ax_prefix_config_h.m4 \ + $(top_srcdir)/m4/ax_set_version_info.m4 \ + $(top_srcdir)/m4/ax_spec_file.m4 \ + $(top_srcdir)/m4/ax_spec_package_version.m4 \ + $(top_srcdir)/m4/ax_warning_default_aclocaldir.m4 \ + $(top_srcdir)/m4/ax_warning_default_pkgconfig.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/patch_libtool_on_darwin_zsh_overquoting.m4 \ + $(top_srcdir)/m4/patch_libtool_sys_lib_search_path_spec.m4 \ + $(top_srcdir)/m4/patch_libtool_to_add_host_cc.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/uses/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(aclocaldir)" +PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) +unzip_mem_SOURCES = unzip-mem.c +unzip_mem_OBJECTS = unzip-mem.$(OBJEXT) +unzip_mem_DEPENDENCIES = ../zzip/libzzipmmapped.la +unzzip_SOURCES = unzzip.c +unzzip_OBJECTS = unzzip.$(OBJEXT) +unzzip_DEPENDENCIES = ../zzip/libzzip.la +unzzipcat_SOURCES = unzzipcat.c +unzzipcat_OBJECTS = unzzipcat.$(OBJEXT) +unzzipcat_DEPENDENCIES = ../zzip/libzzipmmapped.la +unzzipcat_mem_SOURCES = unzzipcat-mem.c +unzzipcat_mem_OBJECTS = unzzipcat-mem.$(OBJEXT) +unzzipcat_mem_DEPENDENCIES = ../zzip/libzzipmmapped.la +unzzipcat_seeko_SOURCES = unzzipcat-seeko.c +unzzipcat_seeko_OBJECTS = unzzipcat-seeko.$(OBJEXT) +unzzipcat_seeko_DEPENDENCIES = ../zzip/libzzipfseeko.la +unzzipdir_SOURCES = unzzipdir.c +unzzipdir_OBJECTS = unzzipdir.$(OBJEXT) +unzzipdir_DEPENDENCIES = ../zzip/libzzipmmapped.la +unzzipdir_mem_SOURCES = unzzipdir-mem.c +unzzipdir_mem_OBJECTS = unzzipdir-mem.$(OBJEXT) +unzzipdir_mem_DEPENDENCIES = ../zzip/libzzipmmapped.la +zzcat_SOURCES = zzcat.c +zzcat_OBJECTS = zzcat.$(OBJEXT) +zzcat_DEPENDENCIES = ../zzip/libzzip.la +zzdir_SOURCES = zzdir.c +zzdir_OBJECTS = zzdir.$(OBJEXT) +zzdir_DEPENDENCIES = ../zzip/libzzip.la +zzip_SOURCES = zzip.c +zzip_OBJECTS = zzip.$(OBJEXT) +zzip_DEPENDENCIES = ../zzip/libzzip.la +zziptest_SOURCES = zziptest.c +zziptest_OBJECTS = zziptest.$(OBJEXT) +zziptest_DEPENDENCIES = ../zzip/libzzip.la +zzobfuscated_SOURCES = zzobfuscated.c +zzobfuscated_OBJECTS = zzobfuscated.$(OBJEXT) +zzobfuscated_DEPENDENCIES = ../zzip/libzzip.la +zzxorcat_SOURCES = zzxorcat.c +zzxorcat_OBJECTS = zzxorcat.$(OBJEXT) +zzxorcat_DEPENDENCIES = ../zzip/libzzip.la +zzxorcopy_SOURCES = zzxorcopy.c +zzxorcopy_OBJECTS = zzxorcopy.$(OBJEXT) +zzxorcopy_LDADD = $(LDADD) +zzxordir_SOURCES = zzxordir.c +zzxordir_OBJECTS = zzxordir.$(OBJEXT) +zzxordir_DEPENDENCIES = ../zzip/libzzip.la +depcomp = $(SHELL) $(top_srcdir)/uses/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = unzip-mem.c unzzip.c unzzipcat.c unzzipcat-mem.c \ + unzzipcat-seeko.c unzzipdir.c unzzipdir-mem.c zzcat.c zzdir.c \ + zzip.c zziptest.c zzobfuscated.c zzxorcat.c zzxorcopy.c \ + zzxordir.c +DIST_SOURCES = unzip-mem.c unzzip.c unzzipcat.c unzzipcat-mem.c \ + unzzipcat-seeko.c unzzipdir.c unzzipdir-mem.c zzcat.c zzdir.c \ + zzip.c zziptest.c zzobfuscated.c zzxorcat.c zzxorcopy.c \ + zzxordir.c +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +DATA = $(aclocal_DATA) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_FILES = @CONFIG_FILES@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ -I$(top_builddir) -I$(top_srcdir) # also for automake 1.4 +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GNUTAR = @GNUTAR@ +GREP = @GREP@ +GTAR = @GTAR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LARGEFILE_CFLAGS = @LARGEFILE_CFLAGS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKZIP = @MKZIP@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PAX = @PAX@ +PAX_TAR_CREATE = @PAX_TAR_CREATE@ +PAX_TAR_EXTRACT = @PAX_TAR_EXTRACT@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PYTHON = @PYTHON@ +RANLIB = @RANLIB@ +RELEASE_INFO = @RELEASE_INFO@ +RESOLVES = @RESOLVES@ +SDL = @SDL@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +THREAD_SAFE = @THREAD_SAFE@ +VERSION = @VERSION@ +# +VERSION_INFO = @VERSION_INFO@ +XMLTO = @XMLTO@ +ZIPTESTS = @ZIPTESTS@ +ZLIB_INCL = @ZLIB_INCL@ +ZLIB_LDIR = @ZLIB_LDIR@ +ZLIB_VERSION = @ZLIB_VERSION@ +ZZIPLIB_LDFLAGS = @ZZIPLIB_LDFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +aclocaldir = $(datadir)/aclocal +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_enable_builddir_sed = @ax_enable_builddir_sed@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgconfig_libdir = @pkgconfig_libdir@ +pkgconfig_libfile = @pkgconfig_libfile@ +pkgconfigdir = @pkgconfigdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = 1.4 foreign +AUTOTOOL_VERSION = autoconf-2.52 automake-1.5 libtool-1.4.2 +DEFAULT_INCLUDES = # nothing - no default of -I. -I$(srcdir) +aclocal_DATA = zziplib.m4 +# +WCC10_CLEAN = *.obj *.lk1 *.mk1 *.mk *.sym *.tgt +EXTRA_DIST = $(aclocal_DATA) +CLEANFILES = $(WCC10_CLEAN) +unzzip_LDADD = ../zzip/libzzip.la @RESOLVES@ -lz +zzip_LDADD = ../zzip/libzzip.la @RESOLVES@ -lz +zziptest_LDADD = ../zzip/libzzip.la @RESOLVES@ -lz +zzcat_LDADD = ../zzip/libzzip.la @RESOLVES@ -lz +zzdir_LDADD = ../zzip/libzzip.la @RESOLVES@ -lz +zzxorcat_LDADD = ../zzip/libzzip.la @RESOLVES@ -lz +zzxordir_LDADD = ../zzip/libzzip.la @RESOLVES@ -lz +zzobfuscated_LDADD = ../zzip/libzzip.la @RESOLVES@ -lz + +# these use the simplified mmapped disk version +unzzipdir_LDADD = ../zzip/libzzipmmapped.la @RESOLVES@ -lz +unzzipcat_LDADD = ../zzip/libzzipmmapped.la @RESOLVES@ -lz +unzzipdir_mem_LDADD = ../zzip/libzzipmmapped.la @RESOLVES@ -lz +unzzipcat_mem_LDADD = ../zzip/libzzipmmapped.la @RESOLVES@ -lz +unzip_mem_LDADD = ../zzip/libzzipmmapped.la @RESOLVES@ -lz +# and this uses the simplified fseeko stdio version +unzzipcat_seeko_LDADD = ../zzip/libzzipfseeko.la @RESOLVES@ -lz +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bins/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign bins/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +unzip-mem$(EXEEXT): $(unzip_mem_OBJECTS) $(unzip_mem_DEPENDENCIES) + @rm -f unzip-mem$(EXEEXT) + $(LINK) $(unzip_mem_OBJECTS) $(unzip_mem_LDADD) $(LIBS) +unzzip$(EXEEXT): $(unzzip_OBJECTS) $(unzzip_DEPENDENCIES) + @rm -f unzzip$(EXEEXT) + $(LINK) $(unzzip_OBJECTS) $(unzzip_LDADD) $(LIBS) +unzzipcat$(EXEEXT): $(unzzipcat_OBJECTS) $(unzzipcat_DEPENDENCIES) + @rm -f unzzipcat$(EXEEXT) + $(LINK) $(unzzipcat_OBJECTS) $(unzzipcat_LDADD) $(LIBS) +unzzipcat-mem$(EXEEXT): $(unzzipcat_mem_OBJECTS) $(unzzipcat_mem_DEPENDENCIES) + @rm -f unzzipcat-mem$(EXEEXT) + $(LINK) $(unzzipcat_mem_OBJECTS) $(unzzipcat_mem_LDADD) $(LIBS) +unzzipcat-seeko$(EXEEXT): $(unzzipcat_seeko_OBJECTS) $(unzzipcat_seeko_DEPENDENCIES) + @rm -f unzzipcat-seeko$(EXEEXT) + $(LINK) $(unzzipcat_seeko_OBJECTS) $(unzzipcat_seeko_LDADD) $(LIBS) +unzzipdir$(EXEEXT): $(unzzipdir_OBJECTS) $(unzzipdir_DEPENDENCIES) + @rm -f unzzipdir$(EXEEXT) + $(LINK) $(unzzipdir_OBJECTS) $(unzzipdir_LDADD) $(LIBS) +unzzipdir-mem$(EXEEXT): $(unzzipdir_mem_OBJECTS) $(unzzipdir_mem_DEPENDENCIES) + @rm -f unzzipdir-mem$(EXEEXT) + $(LINK) $(unzzipdir_mem_OBJECTS) $(unzzipdir_mem_LDADD) $(LIBS) +zzcat$(EXEEXT): $(zzcat_OBJECTS) $(zzcat_DEPENDENCIES) + @rm -f zzcat$(EXEEXT) + $(LINK) $(zzcat_OBJECTS) $(zzcat_LDADD) $(LIBS) +zzdir$(EXEEXT): $(zzdir_OBJECTS) $(zzdir_DEPENDENCIES) + @rm -f zzdir$(EXEEXT) + $(LINK) $(zzdir_OBJECTS) $(zzdir_LDADD) $(LIBS) +zzip$(EXEEXT): $(zzip_OBJECTS) $(zzip_DEPENDENCIES) + @rm -f zzip$(EXEEXT) + $(LINK) $(zzip_OBJECTS) $(zzip_LDADD) $(LIBS) +zziptest$(EXEEXT): $(zziptest_OBJECTS) $(zziptest_DEPENDENCIES) + @rm -f zziptest$(EXEEXT) + $(LINK) $(zziptest_OBJECTS) $(zziptest_LDADD) $(LIBS) +zzobfuscated$(EXEEXT): $(zzobfuscated_OBJECTS) $(zzobfuscated_DEPENDENCIES) + @rm -f zzobfuscated$(EXEEXT) + $(LINK) $(zzobfuscated_OBJECTS) $(zzobfuscated_LDADD) $(LIBS) +zzxorcat$(EXEEXT): $(zzxorcat_OBJECTS) $(zzxorcat_DEPENDENCIES) + @rm -f zzxorcat$(EXEEXT) + $(LINK) $(zzxorcat_OBJECTS) $(zzxorcat_LDADD) $(LIBS) +zzxorcopy$(EXEEXT): $(zzxorcopy_OBJECTS) $(zzxorcopy_DEPENDENCIES) + @rm -f zzxorcopy$(EXEEXT) + $(LINK) $(zzxorcopy_OBJECTS) $(zzxorcopy_LDADD) $(LIBS) +zzxordir$(EXEEXT): $(zzxordir_OBJECTS) $(zzxordir_DEPENDENCIES) + @rm -f zzxordir$(EXEEXT) + $(LINK) $(zzxordir_OBJECTS) $(zzxordir_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unzip-mem.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unzzip.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unzzipcat-mem.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unzzipcat-seeko.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unzzipcat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unzzipdir-mem.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unzzipdir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzcat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzdir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzip.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zziptest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzobfuscated.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzxorcat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzxorcopy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzxordir.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-aclocalDATA: $(aclocal_DATA) + @$(NORMAL_INSTALL) + test -z "$(aclocaldir)" || $(MKDIR_P) "$(DESTDIR)$(aclocaldir)" + @list='$(aclocal_DATA)'; test -n "$(aclocaldir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(aclocaldir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(aclocaldir)" || exit $$?; \ + done + +uninstall-aclocalDATA: + @$(NORMAL_UNINSTALL) + @list='$(aclocal_DATA)'; test -n "$(aclocaldir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(aclocaldir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(aclocaldir)" && rm -f $$files + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(DATA) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(aclocaldir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool \ + clean-noinstPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-aclocalDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-aclocalDATA uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool clean-noinstPROGRAMS ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-aclocalDATA install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-aclocalDATA \ + uninstall-am uninstall-binPROGRAMS + + +../zzip/libzzip.la : @top_srcdir@/zzip/*.c + (cd ../zzip && $(MAKE) `basename $@`) + +# 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: diff --git a/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzip-mem.c b/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzip-mem.c new file mode 100644 index 00000000000..3f7d7f0631e --- /dev/null +++ b/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzip-mem.c @@ -0,0 +1,420 @@ +/* + * Copyright (c) 2003 Guido Draheim <guidod@gmx.de> + * Use freely under the restrictions of the ZLIB license. + * + * This file is used as an example to clarify zzipmmap api usage. + */ + +#include <zlib.h> /* crc32 */ + +#include <zzip/memdisk.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#ifdef ZZIP_HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifdef ZZIP_HAVE_IO_H +#include <io.h> +#endif + +#include <time.h> + +#ifdef ZZIP_HAVE_FNMATCH_H +#include <fnmatch.h> +#else +#define fnmatch(x,y,z) strcmp(x,y) +#endif + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +#define ___ { +#define ____ } + +#define EXIT_SUCCESS 0 +#define EXIT_WARNINGS 1 +#define EXIT_ERRORS 2 +#define EXIT_EFORMAT 3 +#define EXIT_ENOMEM 4 +#define EXIT_ENOTTY 5 +#define EXIT_EINFLATE 6 +#define EXIT_ENOARCH 9 +#define EXIT_EOPTION 10 +#define EXIT_ENOFILE 11 +#define EXIT_EDISKFULL 50 +#define EXIT_EPREMATURE 51 +#define EXIT_USERABORT 80 +#define EXIT_BADCOMPRESSION 81 +#define EXIT_BADPASSWORD 82 + +static int status = EXIT_SUCCESS; +static int option_list = 0; /* "-l" */ +static int option_pipe = 0; /* "-p" */ +static int option_verbose = 0; /* "-v" */ +static int option_testcrc = 0; /* "-t" */ +static int option_binary = 0; /* "-b" */ +static int option_nocase = 0; /* "-C" */ +static int option_junkpaths = 0; /* "-j" */ +static int option_dosfiles = 0; /* "-L" */ +static int option_keepold = 0; /* "-n" */ +static int option_overwrite = 0; /* "-o" */ +static int option_quiet = 0; /* "-q" */ +static int option_permbits = 0; /* "-X" */ + +static const char usage[] = +{ + "unzzip-mem <zip> [names].. \n" + " - unzzip a zip archive.\n" + "options:\n" + " -l list archive files (name, usize, mtime, comments)\n" /* +totals */ + " -p extract archive files to pipe, i.e. stdout (binary mode)\n" + " -t test archive files (check the crc values)\n" + " -v verbose list of archive files\n" + " -b accept and ignore (force binary extract)\n" + " -C match filenames case-insensitively\n" + " -j junk paths (do not recreate directory structure)\n" + " -L convert dos filenames to lowercase upon extract\n" + " -n never overwrite existing files\n" + " -o always overwrite existing files\n" + " -q quite operation\n" + " -X restore user/owner attributes of files\n" +}; + +static void zzip_mem_entry_pipe(ZZIP_MEM_DISK* disk, + ZZIP_MEM_ENTRY* entry, FILE* out) +{ + ZZIP_DISK_FILE* file = zzip_mem_entry_fopen (disk, entry); + if (file) + { + char buffer[1024]; int len; + while ((len = zzip_mem_disk_fread (buffer, 1024, 1, file))) + fwrite (buffer, len, 1, out); + + zzip_mem_disk_fclose (file); + } +} + +static void zzip_mem_entry_make(ZZIP_MEM_DISK* disk, + ZZIP_MEM_ENTRY* entry) +{ + FILE* file = fopen (entry->zz_name, "w"); + if (file) { zzip_mem_entry_pipe (disk, entry, file); fclose (file); } + perror (entry->zz_name); + if (status < EXIT_WARNINGS) status = EXIT_WARNINGS; +} + +/* ------------------------- test ------------------------------------ */ + +static char* archive = 0; +static int test_errors = 0; + +static void zzip_mem_entry_test(ZZIP_MEM_DISK* disk, + ZZIP_MEM_ENTRY* entry) +{ + ZZIP_DISK_FILE* file = zzip_mem_entry_fopen (disk, entry); + printf (" testing: %s ", entry->zz_name); + if (strlen (entry->zz_name) < 24) { + printf ("%.*s", 24 - (int) strlen (entry->zz_name), + " "); + } + if (file) + { + unsigned long crc = crc32 (0L, NULL, 0); + unsigned char buffer[1024]; int len; + while ((len = zzip_mem_disk_fread (buffer, 1024, 1, file))) { + crc = crc32 (crc, buffer, len); + } + + zzip_mem_disk_fclose (file); + if (crc == (unsigned long) entry->zz_crc32) { + printf ("OK\n"); + } else { + printf ("BAD %lx (should be %lx)\n", crc, entry->zz_crc32); + test_errors ++; + } + } else { + printf ("ERROR (no such file)\n"); + test_errors ++; + } +} + +static void zzip_mem_entry_test_start(void) +{ + test_errors = 0; + printf ("Archive: %s\n", archive); +} + +static void zzip_mem_entry_test_done(void) +{ + if (test_errors == 0) { + printf ("No errors detected in compressed data of %s\n", archive); + } else { + printf ("%i errors detected in compressed data of %s\n", + test_errors, archive); + } +} + +/* ------------------------- list ------------------------------------ */ + +static char _zzip_time_[30]; +static char* _zzip_ctime (const time_t* timeval) +{ + struct tm* date = localtime (timeval); + sprintf (_zzip_time_, "%02i-%02i-%02i %02i:%02i", + date->tm_mon, date->tm_mday, date->tm_year%100, + date->tm_hour, date->tm_min); + return _zzip_time_; +} + +static const char* comprlevel[] = { + "stored", "shrunk", "redu:1", "redu:2", "redu:3", "redu:4", + "impl:N", "toknze", "defl:N", "defl:B", "impl:B" }; + +zzip_off_t sum_usize = 0; +zzip_off_t sum_csize = 0; +zzip_off_t sum_files = 0; +#define L (long) + +static void zzip_mem_entry_direntry_start (void) +{ + sum_usize = 0; + sum_csize = 0; + sum_files = 0; + if (option_verbose) goto verbose; + printf(" Length Date & Time Name\n"); + printf(" -------- ---- ---- ----\n"); + return; + verbose: + printf(" Length Method Size Ratio Date Time CRC-32 Name\n"); + printf("-------- ------ ------- ----- ---- ---- ------ ----\n"); +} + +static void zzip_mem_entry_direntry_done (void) +{ + char exp = ' '; + if (sum_usize / 1024 > 1024*1024*1024) { exp = 'G'; + sum_usize /= 1024*1024*1024; sum_usize /= 1024*1024*1024; } + if (sum_usize > 1024*1024*1024) { exp = 'M'; + sum_usize /= 1024*1024; sum_csize /= 1024*1024; } + if (sum_usize > 1024*1024) { exp = 'K'; + sum_usize /= 1024; sum_csize /= 1024; } + if (option_verbose) goto verbose; + printf(" -------- ----\n"); + printf(" %8li%c %8li %s\n", L sum_usize, exp, L sum_files, + sum_files == 1 ? "file" : "files"); + return; + verbose: + printf("-------- ------ ------- ----- ----\n"); + printf("%8li%c %8li%c %3li%% %8li %s\n", + L sum_usize, exp, L sum_csize, exp, + L (100 - (sum_csize*100/sum_usize)), L sum_files, + sum_files == 1 ? "file" : "files"); +} + +static void zzip_mem_entry_direntry(ZZIP_MEM_ENTRY* entry) +{ + char* name = zzip_mem_entry_to_name (entry); + zzip_off_t usize = zzip_mem_entry_usize (entry); + zzip_off_t csize = zzip_mem_entry_csize (entry); + int compr = zzip_mem_entry_data_comprlevel (entry); + time_t mtime = entry->zz_mktime; + long crc32 = entry->zz_crc32; + const char* comment = zzip_mem_entry_to_comment (entry); + char exp = ' '; + + sum_usize += usize; + sum_csize += csize; + sum_files += 1; + + if (usize / 1024 > 1024*1024*1024) { exp = 'G'; + usize /= 1024*1024*1024; usize /= 1024*1024*1024; } + if (usize > 1024*1024*1024) { exp = 'M'; + usize /= 1024*1024; csize /= 1024*1024; } + if (usize > 1024*1024) { exp = 'K'; + usize /= 1024; csize /= 1024; } + + if (! comment) comment = ""; + if (*name == '\n') name++; + + if (option_verbose) { + printf("%8li%c %s %8li%c%3li%% %s %8lx %s %s\n", + L usize, exp, comprlevel[compr], L csize, exp, + L (100 - (csize*100/usize)), + _zzip_ctime(&mtime), crc32, name, comment); + } else { + printf(" %8li%c %s %s %s\n", + L usize, exp, _zzip_ctime(&mtime), name, comment); + } +} + +static void zzip_mem_entry_listfiles(ZZIP_MEM_DISK* disk, char* filespec) +{ + zzip_mem_entry_direntry_start (); + ___ ZZIP_MEM_ENTRY* entry = 0; + while ((entry = zzip_mem_disk_findmatch(disk, filespec, entry, 0, 0))) + zzip_mem_entry_direntry (entry); ____; + zzip_mem_entry_direntry_done (); +} + +static void zzip_mem_entry_listall(ZZIP_MEM_DISK* disk) +{ + zzip_mem_entry_direntry_start (); + ___ ZZIP_MEM_ENTRY* entry = zzip_mem_disk_findfirst(disk); + for (; entry ; entry = zzip_mem_disk_findnext(disk, entry)) + zzip_mem_entry_direntry (entry); ____; + zzip_mem_entry_direntry_done (); +} + +static void zzip_mem_entry_testfiles(ZZIP_MEM_DISK* disk, char* filespec) +{ + zzip_mem_entry_test_start (); + ___ ZZIP_MEM_ENTRY* entry = 0; + while ((entry = zzip_mem_disk_findmatch(disk, filespec, entry, 0, 0))) + zzip_mem_entry_test (disk, entry); ____; + zzip_mem_entry_test_done (); +} + +static void zzip_mem_entry_testall(ZZIP_MEM_DISK* disk) +{ + zzip_mem_entry_test_start (); + ___ ZZIP_MEM_ENTRY* entry = zzip_mem_disk_findfirst(disk); + for (; entry ; entry = zzip_mem_disk_findnext(disk, entry)) + zzip_mem_entry_test (disk, entry); ____; + zzip_mem_entry_test_done (); +} + +static void zzip_mem_entry_pipefiles(ZZIP_MEM_DISK* disk, char* filespec) +{ + ZZIP_MEM_ENTRY* entry = 0; + while ((entry = zzip_mem_disk_findmatch(disk, filespec, entry, 0, 0))) + zzip_mem_entry_pipe (disk, entry, stdout); +} + +static void zzip_mem_entry_pipeall(ZZIP_MEM_DISK* disk) +{ + ZZIP_MEM_ENTRY* entry = zzip_mem_disk_findfirst(disk); + for (; entry ; entry = zzip_mem_disk_findnext(disk, entry)) + zzip_mem_entry_pipe (disk, entry, stdout); +} + +static void zzip_mem_entry_makefiles(ZZIP_MEM_DISK* disk, char* filespec) +{ + ZZIP_MEM_ENTRY* entry = 0; + while ((entry = zzip_mem_disk_findmatch(disk, filespec, entry, 0, 0))) + zzip_mem_entry_make (disk, entry); +} + +static void zzip_mem_entry_makeall(ZZIP_MEM_DISK* disk) +{ + ZZIP_MEM_ENTRY* entry = zzip_mem_disk_findfirst(disk); + for (; entry ; entry = zzip_mem_disk_findnext(disk, entry)) + zzip_mem_entry_make (disk, entry); +} + +int +main (int argc, char ** argv) +{ + int argn; int archname = 0; int filespec = 0; + ZZIP_MEM_DISK* disk; + if (argc <= 1 || ! strcmp (argv[1], "--help")) + { + printf (usage); + return 0; + } + if (! strcmp (argv[1], "--version")) + { + printf (__FILE__" version "ZZIP_PACKAGE" "ZZIP_VERSION"\n"); + return 0; + } + + for (argn=1; argn < argc; argn++) { + if ((argv[argn])[0] == '-') { + int x = 1; + while ((argv[argn])[x]) { + switch (argv[argn][x]) { + case 'l': option_list++; break; + case 'p': option_pipe++; break; + case 't': option_testcrc++; break; + case 'v': option_verbose++; break; + case 'b': option_binary++; break; + case 'C': option_nocase++; break; + case 'j': option_junkpaths++; break; + case 'L': option_dosfiles++; break; + case 'n': option_keepold++; break; + case 'o': option_overwrite++; break; + case 'q': option_quiet++; break; + case 'X': option_permbits++; break; + } + x++; + } + (argv[argn])[0] = 0; + } else { + if (! archname) { archname = argn; continue; } + if (! filespec) { filespec = argn; continue; } + } + } + + if (! archname) { + printf (usage); + return 0; + } else archive = argv[archname]; + + disk = zzip_mem_disk_open (argv[archname]); + if (! disk) { + perror(argv[archname]); + return -1; + } + + if (option_list || option_verbose) { + if (! filespec) { + zzip_mem_entry_listall (disk); + } else { + for (argn=filespec; argn < argc; argn++) { + if (argv[argn][0]) { + zzip_mem_entry_listfiles (disk, argv[argn]); + } + } + } + } else if (option_pipe) { + if (! filespec) { + zzip_mem_entry_pipeall (disk); + } else { + for (argn=filespec; argn < argc; argn++) { + if (argv[argn][0]) { + zzip_mem_entry_pipefiles (disk, argv[argn]); + } + } + } + } else if (option_testcrc) { + if (! filespec) { + zzip_mem_entry_testall (disk); + } else { + for (argn=filespec; argn < argc; argn++) { + if (argv[argn][0]) { + zzip_mem_entry_testfiles (disk, argv[argn]); + } + } + } + } else { + if (! filespec) { + zzip_mem_entry_makeall (disk); + } else { + for (argn=filespec; argn < argc; argn++) { + if (argv[argn][0]) { + zzip_mem_entry_makefiles (disk, argv[argn]); + } + } + } + } + + return status; +} + +/* + * Local variables: + * c-file-style: "stroustrup" + * End: + */ diff --git a/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzzip.c b/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzzip.c new file mode 100644 index 00000000000..ae8b3b97969 --- /dev/null +++ b/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzzip.c @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2003 Guido Draheim <guidod@gmx.de> + * Use freely under the restrictions of the ZLIB license. + * + * This file is used as an example to clarify zzip api usage. + */ + +#include <zzip/zzip.h> +#include <stdio.h> +#include <string.h> + +#ifdef ZZIP_HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifdef ZZIP_HAVE_IO_H +#include <io.h> +#endif + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +static const char usage[] = +{ + "unzzip <dir>.. \n" + " - unzzip the files contained in a zip archive.\n" +}; + +int +main (int argc, char ** argv) +{ + int argn; + int exitcode = 0; + zzip_error_t error; + + if (argc <= 1 || ! strcmp (argv[1], "--help")) + { + printf (usage); + return 0; + } + if (! strcmp (argv[1], "--version")) + { + printf (__FILE__" version "ZZIP_PACKAGE" "ZZIP_VERSION"\n"); + return 0; + } + + for (argn=1; argn < argc; argn++) + { + ZZIP_DIR * dir; + ZZIP_DIRENT d; + + dir = zzip_dir_open(argv[argn], &error); + if (! dir) + { + fprintf (stderr, "did not open %s: \n", argv[argn]); + fprintf (stderr, "%s: %s\n", argv[argn], zzip_strerror(error)); + exitcode++; + continue; + } + + if (argc > 2) printf ("%s: \n", argv[argn]); + + /* read each dir entry and show one line of info per file */ + while (zzip_dir_read (dir, &d)) + { + int output; + ZZIP_FILE* input = zzip_file_open (dir, d.d_name, O_RDONLY); + if (! input) + { + fprintf (stderr, "|did not open %s: \n", d.d_name); + fprintf (stderr, "|%s: %s\n", d.d_name, zzip_strerror_of(dir)); + continue; + } + + output = creat (d.d_name, 0664); + if (output == -1) + { + fprintf (stderr, "|output file %s: \n", d.d_name); + perror(d.d_name); + zzip_file_close (input); + continue; + } + + printf("%s\n", d.d_name); + + { + char buf[17]; zzip_ssize_t n; + /* read chunks of 16 bytes into buf */ + while (0 < (n = zzip_read (input, buf, 16))) + { + write (output, buf, n); + } + + if (n == -1) + perror (d.d_name); + } + close (output); + zzip_file_close (input); + } + + zzip_dir_close(dir); + } + + return exitcode; +} + +/* + * Local variables: + * c-file-style: "stroustrup" + * End: + */ diff --git a/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzzipcat-mem.c b/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzzipcat-mem.c new file mode 100644 index 00000000000..7474854187e --- /dev/null +++ b/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzzipcat-mem.c @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2003 Guido Draheim <guidod@gmx.de> + * Use freely under the restrictions of the ZLIB license. + * + * This file is used as an example to clarify zzipmmap api usage. + */ + +#include <zzip/memdisk.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#ifdef ZZIP_HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifdef ZZIP_HAVE_IO_H +#include <io.h> +#endif + +#ifdef ZZIP_HAVE_FNMATCH_H +#include <fnmatch.h> +#else +#define fnmatch(x,y,z) strcmp(x,y) +#endif + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +static const char usage[] = +{ + "unzzipdir-mem <zip> [names].. \n" + " - unzzip data content of files contained in a zip archive.\n" +}; + +static void zzip_mem_entry_fprint(ZZIP_MEM_DISK* disk, + ZZIP_MEM_ENTRY* entry, FILE* out) +{ + ZZIP_DISK_FILE* file = zzip_mem_entry_fopen (disk, entry); + if (file) + { + char buffer[1024]; int len; + while ((len = zzip_mem_disk_fread (buffer, 1024, 1, file))) + fwrite (buffer, len, 1, out); + + zzip_mem_disk_fclose (file); + } +} + +static void zzip_mem_disk_cat_file(ZZIP_MEM_DISK* disk, char* name, FILE* out) +{ + ZZIP_DISK_FILE* file = zzip_mem_disk_fopen (disk, name); + if (file) + { + char buffer[1024]; int len; + while ((len = zzip_mem_disk_fread (buffer, 1, 1024, file))) + { + fwrite (buffer, 1, len, out); + } + + zzip_mem_disk_fclose (file); + } +} + +int +main (int argc, char ** argv) +{ + int argn; + ZZIP_MEM_DISK* disk; + + if (argc <= 1 || ! strcmp (argv[1], "--help")) + { + printf (usage); + return 0; + } + if (! strcmp (argv[1], "--version")) + { + printf (__FILE__" version "ZZIP_PACKAGE" "ZZIP_VERSION"\n"); + return 0; + } + + disk = zzip_mem_disk_open (argv[1]); + if (! disk) { + perror(argv[1]); + return -1; + } + + if (argc == 2) + { /* print directory list */ + ZZIP_MEM_ENTRY* entry = zzip_mem_disk_findfirst(disk); + for (; entry ; entry = zzip_mem_disk_findnext(disk, entry)) + { + char* name = zzip_mem_entry_to_name (entry); + printf ("%s\n", name); + } + return 0; + } + + if (argc == 3) + { /* list from one spec */ + ZZIP_MEM_ENTRY* entry = 0; + while ((entry = zzip_mem_disk_findmatch(disk, argv[2], entry, 0, 0))) + { + zzip_mem_entry_fprint (disk, entry, stdout); + } + + return 0; + } + + for (argn=1; argn < argc; argn++) + { /* list only the matching entries - each in order of commandline */ + ZZIP_MEM_ENTRY* entry = zzip_mem_disk_findfirst(disk); + for (; entry ; entry = zzip_mem_disk_findnext(disk, entry)) + { + char* name = zzip_mem_entry_to_name (entry); + if (! fnmatch (argv[argn], name, + FNM_NOESCAPE|FNM_PATHNAME|FNM_PERIOD)) + zzip_mem_disk_cat_file (disk, name, stdout); + } + } + return 0; +} + +/* + * Local variables: + * c-file-style: "stroustrup" + * End: + */ diff --git a/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzzipcat-seeko.c b/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzzipcat-seeko.c new file mode 100644 index 00000000000..f16f0b96566 --- /dev/null +++ b/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzzipcat-seeko.c @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2003 Guido Draheim <guidod@gmx.de> + * Use freely under the restrictions of the ZLIB license. + * + * This file is used as an example to clarify zzipfseeko api usage. + */ + +#include <zzip/fseeko.h> +#include <stdlib.h> +#include <string.h> + +#ifdef ZZIP_HAVE_FNMATCH_H +#include <fnmatch.h> +#else +#define fnmatch(x,y,z) strcmp(x,y) +#endif + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +static const char usage[] = +{ + "unzzipcat-seeko <zip> [names].. \n" + " - unzzip data content of files contained in a zip archive.\n" +}; + +static void zzip_entry_fprint(ZZIP_ENTRY* entry, FILE* out) +{ + ZZIP_ENTRY_FILE* file = zzip_entry_fopen (entry, 0); + if (file) + { + char buffer[1024]; int len; + while ((len = zzip_entry_fread (buffer, 1024, 1, file))) + fwrite (buffer, len, 1, out); + + zzip_entry_fclose (file); + } +} + +static void zzip_cat_file(FILE* disk, char* name, FILE* out) +{ + ZZIP_ENTRY_FILE* file = zzip_entry_ffile (disk, name); + if (file) + { + char buffer[1024]; int len; + while ((len = zzip_entry_fread (buffer, 1024, 1, file))) + fwrite (buffer, len, 1, out); + + zzip_entry_fclose (file); + } +} + +int +main (int argc, char ** argv) +{ + int argn; + FILE* disk; + + if (argc <= 1 || ! strcmp (argv[1], "--help")) + { + printf (usage); + return 0; + } + if (! strcmp (argv[1], "--version")) + { + printf (__FILE__" version "ZZIP_PACKAGE" "ZZIP_VERSION"\n"); + return 0; + } + + disk = fopen (argv[1], "r"); + if (! disk) { + perror(argv[1]); + return -1; + } + + if (argc == 2) + { /* print directory list */ + ZZIP_ENTRY* entry = zzip_entry_findfirst(disk); + if (! entry) puts("no first entry!\n"); + for (; entry ; entry = zzip_entry_findnext(entry)) + { + char* name = zzip_entry_strdup_name (entry); + printf ("%s\n", name); + free (name); + } + return 0; + } + + if (argc == 3) + { /* list from one spec */ + ZZIP_ENTRY* entry = 0; + while ((entry = zzip_entry_findmatch(disk, argv[2], entry, 0, 0))) + zzip_entry_fprint (entry, stdout); + + return 0; + } + + for (argn=1; argn < argc; argn++) + { /* list only the matching entries - each in order of commandline */ + ZZIP_ENTRY* entry = zzip_entry_findfirst(disk); + for (; entry ; entry = zzip_entry_findnext(entry)) + { + char* name = zzip_entry_strdup_name (entry); + if (! fnmatch (argv[argn], name, + FNM_NOESCAPE|FNM_PATHNAME|FNM_PERIOD)) + zzip_cat_file (disk, name, stdout); + free (name); + } + } + return 0; +} + +/* + * Local variables: + * c-file-style: "stroustrup" + * End: + */ diff --git a/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzzipcat.c b/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzzipcat.c new file mode 100644 index 00000000000..4282cb36be9 --- /dev/null +++ b/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzzipcat.c @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2003 Guido Draheim <guidod@gmx.de> + * Use freely under the restrictions of the ZLIB license. + * + * This file is used as an example to clarify zzipmmap api usage. + */ + +#include <zzip/mmapped.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#ifdef ZZIP_HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifdef ZZIP_HAVE_IO_H +#include <io.h> +#endif + +#ifdef ZZIP_HAVE_FNMATCH_H +#include <fnmatch.h> +#else +#define fnmatch(x,y,z) strcmp(x,y) +#endif + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +static const char usage[] = +{ + "unzzipdir <zip> [names].. \n" + " - unzzip data content of files contained in a zip archive.\n" +}; + +static void zzip_disk_entry_fprint(ZZIP_DISK* disk, + ZZIP_DISK_ENTRY* entry, FILE* out) +{ + ZZIP_DISK_FILE* file = zzip_disk_entry_fopen (disk, entry); + if (file) + { + char buffer[1024]; int len; + while ((len = zzip_disk_fread (buffer, 1024, 1, file))) + fwrite (buffer, len, 1, out); + + zzip_disk_fclose (file); + } +} + +static void zzip_disk_cat_file(ZZIP_DISK* disk, char* name, FILE* out) +{ + ZZIP_DISK_FILE* file = zzip_disk_fopen (disk, name); + if (file) + { + char buffer[1024]; int len; + while ((len = zzip_disk_fread (buffer, 1, 1024, file))) + { + fwrite (buffer, 1, len, out); + } + + zzip_disk_fclose (file); + } +} + +int +main (int argc, char ** argv) +{ + int argn; + ZZIP_DISK* disk; + + if (argc <= 1 || ! strcmp (argv[1], "--help")) + { + printf (usage); + return 0; + } + if (! strcmp (argv[1], "--version")) + { + printf (__FILE__" version "ZZIP_PACKAGE" "ZZIP_VERSION"\n"); + return 0; + } + + disk = zzip_disk_open (argv[1]); + if (! disk) { + perror(argv[1]); + return -1; + } + + if (argc == 2) + { /* print directory list */ + ZZIP_DISK_ENTRY* entry = zzip_disk_findfirst(disk); + for (; entry ; entry = zzip_disk_findnext(disk, entry)) + { + char* name = zzip_disk_entry_strdup_name (disk, entry); + printf ("%s\n", name); + free (name); + } + return 0; + } + + if (argc == 3) + { /* list from one spec */ + ZZIP_DISK_ENTRY* entry = 0; + while ((entry = zzip_disk_findmatch(disk, argv[2], entry, 0, 0))) + zzip_disk_entry_fprint (disk, entry, stdout); + + return 0; + } + + for (argn=1; argn < argc; argn++) + { /* list only the matching entries - each in order of commandline */ + ZZIP_DISK_ENTRY* entry = zzip_disk_findfirst(disk); + for (; entry ; entry = zzip_disk_findnext(disk, entry)) + { + char* name = zzip_disk_entry_strdup_name (disk, entry); + if (! fnmatch (argv[argn], name, + FNM_NOESCAPE|FNM_PATHNAME|FNM_PERIOD)) + zzip_disk_cat_file (disk, name, stdout); + free (name); + } + } + return 0; +} + +/* + * Local variables: + * c-file-style: "stroustrup" + * End: + */ diff --git a/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzzipdir-mem.c b/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzzipdir-mem.c new file mode 100644 index 00000000000..dc020772309 --- /dev/null +++ b/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzzipdir-mem.c @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2003 Guido Draheim <guidod@gmx.de> + * Use freely under the restrictions of the ZLIB license. + * + * This file is used as an example to clarify zzipmmap api usage. + */ + +#include <zzip/memdisk.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#ifdef ZZIP_HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifdef ZZIP_HAVE_IO_H +#include <io.h> +#endif + +#ifdef ZZIP_HAVE_FNMATCH_H +#include <fnmatch.h> +#else +#define fnmatch(x,y,z) strcmp(x,y) +#endif + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +static const char usage[] = +{ + "unzzipdir <zip> [names].. \n" + " - unzzip a listing of files contained in a zip archive.\n" +}; + +int +main (int argc, char ** argv) +{ + int argn; + ZZIP_MEM_DISK* disk; + + if (argc <= 1 || ! strcmp (argv[1], "--help")) + { + printf (usage); + return 0; + } + if (! strcmp (argv[1], "--version")) + { + printf (__FILE__" version "ZZIP_PACKAGE" "ZZIP_VERSION"\n"); + return 0; + } + + disk = zzip_mem_disk_open (argv[1]); + if (! disk) { + perror(argv[1]); + return -1; + } + + if (argc == 2) + { /* list all */ + ZZIP_MEM_ENTRY* entry = zzip_mem_disk_findfirst(disk); + for (; entry ; entry = zzip_mem_disk_findnext(disk, entry)) + { + char* name = zzip_mem_entry_to_name (entry); + printf ("%s\n", name); + } + return 0; + } + + if (argc == 3) + { /* list from one spec */ + ZZIP_MEM_ENTRY* entry = 0; + while ((entry = zzip_mem_disk_findmatch(disk, argv[2], entry, 0, 0))) + { + char* name = zzip_mem_entry_to_name (entry); + printf ("%s\n", name); + } + return 0; + } + + { /* list only the matching entries - in order of zip directory */ + ZZIP_MEM_ENTRY* entry = zzip_mem_disk_findfirst(disk); + for (; entry ; entry = zzip_mem_disk_findnext(disk, entry)) + { + char* name = zzip_mem_entry_to_name (entry); + for (argn=1; argn < argc; argn++) + { + if (! fnmatch (argv[argn], name, + FNM_NOESCAPE|FNM_PATHNAME|FNM_PERIOD)) + printf ("%s\n", name); + } + } + return 0; + } +} + +/* + * Local variables: + * c-file-style: "stroustrup" + * End: + */ diff --git a/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzzipdir.c b/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzzipdir.c new file mode 100644 index 00000000000..3c570c5548f --- /dev/null +++ b/Build/source/libs/zziplib/zziplib-0.13.59/bins/unzzipdir.c @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2003 Guido Draheim <guidod@gmx.de> + * Use freely under the restrictions of the ZLIB license. + * + * This file is used as an example to clarify zzipmmap api usage. + */ + +#include <zzip/mmapped.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#ifdef ZZIP_HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifdef ZZIP_HAVE_IO_H +#include <io.h> +#endif + +#ifdef ZZIP_HAVE_FNMATCH_H +#include <fnmatch.h> +#else +#define fnmatch(x,y,z) strcmp(x,y) +#endif + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +static const char usage[] = +{ + "unzzipdir <zip> [names].. \n" + " - unzzip a listing of files contained in a zip archive.\n" +}; + +int +main (int argc, char ** argv) +{ + int argn; + ZZIP_DISK* disk; + + if (argc <= 1 || ! strcmp (argv[1], "--help")) + { + printf (usage); + return 0; + } + if (! strcmp (argv[1], "--version")) + { + printf (__FILE__" version "ZZIP_PACKAGE" "ZZIP_VERSION"\n"); + return 0; + } + + disk = zzip_disk_open (argv[1]); + if (! disk) { + perror(argv[1]); + return -1; + } + + if (argc == 2) + { /* list all */ + ZZIP_DISK_ENTRY* entry = zzip_disk_findfirst(disk); + for (; entry ; entry = zzip_disk_findnext(disk, entry)) + { + char* name = zzip_disk_entry_strdup_name (disk, entry); + printf ("%s\n", name); + free (name); + } + return 0; + } + + if (argc == 3) + { /* list from one spec */ + ZZIP_DISK_ENTRY* entry = 0; + while ((entry = zzip_disk_findmatch(disk, argv[2], entry, 0, 0))) + { + char* name = zzip_disk_entry_strdup_name (disk, entry); + printf ("%s\n", name); + free (name); + } + return 0; + } + + { /* list only the matching entries - in order of zip directory */ + ZZIP_DISK_ENTRY* entry = zzip_disk_findfirst(disk); + for (; entry ; entry = zzip_disk_findnext(disk, entry)) + { + char* name = zzip_disk_entry_strdup_name (disk, entry); + for (argn=1; argn < argc; argn++) + { + if (! fnmatch (argv[argn], name, + FNM_NOESCAPE|FNM_PATHNAME|FNM_PERIOD)) + printf ("%s\n", name); + } + free (name); + } + return 0; + } +} + +/* + * Local variables: + * c-file-style: "stroustrup" + * End: + */ diff --git a/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzcat.c b/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzcat.c new file mode 100644 index 00000000000..27225820784 --- /dev/null +++ b/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzcat.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2000,2001,2002 Guido Draheim <guidod@gmx.de> + * Use freely under the restrictions of the ZLIB License + */ + +#include <zzip/zzip.h> +#include <stdio.h> +#include <string.h> + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +static const char usage[] = +{ + " zzcat <file>... \n" + " - prints the file to stdout, so you may want to redirect the output; \n" + " the file can be a normal file or an inflated part of a zip-archive, \n" + " to get 'README' from dist.zip you may write \n" + " zzcat dist/README \n" +}; + +int +main (int argc, char ** argv) +{ + int argn; + + if (argc <= 1 || ! strcmp (argv[1], "--help")) + { + printf (usage); + return 0; + } + if (! strcmp (argv[1], "--version")) + { + printf (__FILE__" version "ZZIP_PACKAGE" "ZZIP_VERSION"\n"); + return 0; + } + + for (argn=1; argn < argc; argn++) + { + ZZIP_FILE* fp = zzip_open (argv[argn], O_RDONLY|O_BINARY); + + if (! fp) + { + perror (argv[argn]); + continue; + }else{ + char buf[17]; + int n; + + /* read chunks of 16 bytes into buf and print them to stdout */ + while (0 < (n = zzip_read(fp, buf, 16))) + { + buf[n] = '\0'; +# ifdef STDOUT_FILENO + write (STDOUT_FILENO, buf, n); +# else + fwrite (buf, 1, n, stdout); +# endif + } + + if (n == -1) + perror (argv[argn]); + } + } + + return 0; +} + +/* + * Local variables: + * c-file-style: "stroustrup" + * End: + */ diff --git a/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzdir.c b/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzdir.c new file mode 100644 index 00000000000..5345f0852da --- /dev/null +++ b/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzdir.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2000,2001,2002 Guido Draheim <guidod@gmx.de> + * Use freely under the restrictions of the ZLIB license. + */ + +#include <zzip/zzip.h> +#include <stdio.h> +#include <string.h> + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +static const char usage[] = +{ + "zzdir <dir>.. \n" + " - prints a content table to stdout, but the dir can also be a zip-arch." + "\n" + " To show the contents of a zip-archive named 'test.zip', you may write \n" + " zzdir test \n" +}; + +int +main (int argc, char ** argv) +{ + int argn; + int exitcode = 0; + + if (argc <= 1 || ! strcmp (argv[1], "--help")) + { + printf (usage); + return 0; + } + if (! strcmp (argv[1], "--version")) + { + printf (__FILE__" version "ZZIP_PACKAGE" "ZZIP_VERSION"\n"); + return 0; + } + + for (argn=1; argn < argc; argn++) + { + ZZIP_DIR * dir; + ZZIP_DIRENT * d; + + dir = zzip_opendir(argv[argn]); + if (! dir) + { + fprintf (stderr, "did not open %s: ", argv[argn]); + perror(argv[argn]); + exitcode++; + continue; + } + + if (argc > 2) printf ("%s: \n", argv[argn]); + + /* read each dir entry and show one line of info per file */ + while ((d = zzip_readdir (dir))) + { + /* orignalsize / compression-type / compression-ratio / filename */ + if (d->st_size > 999999) + { + printf ("%5dK %-9s %2d%% %s \n", + d->st_size>>10, + zzip_compr_str(d->d_compr), + 100 - (d->d_csize|1)/((d->st_size/100)|1), + d->d_name); + }else{ + printf ("%6d %-9s %2d%% %s \n", + d->st_size, + zzip_compr_str(d->d_compr), + 100 - (d->d_csize|1)*100/(d->st_size|1), + d->d_name); + } + } + + zzip_closedir(dir); + } + + return exitcode; +} + +/* + * Local variables: + * c-file-style: "stroustrup" + * End: + */ diff --git a/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzip.c b/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzip.c new file mode 100644 index 00000000000..a1e990c3907 --- /dev/null +++ b/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzip.c @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2003 Guido Draheim <guidod@gmx.de> + * Use freely under the restrictions of the ZLIB license. + * + * This file is used as an example to clarify zzip api usage. + * (the write-api is work in progress, beware) + */ + +#define _ZZIP_WRITE_SOURCE + +#include <zzip/write.h> +#include <stdio.h> +#include <string.h> + +#ifdef ZZIP_HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifdef ZZIP_HAVE_IO_H +#include <io.h> +#endif + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +static const char usage[] = +{ + "zzip <dir> files... \n" + " - zzip the files into a zip area." +}; + +int +main (int argc, char ** argv) +{ + int argn; + int exitcode = 0; + ZZIP_DIR * dir; + + if (argc <= 1 || ! strcmp (argv[1], "--help")) + { + printf (usage); + return 0; + } + if (! strcmp (argv[1], "--version")) + { + printf (__FILE__" version "ZZIP_PACKAGE" "ZZIP_VERSION"\n"); + return 0; + } + + dir = zzip_dir_creat(argv[1], 0755); + if (! dir) + { + fprintf (stderr, "did not creat %s: \n", argv[1]); + perror(argv[1]); + if (1) + return 1; + else + fprintf (stderr, "(ignored)\n"); + } + + for (argn=2; argn < argc; argn++) + { + int input = open (argv[argn], O_RDONLY); + if (input == -1) + { + perror (argv[argn]); + continue; + } + else + { + char buf[17]; zzip_ssize_t n; + ZZIP_FILE* output = zzip_file_creat (dir, argv[argn], 0755); + if (! output) + { + fprintf (stderr, "|did not open %s: \n", argv[argn]); + fprintf (stderr, "|%s: %s\n", argv[argn], + zzip_strerror_of(dir)); + continue; + } + + while ((n = read (input, buf, 16))) + { + zzip_write (output, buf, n); + } + zzip_close (output); + } + close (input); + } + zzip_closedir(dir); + + return exitcode; +} + +/* + * Local variables: + * c-file-style: "stroustrup" + * End: + */ diff --git a/Build/source/libs/zziplib/zziplib-0.13.59/bins/zziplib.m4 b/Build/source/libs/zziplib/zziplib-0.13.59/bins/zziplib.m4 new file mode 100644 index 00000000000..4029ca546e3 --- /dev/null +++ b/Build/source/libs/zziplib/zziplib-0.13.59/bins/zziplib.m4 @@ -0,0 +1,105 @@ +dnl this macro has been copied from /usr/share/aclocal/pkg.m4 +dnl modified to check only for zziplib. You are advised to use +dnl pgkconfig macro directly instead. It is only installed to +dnl the convenience of software makers who do not want to have +dnl yet another package dependency when building zziplib-based +dnl projects. In general, you can include in your configure.ac +dnl some line like +dnl PKG_CHECK_ZZIPLIB([ZZIP],[0.10.75]) +dnl in order to get the two autoconf/automake subst variables +dnl named ZZIP_CFLAGS and ZZIP_LIBS respectivly. + +dnl PKG_CHECK_ZZIPLIB(ZZIP, minversion, action-if, action-not) +dnl defines ZZIP_LIBS, ZZIP_CFLAGS, see pkg-config man page +dnl also defines ZZIP_PKG_ERRORS on error +AC_DEFUN([PKG_CHECK_ZZIPLIB], [# checking for zziplib cflags/libs $2 + succeeded=no + + if test -z "$PKG_CONFIG"; then + AC_PATH_PROG([PKG_CONFIG],[pkg-config],[no]) + fi + + if test "$PKG_CONFIG" = "no" ; then + dnl we stick in an extra section that takes advantage of `zzip-config` + dnl script that might be there and carry cflags/libs info as well. + AC_PATH_PROG([ZZIP_CONFIG], [zzip-config], [no]) + if test "$ZZIP_CONFIG" = "no" ; then + echo "*** Neither config spec could be found - there was no archaic" + echo "*** zzip-config script around and no pkg-config script in the" + echo "*** PATH. Make sure that either one is in your path, or set" + echo "*** set the PKG_CONFIG environment variable to the full" + echo "*** path to pkg-config. See http://zziplib.sf.net - or see" + echo "*** http://www.freedesktop.org/software/pkgconfig for more." + else + AC_MSG_CHECKING($1_LIBS) + $1_LIBS=`$ZZIP_CONFIG --libs 2>/dev/null` + AC_MSG_RESULT($[]$1_LIBS) + + if test ".$[]$1_LIBS" != "." ; then + AC_MSG_CHECKING($1_CFLAGS) + $1_CFLAGS=`$ZZIP_CONFIG --cflags 2>/dev/null` + AC_MSG_RESULT($[]$1_CFLAGS) + succeeded="yes" + else + AC_MSG_CHECKING($1_CFLAGS) + $1_CFLAGS=`$ZZIP_CONFIG --cflags 2>&1` + AC_MSG_RESULT([(detecting errors...)]) + AC_MSG_WARN([... there is a problem with zzip-config]) + AC_MSG_WARN([... $[]$1_CFLAGS]) + AC_MSG_WARN([... inference of library requirements from prefix]) + succeeded=`echo $ZZIP_CONFIG | sed -e 's,/[^/]*,,'` # dirname + $1_CFLAGS="" + $1_LIBS="" + if test "/$succeeded" != "//usr" ; then + test -d "$succeeded/include" && $1_CFLAGS="-I$succeeded/include " + test -d "$succeeded/lib" && $1_LIBS="-L$succeeded/lib " + fi + $1_LIBS="$[]$1_LIBS -lzzip -lz" + succeeded="yes" + AC_MSG_CHECKING($1_CFLAGS... guessed) + AC_MSG_RESULT($[]$1_CFLAGS) + AC_MSG_CHECKING($1_LIBS... guessed) + AC_MSG_RESULT($[]$1_LIBS) + fi + fi + else + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + AC_MSG_CHECKING(for zziplib[]ifelse([$2],,,[ >= $2])) + + if $PKG_CONFIG --exists "zziplib[]ifelse([$2],,,[ >= $2])" ; then + AC_MSG_RESULT(yes) + succeeded=yes + + AC_MSG_CHECKING($1_CFLAGS) + $1_CFLAGS=`$PKG_CONFIG --cflags "zziplib[]ifelse([$2],,,[ >= $2])"` + AC_MSG_RESULT($$1_CFLAGS) + + AC_MSG_CHECKING($1_LIBS) + $1_LIBS=`$PKG_CONFIG --libs "zziplib[]ifelse([$2],,,[ >= $2])"` + AC_MSG_RESULT($$1_LIBS) + else + $1_CFLAGS="" + $1_LIBS="" + ## If we have a custom action on failure, don't print errors, but + ## do set a variable so people can do so. + $1_PKG_ERRORS=`$PKG_CONFIG dnl + --errors-to-stdout --print-errors "zziplib[]ifelse([$2],,,[ >= $2])"` + ifelse([$4], ,echo $$1_PKG_ERRORS,) + fi + + AC_SUBST($1_CFLAGS) + AC_SUBST($1_LIBS) + else + echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." + echo "*** See http://www.freedesktop.org/software/pkgconfig" + fi + fi + + if test $succeeded = yes; then + ifelse([$3], , :, [$3]) + else + succeeded="zziplib[]ifelse([$2],,,[ >= $2])" + ifelse([$4], ,[AC_MSG_ERROR([Library requirements ($succeeded) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.])], [$4]) + fi +]) diff --git a/Build/source/libs/zziplib/zziplib-0.13.59/bins/zziptest.c b/Build/source/libs/zziplib/zziplib-0.13.59/bins/zziptest.c new file mode 100644 index 00000000000..2fde5d27bcf --- /dev/null +++ b/Build/source/libs/zziplib/zziplib-0.13.59/bins/zziptest.c @@ -0,0 +1,153 @@ +/* + * Author: + * Guido Draheim <guidod@gmx.de> + * Tomi Ollila <Tomi.Ollila@iki.fi> + * + * Copyright (c) 1999,2000,2001,2002,2003 Guido Draheim + * All rights reserved, + * use under the restrictions of the + * Lesser GNU General Public License + * or alternatively the restrictions + * of the Mozilla Public License 1.1 + */ + +#include <stdio.h> +#include <string.h> + +#include <zzip/lib.h> + +#if defined ZZIP_HAVE_WINDOWS_H +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#define sleep Sleep +#endif + +#ifdef ZZIP_HAVE_UNISTD_H +#include <unistd.h> /* sleep */ +#endif + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +#if __GNUC__+0 >= 3 && __GNUC_MINOR__+0 >= 3 +# ifdef DEBUG +# warning suppress a warning where the compiler should have optimized instead. +# endif +#define I_(_T,_L,_R) do { _T _l = (_T) _L; \ + _l _R; _L = (typeof(_L)) _l; } while(0) +#else +#define I_(_T,_L,_R) _L _R +#endif + +int main(int argc, char ** argv) +{ + ZZIP_DIR * dir; + const char * name = "test.zip"; + zzip_error_t rv; + int i; + + if (argc > 1 && argv[1] != NULL) + { + if (! strcmp (argv[1], "--help")) { + printf ("zziptest [testfile]\n - selftest defaults to 'test.zip'"); + return 0; + }else if (! strcmp (argv[1], "--version")) { + printf (__FILE__" version "ZZIP_PACKAGE" "ZZIP_VERSION"\n"); + return 0; + }else{ + name = argv[1]; + argv++; argc--; + } + } + + printf("Opening zip file `%s'... ", name); + { int fd = open (name, O_RDONLY|O_BINARY); + if (fd == -1) { perror ("could not open input file"); return 0; } + if (! (dir = zzip_dir_fdopen(fd, &rv))) + { + printf("error %d.\n", rv); + return 0; + } + } printf("OK.\n"); + +#if 1 + printf("{check...\n"); + { struct zzip_dir_hdr * hdr = dir->hdr0; + + if (hdr == NULL) + { printf ("could not find first header in dir_hdr"); } + else + { + while (1) + { + printf("\ncompression method: %d", hdr->d_compr); + if (hdr->d_compr == 0) printf(" (stored)"); + else if (hdr->d_compr == 8) printf(" (deflated)"); + else printf(" (unknown)"); + printf("\ncrc32: %x\n", hdr->d_crc32); + printf("compressed size: %d\n", hdr->d_csize); + printf("uncompressed size: %d\n", hdr->d_usize); + printf("offset of file in archive: %d\n", hdr->d_off); + printf("filename: %s\n\n", hdr->d_name); + + if (hdr->d_reclen == 0) break; + I_(char *, hdr, += hdr->d_reclen); + sleep(1); + } + } + } printf ("\n}\n"); +#endif +#if 1 + { printf("{contents...\n"); + for (i = 0; i < 2; i++) + { + ZZIP_DIRENT* d; + + while((d=zzip_readdir(dir))) + { + printf(" name \"%s\", compr %d, size %d, ratio %2d\n", + d->d_name, d->d_compr, d->st_size, + 100 - (d->d_csize|1)*100/(d->st_size|1)); + } + printf(" %d. time ---------------\n", i + 1); + zzip_rewinddir(dir); + } + printf("}...OK\n"); + } +#endif + + { ZZIP_FILE * fp; + char buf[17]; + const char * name = argv[1]? argv[1]: "README"; + + + printf("Opening file `%s' in zip archive... ", name); + fp = zzip_file_open(dir, (char *)name, ZZIP_CASEINSENSITIVE); + + if (! fp) + { printf("error %d: %s\n", zzip_error(dir), zzip_strerror_of(dir)); } + else + { + printf("OK.\n"); + printf("Contents of the file:\n"); + + while (0 < (i = zzip_file_read(fp, buf, 16))) + { + buf[i] = '\0'; + /*printf("\n*** read %d ***\n", i); fflush(stdout); */ + printf("%s", buf); + /*write(1, buf, i);*/ /* Windows does not have write !!! */ + } + if (i < 0) printf("error %d\n", zzip_error(dir)); + } + } + + return 0; +} + +/* + * Local variables: + * c-file-style: "stroustrup" + * End: + */ diff --git a/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzobfuscated.c b/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzobfuscated.c new file mode 100644 index 00000000000..352afc29a13 --- /dev/null +++ b/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzobfuscated.c @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2002 Mike Nordell + * portions Copyright (c) 2000,2001,2002 Guido Draheim <guidod@gmx.de> + * Use freely under the restrictions of the ZLIB License + * + * A small example that displays how the plugin I/O functions can be used + * to read "encrypted" zip archives. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/stat.h> +#include <zzip/zzip.h> +#include <zzip/plugin.h> + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +#if defined ZZIP_HAVE_UNISTD_H +#include <unistd.h> /* read */ +#elif defined ZZIP_HAVE_IO_H +#include <io.h> /* win32 */ +#else +#endif + +#ifdef _MSC_VER +#define _MSC_VER_NULL NULL +#else +#define _MSC_VER_NULL +#endif + +/* + * Only override our the read handler. Let the system take care + * the rest. + */ + +static zzip_ssize_t our_read(int fd, void* buf, zzip_size_t len) +{ + const zzip_ssize_t bytes = read(fd, buf, len); + zzip_ssize_t i; + char* pch = (char*)buf; + for (i=0; i<bytes; ++i) { + pch[i] ^= 0x55; + } + return bytes; +} + +static zzip_plugin_io_handlers our_handlers = { _MSC_VER_NULL }; +static const char* const our_fileext [] = { ".dat", ".sav", 0 }; + + +static const char usage[] = +{ + " zzobfuscated <file> [in-zip filename]\n" + " - Demonstrates the use of installable file I/O handlers.\n" + " Copies <file> to \"obfuscated[.dat]\" while \"encrypting\" it by xor'ing\n" + " every byte with 0x55, installs file I/O handlers, and then uses the\n" + " zzip_open_ext_io function to read and print the file to stdout.\n" + " The file can be a normal file or an inflated part of a zip-archive,\n" + " to get 'README' from test.zip you may write \n" + " zzobfuscated test.zip README \n" +}; + +int +main (int argc, char* argv[]) +{ + if (argc <= 1 || argc > 3 || ! strcmp (argv[1], "--help")) + { + printf (usage); + return 0; + } + if (! strcmp (argv[1], "--version")) + { + printf (__FILE__" version "ZZIP_PACKAGE" "ZZIP_VERSION"\n"); + return 0; + } + + if (strlen(argv[1]) > 128) { + fprintf(stderr, "Please provide a filename shorter than 128 chars.\n"); + exit(1); + } + + /* obfuscate the file */ + { + int ch; + FILE* fin; + FILE* fout; + fin = fopen(argv[1], "rb"); + if (!fin) { + fprintf(stderr, "Can't open input file \"%s\"\n", argv[1]); + exit(1); + } + fout = fopen((argc == 2) ? "obfuscated" : "obfuscated.dat", "wb"); + if (!fout) { + fprintf(stderr, "Can't open output file \"obfuscated\"\n"); + exit(1); + } + while ((ch = fgetc(fin)) != EOF) { + ch ^= 0x55; + fputc(ch, fout); + } + fclose(fout); + fclose(fin); + } + + /* install our I/O hander */ + zzip_init_io(&our_handlers, 0); + our_handlers.fd.read = &our_read; + + { +# define argn 2 + ZZIP_FILE* fp; + char name[256]; + if (argc == 3) { + sprintf(name, "obfuscated/%s", argv[argn]); + } else { + sprintf(name, "obfuscated"); + } + fp = zzip_open_ext_io (name, O_RDONLY|O_BINARY, ZZIP_PREFERZIP, + our_fileext, &our_handlers); + + if (! fp) + { + perror (name); + exit(1); + }else{ + char buf[17]; + int n; + + /* read chunks of 16 bytes into buf and print them to stdout */ + while (0 < (n = zzip_read(fp, buf, 16))) + { + buf[n] = '\0'; +# ifdef STDOUT_FILENO + write (STDOUT_FILENO, buf, n); +# else + fwrite (buf, 1, n, stdout); +# endif + } + + if (n == -1) + perror (argv[argn]); + } + } + + return 0; +} + +/* + * Local variables: + * c-file-style: "stroustrup" + * End: + */ diff --git a/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzxorcat.c b/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzxorcat.c new file mode 100644 index 00000000000..97fcd51fd32 --- /dev/null +++ b/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzxorcat.c @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2000,2001,2002 Guido Draheim <guidod@gmx.de> + * Use freely under the restrictions of the ZLIB License + * + * show zip-reading with xor-obfuscation. + * Note that the difference to the standard zzcat.c is quite small. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <zzip/zzip.h> +#include <zzip/plugin.h> + +#if defined ZZIP_HAVE_UNISTD_H +#include <unistd.h> +#elif defined ZZIP_HAVE_IO_H +#include <io.h> +#else +#error need posix io for this example +#endif + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +static const char usage[] = +{ + " zzxorcat [-#] <file>... \n" + " - prints the file to stdout, so you may want to redirect the output; \n" + " the file is part of an inflated zip-archive obfuscated with xor value,\n" + " given by the numeric option (default is 0x55). \n" + " to get 'README' from dist.dat you may write \n" + " zzcat dist/README \n" +}; + +static int xor_value; + +static zzip_ssize_t xor_read (int f, void* p, zzip_size_t l) +{ + zzip_ssize_t r = read(f, p, l); + zzip_ssize_t x; char* q; for (x=0, q=p; x < r; x++) q[x] ^= xor_value; + return r; +} + +static zzip_plugin_io_handlers xor_handlers; +static zzip_strings_t xor_fileext[] = { ".dat", "", 0 }; + +int +main (int argc, char ** argv) +{ + int argn; + xor_value = 0x55; + + if (argc <= 1 || ! strcmp (argv[1], "--help")) + { + printf (usage); + return 0; + } + if (! strcmp (argv[1], "--version")) + { + printf (__FILE__" version "ZZIP_PACKAGE" "ZZIP_VERSION"\n"); + return 0; + } + + zzip_init_io (&xor_handlers, 0); xor_handlers.fd.read = &xor_read; + + for (argn=1; argn < argc; argn++) + { + ZZIP_FILE* fp; + + if (argv[argn][0] == '-') + { + if (isdigit(argv[argn][1])) xor_value = atoi (argv[argn]+1); + continue; + } + + fp = zzip_open_ext_io (argv[argn], O_RDONLY|O_BINARY, + ZZIP_CASELESS|ZZIP_ONLYZIP, + xor_fileext, &xor_handlers); + if (! fp) + { + perror (argv[argn]); + continue; + }else{ + char buf[17]; + zzip_ssize_t n; + + /* read chunks of 16 bytes into buf and print them to stdout */ + while (0 < (n = zzip_read(fp, buf, 16))) + { + buf[n] = '\0'; +# ifdef STDOUT_FILENO + write (STDOUT_FILENO, buf, n); +# else + fwrite (buf, 1, n, stdout); +# endif + } + + if (n == -1) + perror (argv[n]); + } + } + + return 0; +} + +/* + * Local variables: + * c-file-style: "stroustrup" + * End: + */ diff --git a/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzxorcopy.c b/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzxorcopy.c new file mode 100644 index 00000000000..1c06e534126 --- /dev/null +++ b/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzxorcopy.c @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2000,2001,2002 Guido Draheim <guidod@gmx.de> + * Use freely under the restrictions of the ZLIB License + * + * show a simple program to add xor-obfuscation. + * look at the resulting file with zzxordir an zzxorcat + * Remember that xor'ing data twice will result in the original data. + * This file has no dependency with zziplib - it's freestanding. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ctype.h> + +#include <zzip/_config.h> /* for ZZIP_VERSION */ + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +#if __STDC_VERSION__+0 < 199901 +#define _ssize_t int +#define _size_t unsigned +#else +#define _ssize_t ssize_t +#define _size_t size_t +#endif + +static const char usage[] = +{ + " zzxopy [-#] <input-file> <output-file> \n" + " copies data from input-file to output-file adding simple \n" + " obfuscation by xor-ing each byte with the numeric value given. \n" + " the default xor-value is 0x55. Remember that copying data twice \n" + " with the same xor-value will result in the original file data. \n" +}; + +static int xor_value; + +static _ssize_t xor_read (FILE* f, void* p, _size_t l) +{ + _ssize_t r = fread(p, 1, l, f); + _ssize_t x; char* q; for (x=0, q=p; x < r; x++) q[x] ^= xor_value; + return r; +} + +int +main (int argc, char ** argv) +{ + int argn; + xor_value = 0x55; + + if (argc <= 1 || ! strcmp (argv[1], "--help")) + { + printf (usage); + return 0; + } + if (! strcmp (argv[1], "--version")) + { + printf (__FILE__" version "ZZIP_PACKAGE" "ZZIP_VERSION"\n"); + return 0; + } + + for (argn=1; argn < argc; argn++) + { + FILE* iF = 0; + FILE* oF = 0; + + if (argv[argn][0] == '-') + { + if (isdigit(argv[argn][1])) xor_value = atoi (argv[argn]+1); + continue; + } + + if (argn + 1 >= argc) + { + printf (usage); + exit (1); + } + + iF = fopen (argv[argn], "rb"); + if (! iF) { perror (argv[argn]); exit (2); } + argn++; + oF = fopen (argv[argn], "wb"); + if (! oF) { perror (argv[argn]); fclose(iF); exit (3); } + + { + char buf[17]; + _ssize_t n; + + /* read chunks of 16 bytes into buf and print them to stdout */ + while (0 < (n = xor_read(iF, buf, 16))) + { + buf[n] = '\0'; + n = fwrite (buf, 1, n, oF); + if (n < 0) break; + } + + if (n < 0 && ferror (iF)) + perror (argv[argn]); + } + } + + return 0; +} + +/* + * Local variables: + * c-file-style: "stroustrup" + * End: + */ diff --git a/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzxordir.c b/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzxordir.c new file mode 100644 index 00000000000..c1e1f141446 --- /dev/null +++ b/Build/source/libs/zziplib/zziplib-0.13.59/bins/zzxordir.c @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2000,2001,2002 Guido Draheim <guidod@gmx.de> + * Use freely under the restrictions of the ZLIB license. + * + * show zip-reading with xor-obfuscation. + * Note that the difference to the standard zzdir.c is quite small. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ctype.h> + +#include <zzip/zzip.h> +#include <zzip/plugin.h> + +#if defined ZZIP_HAVE_UNISTD_H +#include <unistd.h> +#elif defined ZZIP_HAVE_IO_H +#include <io.h> +#else +#error need posix io for this example +#endif + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +static const char usage[] = +{ + "zzdir <dir>.. \n" + " - prints a content table to stdout, but the dir can also be a zip-arch." + "\n" + " the file is part of an inflated zip-archive obfuscated with xor value,\n" + " given by the numeric option (default is 0x55). \n" + "\n" + " To show the contents of a zip-archive named 'test.zip', you may write \n" + " zzdir test \n" +}; + +static int xor_value; + +static zzip_ssize_t xor_read (int f, void* p, zzip_size_t l) +{ + zzip_ssize_t r = read(f, p, l); + zzip_ssize_t x; char* q; for (x=0, q=p; x < r; x++) q[x] ^= xor_value; + return r; +} + +static zzip_plugin_io_handlers xor_handlers = { }; +static zzip_strings_t xor_fileext[] = { ".dat", "", 0 }; + +int +main (int argc, char ** argv) +{ + int argn; + int exitcode = 0; + xor_value = 0x55; + + if (argc <= 1 || ! strcmp (argv[1], "--help")) + { + printf (usage); + return 0; + } + if (! strcmp (argv[1], "--version")) + { + printf (__FILE__" version "ZZIP_PACKAGE" "ZZIP_VERSION"\n"); + return 0; + } + + zzip_init_io (&xor_handlers, 0); xor_handlers.fd.read = &xor_read; + + for (argn=1; argn < argc; argn++) + { + ZZIP_DIR * dir; + ZZIP_DIRENT * d; + + if (argv[argn][0] == '-') + { + if (isdigit(argv[argn][1])) xor_value = atoi (argv[argn]+1); + continue; + } + + dir = zzip_opendir_ext_io(argv[argn], + ZZIP_ONLYZIP, xor_fileext, &xor_handlers); + if (! dir) + { + fprintf (stderr, "did not open %s: ", argv[argn]); + perror(argv[argn]); + exitcode++; + continue; + } + + if (argc > 2) printf ("%s: \n", argv[argn]); + + /* read each dir entry and show one line of info per file */ + while ((d = zzip_readdir (dir))) + { + /* orignalsize / compression-type / compression-ratio / filename */ + if (d->st_size > 999999) + { + printf ("%5dK %-9s %2d%% %s \n", + d->st_size>>10, + zzip_compr_str(d->d_compr), + 100 - (d->d_csize|1)/((d->st_size/100)|1), + d->d_name); + }else{ + printf ("%6d %-9s %2d%% %s \n", + d->st_size, + zzip_compr_str(d->d_compr), + 100 - (d->d_csize|1)*100/(d->st_size|1), + d->d_name); + } + } + + zzip_closedir(dir); + } + + return exitcode; +} + +/* + * Local variables: + * c-file-style: "stroustrup" + * End: + */ |