4 typedef struct host_callback_struct host_callback;
6 #define MAX_CALLBACK_FDS 10
8 struct host_callback_struct
10 int (*close) PARAMS ((host_callback *,int));
11 int (*get_errno) PARAMS ((host_callback *));
12 int (*isatty) PARAMS ((host_callback *, int));
13 int (*lseek) PARAMS ((host_callback *, int, long , int));
14 int (*open) PARAMS ((host_callback *, const char*, int mode));
15 int (*read) PARAMS ((host_callback *,int, char *, int));
16 int (*read_stdin) PARAMS (( host_callback *, char *, int));
17 int (*rename) PARAMS ((host_callback *, const char *, const char *));
18 int (*system) PARAMS ((host_callback *, const char *));
19 long (*time) PARAMS ((host_callback *, long *));
20 int (*unlink) PARAMS ((host_callback *, const char *));
21 int (*write) PARAMS ((host_callback *,int, const char *, int));
22 int (*write_stdout) PARAMS ((host_callback *, const char *, int));
24 /* Used when the target has gone away, so we can close open
25 handles and free memory etc etc. */
26 int (*shutdown) PARAMS ((host_callback *));
27 int (*init) PARAMS ((host_callback *));
29 /* Talk to the user on a console. */
30 void (*printf_filtered) PARAMS ((host_callback *, const char *, ...));
31 /* Print an error message and "exit".
32 In the case of gdb "exiting" means doing a longjmp back to the main
34 void (*error) PARAMS ((host_callback *, const char *, ...));
36 int last_errno; /* host format */
38 int fdmap[MAX_CALLBACK_FDS];
39 char fdopen[MAX_CALLBACK_FDS];
40 char alwaysopen[MAX_CALLBACK_FDS];
43 extern host_callback default_callback;
45 /* Mapping of host/target values. */
46 /* ??? For debugging purposes, one might want to add a string of the
47 name of the symbol. */
54 extern target_defs_map errno_map[];
55 extern target_defs_map open_map[];
57 extern int host_to_target_errno PARAMS ((int));
58 extern int target_to_host_open PARAMS ((int));