| 1 | /********************************************************************** |
| 2 | regposix.c - Onigmo (Oniguruma-mod) (regular expression library) |
| 3 | **********************************************************************/ |
| 4 | /*- |
| 5 | * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> |
| 6 | * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp> |
| 7 | * All rights reserved. |
| 8 | * |
| 9 | * Redistribution and use in source and binary forms, with or without |
| 10 | * modification, are permitted provided that the following conditions |
| 11 | * are met: |
| 12 | * 1. Redistributions of source code must retain the above copyright |
| 13 | * notice, this list of conditions and the following disclaimer. |
| 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| 15 | * notice, this list of conditions and the following disclaimer in the |
| 16 | * documentation and/or other materials provided with the distribution. |
| 17 | * |
| 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
| 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
| 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 28 | * SUCH DAMAGE. |
| 29 | */ |
| 30 | |
| 31 | #define regex_tcxx . . $ `vendor/onigmo-source/regposix.c:31:9`! onig_regex_t |
| 32 | #include "regint.h"cxx . . $ `<file>/vendor/onigmo-source/regint.h`/ |
| 33 | #undef regex_tcxx . . $ `vendor/onigmo-source/regposix.c:31:9`! |
| 34 | #include "onigmoposix.h"cxx . . $ `<file>/vendor/onigmo-source/onigmoposix.h`/ |
| 35 | |
| 36 | #define ONIG_Ccxx . . $ `vendor/onigmo-source/regposix.c:36:9`!(reg) ((onig_regex_t* )((reg)->onig)) |
| 37 | #define PONIG_Ccxx . . $ `vendor/onigmo-source/regposix.c:37:9`!(reg) ((onig_regex_t** )(&(reg)->onig)) |
| 38 | |
| 39 | /* #define ENC_STRING_LEN(enc,s,len) len = strlen(s) */ |
| 40 | #define ENC_STRING_LENcxx . . $ `vendor/onigmo-source/regposix.c:40:9`!(enc,s,len) do { \ |
| 41 | if (ONIGENC_MBC_MINLENcxx . . $ `vendor/onigmo-source/onigmo.h:364:9`!(enc) == 1) { \ |
| 42 | UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`!* tmps = (UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`!* )(s); \ |
| 43 | while (*tmps != 0) tmps++; \ |
| 44 | len = (int )(tmps - (UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`!* )(s)); \ |
| 45 | } \ |
| 46 | else { \ |
| 47 | len = onigenc_str_bytelen_null(enc, (UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`!* )s); \ |
| 48 | } \ |
| 49 | } while(0) |
| 50 | |
| 51 | typedef structcxx . . $ $anonymous_type_4cf47ec43ab96c0e_0# { |
| 52 | int onig_errcxx . . $ $anonymous_type_4cf47ec43ab96c0e_0#onig_err.; |
| 53 | int posix_errcxx . . $ $anonymous_type_4cf47ec43ab96c0e_0#posix_err.; |
| 54 | } O2PERRcxx . . $ O2PERR#; |
| 55 | |
| 56 | static int |
| 57 | onig2posix_error_codecxx . . $ onig2posix_error_code(7864480464b09eea).(int code) |
| 58 | { |
| 59 | static const O2PERRcxx . . $ O2PERR# o2p[] = { |
| 60 | { ONIG_MISMATCHcxx . . $ `vendor/onigmo-source/onigmo.h:625:9`!, REG_NOMATCHcxx . . $ `vendor/onigmo-source/onigmoposix.h:47:9`! }, |
| 61 | { ONIG_NO_SUPPORT_CONFIGcxx . . $ `vendor/onigmo-source/onigmo.h:626:9`!, REG_EONIG_INTERNALcxx . . $ `vendor/onigmo-source/onigmoposix.h:62:9`! }, |
| 62 | { ONIGERR_MEMORYcxx . . $ `vendor/onigmo-source/onigmo.h:629:9`!, REG_ESPACEcxx . . $ `vendor/onigmo-source/onigmoposix.h:58:9`! }, |
| 63 | { ONIGERR_MATCH_STACK_LIMIT_OVERcxx . . $ `vendor/onigmo-source/onigmo.h:635:9`!, REG_EONIG_INTERNALcxx . . $ `vendor/onigmo-source/onigmoposix.h:62:9`! }, |
| 64 | { ONIGERR_TYPE_BUGcxx . . $ `vendor/onigmo-source/onigmo.h:630:9`!, REG_EONIG_INTERNALcxx . . $ `vendor/onigmo-source/onigmoposix.h:62:9`! }, |
| 65 | { ONIGERR_PARSER_BUGcxx . . $ `vendor/onigmo-source/onigmo.h:631:9`!, REG_EONIG_INTERNALcxx . . $ `vendor/onigmo-source/onigmoposix.h:62:9`! }, |
| 66 | { ONIGERR_STACK_BUGcxx . . $ `vendor/onigmo-source/onigmo.h:632:9`!, REG_EONIG_INTERNALcxx . . $ `vendor/onigmo-source/onigmoposix.h:62:9`! }, |
| 67 | { ONIGERR_UNDEFINED_BYTECODEcxx . . $ `vendor/onigmo-source/onigmo.h:633:9`!, REG_EONIG_INTERNALcxx . . $ `vendor/onigmo-source/onigmoposix.h:62:9`! }, |
| 68 | { ONIGERR_UNEXPECTED_BYTECODEcxx . . $ `vendor/onigmo-source/onigmo.h:634:9`!, REG_EONIG_INTERNALcxx . . $ `vendor/onigmo-source/onigmoposix.h:62:9`! }, |
| 69 | { ONIGERR_DEFAULT_ENCODING_IS_NOT_SETcxx . . $ `vendor/onigmo-source/onigmo.h:637:9`!, REG_EONIG_BADARGcxx . . $ `vendor/onigmo-source/onigmoposix.h:64:9`! }, |
| 70 | { ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHARcxx . . $ `vendor/onigmo-source/onigmo.h:638:9`!, REG_EONIG_BADARGcxx . . $ `vendor/onigmo-source/onigmoposix.h:64:9`! }, |
| 71 | { ONIGERR_INVALID_ARGUMENTcxx . . $ `vendor/onigmo-source/onigmo.h:640:9`!, REG_EONIG_BADARGcxx . . $ `vendor/onigmo-source/onigmoposix.h:64:9`! }, |
| 72 | { ONIGERR_END_PATTERN_AT_LEFT_BRACEcxx . . $ `vendor/onigmo-source/onigmo.h:642:9`!, REG_EBRACEcxx . . $ `vendor/onigmo-source/onigmoposix.h:55:9`! }, |
| 73 | { ONIGERR_END_PATTERN_AT_LEFT_BRACKETcxx . . $ `vendor/onigmo-source/onigmo.h:643:9`!, REG_EBRACKcxx . . $ `vendor/onigmo-source/onigmoposix.h:53:9`! }, |
| 74 | { ONIGERR_EMPTY_CHAR_CLASScxx . . $ `vendor/onigmo-source/onigmo.h:644:9`!, REG_ECTYPEcxx . . $ `vendor/onigmo-source/onigmoposix.h:50:9`! }, |
| 75 | { ONIGERR_PREMATURE_END_OF_CHAR_CLASScxx . . $ `vendor/onigmo-source/onigmo.h:645:9`!, REG_ECTYPEcxx . . $ `vendor/onigmo-source/onigmoposix.h:50:9`! }, |
| 76 | { ONIGERR_END_PATTERN_AT_ESCAPEcxx . . $ `vendor/onigmo-source/onigmo.h:646:9`!, REG_EESCAPEcxx . . $ `vendor/onigmo-source/onigmoposix.h:51:9`! }, |
| 77 | { ONIGERR_END_PATTERN_AT_METAcxx . . $ `vendor/onigmo-source/onigmo.h:647:9`!, REG_EESCAPEcxx . . $ `vendor/onigmo-source/onigmoposix.h:51:9`! }, |
| 78 | { ONIGERR_END_PATTERN_AT_CONTROLcxx . . $ `vendor/onigmo-source/onigmo.h:648:9`!, REG_EESCAPEcxx . . $ `vendor/onigmo-source/onigmoposix.h:51:9`! }, |
| 79 | { ONIGERR_META_CODE_SYNTAXcxx . . $ `vendor/onigmo-source/onigmo.h:649:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 80 | { ONIGERR_CONTROL_CODE_SYNTAXcxx . . $ `vendor/onigmo-source/onigmo.h:650:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 81 | { ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGEcxx . . $ `vendor/onigmo-source/onigmo.h:651:9`!, REG_ECTYPEcxx . . $ `vendor/onigmo-source/onigmoposix.h:50:9`! }, |
| 82 | { ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGEcxx . . $ `vendor/onigmo-source/onigmo.h:652:9`!, REG_ECTYPEcxx . . $ `vendor/onigmo-source/onigmoposix.h:50:9`! }, |
| 83 | { ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASScxx . . $ `vendor/onigmo-source/onigmo.h:653:9`!, REG_ECTYPEcxx . . $ `vendor/onigmo-source/onigmoposix.h:50:9`! }, |
| 84 | { ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIEDcxx . . $ `vendor/onigmo-source/onigmo.h:654:9`!, REG_BADRPTcxx . . $ `vendor/onigmo-source/onigmoposix.h:59:9`! }, |
| 85 | { ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALIDcxx . . $ `vendor/onigmo-source/onigmo.h:655:9`!, REG_BADRPTcxx . . $ `vendor/onigmo-source/onigmoposix.h:59:9`! }, |
| 86 | { ONIGERR_NESTED_REPEAT_OPERATORcxx . . $ `vendor/onigmo-source/onigmo.h:656:9`!, REG_BADRPTcxx . . $ `vendor/onigmo-source/onigmoposix.h:59:9`! }, |
| 87 | { ONIGERR_UNMATCHED_CLOSE_PARENTHESIScxx . . $ `vendor/onigmo-source/onigmo.h:657:9`!, REG_EPARENcxx . . $ `vendor/onigmo-source/onigmoposix.h:54:9`! }, |
| 88 | { ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIScxx . . $ `vendor/onigmo-source/onigmo.h:658:9`!, REG_EPARENcxx . . $ `vendor/onigmo-source/onigmoposix.h:54:9`! }, |
| 89 | { ONIGERR_END_PATTERN_IN_GROUPcxx . . $ `vendor/onigmo-source/onigmo.h:659:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 90 | { ONIGERR_UNDEFINED_GROUP_OPTIONcxx . . $ `vendor/onigmo-source/onigmo.h:660:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 91 | { ONIGERR_INVALID_POSIX_BRACKET_TYPEcxx . . $ `vendor/onigmo-source/onigmo.h:661:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 92 | { ONIGERR_INVALID_LOOK_BEHIND_PATTERNcxx . . $ `vendor/onigmo-source/onigmo.h:662:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 93 | { ONIGERR_INVALID_REPEAT_RANGE_PATTERNcxx . . $ `vendor/onigmo-source/onigmo.h:663:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 94 | { ONIGERR_TOO_BIG_NUMBERcxx . . $ `vendor/onigmo-source/onigmo.h:666:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 95 | { ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGEcxx . . $ `vendor/onigmo-source/onigmo.h:667:9`!, REG_BADBRcxx . . $ `vendor/onigmo-source/onigmoposix.h:56:9`! }, |
| 96 | { ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGEcxx . . $ `vendor/onigmo-source/onigmo.h:668:9`!, REG_BADBRcxx . . $ `vendor/onigmo-source/onigmoposix.h:56:9`! }, |
| 97 | { ONIGERR_EMPTY_RANGE_IN_CHAR_CLASScxx . . $ `vendor/onigmo-source/onigmo.h:669:9`!, REG_ECTYPEcxx . . $ `vendor/onigmo-source/onigmoposix.h:50:9`! }, |
| 98 | { ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGEcxx . . $ `vendor/onigmo-source/onigmo.h:670:9`!, REG_ECTYPEcxx . . $ `vendor/onigmo-source/onigmoposix.h:50:9`! }, |
| 99 | { ONIGERR_TOO_MANY_MULTI_BYTE_RANGEScxx . . $ `vendor/onigmo-source/onigmo.h:671:9`!, REG_ECTYPEcxx . . $ `vendor/onigmo-source/onigmoposix.h:50:9`! }, |
| 100 | { ONIGERR_TOO_SHORT_MULTI_BYTE_STRINGcxx . . $ `vendor/onigmo-source/onigmo.h:672:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 101 | { ONIGERR_TOO_BIG_BACKREF_NUMBERcxx . . $ `vendor/onigmo-source/onigmo.h:673:9`!, REG_ESUBREGcxx . . $ `vendor/onigmo-source/onigmoposix.h:52:9`! }, |
| 102 | { ONIGERR_INVALID_BACKREFcxx . . $ `vendor/onigmo-source/onigmo.h:674:9`!, REG_ESUBREGcxx . . $ `vendor/onigmo-source/onigmoposix.h:52:9`! }, |
| 103 | { ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWEDcxx . . $ `vendor/onigmo-source/onigmo.h:675:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 104 | { ONIGERR_TOO_BIG_WIDE_CHAR_VALUEcxx . . $ `vendor/onigmo-source/onigmo.h:691:9`!, REG_EONIG_BADWCcxx . . $ `vendor/onigmo-source/onigmoposix.h:63:9`! }, |
| 105 | { ONIGERR_TOO_LONG_WIDE_CHAR_VALUEcxx . . $ `vendor/onigmo-source/onigmo.h:678:9`!, REG_EONIG_BADWCcxx . . $ `vendor/onigmo-source/onigmoposix.h:63:9`! }, |
| 106 | { ONIGERR_INVALID_CODE_POINT_VALUEcxx . . $ `vendor/onigmo-source/onigmo.h:689:9`!, REG_EONIG_BADWCcxx . . $ `vendor/onigmo-source/onigmoposix.h:63:9`! }, |
| 107 | { ONIGERR_EMPTY_GROUP_NAMEcxx . . $ `vendor/onigmo-source/onigmo.h:679:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 108 | { ONIGERR_INVALID_GROUP_NAMEcxx . . $ `vendor/onigmo-source/onigmo.h:680:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 109 | { ONIGERR_INVALID_CHAR_IN_GROUP_NAMEcxx . . $ `vendor/onigmo-source/onigmo.h:681:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 110 | { ONIGERR_UNDEFINED_NAME_REFERENCEcxx . . $ `vendor/onigmo-source/onigmo.h:682:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 111 | { ONIGERR_UNDEFINED_GROUP_REFERENCEcxx . . $ `vendor/onigmo-source/onigmo.h:683:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 112 | { ONIGERR_MULTIPLEX_DEFINED_NAMEcxx . . $ `vendor/onigmo-source/onigmo.h:684:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 113 | { ONIGERR_MULTIPLEX_DEFINITION_NAME_CALLcxx . . $ `vendor/onigmo-source/onigmo.h:685:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 114 | { ONIGERR_NEVER_ENDING_RECURSIONcxx . . $ `vendor/onigmo-source/onigmo.h:686:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 115 | { ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORYcxx . . $ `vendor/onigmo-source/onigmo.h:687:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 116 | { ONIGERR_INVALID_CHAR_PROPERTY_NAMEcxx . . $ `vendor/onigmo-source/onigmo.h:688:9`!, REG_BADPATcxx . . $ `vendor/onigmo-source/onigmoposix.h:48:9`! }, |
| 117 | { ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATIONcxx . . $ `vendor/onigmo-source/onigmo.h:692:9`!, REG_EONIG_BADARGcxx . . $ `vendor/onigmo-source/onigmoposix.h:64:9`! }, |
| 118 | |
| 119 | }; |
| 120 | |
| 121 | int i; |
| 122 | |
| 123 | if (code >= 0) return 0; |
| 124 | |
| 125 | for (i = 0; i < numberofcxx . . $ `vendor/onigmo-source/regenc.h:128:10`!(o2p); i++) { |
| 126 | if (code == o2p[i].onig_errcxx . . $ $anonymous_type_4cf47ec43ab96c0e_0#onig_err.) |
| 127 | return o2p[i].posix_errcxx . . $ $anonymous_type_4cf47ec43ab96c0e_0#posix_err.; |
| 128 | } |
| 129 | |
| 130 | return REG_EONIG_INTERNALcxx . . $ `vendor/onigmo-source/onigmoposix.h:62:9`!; /* but, unknown error code */ |
| 131 | } |
| 132 | |
| 133 | extern int |
| 134 | regcompcxx . . $ regcomp(7d3483c078aef8a).(regex_tcxx . . $ regex_t#* reg, const char* pattern, int posix_options) |
| 135 | { |
| 136 | int r, len; |
| 137 | const OnigSyntaxTypecxx . . $ OnigSyntaxType#* syntax = OnigDefaultSyntaxcxx . . $ OnigDefaultSyntax.; |
| 138 | OnigOptionTypecxx . . $ OnigOptionType# options; |
| 139 | |
| 140 | if ((posix_options & REG_EXTENDEDcxx . . $ `vendor/onigmo-source/onigmoposix.h:43:9`!) == 0) |
| 141 | syntax = ONIG_SYNTAX_POSIX_BASICcxx . . $ `vendor/onigmo-source/onigmo.h:502:9`!; |
| 142 | |
| 143 | options = syntax->optionscxx . . $ $anonymous_type_d8a9e63ad63ca5ad_2#options.; |
| 144 | if ((posix_options & REG_ICASEcxx . . $ `vendor/onigmo-source/onigmoposix.h:39:9`!) != 0) |
| 145 | ONIG_OPTION_ONcxx . . $ `vendor/onigmo-source/onigmo.h:474:9`!(options, ONIG_OPTION_IGNORECASEcxx . . $ `vendor/onigmo-source/onigmo.h:451:9`!); |
| 146 | if ((posix_options & REG_NEWLINEcxx . . $ `vendor/onigmo-source/onigmoposix.h:40:9`!) != 0) { |
| 147 | ONIG_OPTION_ONcxx . . $ `vendor/onigmo-source/onigmo.h:474:9`!( options, ONIG_OPTION_NEGATE_SINGLELINEcxx . . $ `vendor/onigmo-source/onigmo.h:458:9`!); |
| 148 | ONIG_OPTION_OFFcxx . . $ `vendor/onigmo-source/onigmo.h:475:9`!(options, ONIG_OPTION_SINGLELINEcxx . . $ `vendor/onigmo-source/onigmo.h:455:9`!); |
| 149 | } |
| 150 | |
| 151 | reg->comp_optionscxx . . $ $anonymous_type_f3f2c4fec7a76494_1#comp_options. = posix_options; |
| 152 | |
| 153 | ENC_STRING_LENcxx . . $ `vendor/onigmo-source/regposix.c:40:9`!(OnigEncDefaultCharEncoding, pattern, len); |
| 154 | r = onig_newcxx . . $ onig_new(8407fdcc7f7ecfac).(PONIG_Ccxx . . $ `vendor/onigmo-source/regposix.c:37:9`!(reg), (UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`!* )pattern, (UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`!* )(pattern + len), |
| 155 | options, OnigEncDefaultCharEncodingcxx . . $ OnigEncDefaultCharEncoding., syntax, |
| 156 | (OnigErrorInfocxx . . $ OnigErrorInfo#* )NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 157 | if (r != ONIG_NORMALcxx . . $ `vendor/onigmo-source/onigmo.h:624:9`!) { |
| 158 | return onig2posix_error_codecxx . . $ onig2posix_error_code(7864480464b09eea).(r); |
| 159 | } |
| 160 | |
| 161 | reg->re_nsubcxx . . $ $anonymous_type_f3f2c4fec7a76494_1#re_nsub. = ONIG_Ccxx . . $ `vendor/onigmo-source/regposix.c:36:9`!(reg)->num_memcxx . . $ re_pattern_buffer#num_mem.; |
| 162 | return 0; |
| 163 | } |
| 164 | |
| 165 | extern int |
| 166 | regexeccxx . . $ regexec(df0da16647a0e527).(regex_tcxx . . $ regex_t#* reg, const char* str, size_tcxx . . $ size_t# nmatch, |
| 167 | regmatch_tcxx . . $ regmatch_t# pmatch[], int posix_options) |
| 168 | { |
| 169 | int r, i, len; |
| 170 | UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`!* end; |
| 171 | OnigRegioncxx . . $ OnigRegion#* region = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 172 | OnigOptionTypecxx . . $ OnigOptionType# options; |
| 173 | |
| 174 | options = ONIG_OPTION_NONEcxx . . $ `vendor/onigmo-source/onigmo.h:450:9`!; |
| 175 | if ((posix_options & REG_NOTBOLcxx . . $ `vendor/onigmo-source/onigmoposix.h:41:9`!) != 0) options |= ONIG_OPTION_NOTBOLcxx . . $ `vendor/onigmo-source/onigmo.h:462:9`!; |
| 176 | if ((posix_options & REG_NOTEOLcxx . . $ `vendor/onigmo-source/onigmoposix.h:42:9`!) != 0) options |= ONIG_OPTION_NOTEOLcxx . . $ `vendor/onigmo-source/onigmo.h:463:9`!; |
| 177 | |
| 178 | if ((reg->comp_optionscxx . . $ $anonymous_type_f3f2c4fec7a76494_1#comp_options. & REG_NOSUBcxx . . $ `vendor/onigmo-source/onigmoposix.h:44:9`!) != 0) { |
| 179 | nmatch = 0; |
| 180 | } |
| 181 | else if (nmatch != 0) { |
| 182 | region = onig_region_newcxx . . $ onig_region_new(d7fa0e54474889ca).(); |
| 183 | if (region == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!) |
| 184 | return REG_ESPACEcxx . . $ `vendor/onigmo-source/onigmoposix.h:58:9`!; |
| 185 | } |
| 186 | |
| 187 | ENC_STRING_LENcxx . . $ `vendor/onigmo-source/regposix.c:40:9`!(ONIG_Ccxx . . $ `vendor/onigmo-source/regposix.c:36:9`!(reg)->enc, str, len); |
| 188 | end = (UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`!* )(str + len); |
| 189 | r = (int )onig_searchcxx . . $ onig_search(68be31d4a4ee5023).(ONIG_Ccxx . . $ `vendor/onigmo-source/regposix.c:36:9`!(reg), (UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`!* )str, end, (UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`!* )str, end, |
| 190 | region, options); |
| 191 | |
| 192 | if (r >= 0) { |
| 193 | r = 0; /* Match */ |
| 194 | for (i = 0; i < (int )nmatch; i++) { |
| 195 | pmatch[i].rm_socxx . . $ $anonymous_type_f3f2c4fec7a76494_0#rm_so. = (regoff_tcxx . . $ regoff_t# )region->begcxx . . $ re_registers#beg.[i]; |
| 196 | pmatch[i].rm_eocxx . . $ $anonymous_type_f3f2c4fec7a76494_0#rm_eo. = (regoff_tcxx . . $ regoff_t# )region->endcxx . . $ re_registers#end.[i]; |
| 197 | } |
| 198 | } |
| 199 | else if (r == ONIG_MISMATCHcxx . . $ `vendor/onigmo-source/onigmo.h:625:9`!) { |
| 200 | r = REG_NOMATCHcxx . . $ `vendor/onigmo-source/onigmoposix.h:47:9`!; |
| 201 | for (i = 0; i < (int )nmatch; i++) |
| 202 | pmatch[i].rm_socxx . . $ $anonymous_type_f3f2c4fec7a76494_0#rm_so. = pmatch[i].rm_eocxx . . $ $anonymous_type_f3f2c4fec7a76494_0#rm_eo. = ONIG_REGION_NOTPOScxx . . $ `vendor/onigmo-source/onigmo.h:730:9`!; |
| 203 | } |
| 204 | else { |
| 205 | r = onig2posix_error_codecxx . . $ onig2posix_error_code(7864480464b09eea).(r); |
| 206 | } |
| 207 | |
| 208 | if (region != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!) |
| 209 | onig_region_freecxx . . $ onig_region_free(f7147865f954e3eb).(region, 1); |
| 210 | |
| 211 | #if 0 |
| 212 | if (reg->re_nsub > nmatch - 1) |
| 213 | reg->re_nsub = (nmatch <= 1 ? 0 : nmatch - 1); |
| 214 | #endif |
| 215 | |
| 216 | return r; |
| 217 | } |
| 218 | |
| 219 | extern void |
| 220 | regfreecxx . . $ regfree(ab82da76d8b744a9).(regex_tcxx . . $ regex_t#* reg) |
| 221 | { |
| 222 | onig_freecxx . . $ onig_free(b1814a8fd6af504b).(ONIG_Ccxx . . $ `vendor/onigmo-source/regposix.c:36:9`!(reg)); |
| 223 | } |
| 224 | |
| 225 | |
| 226 | extern void |
| 227 | reg_set_encodingcxx . . $ reg_set_encoding(d4f767463ce0a6b3).(int mb_code) |
| 228 | { |
| 229 | OnigEncodingcxx . . $ OnigEncoding# enc; |
| 230 | |
| 231 | switch (mb_code) { |
| 232 | case REG_POSIX_ENCODING_ASCIIcxx . . $ `vendor/onigmo-source/onigmoposix.h:68:9`!: |
| 233 | enc = ONIG_ENCODING_ASCIIcxx . . $ `vendor/onigmo-source/onigmo.h:225:9`!; |
| 234 | break; |
| 235 | case REG_POSIX_ENCODING_EUC_JPcxx . . $ `vendor/onigmo-source/onigmoposix.h:69:9`!: |
| 236 | enc = ONIG_ENCODING_EUC_JPcxx . . $ `vendor/onigmo-source/onigmo.h:247:10`!; |
| 237 | break; |
| 238 | case REG_POSIX_ENCODING_SJIScxx . . $ `vendor/onigmo-source/onigmoposix.h:70:9`!: |
| 239 | enc = ONIG_ENCODING_SJIScxx . . $ `vendor/onigmo-source/onigmo.h:266:10`!; |
| 240 | break; |
| 241 | case REG_POSIX_ENCODING_UTF8cxx . . $ `vendor/onigmo-source/onigmoposix.h:71:9`!: |
| 242 | enc = ONIG_ENCODING_UTF8cxx . . $ `vendor/onigmo-source/onigmo.h:274:10`!; |
| 243 | break; |
| 244 | case REG_POSIX_ENCODING_UTF16_BEcxx . . $ `vendor/onigmo-source/onigmoposix.h:72:9`!: |
| 245 | enc = ONIG_ENCODING_UTF16_BEcxx . . $ `vendor/onigmo-source/onigmo.h:275:10`!; |
| 246 | break; |
| 247 | case REG_POSIX_ENCODING_UTF16_LEcxx . . $ `vendor/onigmo-source/onigmoposix.h:73:9`!: |
| 248 | enc = ONIG_ENCODING_UTF16_LEcxx . . $ `vendor/onigmo-source/onigmo.h:276:10`!; |
| 249 | break; |
| 250 | |
| 251 | default: |
| 252 | return ; |
| 253 | break; |
| 254 | } |
| 255 | |
| 256 | onigenc_set_default_encodingcxx . . $ onigenc_set_default_encoding(33f7db2cc2653896).(enc); |
| 257 | } |
| 258 | |
| 259 | extern int |
| 260 | reg_name_to_group_numberscxx . . $ reg_name_to_group_numbers(2e3fa3500f4c03ee).(regex_tcxx . . $ regex_t#* reg, |
| 261 | const unsigned char* name, const unsigned char* name_end, int** nums) |
| 262 | { |
| 263 | return onig_name_to_group_numberscxx . . $ onig_name_to_group_numbers(e1cabcacd17cba1d).(ONIG_Ccxx . . $ `vendor/onigmo-source/regposix.c:36:9`!(reg), name, name_end, nums); |
| 264 | } |
| 265 | |
| 266 | typedef structcxx . . $ $anonymous_type_4cf47ec43ab96c0e_1# { |
| 267 | int (*funccxx . . $ $anonymous_type_4cf47ec43ab96c0e_1#func.)(const unsigned char*, const unsigned char*,int,int*,regex_tcxx . . $ regex_t#*,void*); |
| 268 | regex_tcxx . . $ regex_t#* regcxx . . $ $anonymous_type_4cf47ec43ab96c0e_1#reg.; |
| 269 | void* argcxx . . $ $anonymous_type_4cf47ec43ab96c0e_1#arg.; |
| 270 | } i_wrapcxx . . $ i_wrap#; |
| 271 | |
| 272 | static int |
| 273 | i_wrappercxx . . $ i_wrapper(cdcfab50772506d9).(const UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`!* name, const UCharcxx . . $ `vendor/onigmo-source/onigmo.h:76:10`!* name_end, int ng, int* gs, |
| 274 | onig_regex_tcxx . . $ onig_regex_t#* reg ARG_UNUSEDcxx . . $ `vendor/onigmo-source/regint.h:100:10`!, void* arg) |
| 275 | { |
| 276 | i_wrapcxx . . $ i_wrap#* warg = (i_wrapcxx . . $ i_wrap#* )arg; |
| 277 | |
| 278 | return (*warg->funccxx . . $ $anonymous_type_4cf47ec43ab96c0e_1#func.)(name, name_end, ng, gs, warg->regcxx . . $ $anonymous_type_4cf47ec43ab96c0e_1#reg., warg->argcxx . . $ $anonymous_type_4cf47ec43ab96c0e_1#arg.); |
| 279 | } |
| 280 | |
| 281 | extern int |
| 282 | reg_foreach_namecxx . . $ reg_foreach_name(aa59a9e9016fce4e).(regex_tcxx . . $ regex_t#* reg, |
| 283 | int (*func)(const unsigned char*, const unsigned char*,int,int*,regex_tcxx . . $ regex_t#*,void*), |
| 284 | void* arg) |
| 285 | { |
| 286 | i_wrapcxx . . $ i_wrap# warg; |
| 287 | |
| 288 | warg.funccxx . . $ $anonymous_type_4cf47ec43ab96c0e_1#func. = func; |
| 289 | warg.regcxx . . $ $anonymous_type_4cf47ec43ab96c0e_1#reg. = reg; |
| 290 | warg.argcxx . . $ $anonymous_type_4cf47ec43ab96c0e_1#arg. = arg; |
| 291 | |
| 292 | return onig_foreach_namecxx . . $ onig_foreach_name(33d9f0650d880f67).(ONIG_Ccxx . . $ `vendor/onigmo-source/regposix.c:36:9`!(reg), i_wrappercxx . . $ i_wrapper(cdcfab50772506d9)., &warg); |
| 293 | } |
| 294 | |
| 295 | extern int |
| 296 | reg_number_of_namescxx . . $ reg_number_of_names(d43d46549d27ae24).(regex_tcxx . . $ regex_t#* reg) |
| 297 | { |
| 298 | return onig_number_of_namescxx . . $ onig_number_of_names(43f0144577350758).(ONIG_Ccxx . . $ `vendor/onigmo-source/regposix.c:36:9`!(reg)); |
| 299 | } |