| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
file_wrappers.h
Go to the documentation of this file.
1
8
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
22 extern FILE_T file_open(const char *path);
23
30 extern FILE_T file_fdopen(int fildes);
31
39 extern void file_set_random_access(FILE_T stream, bool random_flag, GPtrArray *seek);
40
52WS_WARN_UNUSED WS_DLL_PUBLIC int64_t file_seek(FILE_T stream, int64_t offset, int whence, int *err);
53
62WS_DLL_PUBLIC int64_t file_tell(FILE_T stream);
63
72 extern int64_t file_tell_raw(FILE_T stream);
73
82 extern int file_fstat(FILE_T stream, ws_statb64 *statb, int *err);
83
92WS_DLL_PUBLIC bool file_iscompressed(FILE_T stream);
93
104WS_DLL_PUBLIC int file_read(void *buf, unsigned int count, FILE_T file);
105
114WS_DLL_PUBLIC int file_peekc(FILE_T stream);
115
124WS_DLL_PUBLIC int file_getc(FILE_T stream);
125
136WS_DLL_PUBLIC char *file_gets(char *buf, int len, FILE_T stream);
137
149WS_DLL_PUBLIC char *file_getsp(char *buf, int len, FILE_T stream);
150
159WS_DLL_PUBLIC bool file_eof(FILE_T stream);
160
170WS_DLL_PUBLIC int file_error(FILE_T fh, char **err_info);
171
177 extern void file_clearerr(FILE_T stream);
178
184 extern void file_fdclose(FILE_T file);
185
193 extern bool file_fdreopen(FILE_T file, const char *path);
194
200 extern void file_close(FILE_T file);
201
202#endif /* __FILE_H__ */
file_util.h
file_iscompressed
WS_DLL_PUBLIC bool file_iscompressed(FILE_T stream)
Check if file is compressed.
Definition file_wrappers.c:2116
file_fstat
int file_fstat(FILE_T stream, ws_statb64 *statb, int *err)
Get file status information.
Definition file_wrappers.c:2105
file_error
WS_DLL_PUBLIC int file_error(FILE_T fh, char **err_info)
Check for file error.
Definition file_wrappers.c:2383
file_seek
WS_WARN_UNUSED WS_DLL_PUBLIC int64_t file_seek(FILE_T stream, int64_t offset, int whence, int *err)
Seek to a position in the file.
Definition file_wrappers.c:1724
file_fdclose
void file_fdclose(FILE_T file)
Close a file stream.
Definition file_wrappers.c:2402
file_set_random_access
void file_set_random_access(FILE_T stream, bool random_flag, GPtrArray *seek)
Set random access flag for a file stream.
Definition file_wrappers.c:1718
file_tell_raw
int64_t file_tell_raw(FILE_T stream)
Get current raw position in the file.
Definition file_wrappers.c:2099
file_getsp
WS_DLL_PUBLIC char * file_getsp(char *buf, int len, FILE_T stream)
Read a line from the file, returning a pointer to the end.
Definition file_wrappers.c:2291
file_eof
WS_DLL_PUBLIC bool file_eof(FILE_T stream)
Check for end-of-file.
Definition file_wrappers.c:2371
file_gets
WS_DLL_PUBLIC char * file_gets(char *buf, int len, FILE_T stream)
Read a line from the file.
Definition file_wrappers.c:2364
file_open
FILE_T file_open(const char *path)
Open a file for reading or writing.
Definition file_wrappers.c:1666
file_getc
WS_DLL_PUBLIC int file_getc(FILE_T stream)
Read the next byte from the file.
Definition file_wrappers.c:2266
file_tell
WS_DLL_PUBLIC int64_t file_tell(FILE_T stream)
Get current position in the file.
Definition file_wrappers.c:2092
file_read
WS_DLL_PUBLIC int file_read(void *buf, unsigned int count, FILE_T file)
Read bytes from a file.
Definition file_wrappers.c:2155
file_close
void file_close(FILE_T file)
Close a file stream.
Definition file_wrappers.c:2421
file_peekc
WS_DLL_PUBLIC int file_peekc(FILE_T stream)
Peek the next byte from the file without advancing the position.
Definition file_wrappers.c:2219
file_fdreopen
bool file_fdreopen(FILE_T file, const char *path)
Reopens a file descriptor for reading.
Definition file_wrappers.c:2410
file_clearerr
void file_clearerr(FILE_T stream)
Clear error and end-of-file indicators for a file stream.
Definition file_wrappers.c:2393
file_fdopen
FILE_T file_fdopen(int fildes)
Open a file descriptor for reading or writing.
Definition file_wrappers.c:1480
stream
Definition stream.c:41
wtap.h