zip-reader: Better hide implementation details from clients.
[pspp] / src / libpspp / zip-reader.h
index ccb1ef39f1bd25d3e5cf9b34f2135e9675d20387..05642ffdc0ca2c442eef14a070d3b3a878d3f9e0 100644 (file)
 #ifndef ZIP_READER_H
 #define ZIP_READER_H 1
 
-#include <inttypes.h>
-
+struct zip_member;
 struct zip_reader;
 struct string;
 
-enum compression
-  {
-    COMPRESSION_STORED = 0,
-    COMPRESSION_INFLATE,
-    n_COMPRESSION
-  };
-
-struct zip_member
-{
-  FILE *fp;                   /* The stream from which the data is read */
-  uint32_t offset;            /* Starting offset in file. */
-  uint32_t comp_size;         /* Length of member file data, in bytes. */
-  uint32_t ucomp_size;        /* Uncompressed length of member file data, in bytes. */
-  uint32_t expected_crc;      /* CRC-32 of member file data.. */
-  char *name;                 /* Name of member file. */
-  uint32_t crc;
-  enum compression compression;
-
-  size_t bytes_unread;       /* Number of bytes left in the member available for reading */
-  int ref_cnt;
-  struct string *errs;
-  void *aux;
-};
-
-struct decompressor
-{
-  bool (*init) (struct zip_member *);
-  int  (*read) (struct zip_member *, void *, size_t);
-  void (*finish) (struct zip_member *);
-};
-
-
 void zm_dump (const struct zip_member *zm);
 
 /* Create zip reader to read the file called FILENAME.
@@ -69,7 +36,7 @@ void zip_reader_destroy (struct zip_reader *zr);
 /* Return the zip member in the reader ZR, called MEMBER */
 struct zip_member *zip_member_open (struct zip_reader *zr, const char *member);
 
-/* Read upto N bytes from ZM, storing them in BUF.
+/* Read up to N bytes from ZM, storing them in BUF.
    Returns the number of bytes read, or -1 on error */
 int zip_member_read (struct zip_member *zm, void *buf, size_t n);