summaryrefslogtreecommitdiff
path: root/src/oniguruma.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-08-31 03:42:05 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-08-31 03:42:05 +0200
commita76fa337cc657dbe669ffb8dbdac606d4d6616f1 (patch)
treea6f004237df60876d087f79ac369fdc2545697c9 /src/oniguruma.h
parent5e01a4852b31d537307994248869caf38b4023cc (diff)
Imported Upstream version 6.1.0upstream/6.1.0
Diffstat (limited to 'src/oniguruma.h')
-rw-r--r--src/oniguruma.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/oniguruma.h b/src/oniguruma.h
index 6e62b50..75301ca 100644
--- a/src/oniguruma.h
+++ b/src/oniguruma.h
@@ -35,7 +35,7 @@ extern "C" {
#define ONIGURUMA
#define ONIGURUMA_VERSION_MAJOR 6
-#define ONIGURUMA_VERSION_MINOR 0
+#define ONIGURUMA_VERSION_MINOR 1
#define ONIGURUMA_VERSION_TEENY 0
#ifdef __cplusplus
@@ -103,9 +103,9 @@ extern "C" {
typedef unsigned int OnigCodePoint;
typedef unsigned char OnigUChar;
typedef unsigned int OnigCtype;
-typedef unsigned int OnigDistance;
+typedef unsigned int OnigLen;
-#define ONIG_INFINITE_DISTANCE ~((OnigDistance )0)
+#define ONIG_INFINITE_DISTANCE ~((OnigLen )0)
typedef unsigned int OnigCaseFoldType; /* case fold flag */
@@ -165,6 +165,7 @@ typedef struct OnigEncodingTypeST {
int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end);
int (*init)(void);
int (*is_initialized)(void);
+ int (*is_valid_mbc_string)(const OnigUChar* s, const OnigUChar* end);
} OnigEncodingType;
typedef OnigEncodingType* OnigEncoding;
@@ -279,6 +280,8 @@ ONIG_EXTERN OnigEncodingType OnigEncodingGB18030;
(enc)->is_allowed_reverse_match(s,end)
#define ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc,start,s) \
(enc)->left_adjust_char_head(start, s)
+#define ONIGENC_IS_VALID_MBC_STRING(enc,s,end) \
+ (enc)->is_valid_mbc_string(s,end)
#define ONIGENC_APPLY_ALL_CASE_FOLD(enc,case_fold_flag,f,arg) \
(enc)->apply_all_case_fold(case_fold_flag,f,arg)
#define ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc,case_fold_flag,p,end,acs) \
@@ -360,6 +363,8 @@ ONIG_EXTERN
int onigenc_strlen_null P_((OnigEncoding enc, const OnigUChar* p));
ONIG_EXTERN
int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p));
+ONIG_EXTERN
+int onigenc_is_valid_mbc_string P_((OnigEncoding enc, const UChar* s, const UChar* end));
@@ -367,6 +372,7 @@ int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p));
/* config parameters */
#define ONIG_NREGION 10
+#define ONIG_MAX_CAPTURE_NUM 32767
#define ONIG_MAX_BACKREF_NUM 1000
#define ONIG_MAX_REPEAT_NUM 100000
#define ONIG_MAX_MULTI_BYTE_RANGES_NUM 10000
@@ -575,6 +581,7 @@ ONIG_EXTERN OnigSyntaxType* OnigDefaultSyntax;
#define ONIGERR_TOO_BIG_BACKREF_NUMBER -207
#define ONIGERR_INVALID_BACKREF -208
#define ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED -209
+#define ONIGERR_TOO_MANY_CAPTURES -210
#define ONIGERR_TOO_LONG_WIDE_CHAR_VALUE -212
#define ONIGERR_EMPTY_GROUP_NAME -214
#define ONIGERR_INVALID_GROUP_NAME -215
@@ -679,16 +686,16 @@ typedef struct re_pattern_buffer {
int optimize; /* optimize flag */
int threshold_len; /* search str-length for apply optimize */
int anchor; /* BEGIN_BUF, BEGIN_POS, (SEMI_)END_BUF */
- OnigDistance anchor_dmin; /* (SEMI_)END_BUF anchor distance */
- OnigDistance anchor_dmax; /* (SEMI_)END_BUF anchor distance */
+ OnigLen anchor_dmin; /* (SEMI_)END_BUF anchor distance */
+ OnigLen anchor_dmax; /* (SEMI_)END_BUF anchor distance */
int sub_anchor; /* start-anchor for exact or map */
unsigned char *exact;
unsigned char *exact_end;
unsigned char map[ONIG_CHAR_TABLE_SIZE]; /* used as BM skip or char-map */
int *int_map; /* BM skip for exact_len > 255 */
int *int_map_backward; /* BM skip for backward search */
- OnigDistance dmin; /* min-distance of exact or map */
- OnigDistance dmax; /* max-distance of exact or map */
+ OnigLen dmin; /* min-distance of exact or map */
+ OnigLen dmax; /* max-distance of exact or map */
/* regex_t link chain */
struct re_pattern_buffer* chain; /* escape compile-conflict */
@@ -735,6 +742,8 @@ void onig_free P_((OnigRegex));
ONIG_EXTERN
void onig_free_body P_((OnigRegex));
ONIG_EXTERN
+int onig_scan(regex_t* reg, const UChar* str, const UChar* end, OnigRegion* region, OnigOptionType option, int (*scan_callback)(int, int, OnigRegion*, void*), void* callback_arg);
+ONIG_EXTERN
int onig_search P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));
ONIG_EXTERN
int onig_match P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option));