Function ndpi_memmem
Defined in File ndpi_api.h
Function Documentation
-
void *ndpi_memmem(const void *haystack, size_t haystack_len, const void *needle, size_t needle_len)
Finds the first occurrence of the sequence
needlein the arrayhaystack.This function searches for the first occurrence of the sequence
needleof lengthneedle_lenin the arrayhaystackof lengthhaystack_len. IfhaystackorneedleisNULL, orhaystack_lenis less thanneedle_len, orneedle_lenis 0, the function returnsNULL.For optimization, if
needle_lenis 1, thememchrfunction is used.- Parameters:
haystack – Pointer to the array in which the search is performed.
haystack_len – Length of the
haystackarray.needle – Pointer to the array to be searched for in
haystack.needle_len – Length of the
needlearray.
- Returns:
Pointer to the first occurrence of
needleinhaystackorNULLifneedleis not found.