diff libinterp/corefcn/interpreter-private.cc @ 23517:1bc8f1f50b54

new function for accessing interpreter * interpreter-private.h, interpreter-private.cc (__get_interpreter__): New function. (__get_load_path__): Use it.
author John W. Eaton <jwe@octave.org>
date Fri, 19 May 2017 15:53:32 -0400
parents 232c8d69d934
children 084245f9bd03
line wrap: on
line diff
--- a/libinterp/corefcn/interpreter-private.cc	Mon May 22 13:42:22 2017 -0700
+++ b/libinterp/corefcn/interpreter-private.cc	Fri May 19 15:53:32 2017 -0400
@@ -33,13 +33,20 @@
 
 namespace octave
 {
-  load_path& __get_load_path__ (const std::string& who)
+  interpreter& __get_interpreter__ (const std::string& who)
   {
     interpreter *interp = interpreter::the_interpreter ();
 
     if (! interp)
       error ("%s: interpreter context missing", who.c_str ());
 
-    return interp->get_load_path ();
+    return *interp;
+  }
+
+  load_path& __get_load_path__ (const std::string& who)
+  {
+    interpreter& interp = __get_interpreter__ (who);
+
+    return interp.get_load_path ();
   }
 }