summaryrefslogtreecommitdiff
path: root/prism/util/pm_memchr.c
diff options
context:
space:
mode:
Diffstat (limited to 'prism/util/pm_memchr.c')
-rw-r--r--prism/util/pm_memchr.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/prism/util/pm_memchr.c b/prism/util/pm_memchr.c
index af9c14397e..c5dd2e8655 100644
--- a/prism/util/pm_memchr.c
+++ b/prism/util/pm_memchr.c
@@ -1,13 +1,13 @@
-#include "yarp/util/yp_memchr.h"
+#include "prism/util/pm_memchr.h"
-#define YP_MEMCHR_TRAILING_BYTE_MINIMUM 0x40
+#define PRISM_MEMCHR_TRAILING_BYTE_MINIMUM 0x40
// 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 *
-yp_memchr(const void *memory, int character, size_t number, bool encoding_changed, yp_encoding_t *encoding) {
- if (encoding_changed && encoding->multibyte && character >= YP_MEMCHR_TRAILING_BYTE_MINIMUM) {
+pm_memchr(const void *memory, int character, size_t number, bool encoding_changed, pm_encoding_t *encoding) {
+ if (encoding_changed && encoding->multibyte && character >= PRISM_MEMCHR_TRAILING_BYTE_MINIMUM) {
const uint8_t *source = (const uint8_t *) memory;
size_t index = 0;
@@ -29,3 +29,5 @@ yp_memchr(const void *memory, int character, size_t number, bool encoding_change
return memchr(memory, character, number);
}
}
+
+#undef PRISM_MEMCHR_TRAILING_BYTE_MINIMUM