diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-05-21 13:35:43 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-05-21 13:35:43 +0000 |
commit | afa74d4282044c64ab152392003f47bb0674abd2 (patch) | |
tree | dae202bcf5f0624235f7d7446c5eef9e30288694 /pod | |
parent | 79706302bf1cd487fc44c6b9085b2f2ba0fa11ff (diff) | |
download | perl-afa74d4282044c64ab152392003f47bb0674abd2.tar.gz |
Add Perl_croak_xs_usage(), which reduces a lot of explicit calls of
the form Perl_croak(aTHX_ "Usage %s::%s(%s)", "ouch" "awk", "eee_yow");
down to croak_xs_usage(cv, "eee_yow"); and refactor all the core XS
code to use it. This adds () to the error messages for attributes::*
p4raw-id: //depot/perl@33901
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perlapi.pod | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/pod/perlapi.pod b/pod/perlapi.pod index 2644e88a8a..effd8fbe0e 100644 --- a/pod/perlapi.pod +++ b/pod/perlapi.pod @@ -3931,6 +3931,23 @@ Found in file sv.h =over 8 +=item croak_xs_usage +X<croak_xs_usage> + +A specialised variant of C<croak()> for emitting the usage message for xsubs + + croak_xs_usage(cv, "eee_yow"); + +works out the package name and subroutine name from C<cv>, and then calls +C<croak()>. Hence if C<cv> is C<&ouch::awk>, it would call C<croak> as: + + Perl_croak(aTHX_ "Usage %s::%s(%s)", "ouch" "awk", "eee_yow"); + + void croak_xs_usage(CV *const cv, const char *const params) + +=for hackers +Found in file universal.c + =item get_sv X<get_sv> |