summaryrefslogtreecommitdiff
path: root/prism/internal/memchr.h
blob: 6f6b0bca302008eba185fcf934b4c215af22be8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#ifndef PRISM_INTERNAL_MEMCHR_H
#define PRISM_INTERNAL_MEMCHR_H

#include "prism/internal/encoding.h"

#include <stddef.h>

/*
 * We need to roll our own memchr to handle cases where the encoding changes and
 * we need to search for a character in a buffer that could be the trailing byte
 * of a multibyte character.
 */
const void * pm_memchr(const void *source, int character, size_t number, bool encoding_changed, const pm_encoding_t *encoding);

#endif