diff src/defun.cc @ 9960:5f3c10ecb150

implement get_current_shlib and octave_auto_shlib
author Jaroslav Hajek <highegg@gmail.com>
date Thu, 10 Dec 2009 11:51:33 +0100
parents eb63fbe60fab
children cd96d29c5efa
line wrap: on
line diff
--- a/src/defun.cc	Thu Dec 10 09:14:47 2009 +0100
+++ b/src/defun.cc	Thu Dec 10 11:51:33 2009 +0100
@@ -123,6 +123,29 @@
   symbol_table::alias_built_in_function (alias, name);
 }
 
+octave_shlib
+get_current_shlib (void)
+{
+  octave_shlib retval;
+  
+  octave_function *curr_fcn = octave_call_stack::current ();
+  if (curr_fcn)
+    {
+      if (curr_fcn->is_dld_function ())
+        {
+          octave_dld_function *dld = dynamic_cast<octave_dld_function *> (curr_fcn);
+          retval = dld->get_shlib ();
+        }
+      else if (curr_fcn->is_mex_function ())
+        {
+          octave_mex_function *mex = dynamic_cast<octave_mex_function *> (curr_fcn);
+          retval = mex->get_shlib ();
+        }
+    }
+
+  return retval;
+}
+
 /*
 ;;; Local Variables: ***
 ;;; mode: C++ ***