aboutsummaryrefslogtreecommitdiffstats
path: root/prism/util/pm_memchr.h
blob: fdc55a730b6914778a489d392983e0a15ac9cf59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef PRISM_MEMCHR_H
#define PRISM_MEMCHR_H

#include "prism/defines.h"
#include "prism/enc/pm_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.
void * pm_memchr(const void *source, int character, size_t number, bool encoding_changed, pm_encoding_t *encoding);

#endif