Get / Set the current position of the stream.
More...
|
#define | MEM_SEEK_SET (0) |
| A constant to specify that the offset is relative to the start of the stream.
|
|
#define | MEM_SEEK_CUR (1) |
| A constant to specify that the offset is relative to the current position indicator.
|
|
#define | MEM_SEEK_END (2) |
| A constant to specify that the offset is relative to the end of the stream.
|
|
|
void | mfseek (MemFile *mf, long offset, int whence) |
| Set the stream position indicator for the stream pointed by mf .
|
|
void | mfgetpos (MemFile *mf, mempos_t *pos) |
| Get the stream position indicator of the stream pointed by mf .
|
|
void | mfsetpos (MemFile *mf, const mempos_t *pos) |
| Set the stream position indicator of the stream pointed by mf .
|
|
void | mfsetpos2 (MemFile *mf, const mempos_t *base, long offset) |
| Set the stream position indicator of the stream pointed by mf .
|
|
Get / Set the current position of the stream.
◆ MEM_SEEK_SET
A constant to specify that the offset is relative to the start of the stream.
- See also
- mfseek()
Definition at line 59 of file memfile.h.
◆ MEM_SEEK_CUR
A constant to specify that the offset is relative to the current position indicator.
- See also
- mfseek()
Definition at line 66 of file memfile.h.
◆ MEM_SEEK_END
A constant to specify that the offset is relative to the end of the stream.
- See also
- mfseek()
Definition at line 73 of file memfile.h.
◆ mempos_t
Stream position indicator.
- Note
- Corresponds to
fpos_t
type of the standard C library I/O stream.
Definition at line 80 of file memfile.h.
◆ mfseek()
void mfseek |
( |
MemFile * |
mf, |
|
|
long |
offset, |
|
|
int |
whence |
|
) |
| |
Set the stream position indicator for the stream pointed by mf
.
- Parameters
-
mf | Pointer to opened stream pointer. |
offset | Offset in bytes from the position specified by whence . |
whence | Specify the base position of offset.
- MEM_SEEK_SET specifies that the offset is relative to the start of the stream,
- MEM_SEEK_CUR specifies that the offset is relative to the current position indicator.
- MEM_SEEK_END specifies that the offset is relative to the end of the stream.
|
◆ mfgetpos()
Get the stream position indicator of the stream pointed by mf
.
- Parameters
-
mf | Pointer to opened stream pointer. |
pos | Pointer to the buffer where the stream position indicator will be stored. |
◆ mfsetpos()
Set the stream position indicator of the stream pointed by mf
.
- Parameters
-
mf | Pointer to opened stream pointer. |
pos | Pointer to the stream position indicator retrieved by mfgetpos(). |
◆ mfsetpos2()
Set the stream position indicator of the stream pointed by mf
.
- Parameters
-
mf | Pointer to opened stream pointer. |
base | Pointer to the stream position indicator retrieved by mfgetpos(). |
offset | Offset from the base . |