Mercurial > emacs
changeset 30217:887b4d52a334
(internal_condition_case_2): New function.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 14 Jul 2000 13:57:10 +0000 |
parents | 394c884dc496 |
children | 70f3583c5da1 |
files | src/eval.c |
diffstat | 1 files changed, 44 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/eval.c Fri Jul 14 13:56:56 2000 +0000 +++ b/src/eval.c Fri Jul 14 13:57:10 2000 +0000 @@ -1274,6 +1274,50 @@ handlerlist = h.next; return val; } + + +/* Like internal_condition_case but call HFUN with NARGS as first, + and ARGS as second argument. */ + +Lisp_Object +internal_condition_case_2 (bfun, nargs, args, handlers, hfun) + Lisp_Object (*bfun) (); + int nargs; + Lisp_Object *args; + Lisp_Object handlers; + Lisp_Object (*hfun) (); +{ + Lisp_Object val; + struct catchtag c; + struct handler h; + + c.tag = Qnil; + c.val = Qnil; + c.backlist = backtrace_list; + c.handlerlist = handlerlist; + c.lisp_eval_depth = lisp_eval_depth; + c.pdlcount = specpdl_ptr - specpdl; + c.poll_suppress_count = poll_suppress_count; + c.gcpro = gcprolist; + c.byte_stack = byte_stack_list; + if (_setjmp (c.jmp)) + { + return (*hfun) (c.val); + } + c.next = catchlist; + catchlist = &c; + h.handler = handlers; + h.var = Qnil; + h.next = handlerlist; + h.tag = &c; + handlerlist = &h; + + val = (*bfun) (nargs, args); + catchlist = c.next; + handlerlist = h.next; + return val; +} + static Lisp_Object find_handler_clause ();