debian/0000755000000000000000000000000012236021206007160 5ustar debian/jclassinfo.docs0000644000000000000000000000001407746457021012202 0ustar README NEWS debian/watch0000644000000000000000000000025712236015412010217 0ustar # Compulsory line, this is a version 3 file version=3 # Uncomment to find new files on sourceforge, for debscripts >= 2.9 http://sf.net/jclassinfo/jclassinfo-(.*)\.tar\.gz debian/jclassinfo.sgmlcatalogs0000644000000000000000000000007507746457021013741 0ustar xml/jclassinfo.cat /usr/share/sgml/jclassinfo/jclassinfo.cat debian/jclassinfo.install0000644000000000000000000000006410017261065012707 0ustar usr/bin usr/share/man/man1 usr/share/xml/jclassinfo debian/rules0000755000000000000000000000014012236015444010242 0ustar #!/usr/bin/make -f %: dh $@ --with autoreconf override_dh_install: rm -rf debian/*/usr/lib/ debian/control0000644000000000000000000000200212236012142010554 0ustar Source: jclassinfo Section: java Priority: optional Maintainer: Debian Java Maintainers Uploaders: Vincent Fourmond Build-Depends: debhelper (>= 9 ), zlib1g-dev, dh-autoreconf Standards-Version: 3.9.3 Homepage: http://jclassinfo.sourceforge.net/ Vcs-Svn: svn://svn.debian.org/svn/pkg-java/packages/trunk/jclassinfo/ Vcs-Browser: http://svn.debian.org/wsvn/pkg-java/packages/trunk/jclassinfo/ Package: jclassinfo Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: extracts information from Java class files jclassinfo reads Java class files and extract useful information from them, such as: * the classes/methods/constants/fields provided * their dependencies * the version of the virtual machine necessary to run them * a full disassembly of the bytecode * other attributes . Its main advantage over other similar programs is that it is written in C, which makes it much faster and more suitable for scripting. debian/manpages0000644000000000000000000000001410735467003010704 0ustar jclassinfo.1debian/patches/0000755000000000000000000000000012236021150010605 5ustar debian/patches/03-fix-malloc.diff0000644000000000000000000000106711552661070013731 0ustar #! /bin/sh /usr/share/dpatch/dpatch-run ## Author: Vincent Fourmond ## Description: fix memory allocation error ## @DPATCH@ diff -urNad jclassinfo-0.19.1~/jclass/jstring.c jclassinfo-0.19.1/jclass/jstring.c --- jclassinfo-0.19.1~/jclass/jstring.c 2004-03-21 05:33:07.000000000 +0100 +++ jclassinfo-0.19.1/jclass/jstring.c 2010-01-26 20:48:45.091764004 +0100 @@ -199,7 +199,8 @@ number = strdup("0"); else { - number = (char*) malloc(40); + /* Of course... */ + number = (char*) malloc(41); number[40] = '\0'; /* set sign */ debian/patches/02-use-stdin.diff0000644000000000000000000001434311552661070013611 0ustar #! /bin/sh /usr/share/dpatch/dpatch-run ## 02-use-stdin.dpatch by ## ## DP: Adds some code so that the "-" argument for stdin works. @DPATCH@ diff -urNad jclassinfo-0.19.1~/jclass/Makefile.am jclassinfo-0.19.1/jclass/Makefile.am --- jclassinfo-0.19.1~/jclass/Makefile.am 2007-12-28 18:41:58.000000000 +0100 +++ jclassinfo-0.19.1/jclass/Makefile.am 2007-12-28 18:41:58.000000000 +0100 @@ -29,8 +29,9 @@ constant_pool.c \ field.c \ jar.c \ - java_file.c \ + java_file.c \ java_buf.c \ jstring.c \ manifest.c \ + open.h open.c \ strtok_r.h strtok_r.c diff -urNad jclassinfo-0.19.1~/jclass/class.c jclassinfo-0.19.1/jclass/class.c --- jclassinfo-0.19.1~/jclass/class.c 2004-05-07 13:44:44.000000000 +0200 +++ jclassinfo-0.19.1/jclass/class.c 2007-12-28 18:41:58.000000000 +0100 @@ -28,6 +28,8 @@ #include #include +#include + /* * * libjclass API reference @@ -74,7 +76,7 @@ if(filename == NULL) return NULL; - is_filename = (strlen(filename) > 6) && !strcmp(".class", &filename[strlen(filename) - 6]); + is_filename = ((strlen(filename) > 6) && !strcmp(".class", &filename[strlen(filename) - 6]) || (!strcmp(filename, "-"))); if(!is_filename) { @@ -96,7 +98,7 @@ } else { - classfile = fopen(filename, "rb"); + classfile = my_open(filename, "rb"); new_class = jclass_class_new_from_file(classfile); } diff -urNad jclassinfo-0.19.1~/jclass/class_loader.c jclassinfo-0.19.1/jclass/class_loader.c --- jclassinfo-0.19.1~/jclass/class_loader.c 2004-07-10 17:15:10.000000000 +0200 +++ jclassinfo-0.19.1/jclass/class_loader.c 2007-12-28 18:41:58.000000000 +0100 @@ -40,6 +40,8 @@ #include #include +#include + #include "strtok_r.h" #ifdef __WIN32__ @@ -212,7 +214,7 @@ absolute_class_filename[path_len + 1] = '\0'; strcat(absolute_class_filename, class_filename); - file_ptr = fopen(absolute_class_filename,"rb"); + file_ptr = my_open(absolute_class_filename,"rb"); if (file_ptr) { fclose(file_ptr); break; @@ -292,7 +294,7 @@ absolute_class_filename[path_len + 1] = '\0'; strcat(absolute_class_filename, class_filename); - class_file_info->file_ptr = fopen(absolute_class_filename,"rb"); + class_file_info->file_ptr = my_open(absolute_class_filename,"rb"); free(absolute_class_filename); if(class_file_info->file_ptr != NULL) break; diff -urNad jclassinfo-0.19.1~/jclass/jar.c jclassinfo-0.19.1/jclass/jar.c --- jclassinfo-0.19.1~/jclass/jar.c 2004-03-21 06:04:10.000000000 +0100 +++ jclassinfo-0.19.1/jclass/jar.c 2007-12-28 18:41:58.000000000 +0100 @@ -38,6 +38,8 @@ #include #include +#include + static int readcompresszip(JarFile*, const JarEntry*, char*); static int seekcompresszip (JarFile*, const JarEntry*); static uint16_t read_word (char*); @@ -211,7 +213,7 @@ JarFile *zip = (JarFile *) malloc (sizeof (JarFile)); /* open */ - zip->fp = fopen (zipfile, "rb"); + zip->fp = my_open (zipfile, "rb"); if (zip->fp == NULL) { free (zip); diff -urNad jclassinfo-0.19.1~/jclass/open.c jclassinfo-0.19.1/jclass/open.c --- jclassinfo-0.19.1~/jclass/open.c 1970-01-01 01:00:00.000000000 +0100 +++ jclassinfo-0.19.1/jclass/open.c 2007-12-28 18:41:58.000000000 +0100 @@ -0,0 +1,32 @@ +/* open.c: a small wrapper around fopen to take care of "-" + Copyright 2007 by Vincent Fourmond + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + * + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include +#include + +FILE * my_open(const char * file, const char * mode) +{ + if(! strcmp(file, "-")) { + if(strchr(mode, 'r')) /* Read mode */ + return fdopen(0, "r"); + else + return fdopen(1, "w"); + } + return fopen(file, mode); +} diff -urNad jclassinfo-0.19.1~/jclass/open.h jclassinfo-0.19.1/jclass/open.h --- jclassinfo-0.19.1~/jclass/open.h 1970-01-01 01:00:00.000000000 +0100 +++ jclassinfo-0.19.1/jclass/open.h 2007-12-28 18:41:58.000000000 +0100 @@ -0,0 +1,20 @@ +/* open.h: a small wrapper around fopen to take care of "-" + Copyright 2007 by Vincent Fourmond + + 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. + +*/ + +FILE * my_open(const char * file, const char * mode); diff -urNad jclassinfo-0.19.1~/jclassinfo.1 jclassinfo-0.19.1/jclassinfo.1 --- jclassinfo-0.19.1~/jclassinfo.1 2004-05-07 13:49:00.000000000 +0200 +++ jclassinfo-0.19.1/jclassinfo.1 2007-12-28 18:43:10.000000000 +0100 @@ -1,4 +1,4 @@ -.TH "jclassinfo" "1" "0.18" "jclassinfo" "utils" +.TH "jclassinfo" "1" "0.19" "jclassinfo" "utils" .SH "NAME" .LP jclassinfo \- Provides information for Java class files. @@ -8,7 +8,15 @@ .SH "DESCRIPTION" .LP -jclassinfo reads a class file and provides all sorts of information about it. +jclassinfo reads a class file and provides all sorts of information +about it. +.I file +can be +.I - +then +.B jclassinfo +reads a classfile from standard input. + .SH "OPTIONS" .LP .TP debian/patches/04-newer-jvms.diff0000644000000000000000000000173211552661070013773 0ustar Author: Vincent Fourmond Description: Allow jclassinfo to recognize class files written by recent JVM (numbers come from http://en.wikipedia.org/wiki/Java_class_file) Index: jclassinfo-0.19.1/jclass/class.c =================================================================== --- jclassinfo-0.19.1.orig/jclass/class.c 2011-04-17 23:02:46.611166770 +0200 +++ jclassinfo-0.19.1/jclass/class.c 2011-04-17 23:03:21.219166790 +0200 @@ -181,7 +181,7 @@ const char* jclass_class_get_vm_spec(JavaClass* class_struct) { char* vm_spec; - static char* spec_string[] = { "unknown", "1.1", "1.2", "1.3", "1.4"}; + static char* spec_string[] = { "unknown", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6" }; if(class_struct == NULL) return NULL; @@ -200,6 +200,12 @@ case 48: vm_spec = spec_string[4]; break; + case 49: + vm_spec = spec_string[5]; + break; + case 50: + vm_spec = spec_string[6]; + break; default: vm_spec = spec_string[0]; } debian/patches/01-make-static-lib.diff0000644000000000000000000000140611552661070014637 0ustar #! /bin/sh /usr/share/dpatch/dpatch-run ## 01-make-static-lib.dpatch by ## ## DP: Link statically libjclass: we don't want to support a shared library ## DP: with dubious utility. @DPATCH@ diff -urNad jclassinfo-0.19.1~/jclass/Makefile.am jclassinfo-0.19.1/jclass/Makefile.am --- jclassinfo-0.19.1~/jclass/Makefile.am 2004-03-23 05:55:15.000000000 +0100 +++ jclassinfo-0.19.1/jclass/Makefile.am 2007-12-28 10:43:47.000000000 +0100 @@ -3,7 +3,7 @@ INCLUDES= lib_LTLIBRARIES = libjclass.la -libjclass_la_LDFLAGS = -no-undefined -version-info @JCLASS_CURRENT@:@JCLASS_RELEASE@:@JCLASS_AGE@ +libjclass_la_LDFLAGS = -no-undefined -version-info @JCLASS_CURRENT@:@JCLASS_RELEASE@:@JCLASS_AGE@ -static library_includedir=$(includedir)/jclass/jclass debian/patches/series0000644000000000000000000000015311552661070012034 0ustar 01-make-static-lib.diff 02-use-stdin.diff 03-fix-malloc.diff 04-newer-jvms.diff 05-fix-jstring-memory.diff debian/patches/05-fix-jstring-memory.diff0000644000000000000000000000111011552661070015437 0ustar Author: Vincent Fourmond Description: Fix a small flaw in the computation of the display string length Index: jclassinfo-0.19.1/jclass/jstring.c =================================================================== --- jclassinfo-0.19.1.orig/jclass/jstring.c 2011-04-17 23:09:38.523167000 +0200 +++ jclassinfo-0.19.1/jclass/jstring.c 2011-04-17 23:15:30.663167194 +0200 @@ -114,6 +114,9 @@ string_length++; else if(*str_ptr < ' ') string_length += 2; + else if(*str_ptr == '\\' || + *str_ptr == '"') + string_length++; str_ptr++; } debian/copyright0000644000000000000000000000726011200102563011114 0ustar This package was debianized by Vincent Fourmond on Fri, 28 Dec 2007 10:18:32 +0100. It was downloaded from Upstream Author: Nicos Panayides Copyright (for all files but getopt/*): Copyright 2003, Nicos Panayides License: for all aforementioned files but xml/jclassinfo.cat: This package 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 package 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 package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA for xml/jclassinfo.cat: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL'. Other files copyright: getopt/*: Copyright (C) 1989-2002 Free Software Foundation, Inc. These files are part of the GNU C library: The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. On debian systems, the complete text of the GNU Lesser public license (version 2.1) can be found in /usr/share/common-licenses/LGPL-2.1 The Debian packaging is (C) 2007, Vincent Fourmond and is licensed under the GPL, see above. debian/docs0000644000000000000000000000002111552661070010035 0ustar NEWS README TODO debian/changelog0000644000000000000000000000414212236021136011035 0ustar jclassinfo (0.19.1-7) unstable; urgency=low * Switch to dh 9 * Use dh-autoreconf (closes: #725551) * Bump to newer standards (no changes needed) -- Vincent Fourmond Mon, 04 Nov 2013 23:40:19 +0100 jclassinfo (0.19.1-6) unstable; urgency=low * Switch to dh 7 and its wonderful sequencer * Bump compatibility level accordingly * Now conforms to standards 3.9.2 * Switch to format 3.0 (quilt) * Drop dependencies on dpatch * Drop README.source * Now recognizing newer JVMs (closes: #623158) * Find the flaw in the computations of the string size (closes: #613367) -- Vincent Fourmond Sun, 17 Apr 2011 23:18:23 +0200 jclassinfo (0.19.1-5) unstable; urgency=low * patches/03-fix-malloc: fix a memory allocation error (closes: #550203) * Now conforms to 3.8.3 -- Vincent Fourmond Tue, 26 Jan 2010 21:03:03 +0100 jclassinfo (0.19.1-4) unstable; urgency=low * Definitely should go in Section: java... -- Vincent Fourmond Tue, 05 May 2009 21:15:32 +0200 jclassinfo (0.19.1-3) unstable; urgency=medium * Running libtoolize -f for every build to make sure libtool and autoconf are in sync (closes: #526553). Thanks to Daniel Schepler for reporting and giving a fix. * Urgency medium to fix a RC bug in testing. * Adding a debian/README.source to document the patch system. * Now conforms to standard 3.8.1 * Update the FSF's address in debian/copyright -- Vincent Fourmond Tue, 05 May 2009 20:26:09 +0200 jclassinfo (0.19.1-2) unstable; urgency=low * Make it team-maintained * Added VCS fields * Fixed copyright problems. -- Vincent Fourmond Tue, 01 Jan 2008 19:32:35 +0100 jclassinfo (0.19.1-1) unstable; urgency=low * Initial release (Closes: #458062) * 01-make-static-lib to link libjclass statically * 02-use-stdin to have "-" work with the usual meaning as an argument (this way, no need for temporary files for jar analysis). -- Vincent Fourmond Fri, 28 Dec 2007 10:18:32 +0100 debian/libjclass3-dbg.install0000644000000000000000000000003007746457021013346 0ustar usr/lib/libjclass*.so.* debian/compat0000644000000000000000000000000212236012333010357 0ustar 9 debian/libjclass-docs.install0000644000000000000000000000003707746457021013466 0ustar usr/share/doc/libjclass-docs/* debian/libjclass-dev.install0000644000000000000000000000017307746457021013315 0ustar usr/include usr/lib/jclass*/include/* usr/lib/libjclass*.so usr/lib/libjclass*.a usr/lib/libjclass*.la usr/lib/pkgconfig/* debian/libjclass3.install0000644000000000000000000000003007746457021012614 0ustar usr/lib/libjclass*.so.* debian/source/0000755000000000000000000000000012236021150010456 5ustar debian/source/format0000644000000000000000000000001411552661070011677 0ustar 3.0 (quilt) debian/README.Debian0000644000000000000000000000066410735467003011242 0ustar jclassinfo for Debian --------------------- The original tarball provides a libjclass shared library. As I didn't think there would be much use for it, I preferred, for the sake of simplicity, to turn it into a statically linked library embedded in the jclassinfo binary. If you want to work with the library, please file a bug report against this package. -- Vincent Fourmond , Fri, 28 Dec 2007 10:54:46 +0100