| 1 | /* $Id: jartool.h,v 1.4 2000/08/24 15:23:35 cory Exp $
|
|---|
| 2 |
|
|---|
| 3 | $Log: jartool.h,v $
|
|---|
| 4 | Revision 1.4 2000/08/24 15:23:35 cory
|
|---|
| 5 | Set version number since I think we can let this one out.
|
|---|
| 6 |
|
|---|
| 7 | Revision 1.3 2000/08/23 19:42:17 cory
|
|---|
| 8 | Added support for more Unix platforms. The following code has been hacked
|
|---|
| 9 | to work on AIX, Solaris, True 64, and HP-UX.
|
|---|
| 10 | Added bigendian check. Probably works on most big and little endian platforms
|
|---|
| 11 | now.
|
|---|
| 12 |
|
|---|
| 13 | Revision 1.2 1999/12/06 03:47:20 toast
|
|---|
| 14 | fixing version string
|
|---|
| 15 |
|
|---|
| 16 | Revision 1.1.1.1 1999/12/06 03:08:24 toast
|
|---|
| 17 | initial checkin..
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 | Revision 1.6 1999/05/10 09:16:08 burnsbr
|
|---|
| 22 | *** empty log message ***
|
|---|
| 23 |
|
|---|
| 24 | Revision 1.5 1999/04/27 10:04:20 burnsbr
|
|---|
| 25 | configure support
|
|---|
| 26 |
|
|---|
| 27 | Revision 1.4 1999/04/26 02:36:15 burnsbr
|
|---|
| 28 | changed RDSZ to 4096 from 512
|
|---|
| 29 |
|
|---|
| 30 | Revision 1.3 1999/04/23 12:00:29 burnsbr
|
|---|
| 31 | modified zipentry struct
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 | */
|
|---|
| 35 |
|
|---|
| 36 | /*
|
|---|
| 37 | jartool.h - generic defines, struct defs etc.
|
|---|
| 38 | Copyright (C) 1999 Bryan Burns
|
|---|
| 39 |
|
|---|
| 40 | This program is free software; you can redistribute it and/or
|
|---|
| 41 | modify it under the terms of the GNU General Public License
|
|---|
| 42 | as published by the Free Software Foundation; either version 2
|
|---|
| 43 | of the License, or (at your option) any later version.
|
|---|
| 44 |
|
|---|
| 45 | This program is distributed in the hope that it will be useful,
|
|---|
| 46 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 47 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 48 | GNU General Public License for more details.
|
|---|
| 49 |
|
|---|
| 50 | You should have received a copy of the GNU General Public License
|
|---|
| 51 | along with this program; if not, write to the Free Software
|
|---|
| 52 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|---|
| 53 | */
|
|---|
| 54 |
|
|---|
| 55 | #include "config.h"
|
|---|
| 56 |
|
|---|
| 57 | #define ACTION_NONE 0
|
|---|
| 58 | #define ACTION_CREATE 1
|
|---|
| 59 | #define ACTION_EXTRACT 2
|
|---|
| 60 | #define ACTION_UPDATE 3
|
|---|
| 61 | #define ACTION_LIST 4
|
|---|
| 62 |
|
|---|
| 63 | #define TRUE 1
|
|---|
| 64 | #define FALSE 0
|
|---|
| 65 |
|
|---|
| 66 | /* Amount of bytes to read at a time. You can change this to optimize for
|
|---|
| 67 | your system */
|
|---|
| 68 | #define RDSZ 4096
|
|---|
| 69 |
|
|---|
| 70 | /* Change these to match your system:
|
|---|
| 71 | ub1 == unsigned 1 byte word
|
|---|
| 72 | ub2 == unsigned 2 byte word
|
|---|
| 73 | ub4 == unsigned 4 byte word
|
|---|
| 74 | */
|
|---|
| 75 | #if SIZEOF_CHAR == 1
|
|---|
| 76 | typedef unsigned char ub1;
|
|---|
| 77 | #else
|
|---|
| 78 | typedef u_int8_t ub1;
|
|---|
| 79 | #endif
|
|---|
| 80 |
|
|---|
| 81 | #if SIZEOF_SHORT == 2
|
|---|
| 82 | typedef unsigned short ub2;
|
|---|
| 83 | #elif SIZEOF_INT == 2
|
|---|
| 84 | typedef unsigned int ub2;
|
|---|
| 85 | #else
|
|---|
| 86 | typedef u_int16_t ub2;
|
|---|
| 87 | #endif
|
|---|
| 88 |
|
|---|
| 89 | #if SIZEOF_INT == 4
|
|---|
| 90 | typedef unsigned int ub4;
|
|---|
| 91 | #elif SIZEOF_LONG == 4
|
|---|
| 92 | typedef unsigned long ub4;
|
|---|
| 93 | #elif SIZEOF_LONG_LONG == 4
|
|---|
| 94 | typedef unsigned long long ub4;
|
|---|
| 95 | #else
|
|---|
| 96 | typedef u_int32_t ub4;
|
|---|
| 97 | #endif
|
|---|
| 98 |
|
|---|
| 99 | struct zipentry {
|
|---|
| 100 | ub2 mod_time;
|
|---|
| 101 | ub2 mod_date;
|
|---|
| 102 | ub4 crc;
|
|---|
| 103 | ub4 csize;
|
|---|
| 104 | ub4 usize;
|
|---|
| 105 | ub4 offset;
|
|---|
| 106 | ub1 compressed;
|
|---|
| 107 | char *filename;
|
|---|
| 108 |
|
|---|
| 109 | struct zipentry *next_entry;
|
|---|
| 110 | };
|
|---|
| 111 |
|
|---|
| 112 | typedef struct zipentry zipentry;
|
|---|