SS8_COPY_SUBSTR(3)               Ssstr Manual               SS8_COPY_SUBSTR(3)



NAME
       ss8_copy_substr,  ss8_substr_inplace  -  get  the substring of an ssstr
       byte string

SYNOPSIS
       #include <ss8str.h>

       ss8str *ss8_copy_substr(ss8str *restrict dest,
                               ss8str const *restrict src,
                               size_t start, size_t len);
       ss8str *ss8_substr_inplace(ss8str *str, size_t start,
                                  size_t len);

DESCRIPTION
       ss8_copy_substr() copies a substring of the ss8str at src, starting  at
       byte  position start and having length up to len (limited by the length
       of the source string) to the ss8str at dest.  Behavior is undefined un‐
       less  dest and src point to valid and distinct ss8str objects and start
       is less than or equal to the length of the ss8str at src.

       ss8_substr_inplace() sets the ss8str at str to its own substring start‐
       ing  at  byte  position start and having length up to len.  Behavior is
       undefined unless str points to a valid ss8str object and start is  less
       than or equal to the length of the ss8str at str.

       For  either  function, if start + len is greater than the length of the
       source string, the substring starting at position start  and  extending
       to the end of the string is taken.

RETURN VALUE
       ss8_copy_substr() returns dest.

       ss8_substr_inplace() returns str.

SEE ALSO
       ss8_copy(3), ss8_erase(3), ssstr(7)



SSSTR                             2023-12-30                SS8_COPY_SUBSTR(3)