Mercurial > hg > octave-lyh
annotate examples/unwinddemo.cc @ 9932:6cb30a539481
untabify files in examples directory
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 07 Dec 2009 14:53:20 -0500 |
parents | 4295d634797d |
children | db1f49eaba6b |
rev | line source |
---|---|
6572 | 1 #include <octave/oct.h> |
2 #include <octave/unwind-prot.h> | |
3 | |
4 void | |
5 err_hand (const char *fmt, ...) | |
6 { | |
7 // Do nothing!! | |
8 } | |
9 | |
10 DEFUN_DLD (unwinddemo, args, nargout, "Unwind Demo") | |
11 { | |
12 int nargin = args.length(); | |
13 octave_value retval; | |
14 if (nargin < 2) | |
15 print_usage (); | |
16 else | |
17 { | |
18 NDArray a = args(0).array_value (); | |
19 NDArray b = args(1).array_value (); | |
20 | |
21 if (! error_state) | |
22 { | |
23 unwind_protect::begin_frame ("Funwinddemo"); | |
7081 | 24 unwind_protect_ptr |
9932
6cb30a539481
untabify files in examples directory
John W. Eaton <jwe@octave.org>
parents:
9053
diff
changeset
|
25 (current_liboctave_warning_handler); |
6572 | 26 set_liboctave_warning_handler(err_hand); |
27 retval = octave_value (quotient (a, b)); | |
28 unwind_protect::run_frame ("Funwinddemo"); | |
29 } | |
30 } | |
31 return retval; | |
32 } |