Welcome to little lamb

Code » limb » release » tree

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

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

# NAME

siov_search - search for a byte array in an array of vectors

# SYNOPSIS

    #include <limb/siovec.h>

```pre hl
size_t siov_search(const struct iovec *<em>v</em>, unsigned int <em>n</em>, char *<em>s</em>, size_t <em>len</em>)
```

# DESCRIPTION

The `siov_search`() function scans data pointed by the array `v` of `n` vectors
for the first instance matching data pointed by `s` of `len` bytes.

As such, it may contain any byte, including NUL bytes, and does not need to be
NUL-terminated. The occurrence will be found even if scattered across multiple
memory regions/vectors.

# RETURN VALUE

The `siov_search`() function returns the position of the first occurrence found
in the data within the array `v` of `n` vectors, or the total length of said
data otherwise.

# SEE ALSO

[siov_bytechr](3)