SS8_MOVE(3) Ssstr Manual SS8_MOVE(3)
NAME
ss8_move, ss8_move_destroy - move one ssstr byte string to another
SYNOPSIS
#include <ss8str.h>
ss8str *ss8_move(ss8str *restrict dest, ss8str *restrict src);
ss8str *ss8_move_destroy(ss8str *restrict dest,
ss8str *restrict src);
DESCRIPTION
ss8_move() takes the value of the ss8str object at src and places it in
the ss8str object at dest. After the move, the ss8str object at src
remains valid but its value becomes indeterminate.
ss8_move_destroy() is like ss8_move(), except that the ss8str object at
src becomes invalid (destroyed) after the move; that is,
ss8_move_destroy(dest, src);
is equivalent to
ss8_move(dest, src);
ss8_destroy(src);
For both functions, behavior is undefined unless dest and src point to
valid and distinct ss8str objects.
No memory allocation is performed, but deallocation may be performed.
RETURN VALUE
ss8_move() and ss8_move_destroy() return dest.
NOTES
Care should be taken not to use the value of the ss8str object at src
after the move. It must still be destroyed in the case of ss8_move().
SEE ALSO
ss8_copy(3), ss8_destroy(3), ss8_init_move(3), ss8_swap(3), ssstr(7)
SSSTR 2023-12-30 SS8_MOVE(3)