This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
APItest: Add U8* typemap, and use it
authorKarl Williamson <khw@cpan.org>
Mon, 12 Feb 2018 16:03:09 +0000 (09:03 -0700)
committerKarl Williamson <khw@cpan.org>
Sat, 17 Feb 2018 05:18:14 +0000 (22:18 -0700)
This missiing typemap has slowed me down on numerous occasions, as I
keep forgetting it's missing

ext/XS-APItest/APItest.xs
ext/XS-APItest/typemap

index 794ab40..4e5bf3c 100644 (file)
@@ -1381,7 +1381,7 @@ bytes_cmp_utf8(bytes, utf8)
 
 AV *
 test_utf8_to_bytes(bytes, len)
-        unsigned char * bytes
+        U8 * bytes
         STRLEN len
     PREINIT:
         char * ret;
@@ -4577,9 +4577,9 @@ test_isBLANK_LC(UV ord)
         RETVAL
 
 bool
-test_isBLANK_utf8(unsigned char * p, int type)
+test_isBLANK_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
 
         /* In this function and those that follow, the boolean 'type'
@@ -4596,9 +4596,9 @@ test_isBLANK_utf8(unsigned char * p, int type)
         RETVAL
 
 bool
-test_isBLANK_LC_utf8(unsigned char * p, int type)
+test_isBLANK_LC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -4625,9 +4625,9 @@ test_isVERTWS_uvchr(UV ord)
         RETVAL
 
 bool
-test_isVERTWS_utf8(unsigned char * p, int type)
+test_isVERTWS_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -4689,9 +4689,9 @@ test_isUPPER_LC(UV ord)
         RETVAL
 
 bool
-test_isUPPER_utf8(unsigned char * p, int type)
+test_isUPPER_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -4704,9 +4704,9 @@ test_isUPPER_utf8(unsigned char * p, int type)
         RETVAL
 
 bool
-test_isUPPER_LC_utf8(unsigned char * p, int type)
+test_isUPPER_LC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -4768,9 +4768,9 @@ test_isLOWER_LC(UV ord)
         RETVAL
 
 bool
-test_isLOWER_utf8(unsigned char * p, int type)
+test_isLOWER_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -4783,9 +4783,9 @@ test_isLOWER_utf8(unsigned char * p, int type)
         RETVAL
 
 bool
-test_isLOWER_LC_utf8(unsigned char * p, int type)
+test_isLOWER_LC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -4847,9 +4847,9 @@ test_isALPHA_LC(UV ord)
         RETVAL
 
 bool
-test_isALPHA_utf8(unsigned char * p, int type)
+test_isALPHA_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -4862,9 +4862,9 @@ test_isALPHA_utf8(unsigned char * p, int type)
         RETVAL
 
 bool
-test_isALPHA_LC_utf8(unsigned char * p, int type)
+test_isALPHA_LC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -4926,9 +4926,9 @@ test_isWORDCHAR_LC(UV ord)
         RETVAL
 
 bool
-test_isWORDCHAR_utf8(unsigned char * p, int type)
+test_isWORDCHAR_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -4941,9 +4941,9 @@ test_isWORDCHAR_utf8(unsigned char * p, int type)
         RETVAL
 
 bool
-test_isWORDCHAR_LC_utf8(unsigned char * p, int type)
+test_isWORDCHAR_LC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5005,9 +5005,9 @@ test_isALPHANUMERIC_LC(UV ord)
         RETVAL
 
 bool
-test_isALPHANUMERIC_utf8(unsigned char * p, int type)
+test_isALPHANUMERIC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5020,9 +5020,9 @@ test_isALPHANUMERIC_utf8(unsigned char * p, int type)
         RETVAL
 
 bool
-test_isALPHANUMERIC_LC_utf8(unsigned char * p, int type)
+test_isALPHANUMERIC_LC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5063,9 +5063,9 @@ test_isALNUM_LC(UV ord)
         RETVAL
 
 bool
-test_isALNUM_utf8(unsigned char * p, int type)
+test_isALNUM_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5078,9 +5078,9 @@ test_isALNUM_utf8(unsigned char * p, int type)
         RETVAL
 
 bool
-test_isALNUM_LC_utf8(unsigned char * p, int type)
+test_isALNUM_LC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5114,9 +5114,9 @@ test_isDIGIT_LC_uvchr(UV ord)
         RETVAL
 
 bool
-test_isDIGIT_utf8(unsigned char * p, int type)
+test_isDIGIT_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5129,9 +5129,9 @@ test_isDIGIT_utf8(unsigned char * p, int type)
         RETVAL
 
 bool
-test_isDIGIT_LC_utf8(unsigned char * p, int type)
+test_isDIGIT_LC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5242,9 +5242,9 @@ test_isIDFIRST_LC(UV ord)
         RETVAL
 
 bool
-test_isIDFIRST_utf8(unsigned char * p, int type)
+test_isIDFIRST_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5257,9 +5257,9 @@ test_isIDFIRST_utf8(unsigned char * p, int type)
         RETVAL
 
 bool
-test_isIDFIRST_LC_utf8(unsigned char * p, int type)
+test_isIDFIRST_LC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5321,9 +5321,9 @@ test_isIDCONT_LC(UV ord)
         RETVAL
 
 bool
-test_isIDCONT_utf8(unsigned char * p, int type)
+test_isIDCONT_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5336,9 +5336,9 @@ test_isIDCONT_utf8(unsigned char * p, int type)
         RETVAL
 
 bool
-test_isIDCONT_LC_utf8(unsigned char * p, int type)
+test_isIDCONT_LC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5400,9 +5400,9 @@ test_isSPACE_LC(UV ord)
         RETVAL
 
 bool
-test_isSPACE_utf8(unsigned char * p, int type)
+test_isSPACE_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5415,9 +5415,9 @@ test_isSPACE_utf8(unsigned char * p, int type)
         RETVAL
 
 bool
-test_isSPACE_LC_utf8(unsigned char * p, int type)
+test_isSPACE_LC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5479,9 +5479,9 @@ test_isASCII_LC(UV ord)
         RETVAL
 
 bool
-test_isASCII_utf8(unsigned char * p, int type)
+test_isASCII_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
 #ifndef DEBUGGING
         PERL_UNUSED_VAR(e);
@@ -5497,9 +5497,9 @@ test_isASCII_utf8(unsigned char * p, int type)
         RETVAL
 
 bool
-test_isASCII_LC_utf8(unsigned char * p, int type)
+test_isASCII_LC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
 #ifndef DEBUGGING
         PERL_UNUSED_VAR(e);
@@ -5564,9 +5564,9 @@ test_isCNTRL_LC(UV ord)
         RETVAL
 
 bool
-test_isCNTRL_utf8(unsigned char * p, int type)
+test_isCNTRL_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5579,9 +5579,9 @@ test_isCNTRL_utf8(unsigned char * p, int type)
         RETVAL
 
 bool
-test_isCNTRL_LC_utf8(unsigned char * p, int type)
+test_isCNTRL_LC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5643,9 +5643,9 @@ test_isPRINT_LC(UV ord)
         RETVAL
 
 bool
-test_isPRINT_utf8(unsigned char * p, int type)
+test_isPRINT_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5658,9 +5658,9 @@ test_isPRINT_utf8(unsigned char * p, int type)
         RETVAL
 
 bool
-test_isPRINT_LC_utf8(unsigned char * p, int type)
+test_isPRINT_LC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5722,9 +5722,9 @@ test_isGRAPH_LC(UV ord)
         RETVAL
 
 bool
-test_isGRAPH_utf8(unsigned char * p, int type)
+test_isGRAPH_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5737,9 +5737,9 @@ test_isGRAPH_utf8(unsigned char * p, int type)
         RETVAL
 
 bool
-test_isGRAPH_LC_utf8(unsigned char * p, int type)
+test_isGRAPH_LC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5801,9 +5801,9 @@ test_isPUNCT_LC(UV ord)
         RETVAL
 
 bool
-test_isPUNCT_utf8(unsigned char * p, int type)
+test_isPUNCT_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5816,9 +5816,9 @@ test_isPUNCT_utf8(unsigned char * p, int type)
         RETVAL
 
 bool
-test_isPUNCT_LC_utf8(unsigned char * p, int type)
+test_isPUNCT_LC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5880,9 +5880,9 @@ test_isXDIGIT_LC(UV ord)
         RETVAL
 
 bool
-test_isXDIGIT_utf8(unsigned char * p, int type)
+test_isXDIGIT_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5895,9 +5895,9 @@ test_isXDIGIT_utf8(unsigned char * p, int type)
         RETVAL
 
 bool
-test_isXDIGIT_LC_utf8(unsigned char * p, int type)
+test_isXDIGIT_LC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5959,9 +5959,9 @@ test_isPSXSPC_LC(UV ord)
         RETVAL
 
 bool
-test_isPSXSPC_utf8(unsigned char * p, int type)
+test_isPSXSPC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -5974,9 +5974,9 @@ test_isPSXSPC_utf8(unsigned char * p, int type)
         RETVAL
 
 bool
-test_isPSXSPC_LC_utf8(unsigned char * p, int type)
+test_isPSXSPC_LC_utf8(U8 * p, int type)
     PREINIT:
-       const unsigned char * e;
+       const U8 * e;
     CODE:
         if (type >= 0) {
             e = p + UTF8SKIP(p) - type;
@@ -6126,7 +6126,7 @@ test_is_utf8_string(char *s, STRLEN len)
 #define WORDSIZE            sizeof(PERL_UINTMAX_T)
 
 AV *
-test_is_utf8_invariant_string_loc(unsigned char *s, STRLEN offset, STRLEN len)
+test_is_utf8_invariant_string_loc(U8 *s, STRLEN offset, STRLEN len)
     PREINIT:
         AV *av;
         const U8 * ep = NULL;
@@ -6147,7 +6147,7 @@ test_is_utf8_invariant_string_loc(unsigned char *s, STRLEN offset, STRLEN len)
         RETVAL
 
 STRLEN
-test_variant_under_utf8_count(unsigned char *s, STRLEN offset, STRLEN len)
+test_variant_under_utf8_count(U8 *s, STRLEN offset, STRLEN len)
     PREINIT:
         PERL_UINTMAX_T * copy;
     CODE:
@@ -6159,7 +6159,7 @@ test_variant_under_utf8_count(unsigned char *s, STRLEN offset, STRLEN len)
         RETVAL
 
 STRLEN
-test_utf8_length(unsigned char *s, STRLEN offset, STRLEN len)
+test_utf8_length(U8 *s, STRLEN offset, STRLEN len)
 CODE:
     RETVAL = utf8_length(s + offset, s + len);
 OUTPUT:
@@ -6415,7 +6415,7 @@ test_toLOWER_utf8(SV * p, int type)
         STRLEN len;
         AV *av;
         SV *utf8;
-       const unsigned char * e;
+       const U8 * e;
         UV resultant_cp = UV_MAX;   /* Initialized because of dumb compilers */
     CODE:
         input = (U8 *) SvPV(p, len);
@@ -6505,7 +6505,7 @@ test_toFOLD_utf8(SV * p, int type)
         STRLEN len;
         AV *av;
         SV *utf8;
-       const unsigned char * e;
+       const U8 * e;
         UV resultant_cp = UV_MAX;
     CODE:
         input = (U8 *) SvPV(p, len);
@@ -6595,7 +6595,7 @@ test_toUPPER_utf8(SV * p, int type)
         STRLEN len;
         AV *av;
         SV *utf8;
-       const unsigned char * e;
+       const U8 * e;
         UV resultant_cp = UV_MAX;
     CODE:
         input = (U8 *) SvPV(p, len);
@@ -6678,7 +6678,7 @@ test_toTITLE_utf8(SV * p, int type)
         STRLEN len;
         AV *av;
         SV *utf8;
-       const unsigned char * e;
+       const U8 * e;
         UV resultant_cp = UV_MAX;
     CODE:
         input = (U8 *) SvPV(p, len);
index ed86a37..f4c401e 100644 (file)
@@ -1,6 +1,7 @@
 XS::APItest::PtrTable          T_PTROBJ
 
 const WCHAR *                  WPV
+U8 *                           T_PV
 
 INPUT