* objcopy.c: Move new struct and variable definitions to top of
[deliverable/binutils-gdb.git] / include / callback.h
index b2a7fe247d9843d637b94bbf7897a926860b523f..4e3c9ef6572d9fbe9a5aaefb5b6b89653a0096d6 100644 (file)
@@ -17,6 +17,16 @@ 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.  */
 
+/* ??? This interface isn't intended to be specific to any particular kind
+   of remote (hardware, simulator, whatever).  However, at the present
+   time it is only used by the simulators.  At some point this should be
+   an entity onto itself.  For example, it's wrong that the definitions of the
+   functions host_to_target_errno, target_to_host_open live in the simulator
+   sources.  It would also be wrong for such functions to live in gdb
+   sources.  Until such time perhaps it would be best to avoid adding
+   prototypes of functions (and thus expanding the definition of the
+   interface).  */
+
 #ifndef CALLBACK_H
 #define CALLBACK_H
 
@@ -52,6 +62,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 *));
@@ -60,8 +75,7 @@ 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 *'.  */
+  /* Talk to the user on a console.  */
   void (*vprintf_filtered) PARAMS ((host_callback *, const char *, va_list));
 
   /* Same as vprintf_filtered but to stderr.  */
@@ -77,6 +91,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;
This page took 0.024552 seconds and 4 git commands to generate.