Wireshark 4.7.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
22extern FILE_T file_open(const char *path);
23
30extern FILE_T file_fdopen(int fildes);
31
39extern 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
72extern int64_t file_tell_raw(FILE_T stream);
73
82extern 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
177extern void file_clearerr(FILE_T stream);
178
184extern void file_fdclose(FILE_T file);
185
193extern bool file_fdreopen(FILE_T file, const char *path);
194
200extern void file_close(FILE_T file);
201
202#endif /* __FILE_H__ */
WS_DLL_PUBLIC bool file_iscompressed(FILE_T stream)
Check if file is compressed.
Definition file_wrappers.c:2111
int file_fstat(FILE_T stream, ws_statb64 *statb, int *err)
Get file status information.
Definition file_wrappers.c:2100
WS_DLL_PUBLIC int file_error(FILE_T fh, char **err_info)
Check for file error.
Definition file_wrappers.c:2378
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
void file_fdclose(FILE_T file)
Close a file stream.
Definition file_wrappers.c:2397
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
int64_t file_tell_raw(FILE_T stream)
Get current raw position in the file.
Definition file_wrappers.c:2094
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:2286
WS_DLL_PUBLIC bool file_eof(FILE_T stream)
Check for end-of-file.
Definition file_wrappers.c:2366
WS_DLL_PUBLIC char * file_gets(char *buf, int len, FILE_T stream)
Read a line from the file.
Definition file_wrappers.c:2359
FILE_T file_open(const char *path)
Open a file for reading or writing.
Definition file_wrappers.c:1666
WS_DLL_PUBLIC int file_getc(FILE_T stream)
Read the next byte from the file.
Definition file_wrappers.c:2261
WS_DLL_PUBLIC int64_t file_tell(FILE_T stream)
Get current position in the file.
Definition file_wrappers.c:2087
WS_DLL_PUBLIC int file_read(void *buf, unsigned int count, FILE_T file)
Read bytes from a file.
Definition file_wrappers.c:2150
void file_close(FILE_T file)
Close a file stream.
Definition file_wrappers.c:2416
WS_DLL_PUBLIC int file_peekc(FILE_T stream)
Peek the next byte from the file without advancing the position.
Definition file_wrappers.c:2214
bool file_fdreopen(FILE_T file, const char *path)
Reopens a file descriptor for reading.
Definition file_wrappers.c:2405
void file_clearerr(FILE_T stream)
Clear error and end-of-file indicators for a file stream.
Definition file_wrappers.c:2388
FILE_T file_fdopen(int fildes)
Open a file descriptor for reading or writing.
Definition file_wrappers.c:1480
Definition stream.c:41
Definition file_wrappers.c:96