aboutsummaryrefslogtreecommitdiffstats
path: root/include/ruby/encoding.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ruby/encoding.h')
-rw-r--r--include/ruby/encoding.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h
index 48b1621745..4f6608cb1b 100644
--- a/include/ruby/encoding.h
+++ b/include/ruby/encoding.h
@@ -123,8 +123,14 @@ int rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc);
/* -> 0x00..0x7f, -1 */
int rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc);
-/* -> code or raise exception */
+
+/* -> code (and len) or raise exception */
+unsigned int rb_enc_codepoint_len(const char *p, const char *e, int *len, rb_encoding *enc);
+
+/* prototype for obsolete function */
unsigned int rb_enc_codepoint(const char *p, const char *e, rb_encoding *enc);
+/* overriding macro */
+#define rb_enc_codepoint(p,e,enc) rb_enc_codepoint_len((p),(e),0,(enc))
#define rb_enc_mbc_to_codepoint(p, e, enc) ONIGENC_MBC_TO_CODE(enc,(UChar*)(p),(UChar*)(e))
/* -> codelen>0 or raise exception */