(progargs_fluid): New.
[bpt/guile.git] / libguile / gdb_interface.h
index 9ca931b..24f3177 100644 (file)
@@ -1,28 +1,27 @@
-/* Simple interpreter interface for GDB, the GNU debugger.
-   Copyright (C) 1996 Mikael Djurfeldt.
+/* classes: h_files */
 
-This file is part of GDB.
+#ifndef GDB_INTERFACE_H
+#define GDB_INTERFACE_H
+/* Simple interpreter interface for GDB, the GNU debugger.
+   Copyright (C) 1996, 2000, 2001 Free Software Foundation
 
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
 The author can be reached at djurfeldt@nada.kth.se
 Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN  */
 
-#ifndef GDB_INTERFACE_H
-#define GDB_INTERFACE_H
-
 /* This is the header file for GDB's interpreter interface.  The
    interpreter must supply definitions of all symbols declared in this
    file.
@@ -34,6 +33,7 @@ Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN  */
    interface in your main program.  This is necessary if the interface
    is defined in a library, such as Guile. */
 
+#if !defined (__MINGW32__) && !defined (__CYGWIN__)
 #define GDB_INTERFACE \
 void *gdb_interface[] = { \
   &gdb_options, \
@@ -46,8 +46,28 @@ void *gdb_interface[] = { \
   (void *) gdb_eval, \
   (void *) gdb_print, \
   (void *) gdb_binding \
-}; \
-
+}
+#else /* __MINGW32__, __CYGWIN__  */
+/* Because the following functions are imported from a DLL (some kind of
+   shared library) these are NO static initializers. That is why you need to
+   define them and assign the functions and data items at run time. */
+#define GDB_INTERFACE \
+void *gdb_interface[] = \
+  { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
+#define GDB_INTERFACE_INIT \
+  do { \
+    gdb_interface[0] = &gdb_options; \
+    gdb_interface[1] = &gdb_language; \
+    gdb_interface[2] = &gdb_result; \
+    gdb_interface[3] = &gdb_output; \
+    gdb_interface[4] = &gdb_output_length; \
+    gdb_interface[5] = (void *) gdb_maybe_valid_type_p; \
+    gdb_interface[6] = (void *) gdb_read; \
+    gdb_interface[7] = (void *) gdb_eval; \
+    gdb_interface[8] = (void *) gdb_print; \
+    gdb_interface[9] = (void *) gdb_binding; \
+  } while (0);
+#endif /* __MINGW32__ */
 
 /* GDB_OPTIONS is a set of flags informing gdb what features are present
    in the interface.  Currently only one option is supported: */
@@ -57,25 +77,25 @@ void *gdb_interface[] = { \
 
 #define GDB_HAVE_BINDINGS 1
 
-extern unsigned short gdb_options;
+SCM_API unsigned short gdb_options;
 
 /* GDB_LANGUAGE holds the name of the preferred language mode for this
    interpreter.  For lisp interpreters, the suggested mode is "lisp/c". */
 
-extern char *gdb_language;
+SCM_API char *gdb_language;
    
 /* GDB_RESULT is used for passing results from the interpreter to GDB */
 
-extern GDB_TYPE gdb_result;
+SCM_API GDB_TYPE gdb_result;
 
 /* The interpreter passes strings to GDB in GDB_OUTPUT and
    GDB_OUTPUT_LENGTH.  GDB_OUTPUT should hold the pointer to the
    string.  GDB_OUTPUT_LENGTH should hold its length.  The string
    doesn't need to be terminated by '\0'. */
 
-extern char *gdb_output;
+SCM_API char *gdb_output;
 
-extern int gdb_output_length;
+SCM_API int gdb_output_length;
 
 /* Return TRUE if the interpreter regards VALUE's type as valid.  A
    lazy implementation is allowed to pass TRUE always.  FALSE should
@@ -84,7 +104,7 @@ extern int gdb_output_length;
    In the "lisp/c" language mode, this is used to heuristically
    discriminate lisp values from C values during printing. */
 
-extern int gdb_maybe_valid_type_p SCM_P ((GDB_TYPE value));
+SCM_API int gdb_maybe_valid_type_p (GDB_TYPE value);
 
 /* Parse expression in string STR.  Store result in GDB_RESULT, then
    return 0 to indicate success.  On error, return -1 to indicate
@@ -93,7 +113,7 @@ extern int gdb_maybe_valid_type_p SCM_P ((GDB_TYPE value));
    no message is passed.  Please note that the resulting value should
    be protected against garbage collection. */
 
-extern int gdb_read SCM_P ((char *str));
+SCM_API int gdb_read (char *str);
 
 /* Evaluate expression EXP.  Store result in GDB_RESULT, then return 0
    to indicate success.  On error, return -1 to indicate failure.  Any
@@ -102,7 +122,7 @@ extern int gdb_read SCM_P ((char *str));
    if no output is passed.  Please note that the resulting lisp object
    should be protected against garbage collection. */
 
-extern int gdb_eval SCM_P ((GDB_TYPE exp));
+SCM_API int gdb_eval (GDB_TYPE exp);
 
 /* Print VALUE.  Store output in GDB_OUTPUT and GDB_OUTPUT_LENGTH.
    Return 0 to indicate success.  On error, return -1 to indicate
@@ -110,7 +130,7 @@ extern int gdb_eval SCM_P ((GDB_TYPE exp));
    failure.  Note that this function should be robust against strange
    values.  It could in fact be passed any kind of value. */
 
-extern int gdb_print SCM_P ((GDB_TYPE value));
+SCM_API int gdb_print (GDB_TYPE value);
 
 /* Bind NAME to VALUE in interpreter.  (GDB has previously obtained
    NAME by passing a string to gdb_read.)  Return 0 to indicate
@@ -122,6 +142,12 @@ extern int gdb_print SCM_P ((GDB_TYPE value));
    For scheme interpreters, this function should introduce top-level
    bindings. */
 
-extern int gdb_binding SCM_P ((GDB_TYPE name, GDB_TYPE value));
+SCM_API int gdb_binding (GDB_TYPE name, GDB_TYPE value);
+
+#endif  /* GDB_INTERFACE_H */
 
-#endif /* GDB_INTERFACE_H */
+/*
+  Local Variables:
+  c-file-style: "gnu"
+  End:
+*/