SS8_EQUALS(3)                    Ssstr Manual                    SS8_EQUALS(3)



NAME
       ss8_equals,  ss8_equals_cstr,  ss8_equals_bytes, ss8_equals_ch - deter‐
       mine if an ssstr byte string is equal to a string or character

SYNOPSIS
       #include <ss8str.h>

       bool ss8_equals(ss8str const *lhs, ss8str const *rhs);
       bool ss8_equals_cstr(ss8str const *lhs, char const *rhs);
       bool ss8_equals_bytes(ss8str const *lhs, char const *rhs,
                             size_t rhslen);
       bool ss8_equals_ch(ss8str const *lhs, char rhs);

DESCRIPTION
       ss8_equals() tests whether the ss8str at lhs is equal to the ss8str  at
       rhs.   Behavior  is  undefined  unless  lhs and rhs both point to valid
       ss8str objects.

       ss8_equals_cstr() tests whether the ss8str at lhs is equal to the null-
       terminated byte string rhs.  Behavior is undefined unless lhs points to
       a valid ss8str object and rhs is a null-terminated byte string.

       ss8_equals_bytes() tests whether the ss8str at lhs is equal to the byte
       string with length rhslen located at rhs.  Behavior is undefined unless
       lhs points to a valid ss8str object and rhs is not NULL and  points  to
       an array of at least rhslen bytes.

       ss8_equals_ch()  tests  whether  the ss8str at lhs is equal to the byte
       string consisting of the single byte rhs.  Behavior is undefined unless
       lhs points to a valid ss8str object.

       Two  byte  strings  are considered equal when they have the same length
       and are byte-wise equal.

RETURN VALUE
       All 4 functions return true if lhs is equal to rhs; otherwise they  re‐
       turn false.

NOTES
       The equality comparison performed by these functions does not take into
       account the possibility of different byte  sequences  representing  the
       same  character.  If the strings are UTF-8-encoded, canonically-equiva‐
       lent strings may not be considered equal by these functions unless  the
       strings are normalized ahead of time.

SEE ALSO
       ss8_cmp(3),   ss8_contains(3),   ss8_ends_with(3),  ss8_starts_with(3),
       ssstr(7)



SSSTR                             2023-12-30                     SS8_EQUALS(3)