wtap_opttypes.c: Fix build error.
[metze/wireshark/wip.git] / wiretap / file_wrappers.h
1 /* file_wrappers.h
2  *
3  * Wiretap Library
4  * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20
21 #ifndef __WTAP_FILE_WRAPPERS_H__
22 #define __WTAP_FILE_WRAPPERS_H__
23
24 #include <glib.h>
25 #include "wtap.h"
26 #include <wsutil/file_util.h>
27 #include "ws_symbol_export.h"
28
29 extern FILE_T file_open(const char *path);
30 extern FILE_T file_fdopen(int fildes);
31 extern void file_set_random_access(FILE_T stream, gboolean random_flag, GPtrArray *seek);
32 WS_DLL_PUBLIC gint64 file_seek(FILE_T stream, gint64 offset, int whence, int *err);
33 extern gboolean file_skip(FILE_T file, gint64 delta, int *err);
34 WS_DLL_PUBLIC gint64 file_tell(FILE_T stream);
35 extern gint64 file_tell_raw(FILE_T stream);
36 extern int file_fstat(FILE_T stream, ws_statb64 *statb, int *err);
37 WS_DLL_PUBLIC gboolean file_iscompressed(FILE_T stream);
38 WS_DLL_PUBLIC int file_read(void *buf, unsigned int count, FILE_T file);
39 WS_DLL_PUBLIC int file_peekc(FILE_T stream);
40 WS_DLL_PUBLIC int file_getc(FILE_T stream);
41 WS_DLL_PUBLIC char *file_gets(char *buf, int len, FILE_T stream);
42 WS_DLL_PUBLIC int file_eof(FILE_T stream);
43 WS_DLL_PUBLIC int file_error(FILE_T fh, gchar **err_info);
44 extern void file_clearerr(FILE_T stream);
45 extern void file_fdclose(FILE_T file);
46 extern int file_fdreopen(FILE_T file, const char *path);
47 extern void file_close(FILE_T file);
48
49 #ifdef HAVE_ZLIB
50 typedef struct wtap_writer *GZWFILE_T;
51
52 extern GZWFILE_T gzwfile_open(const char *path);
53 extern GZWFILE_T gzwfile_fdopen(int fd);
54 extern guint gzwfile_write(GZWFILE_T state, const void *buf, guint len);
55 extern int gzwfile_flush(GZWFILE_T state);
56 extern int gzwfile_close(GZWFILE_T state, gboolean is_stdout);
57 extern int gzwfile_geterr(GZWFILE_T state);
58 #endif /* HAVE_ZLIB */
59
60 #endif /* __FILE_H__ */