SS8_FIND_FIRST_OF(3)             Ssstr Manual             SS8_FIND_FIRST_OF(3)



NAME
       ss8_find_first_of,   ss8_find_first_of_cstr,   ss8_find_first_of_bytes,
       ss8_find_first_not_of,                      ss8_find_first_not_of_cstr,
       ss8_find_first_not_of_bytes,  ss8_find_last_of,  ss8_find_last_of_cstr,
       ss8_find_last_of_bytes,                           ss8_find_last_not_of,
       ss8_find_last_not_of_cstr,  ss8_find_last_not_of_bytes  -  find  in  an
       ssstr byte string occurrence of a character in or not in a set

SYNOPSIS
       #include <ss8str.h>

       size_t ss8_find_first_of(ss8str const *haystack, size_t start,
                                ss8str const *needles);
       size_t ss8_find_first_of_cstr(ss8str const *haystack,
                                size_t start, char const *needles);
       size_t ss8_find_first_of_bytes(ss8str const *haystack,
                                size_t start, char const *needles,
                                size_t count);

       size_t ss8_find_first_not_of(ss8str const *haystack,
                                size_t start, ss8str const *needles);
       size_t ss8_find_first_not_of_cstr(ss8str const *haystack,
                                size_t start, char const *needles);
       size_t ss8_find_first_not_of_bytes(ss8str const *haystack,
                                size_t start, char const *needles,
                                size_t count);

       size_t ss8_find_last_of(ss8str const *haystack, size_t start,
                                ss8str const *needles);
       size_t ss8_find_last_of_cstr(ss8str const *haystack,
                                size_t start, char const *needles);
       size_t ss8_find_last_of_bytes(ss8str const *haystack,
                                size_t start, char const *needles,
                                size_t count);

       size_t ss8_find_last_not_of(ss8str const *haystack,
                                size_t start, ss8str const *needles);
       size_t ss8_find_last_not_of_cstr(ss8str const *haystack,
                                size_t start, char const *needles);
       size_t ss8_find_last_not_of_bytes(ss8str const *haystack,
                                size_t start, char const *needles,
                                size_t count);

DESCRIPTION
       ss8_find_first_of() finds the first occurrence of any of the bytes that
       appear in the ss8str at needles, in the ss8str at haystack.  The search
       begins at byte position start.  Behavior is undefined  unless  haystack
       and  needles  both point to valid ss8str objects and start is less than
       or equal to the length of the haystack string.

       ss8_find_first_of_cstr() is  like  ss8_find_first_of()  but  finds  the
       first occurrence of any of the bytes that appear in the null-terminated
       byte string needles.  Behavior is undefined unless haystack points to a
       valid  ss8str  object, start is less than or equal to the length of the
       haystack string, and needles is a null-terminated byte string.

       ss8_find_first_of_bytes() is like  ss8_find_first_of()  but  finds  the
       first  occurrence of any of the bytes that appear in the byte string of
       length count located at needles.  Behavior is undefined unless haystack
       points  to  a  valid  ss8str object, start is less than or equal to the
       length of the haystack string, and needles is not NULL and points to an
       array of at least count bytes.

       ss8_find_first_not_of(),        ss8_find_first_not_of_cstr(),       and
       ss8_find_first_not_of_bytes()  are  like  the  corresponding  functions
       without the not in the name, except that they find the first occurrence
       of a byte that does not appear in needles.

       ss8_find_last_of(),            ss8_find_last_of_cstr(),             and
       ss8_find_last_of_bytes()  are  like  the  corresponding  functions with
       first instead of last in the name, except that they find the  last  oc‐
       currence of a byte that appears in needles.

       ss8_find_last_not_of(),         ss8_find_last_not_of_cstr(),        and
       ss8_find_last_not_of_bytes() are like the corresponding functions with‐
       out the not in the name, except that they find the last occurrence of a
       byte that does not appear in needles.

RETURN VALUE
       All 12 functions return the position, counting from  the  beginning  of
       the  haystack  string,  of  the matching byte.  If there is no matching
       byte, SIZE_MAX is returned.

SEE ALSO
       ss8_find(3), ss8_strip(3), ssstr(7)



SSSTR                             2023-12-30              SS8_FIND_FIRST_OF(3)