diff options
author | Karl Williamson <khw@cpan.org> | 2018-04-09 10:43:06 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-04-20 01:11:51 -0600 |
commit | 95e064d9059a4371bc291235b71f81066dfdd08b (patch) | |
tree | 8fddb88c62a66e8af95e59fc2b9c111a2eedb92c /utf8.c | |
parent | 4273b0cccad37ddd85afb1abe763af2c6a6023a5 (diff) | |
download | perl-95e064d9059a4371bc291235b71f81066dfdd08b.tar.gz |
Move inversion lists to utf8.c
These previously were statics in perl.c. A future commit would need
access to these from regcomp.c. We could create an access function in
perl.c so that regcomp.c could access them, or we could move them to
regcomp.c. But doing that means also they would be statics in
re_comp.c, and that would mean two copies.
So that means an access function is needed. Their use is really
unrelated to perl.c, which merely initializes them, so that could have
an access function instead. But the most logical place for their home
is utf8.c, which is described as for Unicode things, not just UTF-8
things.
So this commit moves these inversion lists to utf8.c, and creates an
initialization function called on perl startup from perl.c
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 47 |
1 files changed, 47 insertions, 0 deletions
@@ -5862,6 +5862,53 @@ Perl_uvuni_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags) return uvoffuni_to_utf8_flags(d, uv, flags); } +void +Perl_init_uniprops(pTHX) +{ + /* Set up the inversion list global variables */ + + PL_XPosix_ptrs[_CC_ASCII] = _new_invlist_C_array(ASCII_invlist); + PL_XPosix_ptrs[_CC_ALPHANUMERIC] = _new_invlist_C_array(XPosixAlnum_invlist); + PL_XPosix_ptrs[_CC_ALPHA] = _new_invlist_C_array(XPosixAlpha_invlist); + PL_XPosix_ptrs[_CC_BLANK] = _new_invlist_C_array(XPosixBlank_invlist); + PL_XPosix_ptrs[_CC_CASED] = _new_invlist_C_array(Cased_invlist); + PL_XPosix_ptrs[_CC_CNTRL] = _new_invlist_C_array(XPosixCntrl_invlist); + PL_XPosix_ptrs[_CC_DIGIT] = _new_invlist_C_array(XPosixDigit_invlist); + PL_XPosix_ptrs[_CC_GRAPH] = _new_invlist_C_array(XPosixGraph_invlist); + PL_XPosix_ptrs[_CC_LOWER] = _new_invlist_C_array(XPosixLower_invlist); + PL_XPosix_ptrs[_CC_PRINT] = _new_invlist_C_array(XPosixPrint_invlist); + PL_XPosix_ptrs[_CC_PUNCT] = _new_invlist_C_array(XPosixPunct_invlist); + PL_XPosix_ptrs[_CC_SPACE] = _new_invlist_C_array(XPerlSpace_invlist); + PL_XPosix_ptrs[_CC_UPPER] = _new_invlist_C_array(XPosixUpper_invlist); + PL_XPosix_ptrs[_CC_VERTSPACE] = _new_invlist_C_array(VertSpace_invlist); + PL_XPosix_ptrs[_CC_WORDCHAR] = _new_invlist_C_array(XPosixWord_invlist); + PL_XPosix_ptrs[_CC_XDIGIT] = _new_invlist_C_array(XPosixXDigit_invlist); + PL_GCB_invlist = _new_invlist_C_array(_Perl_GCB_invlist); + PL_SB_invlist = _new_invlist_C_array(_Perl_SB_invlist); + PL_WB_invlist = _new_invlist_C_array(_Perl_WB_invlist); + PL_LB_invlist = _new_invlist_C_array(_Perl_LB_invlist); + PL_Assigned_invlist = _new_invlist_C_array(Assigned_invlist); + PL_SCX_invlist = _new_invlist_C_array(_Perl_SCX_invlist); + PL_utf8_toupper = _new_invlist_C_array(Uppercase_Mapping_invlist); + PL_utf8_tolower = _new_invlist_C_array(Lowercase_Mapping_invlist); + PL_utf8_totitle = _new_invlist_C_array(Titlecase_Mapping_invlist); + PL_utf8_tofold = _new_invlist_C_array(Case_Folding_invlist); + PL_utf8_tosimplefold = _new_invlist_C_array(Simple_Case_Folding_invlist); + PL_utf8_perl_idstart = _new_invlist_C_array(_Perl_IDStart_invlist); + PL_utf8_perl_idcont = _new_invlist_C_array(_Perl_IDCont_invlist); + PL_AboveLatin1 = _new_invlist_C_array(AboveLatin1_invlist); + PL_Latin1 = _new_invlist_C_array(Latin1_invlist); + PL_UpperLatin1 = _new_invlist_C_array(UpperLatin1_invlist); + PL_utf8_foldable = _new_invlist_C_array(_Perl_Any_Folds_invlist); + PL_HasMultiCharFold = _new_invlist_C_array( + _Perl_Folds_To_Multi_Char_invlist); + PL_NonL1NonFinalFold = _new_invlist_C_array( + NonL1_Perl_Non_Final_Folds_invlist); + PL_utf8_charname_begin = _new_invlist_C_array(_Perl_Charname_Begin_invlist); + PL_utf8_charname_continue = _new_invlist_C_array(_Perl_Charname_Continue_invlist); + PL_utf8_foldclosures = _new_invlist_C_array(_Perl_IVCF_invlist); +} + /* =for apidoc utf8_to_uvchr |