|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
Go to the source code of this file.
Functions | |
| FILE_T | file_open (const char *path) |
| FILE_T | file_fdopen (int fildes) |
| void | file_set_random_access (FILE_T stream, bool random_flag, GPtrArray *seek) |
| WS_DLL_PUBLIC int64_t | file_seek (FILE_T stream, int64_t offset, int whence, int *err) |
| Seek to a position in the file. | |
| WS_DLL_PUBLIC int64_t | file_tell (FILE_T stream) |
| Get current position in the file. | |
| int64_t | file_tell_raw (FILE_T stream) |
| int | file_fstat (FILE_T stream, ws_statb64 *statb, int *err) |
| WS_DLL_PUBLIC bool | file_iscompressed (FILE_T stream) |
| Check if file is compressed. | |
| WS_DLL_PUBLIC int | file_read (void *buf, unsigned int count, FILE_T file) |
| Read bytes from a file. | |
| WS_DLL_PUBLIC int | file_peekc (FILE_T stream) |
| Peek the next byte from the file without advancing the position. | |
| WS_DLL_PUBLIC int | file_getc (FILE_T stream) |
| Read the next byte from the file. | |
| WS_DLL_PUBLIC char * | file_gets (char *buf, int len, FILE_T stream) |
| Read a line from the file. | |
| WS_DLL_PUBLIC char * | file_getsp (char *buf, int len, FILE_T stream) |
| Read a line from the file, skipping leading whitespace. | |
| WS_DLL_PUBLIC bool | file_eof (FILE_T stream) |
| Check for end-of-file. | |
| WS_DLL_PUBLIC int | file_error (FILE_T fh, char **err_info) |
| Check for file error. | |
| void | file_clearerr (FILE_T stream) |
| void | file_fdclose (FILE_T file) |
| bool | file_fdreopen (FILE_T file, const char *path) |
| void | file_close (FILE_T file) |
Wiretap Library Copyright (c) 1998 by Gilbert Ramirez gram@.nosp@m.alum.nosp@m.ni.ri.nosp@m.ce.e.nosp@m.du
SPDX-License-Identifier: GPL-2.0-or-later
| WS_DLL_PUBLIC bool file_eof | ( | FILE_T | stream | ) |
Check for end-of-file.
Returns true if EOF has been reached on the stream.
| stream | File handle. |
| WS_DLL_PUBLIC int file_error | ( | FILE_T | fh, |
| char ** | err_info | ||
| ) |
Check for file error.
Returns the error status and optionally sets an error message.
| fh | File handle. |
| err_info | Optional pointer to error message string. |
| WS_DLL_PUBLIC int file_getc | ( | FILE_T | stream | ) |
Read the next byte from the file.
Advances the file position by one.
| stream | File handle. |
| WS_DLL_PUBLIC char * file_gets | ( | char * | buf, |
| int | len, | ||
| FILE_T | stream | ||
| ) |
Read a line from the file.
Reads up to len - 1 characters into buf, stopping at newline or EOF.
| buf | Destination buffer. |
| len | Buffer size. |
| stream | File handle. |
buf on success, or NULL on error or EOF. | WS_DLL_PUBLIC char * file_getsp | ( | char * | buf, |
| int | len, | ||
| FILE_T | stream | ||
| ) |
Read a line from the file, skipping leading whitespace.
Similar to file_gets(), but trims leading spaces before reading.
| buf | Destination buffer. |
| len | Buffer size. |
| stream | File handle. |
buf on success, or NULL on error or EOF. | WS_DLL_PUBLIC bool file_iscompressed | ( | FILE_T | stream | ) |
Check if file is compressed.
Returns true for compressed formats.
| stream | File handle. |
| WS_DLL_PUBLIC int file_peekc | ( | FILE_T | stream | ) |
Peek the next byte from the file without advancing the position.
Returns the next byte in the stream or EOF.
| stream | File handle. |
| WS_DLL_PUBLIC int file_read | ( | void * | buf, |
| unsigned int | count, | ||
| FILE_T | file | ||
| ) |
Read bytes from a file.
Reads up to count bytes into buf from the given file stream.
| buf | Destination buffer. |
| count | Number of bytes to read. |
| file | File handle. |
| WS_DLL_PUBLIC int64_t file_seek | ( | FILE_T | stream, |
| int64_t | offset, | ||
| int | whence, | ||
| int * | err | ||
| ) |
Seek to a position in the file.
Supports large offsets and returns error codes.
| stream | File handle. |
| offset | Byte offset. |
| whence | SEEK_SET, SEEK_CUR, or SEEK_END. |
| err | Optional error code output. |
| WS_DLL_PUBLIC int64_t file_tell | ( | FILE_T | stream | ) |
Get current position in the file.
Returns logical position, accounting for buffering.
| stream | File handle. |