* objalloc.h: New file.
[deliverable/binutils-gdb.git] / include / callback.h
CommitLineData
efa86080
DE
1/* Remote target system call callback support.
2 Copyright 1997 Free Software Foundation, Inc.
3
4This file is part of GDB.
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program; if not, write to the Free Software
18Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
19
9d10b92d
DE
20#ifndef CALLBACK_H
21#define CALLBACK_H
22
23typedef struct host_callback_struct host_callback;
24
25#define MAX_CALLBACK_FDS 10
26
27struct host_callback_struct
28{
29 int (*close) PARAMS ((host_callback *,int));
30 int (*get_errno) PARAMS ((host_callback *));
31 int (*isatty) PARAMS ((host_callback *, int));
32 int (*lseek) PARAMS ((host_callback *, int, long , int));
33 int (*open) PARAMS ((host_callback *, const char*, int mode));
34 int (*read) PARAMS ((host_callback *,int, char *, int));
35 int (*read_stdin) PARAMS (( host_callback *, char *, int));
36 int (*rename) PARAMS ((host_callback *, const char *, const char *));
37 int (*system) PARAMS ((host_callback *, const char *));
38 long (*time) PARAMS ((host_callback *, long *));
39 int (*unlink) PARAMS ((host_callback *, const char *));
40 int (*write) PARAMS ((host_callback *,int, const char *, int));
41 int (*write_stdout) PARAMS ((host_callback *, const char *, int));
6d685937
AC
42 void (*flush_stdout) PARAMS ((host_callback *));
43 int (*write_stderr) PARAMS ((host_callback *, const char *, int));
44 void (*flush_stderr) PARAMS ((host_callback *));
9d10b92d
DE
45
46 /* Used when the target has gone away, so we can close open
e1144153 47 handles and free memory etc etc. */
9d10b92d
DE
48 int (*shutdown) PARAMS ((host_callback *));
49 int (*init) PARAMS ((host_callback *));
50
6d685937 51 /* depreciated, use vprintf_filtered - Talk to the user on a console. */
9d10b92d 52 void (*printf_filtered) PARAMS ((host_callback *, const char *, ...));
6d685937 53
efa86080
DE
54 /* Talk to the user on a console.
55 The `void *' is actually `va_list *'. */
6d685937
AC
56 void (*vprintf_filtered) PARAMS ((host_callback *, const char *, void *));
57
efa86080
DE
58 /* Same as vprintf_filtered but to stderr. */
59 void (*evprintf_filtered) PARAMS ((host_callback *, const char *, void *));
60
e1144153
DE
61 /* Print an error message and "exit".
62 In the case of gdb "exiting" means doing a longjmp back to the main
63 command loop. */
64 void (*error) PARAMS ((host_callback *, const char *, ...));
9d10b92d
DE
65
66 int last_errno; /* host format */
67
68 int fdmap[MAX_CALLBACK_FDS];
69 char fdopen[MAX_CALLBACK_FDS];
70 char alwaysopen[MAX_CALLBACK_FDS];
71};
72
73extern host_callback default_callback;
74
75/* Mapping of host/target values. */
76/* ??? For debugging purposes, one might want to add a string of the
77 name of the symbol. */
78
79typedef struct {
80 int host_val;
81 int target_val;
82} target_defs_map;
83
84extern target_defs_map errno_map[];
85extern target_defs_map open_map[];
86
87extern int host_to_target_errno PARAMS ((int));
88extern int target_to_host_open PARAMS ((int));
89
90#endif
This page took 0.043655 seconds and 4 git commands to generate.