summaryrefslogtreecommitdiff
path: root/src/regenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/regenc.c')
-rw-r--r--src/regenc.c43
1 files changed, 42 insertions, 1 deletions
diff --git a/src/regenc.c b/src/regenc.c
index 01bfd1d..554a622 100644
--- a/src/regenc.c
+++ b/src/regenc.c
@@ -2,7 +2,7 @@
regenc.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -108,6 +108,20 @@ onigenc_step_back(OnigEncoding enc, const UChar* start, const UChar* s, int n)
return (UChar* )s;
}
+#if 0
+extern int
+onigenc_mbc_enc_len_end(OnigEncoding enc, const UChar* p, const UChar* end)
+{
+ int len;
+ int n;
+
+ len = ONIGENC_MBC_ENC_LEN(enc, p);
+ n = (int )(end - p);
+
+ return (n < len ? n : len);
+}
+#endif
+
extern UChar*
onigenc_step(OnigEncoding enc, const UChar* p, const UChar* end, int n)
{
@@ -649,6 +663,33 @@ onigenc_always_false_is_allowed_reverse_match(const UChar* s ARG_UNUSED,
return FALSE;
}
+extern int
+onigenc_always_true_is_valid_mbc_string(const UChar* s ARG_UNUSED,
+ const UChar* end ARG_UNUSED)
+{
+ return TRUE;
+}
+
+extern int
+onigenc_length_check_is_valid_mbc_string(OnigEncoding enc,
+ const UChar* p, const UChar* end)
+{
+ while (p < end) {
+ p += enclen(enc, p);
+ }
+
+ if (p != end)
+ return FALSE;
+ else
+ return TRUE;
+}
+
+extern int
+onigenc_is_valid_mbc_string(OnigEncoding enc, const UChar* s, const UChar* end)
+{
+ return ONIGENC_IS_VALID_MBC_STRING(enc, s, end);
+}
+
extern OnigCodePoint
onigenc_mbn_mbc_to_code(OnigEncoding enc, const UChar* p, const UChar* end)
{