SS8_COPY(3)                      Ssstr Manual                      SS8_COPY(3)



NAME
       ss8_copy,  ss8_copy_cstr,  ss8_copy_bytes, ss8_copy_ch, ss8_copy_ch_n -
       copy a string or characters to an ssstr byte string

SYNOPSIS
       #include <ss8str.h>

       ss8str *ss8_copy(ss8str *restrict dest,
                        ss8str const *restrict src);
       ss8str *ss8_copy_cstr(ss8str *restrict dest,
                        char const *restrict src);
       ss8str *ss8_copy_bytes(ss8str *restrict dest,
                        char const *restrict src, size_t srclen);
       ss8str *ss8_copy_ch(ss8str *dest, char ch);
       ss8str *ss8_copy_ch_n(ss8str *dest, char ch, size_t count);

DESCRIPTION
       ss8_copy() copies the value of the ss8str object at src to  the  ss8str
       object  at  dest.  Behavior is undefined unless dest and src point to a
       valid and distinct ss8str objects.

       ss8_copy_cstr() copies the  null-terminated  byte  string  src  to  the
       ss8str  object  at dest.  Behavior is undefined unless dest points to a
       valid ss8str object and src is a null-terminated byte string that  does
       not overlap with the internal buffer of dest.

       ss8_copy_bytes() copies the byte string of length srclen located at src
       to the ss8str object at dest.  Behavior is undefined unless dest points
       to  a valid ss8str object and src is not NULL and points to an array of
       at least srclen bytes that does not overlap with the internal buffer of
       dest.

       ss8_copy_ch()  assigns  the  string consisting of the single byte ch to
       the ss8str object at dest.  Behavior is undefined unless dest points to
       a valid ss8str object.

       ss8_copy_ch_n()  assigns  the  string consisting of count copies of the
       byte ch to the ss8str object at dest.   Behavior  is  undefined  unless
       dest points to a valid ss8str object.

RETURN VALUE
       All 5 functions return dest.

SEE ALSO
       ss8_cat(3),          ss8_copy_substr(3),          ss8_copy_to_bytes(3),
       ss8_copy_to_cstr(3),   ss8_init_copy(3),   ss8_move(3),    ss8_swap(3),
       ssstr(7)



SSSTR                             2023-12-30                       SS8_COPY(3)