Extension Language API
[deliverable/binutils-gdb.git] / gdb / python / py-auto-load.c
index ebea0c631b3462d70d49434fa4bf25d332c8f49a..66f731653ea35e72e1199655de6838fe5b4535f7 100644 (file)
@@ -25,9 +25,6 @@
 #include "objfiles.h"
 #include "python.h"
 #include "auto-load.h"
-
-#ifdef HAVE_PYTHON
-
 #include "python-internal.h"
 
 /* User-settable option to enable/disable auto-loading of Python scripts:
@@ -45,38 +42,21 @@ show_auto_load_python_scripts (struct ui_file *file, int from_tty,
   fprintf_filtered (file, _("Auto-loading of Python scripts is %s.\n"), value);
 }
 
-/* Return non-zero if auto-loading Python scripts is enabled.  */
+/* Return non-zero if auto-loading Python scripts is enabled.
+   This is the extension_language_script_ops.auto_load_enabled "method".  */
 
-static int
-auto_load_python_scripts_enabled (void)
+int
+gdbpy_auto_load_enabled (const struct extension_language_defn *extlang)
 {
   return auto_load_python_scripts;
 }
 
-/* Definition of script language for Python scripts.  */
-
-static const struct script_language script_language_python =
-{
-  "python",
-  GDBPY_AUTO_FILE_NAME,
-  auto_load_python_scripts_enabled,
-  source_python_script_for_objfile
-};
-
-/* Return the Python script language definition.  */
-
-const struct script_language *
-gdbpy_script_language_defn (void)
-{
-  return &script_language_python;
-}
-
 /* Wrapper for "info auto-load python-scripts".  */
 
 static void
 info_auto_load_python_scripts (char *pattern, int from_tty)
 {
-  auto_load_info_scripts (pattern, from_tty, &script_language_python);
+  auto_load_info_scripts (pattern, from_tty, &extension_language_python);
 }
 \f
 int
@@ -125,16 +105,3 @@ Print the list of automatically loaded Python scripts, deprecated."));
 
   return 0;
 }
-
-#else /* ! HAVE_PYTHON */
-
-/* Return the Python script language definition.
-   Since support isn't compiled in, return NULL.  */
-
-const struct script_language *
-gdbpy_script_language_defn (void)
-{
-  return NULL;
-}
-
-#endif /* ! HAVE_PYTHON */
This page took 0.027746 seconds and 4 git commands to generate.