1 #ifndef _ZZIP_FSEEKO_H_
2 #define _ZZIP_FSEEKO_H_
4 * NOTE: this is part of libzzipfseeko (i.e. it is not libzzip).
6 * simplified zip disk access using fseeko on a stdio FILE handle
9 * Guido Draheim <guidod@gmx.de>
11 * Copyright (c) 2003,2004 Guido Draheim
12 * All rights reserved,
13 * use under the restrictions of the
14 * Lesser GNU General Public License
15 * or alternatively the restrictions
16 * of the Mozilla Public License 1.1
20 #include <zzip/types.h>
23 #ifdef _ZZIP_ENTRY_STRUCT
25 #include <zzip/format.h>
32 typedef struct zzip_entry ZZIP_ENTRY
;
33 typedef struct zzip_entry_file ZZIP_ENTRY_FILE
;
35 typedef int (*zzip_strcmp_fn_t
)(char*, char*);
36 typedef int (*zzip_fnmatch_fn_t
)(char*, char*, int);
38 #ifndef zzip_entry_extern
39 #define zzip_entry_extern extern
42 zzip_entry_extern zzip_off_t
43 zzip_entry_data_offset(ZZIP_ENTRY
* entry
);
46 zzip_entry_extern ZZIP_ENTRY
*
47 zzip_entry_findfirst(FILE* file
);
50 zzip_entry_extern ZZIP_ENTRY
*
51 zzip_entry_findnext(ZZIP_ENTRY
* _zzip_restrict entry
);
53 #define zzip_entry_findlast zzip_entry_free
54 #define zzip_entry_findlastfile zzip_entry_free
55 #define zzip_entry_findlastmatch zzip_entry_free
58 zzip_entry_free(ZZIP_ENTRY
* entry
);
61 zzip_entry_extern
char*
62 zzip_entry_strdup_name(ZZIP_ENTRY
* entry
);
63 zzip_entry_extern
char*
64 zzip_entry_to_data(ZZIP_ENTRY
* entry
);
67 zzip_entry_extern ZZIP_ENTRY
*
68 zzip_entry_findfile(FILE* disk
, char* filename
,
69 ZZIP_ENTRY
* _zzip_restrict old
,
70 zzip_strcmp_fn_t compare
);
72 zzip_entry_extern ZZIP_ENTRY
*
73 zzip_entry_findmatch(FILE* disk
, char* filespec
,
74 ZZIP_ENTRY
* _zzip_restrict old
,
75 zzip_fnmatch_fn_t compare
, int flags
);
77 zzip_entry_extern ZZIP_ENTRY_FILE
*
78 zzip_entry_fopen (ZZIP_ENTRY
* entry
, int takeover
);
81 zzip_entry_extern ZZIP_ENTRY_FILE
*
82 zzip_entry_ffile (FILE* disk
, char* filename
);
84 zzip_entry_extern _zzip_size_t
85 zzip_entry_fread (void* ptr
, _zzip_size_t size
, _zzip_size_t nmemb
,
86 ZZIP_ENTRY_FILE
* file
);
88 zzip_entry_fclose (ZZIP_ENTRY_FILE
* file
);
90 zzip_entry_feof (ZZIP_ENTRY_FILE
* file
);
92 # ifdef _ZZIP_ENTRY_STRUCT
94 # define __zzip_entry_extends_zzip_disk_entry
95 struct zzip_entry
: public struct zzip_disk_entry
97 char* _zzip_restrict tail
;
98 zzip_off_t tailalloc
; /* the allocated size of tail */
99 FILE* diskfile
; /* a file reference */
100 zzip_off_t disksize
; /* the size of the file */
101 zzip_off_t headseek
; /* the offset within the file */
103 zzip_off_t zz_csize
; /* items scanned from header */
104 zzip_off_t zz_offset
; /* or zip64 extension block */
108 struct zzip_entry
/* : struct zzip_disk_entry */
110 struct zzip_disk_entry head
;
111 char* _zzip_restrict tail
;
112 zzip_off_t tailalloc
; /* the allocated size of tail */
113 FILE* diskfile
; /* a file reference */
114 zzip_off_t disksize
; /* the size of the file */
115 zzip_off_t headseek
; /* the offset within the file */
117 zzip_off_t zz_csize
; /* items scanned from header */
118 zzip_off_t zz_offset
; /* or zip64 extension block */
121 # endif /* __cplusplus */
122 # endif /* _ZZIP_MEM_ENTRY_PRIVATE */