2021-11-26 03:31:05 +00:00
|
|
|
/** @file
|
1999-09-22 01:28:04 +00:00
|
|
|
*
|
|
|
|
* Wiretap Library
|
2001-11-13 23:55:44 +00:00
|
|
|
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
|
2002-08-28 20:30:45 +00:00
|
|
|
*
|
2018-02-07 11:26:45 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
1999-09-22 01:28:04 +00:00
|
|
|
*/
|
|
|
|
|
2014-01-08 04:35:28 +00:00
|
|
|
#ifndef __WTAP_FILE_WRAPPERS_H__
|
|
|
|
#define __WTAP_FILE_WRAPPERS_H__
|
1999-09-22 01:28:04 +00:00
|
|
|
|
2021-10-16 09:33:34 +00:00
|
|
|
#include <wireshark.h>
|
2014-03-18 17:21:51 +00:00
|
|
|
#include "wtap.h"
|
2011-06-04 21:20:57 +00:00
|
|
|
#include <wsutil/file_util.h>
|
|
|
|
|
2012-05-02 21:25:48 +00:00
|
|
|
extern FILE_T file_open(const char *path);
|
2012-06-01 08:05:12 +00:00
|
|
|
extern FILE_T file_fdopen(int fildes);
|
2012-12-05 16:19:12 +00:00
|
|
|
extern void file_set_random_access(FILE_T stream, gboolean random_flag, GPtrArray *seek);
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC gint64 file_seek(FILE_T stream, gint64 offset, int whence, int *err);
|
|
|
|
WS_DLL_PUBLIC gint64 file_tell(FILE_T stream);
|
2011-05-09 05:30:59 +00:00
|
|
|
extern gint64 file_tell_raw(FILE_T stream);
|
2011-05-09 08:12:26 +00:00
|
|
|
extern int file_fstat(FILE_T stream, ws_statb64 *statb, int *err);
|
2014-03-18 17:21:51 +00:00
|
|
|
WS_DLL_PUBLIC gboolean file_iscompressed(FILE_T stream);
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int file_read(void *buf, unsigned int count, FILE_T file);
|
2014-03-18 17:21:51 +00:00
|
|
|
WS_DLL_PUBLIC int file_peekc(FILE_T stream);
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int file_getc(FILE_T stream);
|
|
|
|
WS_DLL_PUBLIC char *file_gets(char *buf, int len, FILE_T stream);
|
2018-04-07 22:00:46 +00:00
|
|
|
WS_DLL_PUBLIC char *file_getsp(char *buf, int len, FILE_T stream);
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC int file_eof(FILE_T stream);
|
|
|
|
WS_DLL_PUBLIC int file_error(FILE_T fh, gchar **err_info);
|
2011-04-08 00:28:37 +00:00
|
|
|
extern void file_clearerr(FILE_T stream);
|
2012-06-01 08:05:12 +00:00
|
|
|
extern void file_fdclose(FILE_T file);
|
|
|
|
extern int file_fdreopen(FILE_T file, const char *path);
|
|
|
|
extern void file_close(FILE_T file);
|
2011-04-12 02:40:14 +00:00
|
|
|
|
2016-04-01 00:32:56 +00:00
|
|
|
#ifdef HAVE_ZLIB
|
2011-04-11 21:33:22 +00:00
|
|
|
typedef struct wtap_writer *GZWFILE_T;
|
|
|
|
|
|
|
|
extern GZWFILE_T gzwfile_open(const char *path);
|
|
|
|
extern GZWFILE_T gzwfile_fdopen(int fd);
|
2013-01-04 05:22:43 +00:00
|
|
|
extern guint gzwfile_write(GZWFILE_T state, const void *buf, guint len);
|
2011-04-11 21:33:22 +00:00
|
|
|
extern int gzwfile_flush(GZWFILE_T state);
|
2016-12-03 22:17:08 +00:00
|
|
|
extern int gzwfile_close(GZWFILE_T state);
|
2011-04-11 21:33:22 +00:00
|
|
|
extern int gzwfile_geterr(GZWFILE_T state);
|
2016-04-01 00:32:56 +00:00
|
|
|
#endif /* HAVE_ZLIB */
|
1999-09-22 01:28:04 +00:00
|
|
|
|
|
|
|
#endif /* __FILE_H__ */
|