home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / java.z / zip.h < prev   
C/C++ Source or Header  |  1996-05-03  |  2KB  |  60 lines

  1. /*
  2.  * @(#)zip.h    1.2 95/10/14 David Connelly
  3.  *
  4.  * Copyright (c) 1995 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software
  7.  * and its documentation for NON-COMMERCIAL purposes and without
  8.  * fee is hereby granted provided that this copyright notice
  9.  * appears in all copies. Please refer to the file "copyright.html"
  10.  * for further important copyright and licensing information.
  11.  *
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  13.  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  14.  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  15.  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  16.  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  17.  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  18.  */
  19.  
  20. /*
  21.  * Prototypes for "zip" file reader support
  22.  */
  23.  
  24. #ifndef _ZIP_H_
  25. #define _ZIP_H_
  26.  
  27. #include <time.h>
  28. #include "bool.h"
  29.  
  30. /*
  31.  * Central directory element
  32.  */
  33. typedef struct {
  34.     char *fn;        /* file name */
  35.     int len;        /* file size */
  36.     int mod;        /* file modification time */
  37.     long off;        /* local file header offset */
  38. } direl_t;
  39.  
  40. /*
  41.  * Zip file
  42.  */
  43. typedef struct {
  44.     char *fn;        /* zip file name */
  45.     int fd;        /* zip file descriptor */
  46.     direl_t *dir;    /* zip file directory */
  47.     int nel;        /* number of directory entries */
  48.     long cenoff;    /* Offset of central directory (CEN) */
  49.     long endoff;    /* Offset of end-of-central-directory record */
  50. } zip_t;
  51.  
  52. struct stat;
  53.  
  54. zip_t *zip_open(const char *fn);
  55. void zip_close(zip_t *zip);
  56. bool_t zip_stat(zip_t *zip, const char *fn, struct stat *sbuf);
  57. bool_t zip_get(zip_t *zip, const char *fn, void *buf, int len);
  58.  
  59. #endif /* !_ZIP_H_ */ 
  60.