view examples/unwinddemo.cc @ 16389:f5204f486a29

gui: add shortcut for goto line action in the editor and center the target line * file-editor.cc(construct): add shortcut Ctrl-G for goto line action * file-editor-tab.cc(center_current_line): new function, centering current line * file-editor-tab.cc(set_debugger_position): use center_current_line * file-editor-tab.cc(goto_line): call center_current_line only if goto_line was called from goto line action * file-editor-tab.h: new function center_current_line
author Torsten <ttl@justmail.de>
date Thu, 28 Mar 2013 17:01:43 +0100
parents 1b48b209a8d6
children be41c30bcb44
line wrap: on
line source

#include <octave/oct.h>
#include <octave/unwind-prot.h>

void
err_hand (const char *fmt, ...)
{
  // Do nothing!!
}

DEFUN_DLD (unwinddemo, args, nargout, "Unwind Demo")
{
  int nargin = args.length ();
  octave_value retval;
  if (nargin < 2)
    print_usage ();
  else
    {
      NDArray a = args(0).array_value ();
      NDArray b = args(1).array_value ();

      if (! error_state)
        {
          unwind_protect::begin_frame ("Funwinddemo");
          unwind_protect_ptr (current_liboctave_warning_handler);
          set_liboctave_warning_handler (err_hand);
          retval = octave_value (quotient (a, b));
          unwind_protect::run_frame ("Funwinddemo");
        }
    }
  return retval;
}