Welcome to little lamb

Code » limb » release » tree

[release] / src / doc / siovec.h / siov_seek.3.md

% limb manual
% siov_seek(3)
% limb 0.1.0
% 2023-07-24

# NAME

siov_seek - seek into an array of vectors

# SYNOPSIS

    #include <limb/siovec.h>

```pre hl
size_t siov_seek(struct iovec *<em>v</em>, unsigned int <em>n</em>, size_t <em>offset</em>)
```

# DESCRIPTION

The `siov_seek`() function updates the array `v` of `n` vectors so that the data
it represents now start after `offset` byte.

You can think of it as a way to perform `s += offset` for vectors.

! NOTE:
! Note that it is safe to have `offset` larger than the amount of data
! represented by `v`, as that will simply set all vectors to 0 -- i.e. the array
! `v` of `n` vectors will not represent any data anymore.
! In other words, `siov_len(v, n)` will then return 0.

# RETURN VALUE

The `siov_seek`() function return the number of bytes "skipped over" which may
be less than `offset` if there wasn't that much data, as noted above.

# SEE ALSO

[siov_len](3), [siov_trunc](3)