Mercurial > hg > octave-lojdl
changeset 16372:4e7a9f950cdc
return hook function ids
* input.cc (Fadd_pre_input_event_hook, Fadd_post_input_event_hook):
Return hook function id.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 26 Mar 2013 13:18:05 -0400 |
parents | effe80808118 |
children | c97e82b2b5b9 |
files | libinterp/interpfcn/input.cc |
diffstat | 1 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/interpfcn/input.cc +++ b/libinterp/interpfcn/input.cc @@ -1275,7 +1275,7 @@ @seealso{remove_pre_input_event_hook}\n\ @end deftypefn") { - octave_value_list retval; + octave_value retval; int nargin = args.length (); @@ -1289,7 +1289,11 @@ hook_function hook_fcn (args(0), user_data); if (! error_state) - pre_input_event_hook_fcn_map[hook_fcn.id ()] = hook_fcn; + { + pre_input_event_hook_fcn_map[hook_fcn.id ()] = hook_fcn; + + retval = hook_fcn.id (); + } else error ("add_pre_input_event_hook: expecting string as first arg"); } @@ -1464,7 +1468,7 @@ @seealso{remove_post_input_event_hook}\n\ @end deftypefn") { - octave_value_list retval; + octave_value retval; int nargin = args.length (); @@ -1478,7 +1482,11 @@ hook_function hook_fcn (args(0), user_data); if (! error_state) - post_input_event_hook_fcn_map[hook_fcn.id ()] = hook_fcn; + { + post_input_event_hook_fcn_map[hook_fcn.id ()] = hook_fcn; + + retval = hook_fcn.id (); + } else error ("add_post_input_event_hook: expecting string as first arg"); }