File: zextract.h

package info (click to toggle)
guavac 1.0-5
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 2,716 kB
  • ctags: 2,357
  • sloc: cpp: 19,765; yacc: 1,629; makefile: 492; lex: 348; ansic: 284; sh: 280
file content (41 lines) | stat: -rw-r--r-- 1,058 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* $Id: zextract.h,v 1.2 1996/07/12 20:43:40 geppetto Exp $ */
/* Definitions for using a zipped' archive.

Copyright (c) 1996 Cygnus Support

See the file "zextract.license.terms" for information on usage and
redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.

Written by Per Bothner <bothner@cygnus.com>, February 1996.
*/

struct ZipFile {
  int fd;
  long size;
  long count;
  long dir_size;
  long reference_count;  /* Added by David Engberg, June 1996. */
  char *central_directory;
};

typedef struct ZipFile ZipFile;

struct ZipDirectory {
  int direntry_size;
  int filename_offset;
  long size; /* length of file */
  long filestart;  /* start of file in archive */
  long filename_length;
  /* char mid_padding[...]; */
  /* char filename[filename_length]; */
  /* char end_padding[...]; */
};

typedef struct ZipDirectory ZipDirectory;

#define ZIPDIR_FILENAME(ZIPD) ((char*)(ZIPD)+(ZIPD)->filename_offset)
#define ZIPDIR_NEXT(ZIPD) \
   ((ZipDirectory*)((char*)(ZIPD)+(ZIPD)->direntry_size))


int read_zip_archive(ZipFile*);