From b6b716fe3a82a1de9cf94c1d43c790a87a9ece17 Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Fri, 15 Sep 2000 00:46:57 +0100 Subject: [PATCH] utf8.c apidoc Message-ID: <20000914234657.A13953@deep-dark-truthful-mirror.perlhacker.org> p4raw-id: //depot/perl@7087 --- perlapi.c | 4 ++-- pod/perlapi.pod | 46 ++++++++++++++++++++++++++++------------------ utf8.c | 2 +- 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/perlapi.c b/perlapi.c index 496fcc9..614f94f 100644 --- a/perlapi.c +++ b/perlapi.c @@ -3380,9 +3380,9 @@ Perl_bytes_to_utf8(pTHXo_ U8 *s, STRLEN *len) #undef Perl_utf8_to_uv UV -Perl_utf8_to_uv(pTHXo_ U8 *s, I32* retlen) +Perl_utf8_to_uv(pTHXo_ U8 *s, I32* retlen, bool checking) { - return ((CPerlObj*)pPerl)->Perl_utf8_to_uv(s, retlen); + return ((CPerlObj*)pPerl)->Perl_utf8_to_uv(s, retlen, checking); } #undef Perl_uv_to_utf8 diff --git a/pod/perlapi.pod b/pod/perlapi.pod index ca2ba7c..5d5bc5f 100644 --- a/pod/perlapi.pod +++ b/pod/perlapi.pod @@ -2355,19 +2355,19 @@ false, defined or undefined. Does not handle 'get' magic. =for hackers Found in file sv.h -=item SvTYPE - -Returns the type of the SV. See C. +=item svtype - svtype SvTYPE(SV* sv) +An enum of flags for Perl types. These are found in the file B +in the C enum. Test these flags with the C macro. =for hackers Found in file sv.h -=item svtype +=item SvTYPE -An enum of flags for Perl types. These are found in the file B -in the C enum. Test these flags with the C macro. +Returns the type of the SV. See C. + + svtype SvTYPE(SV* sv) =for hackers Found in file sv.h @@ -3182,18 +3182,10 @@ Found in file handy.h =item U8 *s -Returns the character value of the first character in the string C -which is assumed to be in UTF8 encoding; C will be set to the -length, in bytes, of that character, and the pointer C will be -advanced to the end of the character. - -If C does not point to a well-formed UTF8 character, the behaviour -is dependent on the value of C: if this is true, it is -assumed that the caller will raise a warning, and this function will -set C to C<-1> and return. If C is not true, an optional UTF8 -warning is produced. +Returns true if first C bytes of the given string form valid a UTF8 +string, false otherwise. - utf8_to_uv U8 *s(I32 *retlen, I32 checking) + is_utf8_string U8 *s(STRLEN len) =for hackers Found in file utf8.c @@ -3210,6 +3202,24 @@ Returns zero on failure, setting C to -1. =for hackers Found in file utf8.c +=item utf8_to_uv + +Returns the character value of the first character in the string C +which is assumed to be in UTF8 encoding; C will be set to the +length, in bytes, of that character, and the pointer C will be +advanced to the end of the character. + +If C does not point to a well-formed UTF8 character, the behaviour +is dependent on the value of C: if this is true, it is +assumed that the caller will raise a warning, and this function will +set C to C<-1> and return. If C is not true, an optional UTF8 +warning is produced. + + U8* s utf8_to_uv(I32 *retlen, I32 checking) + +=for hackers +Found in file utf8.c + =item warn This is the XSUB-writer's interface to Perl's C function. Use this diff --git a/utf8.c b/utf8.c index d97a8b0..d23c9f7 100644 --- a/utf8.c +++ b/utf8.c @@ -159,7 +159,7 @@ Perl_is_utf8_string(pTHX_ U8 *s, STRLEN len) } /* -=for apidoc Am|utf8_to_uv|U8 *s|I32 *retlen|I32 checking +=for apidoc Am|U8* s|utf8_to_uv|I32 *retlen|I32 checking Returns the character value of the first character in the string C which is assumed to be in UTF8 encoding; C will be set to the -- 2.7.4