diff src/dynamic-ld.cc @ 2893:9fd1df4b464a

[project @ 1997-04-28 02:07:38 by jwe]
author jwe
date Mon, 28 Apr 1997 02:10:02 +0000
parents 95e85daad148
children f1c5f8151397
line wrap: on
line diff
--- a/src/dynamic-ld.cc	Mon Apr 28 02:04:28 1997 +0000
+++ b/src/dynamic-ld.cc	Mon Apr 28 02:10:02 1997 +0000
@@ -50,13 +50,14 @@
 #include "toplev.h"
 #include "pathsearch.h"
 #include "oct-obj.h"
+#include "oct-builtin.h"
 #include "ov.h"
 #include "utils.h"
 #include "variables.h"
 
-typedef builtin_function * (*Octave_builtin_fcn_struct_fcn)(void);
+#if defined (WITH_DYNAMIC_LINKING)
 
-#if defined (WITH_DYNAMIC_LINKING)
+typedef void * (*resolver_fcn) (const string& name, const string& file);
 
 static string
 mangle_octave_oct_file_name (const string& name)
@@ -102,6 +103,8 @@
   return retval;
 }
 
+static resolver_fcn resolve_octave_reference = dl_resolve_octave_reference;
+
 #elif defined (WITH_SHL)
 
 static void *
@@ -138,63 +141,51 @@
   return retval;
 }
 
-#endif
+static resolver_fcn resolve_octave_reference = shl_resolve_octave_reference;
+
 #endif
 
-#if defined (WITH_DYNAMIC_LINKING)
-static void *
-resolve_octave_reference (const string& name, const string& file)
-{
-#if defined (WITH_DL)
-
-  return dl_resolve_octave_reference (name, file);
-
-#elif defined (WITH_SHL)
-
-  return shl_resolve_octave_reference (name, file);
-
-#endif
-}
-#endif
+typedef octave_builtin * (*builtin_obj_fcn) (void);
 
 int
 load_octave_oct_file (const string& name)
 {
   int retval = 0;
 
-#if defined (WITH_DYNAMIC_LINKING)
-
   string oct_file = oct_file_in_path (name);
 
   if (! oct_file.empty ())
     {
       string mangled_name = mangle_octave_oct_file_name (name);
 
-      Octave_builtin_fcn_struct_fcn f =
-	(Octave_builtin_fcn_struct_fcn) resolve_octave_reference
-	  (mangled_name, oct_file);
+      builtin_obj_fcn f
+	= (builtin_obj_fcn) resolve_octave_reference (mangled_name, oct_file);
 
       if (f)
 	{
-	  builtin_function *s = f ();
+	  octave_builtin *obj = f ();
 
-	  if (s)
+	  if (obj)
 	    {
-	      install_builtin_function (*s);
+	      install_builtin_function (obj);
 	      retval = 1;
 	    }
 	}
     }
 
+  return retval;
+}
+
 #else
 
-  (void) name;
+int
+load_octave_oct_file (const string&)
+{
+  return 0;
+}
 
 #endif
 
-  return retval;
-}
-
 /*
 ;;; Local Variables: ***
 ;;; mode: C++ ***