]> Git Repo - binutils.git/blobdiff - include/callback.h
* callback.h (cb_printf, cb_eprintf): Declare.
[binutils.git] / include / callback.h
index 944a1b787fde931307b0cf9aa12178713ec91136..1a2ba716af40efa7181c2d46b3a75bf4f21145a9 100644 (file)
@@ -20,6 +20,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #ifndef CALLBACK_H
 #define CALLBACK_H
 
+#ifndef va_start
+#include <ansidecl.h>
+#ifdef ANSI_PROTOTYPES
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
+#endif
+
 typedef struct host_callback_struct host_callback;
 
 #define MAX_CALLBACK_FDS 10
@@ -43,6 +52,11 @@ struct host_callback_struct
   int (*write_stderr) PARAMS ((host_callback *, const char *, int));
   void (*flush_stderr) PARAMS ((host_callback *));
 
+  /* When present, call to the client to give it the oportunity to
+     poll any io devices for a request to quit (indicated by a nonzero
+     return value). */
+  int (*poll_quit) PARAMS ((host_callback *));
+
   /* Used when the target has gone away, so we can close open
      handles and free memory etc etc.  */
   int (*shutdown) PARAMS ((host_callback *));
@@ -51,12 +65,11 @@ struct host_callback_struct
   /* depreciated, use vprintf_filtered - Talk to the user on a console.  */
   void (*printf_filtered) PARAMS ((host_callback *, const char *, ...));
 
-  /* Talk to the user on a console.
-     The `void *' is actually `va_list *'.  */
-  void (*vprintf_filtered) PARAMS ((host_callback *, const char *, void *));
+  /* Talk to the user on a console.  */
+  void (*vprintf_filtered) PARAMS ((host_callback *, const char *, va_list));
 
   /* Same as vprintf_filtered but to stderr.  */
-  void (*evprintf_filtered) PARAMS ((host_callback *, const char *, void *));
+  void (*evprintf_filtered) PARAMS ((host_callback *, const char *, va_list));
 
   /* Print an error message and "exit".
      In the case of gdb "exiting" means doing a longjmp back to the main
@@ -68,6 +81,12 @@ struct host_callback_struct
   int fdmap[MAX_CALLBACK_FDS];
   char fdopen[MAX_CALLBACK_FDS];
   char alwaysopen[MAX_CALLBACK_FDS];
+
+  /* Marker for thse wanting to do sanity checks.
+     This should remain the last memeber of this struct to help catch
+     miscompilation errors. */
+#define HOST_CALLBACK_MAGIC 4705 /* teds constant */
+  int magic;
 };
 
 extern host_callback default_callback;
@@ -87,4 +106,8 @@ extern target_defs_map open_map[];
 extern int host_to_target_errno PARAMS ((int));
 extern int target_to_host_open PARAMS ((int));
 
+/* Cover functions to the vprintf callbacks.  */
+extern void cb_printf PARAMS ((host_callback *, const char *, ...));
+extern void cb_eprintf PARAMS ((host_callback *, const char *, ...));
+
 #endif
This page took 0.026167 seconds and 4 git commands to generate.