develooper Front page | perl.perl5.porters | Postings from January 2001

[PATCH] utf8.c documentation

From:
Simon Cozens
Date:
January 16, 2001 05:52
Subject:
[PATCH] utf8.c documentation
Message ID:
20010116135248.A13496@pembro26.pmb.ox.ac.uk
--- utf8.c~	Tue Jan 16 13:42:39 2001
+++ utf8.c	Tue Jan 16 13:51:24 2001
@@ -26,8 +26,25 @@
 
 /* Unicode support */
 
+/*
+=for apidoc Am|U8*|uv_to_utf8|U8 *d|UV uv
+
+Adds the UTF8 representation of the Unicode codepoint C<uv> to the end
+of the string C<d>; C<d> should be have at least C<UTF8_MAXLEN+1> free
+bytes available. The return value is the pointer to the byte after the
+end of the new character. In other words, 
+
+    d = uv_to_utf8(d, uv);
+
+is the recommended Unicode-aware way of saying
+
+    *(d++) = uv;
+
+=cut
+*/
+
 U8 *
-Perl_uv_to_utf8(pTHX_ U8 *d, UV uv) /* the d must be UTF8_MAXLEN+1 deep */
+Perl_uv_to_utf8(pTHX_ U8 *d, UV uv)
 {
     if (uv < 0x80) {
 	*d++ = uv;
@@ -101,9 +118,15 @@
 #endif
 }
 
-/* Tests if some arbitrary number of bytes begins in a valid UTF-8 character.
- * The actual number of bytes in the UTF-8 character will be returned if it
- * is valid, otherwise 0. */
+/*
+=for apidoc Am|STRLEN|is_utf8_char|U8 *s
+
+Tests if some arbitrary number of bytes begins in a valid UTF-8 character.
+The actual number of bytes in the UTF-8 character will be returned if it
+is valid, otherwise 0. 
+ 
+=cut
+*/
 STRLEN
 Perl_is_utf8_char(pTHX_ U8 *s)
 {
@@ -143,7 +166,7 @@
 }
 
 /*
-=for apidoc Am|is_utf8_string|U8 *s|STRLEN len
+=for apidoc Am|bool|is_utf8_string|U8 *s|STRLEN len
 
 Returns true if first C<len> bytes of the given string form valid a UTF8
 string, false otherwise.
--- embed.pl~	Tue Jan 16 13:50:50 2001
+++ embed.pl	Tue Jan 16 13:51:15 2001
@@ -1628,8 +1628,8 @@
 Ap	|U32	|to_uni_upper_lc|U32 c
 Ap	|U32	|to_uni_title_lc|U32 c
 Ap	|U32	|to_uni_lower_lc|U32 c
-Ap	|STRLEN	|is_utf8_char	|U8 *p
-Ap	|bool	|is_utf8_string	|U8 *s|STRLEN len
+Apd	|STRLEN	|is_utf8_char	|U8 *p
+Apd	|bool	|is_utf8_string	|U8 *s|STRLEN len
 Ap	|bool	|is_utf8_alnum	|U8 *p
 Ap	|bool	|is_utf8_alnumc	|U8 *p
 Ap	|bool	|is_utf8_idfirst|U8 *p
@@ -2084,7 +2084,7 @@
 ApMd	|U8*	|bytes_to_utf8	|U8 *s|STRLEN *len
 Apd	|UV	|utf8_to_uv_simple|U8 *s|STRLEN* retlen
 Adp	|UV	|utf8_to_uv	|U8 *s|STRLEN curlen|STRLEN* retlen|U32 flags
-Ap	|U8*	|uv_to_utf8	|U8 *d|UV uv
+Apd	|U8*	|uv_to_utf8	|U8 *d|UV uv
 p	|void	|vivify_defelem	|SV* sv
 p	|void	|vivify_ref	|SV* sv|U32 to_what
 p	|I32	|wait4pid	|Pid_t pid|int* statusp|int flags

-- 
I've been around the world  // Had my pick of any girl
You'd think I'd be happy    // But I'm not              - Elli Paspala



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About