Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
file_wrappers.h
Go to the documentation of this file.
1
9#ifndef __WTAP_FILE_WRAPPERS_H__
10#define __WTAP_FILE_WRAPPERS_H__
11
12#include <wireshark.h>
13#include "wtap.h"
14#include <wsutil/file_util.h>
15
16extern FILE_T file_open(const char *path);
17extern FILE_T file_fdopen(int fildes);
18extern void file_set_random_access(FILE_T stream, bool random_flag, GPtrArray *seek);
19WS_DLL_PUBLIC int64_t file_seek(FILE_T stream, int64_t offset, int whence, int *err);
20WS_DLL_PUBLIC int64_t file_tell(FILE_T stream);
21extern int64_t file_tell_raw(FILE_T stream);
22extern int file_fstat(FILE_T stream, ws_statb64 *statb, int *err);
23WS_DLL_PUBLIC bool file_iscompressed(FILE_T stream);
24WS_DLL_PUBLIC int file_read(void *buf, unsigned int count, FILE_T file);
25WS_DLL_PUBLIC int file_peekc(FILE_T stream);
26WS_DLL_PUBLIC int file_getc(FILE_T stream);
27WS_DLL_PUBLIC char *file_gets(char *buf, int len, FILE_T stream);
28WS_DLL_PUBLIC char *file_getsp(char *buf, int len, FILE_T stream);
29WS_DLL_PUBLIC int file_eof(FILE_T stream);
30WS_DLL_PUBLIC int file_error(FILE_T fh, char **err_info);
31extern void file_clearerr(FILE_T stream);
32extern void file_fdclose(FILE_T file);
33extern bool file_fdreopen(FILE_T file, const char *path);
34extern void file_close(FILE_T file);
35
36#if defined (HAVE_ZLIB) || defined (HAVE_ZLIBNG)
37typedef struct wtap_writer *GZWFILE_T;
38
39extern GZWFILE_T gzwfile_open(const char *path);
40extern GZWFILE_T gzwfile_fdopen(int fd);
41extern unsigned gzwfile_write(GZWFILE_T state, const void *buf, unsigned len);
42extern int gzwfile_flush(GZWFILE_T state);
43extern int gzwfile_close(GZWFILE_T state);
44extern int gzwfile_geterr(GZWFILE_T state);
45#endif /* HAVE_ZLIB */
46
47#ifdef HAVE_LZ4
48typedef struct lz4_writer *LZ4WFILE_T;
49
50extern LZ4WFILE_T lz4wfile_open(const char *path);
51extern LZ4WFILE_T lz4wfile_fdopen(int fd);
52extern size_t lz4wfile_write(LZ4WFILE_T state, const void *buf, size_t len);
53extern int lz4wfile_flush(LZ4WFILE_T state);
54extern int lz4wfile_close(LZ4WFILE_T state);
55extern int lz4wfile_geterr(LZ4WFILE_T state);
56#endif
57
58#endif /* __FILE_H__ */
Definition stream.c:41
Definition file_wrappers.c:222