Commit bd8757b3 by Alexandre Petit-Bianco Committed by Alexandre Petit-Bianco

fastjar: Imported.

2000-12-08  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * fastjar: Imported.

From-SVN: r38145
parent 81522a1f
2000-12-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
* fastjar: Imported.
2000-12-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
* Makefile.in (TARGET_CONFIGDIRS): Wrong place. Removed note about
libjava.
* configure.in (target_libs): Removed `target-libjava'.
......
Bryan Burns and Cory Jon Hollingsworth.
0.92 08/24/2000 Improved support for other Unix platforms.
Now works on Solaris, AIX, True 64, and HP-UX.
Hopefully resolved all big endian problems.
Fixed bug in update which caused it to skip
openning update file
0.90 12/06/1999 Fixed recursive archival bug.
0.86 10/12/1999 Applied patch to fix leading "./" problem.
0.85 5/10/1999 The -t and -x flags now work. Hooray! Those
took quite a long time to get working.
Handling extraction/listing added quite a bit
of code, 500-1000 lines. ouch!
0.75 4/27/1999 Added support for -C flag, allowing you to
change directories before adding files. See
fastjar's usage screen for more info. Also
improved the total compression display, and
added install/uninstall targets to the
Makefile.
0.71 4/27/1999 Added -V flag to print version info. Added
better error messages, and added configure
script for better portability.
0.70 4/25/1999 Added compression. Only deflation is supported
at this time (only one jar supports) and is
enabled by default. use the -0 flag to disable
compression.
0.60 4/21/1999 Added support for manifest files (-m, -M).
Fixed bug with mod time/date in central header.
0.50.1 4/20/1999 Added patch from John Bley. (Fixes bug with
not properly closing the file)
0.50 4/20/1999 First public release
This diff is collapsed. Click to expand it.
Tue Nov 16 15:11:36 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
* Makefile.am: New file.
* Makefile.in: Rebuilt.
* aclocal.m4: Likewise.
* stamp-h.in: Likewise.
* config.h.in: Likewise.
* configure.in (AM_INIT_AUTOMAKE): Added.
(AM_CONFIG_HEADER): Likewise.
(AC_CHECK_HEADERS): Check for sys/param.h
(AC_CHECK_LIB): Don't check for system's zlib.
(AC_CHECK_FUNC): Removed system's zlib function checks.
(ZDEPS. ZLIBS, ZINCS): Added.
* configure: Rebuilt.
* jartool.c (sys/param.h): Conditionally included or define MAXPATHLEN.
(init_args, get_next_arg): New function.
(use_explicit_list_only, read_names_from_stdin): New global
(main): Parse new non standard options 'E' and '@', check and
report their usage if necessary. Use init_args and get_next_arg.
Fixed indentation.
(add_to_jar): Don't read directory content if `use_explicit_list_only'.
(usage): Added `-E' and `-@'.
* jartool.h (VERSION): Macro removed.
Tue Nov 14 15:10:44 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
* fastjar imported from sourceforge.net/projects/fastjar with
Bryan Burns' permission. Check `CHANGES' for post import changes.
* ChangeLog: Created.
* NEWS: Likewise.
* mkinstalldirs: Likewise.
* COPYING: Likewise.
* AUTHORS: Likewise.
----------------------
How to install fastjar
----------------------
1. Run the 'configure' script to generate config.h and Makefile. You can
use 'configure --help' to get a list of command-line options.
2. If you're feeling experimental, you can change some settings in jartool.h
to optimize fastjar for your particular system.
3. Type 'make' to create the fastjar binary.
4. Type 'make install' to install fastjar in whichever directory you supplied
to configure (or the default directory if you didn't specify one.)
# Generated automatically from Makefile.in by configure.
CFLAGS = -g -O2 -DHAVE_CONFIG_H
CC = gcc
INSTALL = /usr/bin/ginstall -c
prefix = /usr/local
exec_prefix = ${prefix}
BINARY = ${exec_prefix}/bin/fastjar
all: fastjar grepjar
fastjar: jartool.o dostime.o compress.o pushback.o
$(CC) -o $@ jartool.o dostime.o compress.o pushback.o -lz
grepjar: jargrep.o dostime.o compress.o pushback.o
$(CC) -o $@ jargrep.o dostime.o compress.o pushback.o -lz
install: fastjar
${INSTALL} -s -m 755 fastjar $(BINARY)
uninstall:
/bin/rm -f $(BINARY)
jartool.o: jartool.c dostime.c jartool.h zipfile.h dostime.h compress.h
jartool.c: jartool.h zipfile.h
dostime.o: dostime.c dostime.h
dostime.c: dostime.h
compress.o: compress.c compress.h
compress.c: compress.h
pushback.o: pushback.c pushback.h
pushback.c: pushback.h
jargrep.c: jargrep.h
jargrep.o: jargrep.c jargrep.h
clean:
rm -rf *.o *~ core fastjar
# Process this with automake to create Makefile.in
# Work around what appears to be a GNU make bug handling MAKEFLAGS
# values defined in terms of make variables, as is the case for CC and
# friends when we are called from the top level Makefile.
AM_MAKEFLAGS = \
"AR_FLAGS=$(AR_FLAGS)" \
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
"CFLAGS=$(CFLAGS)" \
"CXXFLAGS=$(CXXFLAGS)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
"INSTALL=$(INSTALL)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
"JC1FLAGS=$(JC1FLAGS)" \
"LDFLAGS=$(LDFLAGS)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
"MAKE=$(MAKE)" \
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
"PICFLAG=$(PICFLAG)" \
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
"SHELL=$(SHELL)" \
"exec_prefix=$(exec_prefix)" \
"infodir=$(infodir)" \
"libdir=$(libdir)" \
"prefix=$(prefix)" \
"AR=$(AR)" \
"AS=$(AS)" \
"CC=$(CC)" \
"CXX=$(CXX)" \
"LD=$(LD)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"NM=$(NM)" \
"PICFLAG=$(PICFLAG)" \
"RANLIB=$(RANLIB)" \
"DESTDIR=$(DESTDIR)"
INCLUDES = -I. -I$(top_srcdir) $(ZINCS)
bin_PROGRAMS = fastjar grepjar
fastjar_SOURCES = jartool.c dostime.c compress.c pushback.c jartool.h zipfile.h dostime.h compress.h pushback.h
fastjar_LDADD = $(ZLIBS)
fastjar_DEPENDENCIES = $(ZDEPS)
grepjar_SOURCES = jargrep.c dostime.c compress.c pushback.c jartool.h zipfile.h dostime.h compress.h pushback.h
grepjar_LDADD = $(ZLIBS)
grepjar_DEPENDENCIES = $(ZDEPS)
Noteworthy changes in fastjar, 11/2000
--------------------------------------
Fastjar as been imported from sourceforge.net/projects/fastjar with
Brian Burns' permission so that it can be used as a replacement to the
zip utility in order to create the libgcj.zip archive. Several missing
distribution files were created, most notably Makefile.am.
Two new options were added: `-E' to prevent fastjar from reading the
content of a directory when specifying one (and instead relying on the
provided list of files to populate the archive with regard to the
directory entry) and `-@' to let fastjar read the name of the files to
add to the archive from the standard input. This last option is
supported only when creating or augmenting an archive.
=======
FastJar 0.90
12/6/1999
=======
FastJar is an attempt at creating a feature-for-feature copy of Sun's JDK's
'jar' command. Sun's jar (or Blackdown's for that matter) is written entirely
in Java which makes it dog slow. Since FastJar is written in C, it can create
the same .jar file as Sun's tool in a fraction of the time. On my system,
Sun's jar takes 50 seconds to create a 10MB jar file, while FastJar only takes
a little over a second.
The reason I wrote fastjar is that building .jar files is a regular process
of the build where I work. The way we have it setup, you have to re-create
the .jar file everytime you want to test it out, which is about every 5 minutes
when I'm busy coding. The .jar file wasn't -that- big, but it did take about
30 seconds to be made, and watching all the garbage collection messages was
pretty irritating as well. I probably wasted a half-hour a day watching
Sun's jar tool chug along. By writing the program in C, I spend much less time
banging my head against the monitor waiting for the build to finish. Yay!
FastJar has been tested on Solaris and Linux 2.2.x systems and nothing else.
It should compile/run without any problems on either system, provided you have
zlib installed.
Please mail any bug reports to burnsbr@ucs.orst.edu.
If you use FastJar and want me to add the rest of the features, send me mail
(toast@users.sourceforge.net). I'll be much more likely to put more work into this
if I know other people find it useful other than me.
As always, this not being a final release, bugs may exist. I test each
release pretty well, but I can always miss things...
Compression will slow things down quite a bit. A 10MB jar file takes about
1 second on my machine without compression, and 9 seconds with it. If you
want fastjar to be fast, use the -0 (zero, not O) flag to turn off compression.
Supported flags:
--------------------------
-c | create a new archive
-v | verbose output
-f | specify archive file name
-m | specify existing manifest file
-M | don't create manifest
-0 | store only
-C | change to dir
-t | list contents
-x | extract contents
Unsupported flags:
----------------------------
-u | update exisiting archive
If you use the "unsupported" flags, nothing bad will happen, but then again
nothing will happen at all.
Unsupported features (in this release):
---------------------------------------------
* updating
* full manifest support (?)
Order or features for the future:
--------------------------------------------
* archive updating
* full manifest support
* filtering
* dependency checking
===========================================================================
http://fastjar.sourceforge.net
toast@users.sourceforge.net
dnl 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>>, <<[^ ]>>, <<>>), <<>>,
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
<<am_indx=1
for am_file in <<$1>>; 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([,]))])
/* $Id: compress.h,v 1.1.1.1 1999/12/06 03:09:12 toast Exp $
$Log: compress.h,v $
Revision 1.1.1.1 1999/12/06 03:09:12 toast
initial checkin..
Revision 1.3 1999/05/10 08:32:09 burnsbr
added new function protos.
Revision 1.2 1999/04/23 12:02:20 burnsbr
added licence
Revision 1.1 1999/04/23 11:59:37 burnsbr
Initial revision
*/
/*
compress.h - header for compression
Copyright (C) 1999 Bryan Burns
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* Initializes the compression data structure(s) */
void init_compression();
/* Compresses the file specified by in_fd and appends it to out_fd */
int compress_file(int in_fd, int out_fd, struct zipentry *ze);
/* Frees memory used by compression function */
void end_compression();
void init_inflation();
int inflate_file(pb_file *, int, struct zipentry *);
void end_inflation();
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define to `long' if <sys/types.h> doesn't define. */
#undef off_t
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if your <sys/time.h> declares struct tm. */
#undef TM_IN_SYS_TIME
/* Define if your processor stores words with the most significant
byte first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
/* The number of bytes in a char. */
#undef SIZEOF_CHAR
/* The number of bytes in a int. */
#undef SIZEOF_INT
/* The number of bytes in a long. */
#undef SIZEOF_LONG
/* The number of bytes in a long long. */
#undef SIZEOF_LONG_LONG
/* The number of bytes in a short. */
#undef SIZEOF_SHORT
/* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H
/* Define if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H
/* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H
/* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Name of package */
#undef PACKAGE
/* Version number of package */
#undef VERSION
dnl Process this file with autoconf to produce a configure script.
AC_INIT(jartool.h)
AM_INIT_AUTOMAKE(fastar, 0.92-gcc)
AM_CONFIG_HEADER(config.h)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PATH_PROG(RM, rm, /bin/rm, $PATH:/bin:/usr/bin:/usr/local/bin)
AC_PATH_PROG(CP, cp, /bin/cp, $PATH:/bin:/usr/bin:/usr/local/bin)
AC_PATH_PROG(STRIP, strip, /usr/bin/strip, $PATH:/bin:/usr/bin:/usr/local/bin)
AC_PATH_PROG(CHMOD, chmod, /bin/chmod, $PATH:/bin:/usr/bin:/usr/local/bin)
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_STRUCT_TM
AC_CHECK_HEADERS(fcntl.h unistd.h sys/param.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_OFF_T
AC_STRUCT_TM
dnl Check for type-widths
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
dnl Check byte order
AC_C_BIGENDIAN
dnl Brain dead check for tree's zlib
ZDEPS='$(top_builddir)/../zlib/libz.a'
ZLIBS="$ZDEPS -L\$(here)/../zlib/$libsubdir"
ZINCS='-I$(top_srcdir)/../zlib'
AC_SUBST(ZLIBS)
AC_SUBST(ZDEPS)
AC_SUBST(ZINCS)
AC_OUTPUT(Makefile install-defs.sh)
/*
dostime.c - routines for converting UNIX time to MS-DOS time.
Borrowed from Info-zip's unzip
Copyright (C) 1999 Bryan Burns
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dostime.c,v 1.1.1.1 1999/12/06 03:09:12 toast Exp $
$Log: dostime.c,v $
Revision 1.1.1.1 1999/12/06 03:09:12 toast
initial checkin..
Revision 1.6 1999/05/10 08:32:26 burnsbr
added dos2unixtime
Revision 1.5 1999/04/27 10:03:50 burnsbr
configure support
Revision 1.4 1999/04/26 21:55:19 burnsbr
switched from sys/time.h to time.h for better portability
Revision 1.3 1999/04/20 08:54:30 burnsbr
added GPL comment
Revision 1.2 1999/04/20 05:10:53 burnsbr
added RCS tags
*/
#include "config.h"
#ifdef TM_IN_SYS_TIME
#include <sys/time.h>
#else
#include <time.h>
#endif
#include "dostime.h"
static char rcsid[] = "$Id: dostime.c,v 1.1.1.1 1999/12/06 03:09:12 toast Exp $";
/*
Copyright (C) 1990-1997 Mark Adler, Richard B. Wales, Jean-loup Gailly,
Kai Uwe Rommel, Onno van der Linden and Igor Mandrichenko.
Permission is granted to any individual or institution to use, copy, or
redistribute this software so long as all of the original files are included,
that it is not sold for profit, and that this copyright notice is retained.
*/
time_t dos2unixtime(dostime)
unsigned long dostime; /* DOS time to convert */
/* Return the Unix time_t value (GMT/UTC time) for the DOS format (local)
* time dostime, where dostime is a four byte value (date in most
* significant word, time in least significant word), see dostime()
* function.
*/
{
struct tm *t; /* argument for mktime() */
time_t clock = time(NULL);
t = localtime(&clock);
t->tm_isdst = -1; /* let mktime() determine if DST is in effect */
/* Convert DOS time to UNIX time_t format */
t->tm_sec = (((int)dostime) << 1) & 0x3e;
t->tm_min = (((int)dostime) >> 5) & 0x3f;
t->tm_hour = (((int)dostime) >> 11) & 0x1f;
t->tm_mday = (int)(dostime >> 16) & 0x1f;
t->tm_mon = ((int)(dostime >> 21) & 0x0f) - 1;
t->tm_year = ((int)(dostime >> 25) & 0x7f) + 80;
return mktime(t);
}
unsigned long dostime(y, n, d, h, m, s)
int y; /* year */
int n; /* month */
int d; /* day */
int h; /* hour */
int m; /* minute */
int s; /* second */
/* Convert the date y/n/d and time h:m:s to a four byte DOS date and
time (date in high two bytes, time in low two bytes allowing magnitude
comparison). */
{
return y < 1980 ? dostime(1980, 1, 1, 0, 0, 0) :
(((unsigned long)y - 1980) << 25) | ((unsigned long)n << 21) |
((unsigned long)d << 16) | ((unsigned long)h << 11) |
((unsigned long)m << 5) | ((unsigned long)s >> 1);
}
unsigned long unix2dostime(t)
time_t *t; /* unix time to convert */
/* Return the Unix time t in DOS format, rounded up to the next two
second boundary. */
{
time_t t_even;
struct tm *s; /* result of localtime() */
t_even = (*t + 1) & (~1); /* Round up to even seconds. */
s = localtime(&t_even); /* Use local time since MSDOS does. */
return dostime(s->tm_year + 1900, s->tm_mon + 1, s->tm_mday,
s->tm_hour, s->tm_min, s->tm_sec);
}
/*
dostime.h - function prototypes
Copyright (C) 1999 Bryan Burns
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
time_t dos2unixtime(unsigned long dostime);
unsigned long dostime(int, int, int, int, int, int);
unsigned long unix2dostime(time_t*);
CP=/bin/cp
STRIP=/usr/bin/strip
CHMOD=/bin/chmod
prefix=/usr/local
exec_prefix=${prefix}
BINDIR=${exec_prefix}/bin
CP=@CP@
STRIP=@STRIP@
CHMOD=@CHMOD@
prefix=@prefix@
exec_prefix=@exec_prefix@
BINDIR=@bindir@
#! /bin/bash
. install-defs.sh
$CP fastjar ${BINDIR}
$STRIP ${BINDIR}/fastjar
$CHMOD 755 ${BINDIR}/fastjar
/*
jargrep.h - header file for jargrep utility
Copyright (C) 2000 Cory Hollingsworth
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*$Id: jargrep.h,v 1.3 2000/09/13 14:02:02 cory Exp $
*/
#define JG_PRINT_BYTEOFFSET 0x00000001
#define JG_PRINT_COUNT 0x00000002
#define JG_IGNORE_CASE 0x00000004
#define JG_PRINT_LINE_NUMBER 0x00000008
#define JG_SUPRESS_ERROR 0x00000010
#define JG_INVERT 0x00000020
#define JG_WORD_EXPRESSIONS 0x00000040
#define GVERSION "jargrep version 0.1 (09/12/2000)"
/* $Id: jartool.h,v 1.4 2000/08/24 15:23:35 cory Exp $
$Log: jartool.h,v $
Revision 1.4 2000/08/24 15:23:35 cory
Set version number since I think we can let this one out.
Revision 1.3 2000/08/23 19:42:17 cory
Added support for more Unix platforms. The following code has been hacked
to work on AIX, Solaris, True 64, and HP-UX.
Added bigendian check. Probably works on most big and little endian platforms
now.
Revision 1.2 1999/12/06 03:47:20 toast
fixing version string
Revision 1.1.1.1 1999/12/06 03:08:24 toast
initial checkin..
Revision 1.6 1999/05/10 09:16:08 burnsbr
*** empty log message ***
Revision 1.5 1999/04/27 10:04:20 burnsbr
configure support
Revision 1.4 1999/04/26 02:36:15 burnsbr
changed RDSZ to 4096 from 512
Revision 1.3 1999/04/23 12:00:29 burnsbr
modified zipentry struct
*/
/*
jartool.h - generic defines, struct defs etc.
Copyright (C) 1999 Bryan Burns
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#define ACTION_NONE 0
#define ACTION_CREATE 1
#define ACTION_EXTRACT 2
#define ACTION_UPDATE 3
#define ACTION_LIST 4
#define TRUE 1
#define FALSE 0
/* Amount of bytes to read at a time. You can change this to optimize for
your system */
#define RDSZ 4096
/* Change these to match your system:
ub1 == unsigned 1 byte word
ub2 == unsigned 2 byte word
ub4 == unsigned 4 byte word
*/
#if SIZEOF_CHAR == 1
typedef unsigned char ub1;
#else
typedef u_int8_t ub1;
#endif
#if SIZEOF_SHORT == 2
typedef unsigned short ub2;
#elif SIZEOF_INT == 2
typedef unsigned int ub2;
#else
typedef u_int16_t ub2;
#endif
#if SIZEOF_INT == 4
typedef unsigned int ub4;
#elif SIZEOF_LONG == 4
typedef unsigned long ub4;
#elif SIZEOF_LONG_LONG == 4
typedef unsigned long long ub4;
#else
typedef u_int32_t ub4;
#endif
struct zipentry {
ub2 mod_time;
ub2 mod_date;
ub4 crc;
ub4 csize;
ub4 usize;
ub4 offset;
ub1 compressed;
char *filename;
struct zipentry *next_entry;
};
typedef struct zipentry zipentry;
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
# Franc,ois Pinard <pinard@iro.umontreal.ca>, 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
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# 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
/* $Id: pushback.c,v 1.2 2000/08/23 19:42:17 cory Exp $
$Log: pushback.c,v $
Revision 1.2 2000/08/23 19:42:17 cory
Added support for more Unix platforms. The following code has been hacked
to work on AIX, Solaris, True 64, and HP-UX.
Added bigendian check. Probably works on most big and little endian platforms
now.
Revision 1.1.1.1 1999/12/06 03:09:13 toast
initial checkin..
Revision 1.1 1999/05/10 08:32:37 burnsbr
Initial revision
*/
/*
pushback.c - code for a pushback buffer to handle file I/O
Copyright (C) 1999 Bryan Burns
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include "jartool.h"
#include "pushback.h"
static char rcsid[] = "$Id: pushback.c,v 1.2 2000/08/23 19:42:17 cory Exp $";
void pb_init(pb_file *pbf, int fd){
pbf->fd = fd;
pbf->next = pbf->pb_buff;
pbf->buff_amt = 0;
}
int pb_push(pb_file *pbf, void *buff, int amt){
int in_amt;
int wrap = 0;
#ifdef DEBUG
printf("%d bytes being pushed back to the buffer\n", amt);
#endif
/* determine how much we can take */
if((RDSZ - pbf->buff_amt) < amt)
in_amt = RDSZ - pbf->buff_amt;
else
in_amt = amt;
if(in_amt == 0)
return 0;
/* figure out if we need to wrap around, and if so, by how much */
if(((pbf->pb_buff + RDSZ) - pbf->next) < in_amt)
wrap = in_amt - ((pbf->pb_buff + RDSZ) - pbf->next);
/* write everything up til the end of the buffer */
memcpy(pbf->next, buff, (in_amt - wrap));
/* finish writing what's wrapped around */
memcpy(pbf->pb_buff, ((char *)buff + (in_amt - wrap)), wrap);
/* update the buff_amt field */
pbf->buff_amt += in_amt;
#ifdef DEBUG
printf("%d bytes we can't accept\n", (amt - in_amt));
#endif
return in_amt;
}
int pb_read(pb_file *pbf, void *buff, int amt){
int out_amt = 0;
int wrap = 0;
void *bp = buff;
int tmp;
#ifdef DEBUG
printf("%d bytes requested from us\n", amt);
#endif
while(out_amt < amt){
/* if our push-back buffer contains some data */
if(pbf->buff_amt > 0){
#ifdef DEBUG
printf("giving data from buffer\n");
#endif
/* calculate how much we can actually give the caller */
if( (amt - out_amt) < pbf->buff_amt )
tmp = (amt - out_amt);
else
tmp = pbf->buff_amt;
/* Determine if we're going to need to wrap around the buffer */
if(tmp > ((pbf->pb_buff + RDSZ) - pbf->next))
wrap = tmp - ((pbf->pb_buff + RDSZ) - pbf->next);
memcpy(bp, pbf->next, (tmp - wrap));
bp = &(((char *)bp)[tmp - wrap]);
/* If we need to wrap, read from the start of the buffer */
if(wrap > 0){
memcpy(bp, pbf->pb_buff, wrap);
bp = &(((char *)bp)[wrap]);
}
/* update the buff_amt field */
pbf->buff_amt -= tmp;
pbf->next += tmp;
#ifdef DEBUG
printf("%d bytes remaining in buffer\n", pbf->buff_amt);
#endif
/* if the buffer is empty, reset the next header to the front of the
buffer so subsequent pushbacks/reads won't have to wrap */
if(pbf->buff_amt == 0)
pbf->next = pbf->pb_buff;
out_amt += tmp;
} else {
#ifdef DEBUG
printf("Reading from file..\n");
#endif
/* The pushback buffer was empty, so we just need to read from the file */
tmp = read(pbf->fd, bp, (amt - out_amt));
if(tmp == 0)
break;
else
out_amt += tmp;
bp = &(((char *)bp)[tmp]);
}
}
#ifdef DEBUG
printf("managed to read %d bytes\n", out_amt);
#endif
return out_amt;
}
/*
pushback.h - header for pushback.c
Copyright (C) 1999 Bryan Burns
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
struct pb_file {
unsigned int buff_amt;
ub1 pb_buff[RDSZ];
int fd;
ub1 *next;
};
typedef struct pb_file pb_file;
void pb_init(pb_file *, int);
int pb_push(pb_file *, void *, int);
int pb_read(pb_file *, void *, int);
/* $Id: zipfile.h,v 1.1.1.1 1999/12/06 03:09:11 toast Exp $
$Log: zipfile.h,v $
Revision 1.1.1.1 1999/12/06 03:09:11 toast
initial checkin..
Revision 1.6 1999/05/10 08:33:08 burnsbr
added UNPACK_UB4 and UNPACK_UB2
Revision 1.5 1999/04/26 02:36:34 burnsbr
added LOC_EXTRA macro
Revision 1.4 1999/04/23 12:01:19 burnsbr
added more defines
*/
/*
zipfile.h - defines for indexing zipfile headers
Copyright (C) 1999 Bryan Burns
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#define LOC_EXTRA 6 /* extra bytes */
#define LOC_COMP 8 /* compression method */
#define LOC_MODTIME 10 /* last modification time */
#define LOC_MODDATE 12 /* last modification date */
#define LOC_CRC 14 /* CRC */
#define LOC_CSIZE 18 /* compressed size */
#define LOC_USIZE 22 /* uncompressed size */
#define LOC_FNLEN 26 /* filename length */
#define LOC_EFLEN 28 /* extra-field length */
#define CEN_COMP 10 /* compression method */
#define CEN_MODTIME 12
#define CEN_MODDATE 14
#define CEN_CRC 16
#define CEN_CSIZE 20
#define CEN_USIZE 24
#define CEN_FNLEN 28
#define CEN_EFLEN 30
#define CEN_COMLEN 32
#define CEN_OFFSET 42
/* macros */
#define PACK_UB4(d, o, v) d[o] = (ub1)((v) & 0x000000ff); \
d[o + 1] = (ub1)(((v) & 0x0000ff00) >> 8); \
d[o + 2] = (ub1)(((v) & 0x00ff0000) >> 16); \
d[o + 3] = (ub1)(((v) & 0xff000000) >> 24)
#define PACK_UB2(d, o, v) d[o] = (ub1)((v) & 0x00ff); \
d[o + 1] = (ub1)(((v) & 0xff00) >> 8)
#define UNPACK_UB4(s, o) (ub4)s[o] + (((ub4)s[o + 1]) << 8) +\
(((ub4)s[o + 2]) << 16) + (((ub4)s[o + 3]) << 24)
#define UNPACK_UB2(s, o) (ub2)s[o] + (((ub2)s[o + 1]) << 8)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment