From cf6ba49f6801c685289a48c999cb8e8067e7dcfe Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sat, 21 May 2022 22:05:32 -0600 Subject: [PATCH] perlapi: Revise wording in sv_derived_from entry I think this reads better --- universal.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/universal.c b/universal.c index 8981ab83de3f..9d09c09f24a2 100644 --- a/universal.c +++ b/universal.c @@ -113,7 +113,6 @@ S_sv_derived_from_svpvn(pTHX_ SV *sv, SV *namesv, const char * name, const STRLE /* =for apidoc_section $SV - =for apidoc sv_derived_from =for apidoc_item sv_derived_from_hv =for apidoc_item sv_derived_from_pv @@ -124,23 +123,27 @@ These each return a boolean indicating whether C is derived from the specified class I. To check derivation at the Perl level, call C as a normal Perl method. -In C, the class name is C (which would -presumably represent a stash). Its UTF8ness is C. +The differences between the forms is how the class is specified, and the +UTF-8ness of its name. -In C and C, the class name is given by -C, which is a NUL-terminated C string. In C, the name -is never considered to be encoded as UTF-8. +In C, the class name is extracted from C using +some version of L>. This is the preferred form. The class name is +considered to be in UTF-8 iff C is marked as such, hence C is +effectively currently ignored. -The remaining forms differ only in how the class name is specified; -they all have a C parameter. Currently, the only significant value for -which is C to indicate that the class name is encoded as such. +In C, the class name is C (which would +presumably represent a stash). Its UTF8ness is C. -In C, the class name is extracted from C. -This is the preferred form. The class name is considered to be in UTF-8 if -C is marked as such. +In the remaining forms, the class name is specified by the C parameter. +In C and C, it is a NUL-terminated C +string. In C, C points to the first byte of the +string specifying the class, and an additional parameter, C, specifies +its length in bytes. Hence, C may contain embedded-NUL characters. -In C, C gives the length of C, so the latter -may contain embedded NUL characters. +C is never considered to be encoded as UTF-8 in C. The +remaining forms have a C parameter. If the C is set in it, +the class name is encoded as UTF-8; otherwise not. No other flags are +currently meaningful. =cut