Next: , Previous: Autobuf deletion, Up: Automatic buffers


11.8 Searching in an autobuf

— Function: ssize_t abuf_find (const Autobuf *abuf, ssize_t index, const Autobuf *target)

Returns the first position in abuf at which the contents of target are found. The first position to look at is the next position after index, or zero if index is negative. If target is not found, -1 is returned.

— Function: ssize_t abuf_find_buf (const Autobuf *abuf, ssize_t index, const unsigned char *buf, ssize_t len)

Returns the first position in abuf at which copies of the len characters stored at buf are found. are found. The first position to look at is the next position after index, or zero if index is negative. If buf is not found, -1 is returned.

— Function: ssize_t abuf_find_astr (const Autobuf *abuf, ssize_t index, const Autostr *astr)

Returns the first position in abuf at which the contents of astr are found. The first position to look at is the next position after index, or zero if index is negative. If astr is not found, -1 is returned.

— Function: ssize_t abuf_find_s (const Autobuf *abuf, ssize_t index, const char *chars)

Returns the first position in abuf at which the characters referenced by chars are found. The first position to look at is the next position after index, or zero if index is negative. If the target is not found, -1 is returned.

— Function: ssize_t abuf_find_c (const Autobuf *abuf, ssize_t index, unsigned char c)

Returns the first position in abuf at which the single character c s found. The first position to look at is the next position after index, or zero if index is negative. If c is not found, -1 is returned.

— Function: ssize_t abuf_rfind_c (const Autobuf *abuf, ssize_t last_found_index, unsigned char c)

Returns the last position in abuf at which the single character c is found. The last position in the autobuf to be considered is the position before last_found_index, or the final position if last_found_index is negative. If c is not found, -1 is returned.