summaryrefslogtreecommitdiff
path: root/oniggnu.h
diff options
context:
space:
mode:
Diffstat (limited to 'oniggnu.h')
-rw-r--r--oniggnu.h45
1 files changed, 39 insertions, 6 deletions
diff --git a/oniggnu.h b/oniggnu.h
index d78dc18b11..106cb0303d 100644
--- a/oniggnu.h
+++ b/oniggnu.h
@@ -1,12 +1,33 @@
+#ifndef ONIGGNU_H
+#define ONIGGNU_H
/**********************************************************************
-
oniggnu.h - Oniguruma (regular expression library)
-
- Copyright (C) 2004 K.Kosako (kosako@sofnec.co.jp)
-
**********************************************************************/
-#ifndef ONIGGNU_H
-#define ONIGGNU_H
+/*-
+ * Copyright (c) 2002-2004 K.Kosako <kosako AT sofnec DOT co DOT jp>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
#include "oniguruma.h"
@@ -27,6 +48,18 @@
#define RE_OPTION_POSIXLINE (RE_OPTION_MULTILINE|RE_OPTION_SINGLELINE)
#ifdef RUBY_PLATFORM
+
+#ifndef ONIG_RUBY_M17N
+
+ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding;
+
+#undef ismbchar
+#define ismbchar(c) (mbclen((c)) != 1)
+#define mbclen(c) \
+ ONIGENC_MBC_ENC_LEN(OnigEncDefaultCharEncoding, (UChar* )(&c))
+
+#endif /* ifndef ONIG_RUBY_M17N */
+
#define re_mbcinit ruby_re_mbcinit
#define re_compile_pattern ruby_re_compile_pattern
#define re_recompile_pattern ruby_re_recompile_pattern