~ubuntu-branches/ubuntu/natty/zziplib/natty

« back to all changes in this revision

Viewing changes to zziplib/zziplib.h

  • Committer: Bazaar Package Importer
  • Author(s): Aurelien Jarno
  • Date: 2005-02-18 12:45:00 UTC
  • mfrom: (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050218124500-4lx3ggkymvi6bf01
Tags: 0.12.83-4
Libtool update for kfreebsd-gnu in zziplib/ directory (closes:
bug#294730).

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 *          usage allowed under the restrictions of the
9
9
 *          Lesser GNU General Public License 
10
10
 *          note the additional license information 
11
 
 *          that can be found in COPYING.ZZIP
 
11
 *          that can be found in COPYING.ZZIP
12
12
 *
13
13
 * if you see "unknown symbol" errors, check first that `-I ..` is part of
14
14
 * your compiler options - a special hint to VC/IDE users who tend to make up
96
96
 
97
97
/*
98
98
 * Getting error strings 
99
 
 * zzip-err.c
 
99
 * zzip/err.c
100
100
 */
101
101
_zzip_export    /* error in _opendir : */
102
102
zzip_char_t*    zzip_strerror(int errcode); 
109
109
/*
110
110
 * Functions to grab information from ZZIP_DIR/ZZIP_FILE structure 
111
111
 * (if ever needed)
112
 
 * zzip-info.c
 
112
 * zzip/info.c
113
113
 */
114
114
_zzip_export
115
115
int             zzip_error(ZZIP_DIR * dir);
133
133
 
134
134
/*
135
135
 * zip handle management
136
 
 * zzip-zip.c
 
136
 * zzip/zip.c
137
137
 */
138
138
_zzip_export
139
139
ZZIP_DIR *      zzip_dir_alloc(zzip_strings_t* fileext);
156
156
 
157
157
/*
158
158
 * Scanning files in zip archive
159
 
 * zzip-dir.c
160
 
 * zzip-zip.c
 
159
 * zzip/dir.c
 
160
 * zzip/zip.c
161
161
 */
162
162
_zzip_export
163
163
ZZIP_DIR *      zzip_opendir(zzip_char_t* filename);
174
174
 
175
175
/*
176
176
 * 'opening', 'closing' and reading invidual files in zip archive.
177
 
 * zzip-file.c
 
177
 * zzip/file.c
178
178
 */
179
 
 
180
179
_zzip_export
181
180
ZZIP_FILE *     zzip_file_open(ZZIP_DIR * dir, zzip_char_t* name, int modes);
182
181
_zzip_export
191
190
_zzip_export
192
191
zzip_ssize_t    zzip_read(ZZIP_FILE * fp, char * buf, zzip_size_t len);
193
192
 
194
 
 
 
193
/*
 
194
 * the stdc variant to open/read/close files. - Take note of the freopen()
 
195
 * call as it may reuse an existing preparsed copy of a zip central directory
 
196
 */
195
197
_zzip_export
196
198
ZZIP_FILE*      zzip_freopen(zzip_char_t* name, zzip_char_t* mode, ZZIP_FILE*);
197
199
_zzip_export
212
214
_zzip_export
213
215
zzip_off_t      zzip_tell(ZZIP_FILE * fp);
214
216
 
215
 
 
216
217
/*
217
218
 * reading info of a single file 
218
 
 * zzip-stat.c
 
219
 * zzip/stat.c
219
220
 */
220
221
_zzip_export
221
222
int             zzip_dir_stat(ZZIP_DIR * dir, zzip_char_t* name, 
222
223
                              ZZIP_STAT * zs, int flags);
223
224
 
224
 
 
225
225
#ifdef ZZIP_LARGEFILE_RENAME
226
226
#define zzip_open_shared_io  zzip_open_shared_io64
227
227
#define zzip_open_ext_io     zzip_open_ext_io64
255
255
                                  zzip_strings_t* ext, zzip_plugin_io_t io);
256
256
 
257
257
_zzip_export
258
 
ZZIP_DIR *  zzip_dir_open_ext_io(zzip_char_t* filename, 
 
258
ZZIP_DIR *  zzip_dir_open_ext_io(zzip_char_t* filename,
259
259
                                 zzip_error_t* errcode_p,
260
260
                                 zzip_strings_t* ext, zzip_plugin_io_t io);
261
261
 
 
262
#if defined _ZZIP_WRITE_SOURCE
 
263
/* ........................................................................
 
264
 * write support is not yet implemented
 
265
 * zzip/write.c
 
266
 */
 
267
#define ZZIP_NO_CREAT 1
 
268
 
 
269
ZZIP_DIR*    zzip_dir_creat_ext_io(zzip_char_t* name, int o_mode, 
 
270
                                   zzip_strings_t* ext, zzip_plugin_io_t io);
 
271
ZZIP_DIR*    zzip_dir_creat(zzip_char_t* name, int o_mode);
 
272
int          zzip_file_mkdir(ZZIP_DIR* dir, zzip_char_t* name, int o_mode);
 
273
ZZIP_FILE*   zzip_file_creat(ZZIP_DIR* dir, zzip_char_t* name, int o_mode);
 
274
zzip_ssize_t zzip_file_write(ZZIP_FILE* file, 
 
275
                             const void* ptr, zzip_size_t len);
 
276
 
 
277
ZZIP_DIR*    zzip_createdir(zzip_char_t* name, int o_mode);
 
278
zzip_ssize_t zzip_write(ZZIP_FILE* file, const void* ptr, zzip_size_t len);
 
279
zzip_size_t  zzip_fwrite(const void* ptr, zzip_size_t len, 
 
280
                         zzip_size_t multiply, ZZIP_FILE* file);
 
281
#ifndef zzip_savefile
 
282
#define zzip_savefile 0
 
283
#define zzip_savefile_is_null
 
284
#endif
 
285
 
 
286
#ifdef _ZZIP_NO_INLINE
 
287
#define zzip_mkdir(_name_,_mode_) \
 
288
        zzip_file_mkdir((zzip_savefile),(_name_),(_mode_))
 
289
#define zzip_creat(_name_,_mode_) \
 
290
        zzip_file_creat((zzip_savefile),(_name_),(_mode_))
 
291
#define zzip_sync() \
 
292
      { zzip_closedir((zzip_savefile)); (zzip_savefile) = 0; }
 
293
#define zzip_start(_name_,_mode_,_ext_) \
 
294
      { if ((zzip_savefile)) zzip_closedir((zzip_savefile)); 
 
295
         zzip_savefile = zzip_dir_creat(_name_, _mode_,_ext_); }
 
296
 
 
297
#else
 
298
 
 
299
_zzip_inline static int         zzip_mkdir(zzip_char_t* name, int o_mode)
 
300
{                   return zzip_file_mkdir(zzip_savefile, name, o_mode); }
 
301
_zzip_inline static ZZIP_FILE*  zzip_creat(zzip_char_t* name, int o_mode)
 
302
{                   return zzip_file_creat(zzip_savefile, name, o_mode); }
 
303
 
 
304
#ifndef zzip_savefile_is_null
 
305
_zzip_inline static void        zzip_sync(void)
 
306
{                           zzip_closedir(zzip_savefile); zzip_savefile = 0; }
 
307
_zzip_inline static void        zzip_mkfifo(zzip_char_t* name, int o_mode)
 
308
{       if ((zzip_savefile)) zzip_closedir (zzip_savefile);
 
309
             zzip_savefile = zzip_createdir(_name_,_mode_); }
 
310
#else
 
311
_zzip_inline static void        zzip_sync(void) {}
 
312
_zzip_inline static void        zzip_mkfifo(zzip_char_t* name, int o_mode) {}
 
313
#endif
 
314
#endif /* _ZZIP_NO_INLINE */
 
315
#endif /* _ZZIP_WRITE_SOURCE */
 
316
 
262
317
#ifdef __cplusplus
263
318
};
264
319
#endif
265
320
 
266
321
#endif /* _ZZIPLIB_H */
267
322
 
 
323
/* 
 
324
 * Local variables:
 
325
 * c-file-style: "stroustrup"
 
326
 * End:
 
327
 */