base/mem/m_mem.c
/* See offset where needle exists in haystack, -1 if it doesn't exist */
See offset where needle exists in haystack, -1 if it doesn't exist
See offset where needle exists in haystack - 1 if it doesn ' t exist
M_bool M_mem_mempos(const void *haystack, size_t haystack_len, const void *needle, size_t needle_len, size_t *idx)
{
	M_uint8 *pos = M_mem_mem(haystack, haystack_len, needle, needle_len);
	if (pos != NULL && idx != NULL)
		*idx = (size_t)(pos - (const M_uint8 *)haystack);
	return pos != NULL;
}
M_bool M_mem_mempos ( const void * haystack , size_t haystack_len , const void * needle , size_t needle_len , size_t * idx ) { M_uint8 * pos = M_mem_mem ( haystack , haystack_len , needle , needle_len ) ; if ( pos != NULL && idx != NULL ) * idx = ( size_t ) ( pos - ( const M_uint8 * ) haystack ) ; return pos != NULL ; }
See offset where needle exists in haystack, -1 if it doesn't exist
See offset where needle exists in haystack - 1 if it doesn ' t exist