summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorksaito <ksaito@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-13 01:39:06 +0000
committerksaito <ksaito@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-13 01:39:06 +0000
commitb89ef2b6441c80a90eaa59ed4875a22675fa85ca (patch)
treea608b8be980d0fdfad79d0232c28b862580d53d9
parent00d60587406dd7710cc191669e86e0859ddb8968 (diff)
downloadruby-b89ef2b6441c80a90eaa59ed4875a22675fa85ca.tar.gz
imported Oni Guruma 3.6.0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/KOSAKO@7956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--oniggnu.h8
-rw-r--r--oniguruma.h26
-rw-r--r--regcomp.c18
-rw-r--r--st.c1
4 files changed, 46 insertions, 7 deletions
diff --git a/oniggnu.h b/oniggnu.h
index e63374efc0..0882577760 100644
--- a/oniggnu.h
+++ b/oniggnu.h
@@ -31,6 +31,10 @@
#include "oniguruma.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define MBCTYPE_ASCII 0
#define MBCTYPE_EUC 1
#define MBCTYPE_SJIS 2
@@ -107,4 +111,8 @@ void re_free_registers P_((struct re_registers*));
ONIG_EXTERN
int re_alloc_pattern P_((struct re_pattern_buffer**)); /* added */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* ONIGGNU_H */
diff --git a/oniguruma.h b/oniguruma.h
index 95cd109384..69dd939e5b 100644
--- a/oniguruma.h
+++ b/oniguruma.h
@@ -29,10 +29,14 @@
* SUCH DAMAGE.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define ONIGURUMA
#define ONIGURUMA_VERSION_MAJOR 3
-#define ONIGURUMA_VERSION_MINOR 5
-#define ONIGURUMA_VERSION_TEENY 4
+#define ONIGURUMA_VERSION_MINOR 6
+#define ONIGURUMA_VERSION_TEENY 0
#ifdef __cplusplus
# ifndef HAVE_PROTOTYPES
@@ -82,6 +86,10 @@ typedef unsigned int OnigDistance;
#define ONIG_INFINITE_DISTANCE ~((OnigDistance )0)
/* ambiguous match flag */
+typedef unsigned int OnigAmbigType;
+
+ONIG_EXTERN OnigAmbigType OnigDefaultAmbigFlag;
+
#define ONIGENC_AMBIGUOUS_MATCH_NONE 0
#define ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE (1<<0)
#define ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE (1<<1)
@@ -96,12 +104,8 @@ typedef unsigned int OnigDistance;
( ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | \
ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE | \
ONIGENC_AMBIGUOUS_MATCH_COMPOUND )
-#define ONIGENC_AMBIGUOUS_MATCH_DEFAULT \
- (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | \
- ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE | \
- ONIGENC_AMBIGUOUS_MATCH_COMPOUND )
+#define ONIGENC_AMBIGUOUS_MATCH_DEFAULT OnigDefaultAmbigFlag
-typedef unsigned int OnigAmbigType;
#define ONIGENC_MAX_COMP_AMBIG_CODE_LEN 3
#define ONIGENC_MAX_COMP_AMBIG_CODE_ITEM_NUM 4
@@ -851,6 +855,10 @@ int onig_set_meta_char P_((OnigEncoding enc, unsigned int what, OnigCodePoint co
ONIG_EXTERN
void onig_copy_encoding P_((OnigEncoding to, OnigEncoding from));
ONIG_EXTERN
+OnigAmbigType onig_get_default_ambig_flag P_(());
+ONIG_EXTERN
+int onig_set_default_ambig_flag P_((OnigAmbigType ambig_flag));
+ONIG_EXTERN
unsigned int onig_get_match_stack_limit_size P_((void));
ONIG_EXTERN
int onig_set_match_stack_limit_size P_((unsigned int size));
@@ -861,4 +869,8 @@ const char* onig_version P_((void));
ONIG_EXTERN
const char* onig_copyright P_((void));
+#ifdef __cplusplus
+}
+#endif
+
#endif /* ONIGURUMA_H */
diff --git a/regcomp.c b/regcomp.c
index 116bcb7c9b..80bc13b4c5 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -29,6 +29,24 @@
#include "regparse.h"
+OnigAmbigType OnigDefaultAmbigFlag =
+ (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE |
+ ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE);
+
+extern OnigAmbigType
+onig_get_default_ambig_flag()
+{
+ return OnigDefaultAmbigFlag;
+}
+
+extern int
+onig_set_default_ambig_flag(OnigAmbigType ambig_flag)
+{
+ OnigDefaultAmbigFlag = ambig_flag;
+ return 0;
+}
+
+
#ifndef PLATFORM_UNALIGNED_WORD_ACCESS
static unsigned char PadBuf[WORD_ALIGNMENT_SIZE];
#endif
diff --git a/st.c b/st.c
index cad73288f6..5bce4ff836 100644
--- a/st.c
+++ b/st.c
@@ -246,6 +246,7 @@ st_free_table(table)
ptr = table->bins[i];
while (ptr != 0) {
next = ptr->next;
+ table->type->key_free(ptr->key);
free(ptr);
ptr = next;
}