[4mSSSTR[24m(7) Ssstr Manual [4mSSSTR[24m(7)
[1mNAME[0m
ssstr, ss8str - short-string-optimized byte string routines
[1mSYNOPSIS[0m
[1m#include <ss8str.h>[0m
[1mDESCRIPTION[0m
[1mssstr [22mis a header-only library for representing and manipulating byte
strings.
[1mString representation[0m
Strings are represented by the opaque type [1mss8str[22m, which is suitable
for use as a regular automatic (stack) variable, or as a member of a
larger data structure. (It is 32 bytes on 64-bit platforms and 16
bytes on 32-bit platforms.)
When the string is small, it is stored directly in the [1mss8str [22mobject;
otherwise, dynamic (heap) storage is allocated to store the string.
The [1mss8str [22mstores the length of the string explicitly, allowing the
handling of strings that contain embedded null bytes in addition to
more efficient operations.
Objects of type [1mss8str [22mmust be initialized before use and destroyed af‐
ter use, exactly once each. See [1mss8_init[22m(3) and [1mss8_destroy[22m(3).
[1mFUNCTIONS[0m
[1mInitialization and cleanup[0m
[1mss8_init[22m(3), [1mss8_init_copy[22m(3), [1mss8_init_move[22m(3), [1mss8_init_move_de‐[0m
[1mstroy[22m(3), [1mss8_destroy[22m(3), and variants of [1mss8_init_copy [22mwith [1m_cstr[22m,
[1m_bytes[22m, [1m_ch[22m, or [1m_ch_n[0m
[1mBasic string operations[0m
[1mss8_clear[22m(3), [1mss8_is_empty[22m(3), [1mss8_len[22m(3)
[1mCopying and assigning strings[0m
[1mss8_copy[22m(3), [1mss8_init_copy[22m(3), and their variants with [1m_cstr[22m, [1m_bytes[22m,
[1m_ch[22m, or [1m_ch_n[0m
[1mMoving strings[0m
[1mss8_move[22m(3), [1mss8_move_destroy[22m(3), [1mss8_init_move[22m(3), [1mss8_init_move_de‐[0m
[1mstroy[22m(3), [1mss8_swap[22m(3)
[1mPassing ss8str to C string functions[0m
[1mss8_cstr[22m(3), [1mss8_cstr_suffix[22m(3)
[1mUsing ss8str as the destination for functions producing C strings[0m
[1mss8_mutable_cstr[22m(3), [1mss8_mutable_cstr_suffix[22m(3), [1mss8_set_len[22m(3),
[1mss8_set_len_to_cstrlen[22m(3), [1mss8_grow_len[22m(3)
[1mConverting from standard C strings and byte buffers[0m
[1mss8_copy_cstr[22m(3), [1mss8_copy_bytes[22m(3), [1mss8_init_copy_cstr[22m(3),
[1mss8_init_copy_bytes[22m(3)
[1mConverting to standard C strings and byte buffers[0m
[1mss8_copy_to_cstr[22m(3), [1mss8_copy_to_bytes[22m(3)
[1mAccessing single bytes in strings[0m
[1mss8_at[22m(3), [1mss8_front[22m(3), [1mss8_back[22m(3), [1mss8_set_at[22m(3), [1mss8_set_front[22m(3),
[1mss8_set_back[22m(3)
[1mConcatenating strings[0m
[1mss8_cat[22m(3) and its variants with [1m_cstr[22m, [1m_bytes[22m, [1m_ch[22m, or [1m_ch_n[0m
[1mManaging buffer capacity[0m
[1mss8_capacity[22m(3), [1mss8_reserve[22m(3), [1mss8_shrink_to_fit[22m(3)
[1mGetting substrings[0m
[1mss8_copy_substr[22m(3), [1mss8_substr_inplace[22m(3)
[1mInserting, replacing, and erasing substrings[0m
[1mss8_insert[22m(3), [1mss8_replace[22m(3), and their variants with [1m_cstr[22m, [1m_bytes[22m,
[1m_ch[22m, or [1m_ch_n[22m; [1mss8_erase[22m(3)
[1mComparing strings[0m
[1mss8_cmp[22m(3), [1mss8_equals[22m(3), [1mss8_contains[22m(3), [1mss8_starts_with[22m(3),
[1mss8_ends_with[22m(3), and their variants with [1m_cstr[22m, [1m_bytes[22m, or [1m_ch[0m
[1mSearching for strings[0m
[1mss8_find[22m(3), [1mss8_rfind[22m(3), and their variants with [1m_cstr[22m, [1m_bytes[22m, [1m_ch[22m,
or [1m_not_ch[0m
[1mSearching for characters[0m
[1mss8_find_first_of[22m(3), [1mss8_find_first_not_of[22m(3), [1mss8_find_last_of[22m(3),
[1mss8_find_last_not_of[22m(3), and their variants with [1m_cstr [22mor [1m_bytes[0m
[1mTrimming certain characters from the ends[0m
[1mss8_strip[22m(3), [1mss8_lstrip[22m(3), [1mss8_rstrip[22m(3), and their variants with
[1m_cstr[22m, [1m_bytes[22m, or [1m_ch[0m
[1mFormatting strings[0m
[1mss8_sprintf[22m(3), [1mss8_cat_sprintf[22m(3), and their variants with [1m_snprintf[22m,
[1m_vsprintf[22m, or [1m_vsnprintf[0m
[1mSEE ALSO[0m
[1mbstring[22m(3), [1mstring[22m(3)
SSSTR 2023-12-30 [4mSSSTR[24m(7)