beta-0.89.2
[luatex.git] / source / libs / zziplib / zziplib-0.13.62 / zzip / fseeko.h
blob9abade7452c7df850bb68124817729e377957563
1 #ifndef _ZZIP_FSEEKO_H_
2 #define _ZZIP_FSEEKO_H_
3 /*
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
8 * Author:
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>
21 #include <stdio.h>
23 #ifdef _ZZIP_ENTRY_STRUCT
24 #include <zlib.h>
25 #include <zzip/format.h>
26 #endif
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
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
40 #endif
42 zzip_entry_extern zzip_off_t
43 zzip_entry_data_offset(ZZIP_ENTRY* entry);
45 zzip__new__
46 zzip_entry_extern ZZIP_ENTRY*
47 zzip_entry_findfirst(FILE* file);
49 zzip__new__
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
57 zzip_entry_extern int
58 zzip_entry_free(ZZIP_ENTRY* entry);
60 zzip__new__
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);
66 zzip__new__
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);
71 zzip__new__
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);
76 zzip__new__
77 zzip_entry_extern ZZIP_ENTRY_FILE*
78 zzip_entry_fopen (ZZIP_ENTRY* entry, int takeover);
80 zzip__new__
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);
87 zzip_entry_extern int
88 zzip_entry_fclose (ZZIP_ENTRY_FILE* file);
89 int
90 zzip_entry_feof (ZZIP_ENTRY_FILE* file);
92 # ifdef _ZZIP_ENTRY_STRUCT
93 # ifdef __cplusplus
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 */
102 zzip_off_t zz_usize;
103 zzip_off_t zz_csize; /* items scanned from header */
104 zzip_off_t zz_offset; /* or zip64 extension block */
105 int zz_diskstart;
107 # else
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 */
116 zzip_off_t zz_usize;
117 zzip_off_t zz_csize; /* items scanned from header */
118 zzip_off_t zz_offset; /* or zip64 extension block */
119 int zz_diskstart;
121 # endif /* __cplusplus */
122 # endif /* _ZZIP_MEM_ENTRY_PRIVATE */
124 #ifdef __cplusplus
125 extern "C" {
127 #endif
128 #endif