NAME

catbuf_match - match bytes in a data buffer

SYNOPSIS

#include <cat.h>

int catbuf_match(cat_buffer *b, const void *data, int datalen);

DESCRIPTION

This function counts the number of bytes from data that match the bytes stored in buffer b, starting from the current index in buffer b. datalen is the length of data in bytes.

The function searches only from the current index (that is, the function does not automatically increase the index and search the rest of the buffer).

This function does not change the buffer index.

RETURN VALUES

Returns the number of bytes that matched the specified bytes.

SEE ALSO

cat, catbuf, catbuf_scan