aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Edelsohn <dje.gcc@gmail.com>1996-11-20 08:42:22 +0000
committerDavid Edelsohn <dje.gcc@gmail.com>1996-11-20 08:42:22 +0000
commit9d10b92d2ab96407190ff3e22afecf0370c75149 (patch)
tree98103af6653df76a4a3c59a78869c184041c518b /include
parent939b233a57272a5d38db26180843e7381ff7afcf (diff)
downloadgdb-9d10b92d2ab96407190ff3e22afecf0370c75149.zip
gdb-9d10b92d2ab96407190ff3e22afecf0370c75149.tar.gz
gdb-9d10b92d2ab96407190ff3e22afecf0370c75149.tar.bz2
* callback.h: New file, moved here from gdb.
Diffstat (limited to 'include')
-rw-r--r--include/.Sanitize1
-rw-r--r--include/callback.h56
2 files changed, 57 insertions, 0 deletions
diff --git a/include/.Sanitize b/include/.Sanitize
index 0ed04e0..d6be81f 100644
--- a/include/.Sanitize
+++ b/include/.Sanitize
@@ -30,6 +30,7 @@ ansidecl.h
aout
bfdlink.h
bout.h
+callback.h
coff
demangle.h
dis-asm.h
diff --git a/include/callback.h b/include/callback.h
new file mode 100644
index 0000000..b6d7b69
--- /dev/null
+++ b/include/callback.h
@@ -0,0 +1,56 @@
+#ifndef CALLBACK_H
+#define CALLBACK_H
+
+typedef struct host_callback_struct host_callback;
+
+#define MAX_CALLBACK_FDS 10
+
+struct host_callback_struct
+{
+ int (*close) PARAMS ((host_callback *,int));
+ int (*get_errno) PARAMS ((host_callback *));
+ int (*isatty) PARAMS ((host_callback *, int));
+ int (*lseek) PARAMS ((host_callback *, int, long , int));
+ int (*open) PARAMS ((host_callback *, const char*, int mode));
+ int (*read) PARAMS ((host_callback *,int, char *, int));
+ int (*read_stdin) PARAMS (( host_callback *, char *, int));
+ int (*rename) PARAMS ((host_callback *, const char *, const char *));
+ int (*system) PARAMS ((host_callback *, const char *));
+ long (*time) PARAMS ((host_callback *, long *));
+ int (*unlink) PARAMS ((host_callback *, const char *));
+ int (*write) PARAMS ((host_callback *,int, const char *, int));
+ int (*write_stdout) PARAMS ((host_callback *, const char *, int));
+
+ /* Used when the target has gone away, so we can close open
+ handles and free memory etc etc. */
+ int (*shutdown) PARAMS ((host_callback *));
+ int (*init) PARAMS ((host_callback *));
+
+ /* Talk to the user on a console. */
+ void (*printf_filtered) PARAMS ((host_callback *, const char *, ...));
+
+ int last_errno; /* host format */
+
+ int fdmap[MAX_CALLBACK_FDS];
+ char fdopen[MAX_CALLBACK_FDS];
+ char alwaysopen[MAX_CALLBACK_FDS];
+};
+
+extern host_callback default_callback;
+
+/* Mapping of host/target values. */
+/* ??? For debugging purposes, one might want to add a string of the
+ name of the symbol. */
+
+typedef struct {
+ int host_val;
+ int target_val;
+} target_defs_map;
+
+extern target_defs_map errno_map[];
+extern target_defs_map open_map[];
+
+extern int host_to_target_errno PARAMS ((int));
+extern int target_to_host_open PARAMS ((int));
+
+#endif