]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/tui/tui.h
Initial creation of sourceware repository
[thirdparty/binutils-gdb.git] / gdb / tui / tui.h
1 /* External/Public TUI Header File */
2
3 #ifndef TUI_H
4 #define TUI_H
5 #include <curses.h>
6
7 #ifdef ANSI_PROTOTYPES
8 #include <stdarg.h>
9 #else
10 #include <varargs.h>
11 #endif
12
13 #include "ansidecl.h"
14
15 #if defined(reg)
16 #undef reg
17 #endif
18 #if defined(chtype)
19 #undef chtype
20 #endif
21
22 /* Opaque data type */
23 typedef char *Opaque;
24 typedef Opaque (*OpaqueFuncPtr) PARAMS ((va_list));
25 typedef char **OpaqueList;
26 typedef OpaqueList OpaquePtr;
27
28 /* Generic function pointer */
29 typedef void (*TuiVoidFuncPtr) PARAMS ((va_list));
30 typedef int (*TuiIntFuncPtr) PARAMS ((va_list));
31 /*
32 typedef Opaque (*TuiOpaqueFuncPtr) PARAMS ((va_list));
33 */
34 typedef OpaqueFuncPtr TuiOpaqueFuncPtr;
35
36 extern Opaque vcatch_errors PARAMS ((OpaqueFuncPtr, ...));
37 extern Opaque va_catch_errors PARAMS ((OpaqueFuncPtr, va_list));
38
39 extern void strcat_to_buf PARAMS ((char *, int, char *));
40 extern void strcat_to_buf_with_fmt PARAMS ((char *, int, char *, ...));
41
42 /* Types of error returns */
43 typedef enum {
44 TUI_SUCCESS,
45 TUI_FAILURE
46 } TuiStatus, *TuiStatusPtr;
47
48 /* Types of windows */
49 typedef enum {
50 SRC_WIN = 0,
51 DISASSEM_WIN,
52 DATA_WIN,
53 CMD_WIN,
54 /* This must ALWAYS be AFTER the major windows last */
55 MAX_MAJOR_WINDOWS,
56 /* auxillary windows */
57 LOCATOR_WIN,
58 EXEC_INFO_WIN,
59 DATA_ITEM_WIN,
60 /* This must ALWAYS be next to last */
61 MAX_WINDOWS,
62 UNDEFINED_WIN /* LAST */
63 } TuiWinType, *TuiWinTypePtr;
64
65 /* This is a point definition */
66 typedef struct _TuiPoint {
67 int x, y;
68 } TuiPoint, *TuiPointPtr;
69
70 /* Generic window information */
71 typedef struct _TuiGenWinInfo {
72 WINDOW *handle; /* window handle */
73 TuiWinType type; /* type of window */
74 int width; /* window width */
75 int height; /* window height */
76 TuiPoint origin; /* origin of window */
77 OpaquePtr content; /* content of window */
78 int contentSize; /* Size of content (# of elements) */
79 int contentInUse; /* Can it be used, or is it already used? */
80 int viewportHeight; /* viewport height */
81 int lastVisibleLine; /* index of last visible line */
82 int isVisible; /* whether the window is visible or not */
83 } TuiGenWinInfo, *TuiGenWinInfoPtr;
84
85 /* GENERAL TUI FUNCTIONS */
86 /* tui.c */
87 extern void tuiInit PARAMS ((char *argv0));
88 extern void tuiInitWindows PARAMS ((void));
89 extern void tuiResetScreen PARAMS ((void));
90 extern void tuiCleanUp PARAMS ((void));
91 extern void tuiError PARAMS ((char *, int));
92 extern void tui_vError PARAMS ((va_list));
93 extern void tuiFree PARAMS ((char *));
94 extern Opaque tuiDo PARAMS ((TuiOpaqueFuncPtr, ...));
95 extern Opaque tuiDoAndReturnToTop PARAMS ((TuiOpaqueFuncPtr, ...));
96 extern Opaque tuiGetLowDisassemblyAddress PARAMS ((Opaque, Opaque));
97 extern Opaque tui_vGetLowDisassemblyAddress PARAMS ((va_list));
98 extern void tui_vSelectSourceSymtab PARAMS ((va_list));
99
100 /* tuiDataWin.c */
101 extern void tui_vCheckDataValues PARAMS ((va_list));
102
103 /* tuiIO.c */
104 extern void tui_vStartNewLines PARAMS ((va_list));
105
106 /* tuiLayout.c */
107 extern void tui_vAddWinToLayout PARAMS ((va_list));
108 extern TuiStatus tui_vSetLayoutTo PARAMS ((va_list));
109
110 /* tuiSourceWin.c */
111 extern void tuiDisplayMainFunction PARAMS ((void));
112 extern void tuiUpdateAllExecInfos PARAMS ((void));
113 extern void tuiUpdateOnEnd PARAMS ((void));
114 extern void tui_vAllSetHasBreakAt PARAMS ((va_list));
115 extern void tui_vUpdateSourceWindowsWithAddr PARAMS ((va_list));
116
117 /* tuiStack.c */
118 extern void tui_vShowFrameInfo PARAMS ((va_list));
119 extern void tui_vUpdateLocatorFilename PARAMS ((va_list));
120 #endif /* TUI_H */