Welcome to little lamb

Code » limb » master » tree

[master] / src / doc / samisc.h / sa_off2ptr.3.md

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

# NAME

sa_off2ptr - turn an array of offsets from an stralloc into an array of strings

# SYNOPSIS

    #include <limb/samisc.h>

```pre hl
void sa_off2ptr(stralloc *<em>sa</em>, size_t <em>arroff</em>, size_t <em>n</em>)
```

# DESCRIPTION

The `sa_off2ptr`() function will transform an array of `n` offsets located at
`arroff` into `sa->s` into an array of string pointers.

This allows to use said array easily with other functions not stralloc-aware.

! HINT:
! You can easily append such an array of offsets from a concatenation of
! NUL-terminated strings into a stralloc using [sa_coloff](3).

# SEE ALSO

[sa_coloff](3), [sa_colptr](3)