diff options
author | Zefram <zefram@fysh.org> | 2010-04-23 01:52:47 +0100 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2010-04-23 01:52:47 +0100 |
commit | c5df3096702d4a814b3774dff243e7eb74814257 (patch) | |
tree | 93ec4463179fc3bf3e5ee20be2afa863b1d3a66a /embed.fnc | |
parent | 96d9b9cd40f1d98fda790eb12b5cdbeef8b48a81 (diff) | |
download | perl-c5df3096702d4a814b3774dff243e7eb74814257.tar.gz |
SV-based interfaces for dieing and warning
New functions croak_sv(), die_sv(), mess_sv(), and warn_sv(), each act
much like their _sv-less counterparts, but take a single SV argument
instead of sprintf-like format and args. They will accept RVs, passing
them through as such. This means there's no more need to clobber ERRSV
in order to throw a structured exception.
pp_warn() and pp_die() are rewritten to use the _sv interfaces.
This fixes part of [perl #74538]. It also means that a structured
warning object will be passed through to $SIG{__WARN__} instead of
being stringified, thus bringing warn in line with die with respect to
structured exception objects.
The new functions and their existing counterparts are all fully
documented.
Diffstat (limited to 'embed.fnc')
-rw-r--r-- | embed.fnc | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -230,9 +230,10 @@ ApR |I32 |my_chsize |int fd|Off_t length pR |OP* |convert |I32 optype|I32 flags|NULLOK OP* o : Used in op.c and perl.c pM |PERL_CONTEXT* |create_eval_scope|U32 flags +Aprd |void |croak_sv |NN SV *baseex : croak()'s first parm can be NULL. Otherwise, mod_perl breaks. Afprd |void |croak |NULLOK const char* pat|... -Apr |void |vcroak |NULLOK const char* pat|NULLOK va_list* args +Aprd |void |vcroak |NULLOK const char* pat|NULLOK va_list* args Aprd |void |croak_xs_usage |NN const CV *const cv \ |NN const char *const params @@ -286,12 +287,10 @@ Anp |char* |delimcpy |NN char* to|NN const char* toend|NN const char* from \ |NN const char* fromend|int delim|NN I32* retlen : Used in op.c, perl.c pM |void |delete_eval_scope -Afp |OP* |die |NULLOK const char* pat|... -#if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT) -s |OP* |vdie |NULLOK const char* pat|NULLOK va_list* args -#endif +Apd |OP* |die_sv |NN SV *baseex +Afpd |OP* |die |NULLOK const char* pat|... : Used in util.c -pr |void |die_where |NULLOK SV* msv +pr |void |die_unwind |NN SV* ex Ap |void |dounwind |I32 cxix : FIXME pmb |bool |do_aexec |NULLOK SV* really|NN SV** mark|NN SV** sp @@ -687,8 +686,9 @@ p |int |magic_setcollxfrm|NN SV* sv|NN MAGIC* mg : Defined in locale.c, used only in sv.c p |char* |mem_collxfrm |NN const char* s|STRLEN len|NN STRLEN* xlen #endif -Afp |SV* |mess |NN const char* pat|... -Ap |SV* |vmess |NN const char* pat|NULLOK va_list* args +Afpd |SV* |mess |NN const char* pat|... +Apd |SV* |mess_sv |NN SV* basemsg|bool consume +Apd |SV* |vmess |NN const char* pat|NULLOK va_list* args : FIXME - either make it public, or stop exporting it. (Data::Alias uses this) : Used in gv.c, op.c, toke.c EXp |void |qerror |NN SV* err @@ -1285,8 +1285,9 @@ pR |UV |get_hash_seed p |void |report_evil_fh |NULLOK const GV *gv|NULLOK const IO *io|I32 op : Used in mg.c, pp.c, pp_hot.c, regcomp.c XEpd |void |report_uninit |NULLOK const SV *uninit_sv +Apd |void |warn_sv |NN SV *baseex Afpd |void |warn |NN const char* pat|... -Ap |void |vwarn |NN const char* pat|NULLOK va_list* args +Apd |void |vwarn |NN const char* pat|NULLOK va_list* args Afp |void |warner |U32 err|NN const char* pat|... Afp |void |ck_warner |U32 err|NN const char* pat|... Afp |void |ck_warner_d |U32 err|NN const char* pat|... @@ -1952,8 +1953,8 @@ s |char* |stdize_locale |NN char* locs #if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT) s |const COP*|closest_cop |NN const COP *cop|NULLOK const OP *o s |SV* |mess_alloc -s |SV *|vdie_croak_common|NULLOK const char *pat|NULLOK va_list *args -s |bool |vdie_common |NULLOK SV *message|bool warn +s |SV *|with_queued_errors|NN SV *ex +s |bool |invoke_exception_hook|NULLOK SV *ex|bool warn sr |char * |write_no_mem #if defined(PERL_MEM_LOG) && !defined(PERL_MEM_LOG_NOIMPL) sn |void |mem_log_common |enum mem_log_type mlt|const UV n|const UV typesize \ |