summaryrefslogtreecommitdiff
path: root/src/onigposix.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2020-11-08 10:58:30 +0100
committerJörg Frings-Fürst <debian@jff.email>2020-11-08 10:58:30 +0100
commitfc9ba4264eafbb5a6ec0f3cc4cd2e1964c9b8fcf (patch)
tree465568f63d306c1de9bb8b934b08ee4f033050ad /src/onigposix.h
parent6b986090d954dbac91bbb3c43ce7c3328c91a780 (diff)
New upstream version 6.9.6upstream/6.9.6
Diffstat (limited to 'src/onigposix.h')
-rw-r--r--src/onigposix.h41
1 files changed, 28 insertions, 13 deletions
diff --git a/src/onigposix.h b/src/onigposix.h
index 37e09ea..3514f80 100644
--- a/src/onigposix.h
+++ b/src/onigposix.h
@@ -74,19 +74,19 @@ extern "C" {
#define REG_POSIX_ENCODING_UTF16_LE 5
-typedef int regoff_t;
+typedef int onig_posix_regoff_t;
typedef struct {
- regoff_t rm_so;
- regoff_t rm_eo;
-} regmatch_t;
+ onig_posix_regoff_t rm_so;
+ onig_posix_regoff_t rm_eo;
+} onig_posix_regmatch_t;
/* POSIX regex_t */
typedef struct {
void* onig; /* Oniguruma regex_t* */
size_t re_nsub;
int comp_options;
-} regex_t;
+} onig_posix_regex_t;
#ifndef P_
@@ -160,16 +160,31 @@ ONIG_EXTERN int onig_end P_((void));
#endif /* ONIGURUMA_H */
-ONIG_EXTERN int regcomp P_((regex_t* reg, const char* pat, int options));
-ONIG_EXTERN int regexec P_((regex_t* reg, const char* str, size_t nmatch, regmatch_t* matches, int options));
-ONIG_EXTERN void regfree P_((regex_t* reg));
-ONIG_EXTERN size_t regerror P_((int code, const regex_t* reg, char* buf, size_t size));
+ONIG_EXTERN int onig_posix_regcomp P_((onig_posix_regex_t* reg, const char* pat, int options));
+ONIG_EXTERN int onig_posix_regexec P_((onig_posix_regex_t* reg, const char* str, size_t nmatch, onig_posix_regmatch_t* matches, int options));
+ONIG_EXTERN void onig_posix_regfree P_((onig_posix_regex_t* reg));
+ONIG_EXTERN size_t onig_posix_regerror P_((int code, const onig_posix_regex_t* reg, char* buf, size_t size));
/* extended API */
-ONIG_EXTERN void reg_set_encoding P_((int enc));
-ONIG_EXTERN int reg_name_to_group_numbers P_((regex_t* reg, const unsigned char* name, const unsigned char* name_end, int** nums));
-ONIG_EXTERN int reg_foreach_name P_((regex_t* reg, int (*func)(const unsigned char*, const unsigned char*,int,int*,regex_t*,void*), void* arg));
-ONIG_EXTERN int reg_number_of_names P_((regex_t* reg));
+ONIG_EXTERN void onig_posix_reg_set_encoding P_((int enc));
+ONIG_EXTERN int onig_posix_reg_name_to_group_numbers P_((onig_posix_regex_t* reg, const unsigned char* name, const unsigned char* name_end, int** nums));
+ONIG_EXTERN int onig_posix_reg_foreach_name P_((onig_posix_regex_t* reg, int (*func)(const unsigned char*, const unsigned char*,int,int*,onig_posix_regex_t*,void*), void* arg));
+ONIG_EXTERN int onig_posix_reg_number_of_names P_((onig_posix_regex_t* reg));
+
+
+/* aliases */
+#define regex_t onig_posix_regex_t
+#define regmatch_t onig_posix_regmatch_t
+#define regoff_t onig_posix_regoff_t
+
+#define regcomp onig_posix_regcomp
+#define regexec onig_posix_regexec
+#define regfree onig_posix_regfree
+#define regerror onig_posix_regerror
+#define reg_set_encoding onig_posix_reg_set_encoding
+#define reg_name_to_group_numbers onig_posix_reg_name_to_group_numbers
+#define reg_foreach_name onig_posix_reg_foreach_name
+#define reg_number_of_names onig_posix_reg_number_of_names
#ifdef __cplusplus
}