This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH]: Cleanup tui.h and tuiData.h
- To: gdb-patches at sources dot redhat dot com
- Subject: [PATCH]: Cleanup tui.h and tuiData.h
- From: Stephane Carrez <Stephane dot Carrez at worldnet dot fr>
- Date: Tue, 17 Jul 2001 00:10:38 +0200
Hi!
The tui/tui.h was including the curses header. This creates a conflict
when compiling several gdb files. For example, monitor.c defines a variable
`int timeout;' which conflicts with a ncurses.h #define;
I've committed the patch below to move several definitions from tui.h
to tuiData.h so that gdb main sources are not affected by tui internal
definitions nor curses headers.
Stephane
2001-07-16 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* tui.h: Cleanup to avoid inclusion of curses includes.
(TuiGenWinInfo, TuiGenWinInfoPtr): Move from here.
* tuiData.h: To here; include curses includes here.
(setTermHeightTo): Rename of setTermHeight to follow reality.
(setTermWidthTo): Likewise with setTermWidth.
Index: tui.h
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui.h,v
retrieving revision 1.5
diff -u -p -r1.5 tui.h
--- tui.h 2001/07/14 19:01:25 1.5
+++ tui.h 2001/07/16 21:52:08
@@ -21,18 +21,9 @@
#ifndef TUI_H
#define TUI_H
-#if defined (HAVE_NCURSES_H)
-#include <ncurses.h>
-#elif defined (HAVE_CURSES_H)
-#include <curses.h>
-#endif
-#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
+#include <string.h>
#include "ansidecl.h"
#if defined(reg)
@@ -96,23 +87,6 @@ TuiWinType, *TuiWinTypePtr;
int x, y;
}
TuiPoint, *TuiPointPtr;
-
-/* Generic window information */
- typedef struct _TuiGenWinInfo
- {
- WINDOW *handle; /* window handle */
- TuiWinType type; /* type of window */
- int width; /* window width */
- int height; /* window height */
- TuiPoint origin; /* origin of window */
- OpaquePtr content; /* content of window */
- int contentSize; /* Size of content (# of elements) */
- int contentInUse; /* Can it be used, or is it already used? */
- int viewportHeight; /* viewport height */
- int lastVisibleLine; /* index of last visible line */
- int isVisible; /* whether the window is visible or not */
- }
-TuiGenWinInfo, *TuiGenWinInfoPtr;
/* GENERAL TUI FUNCTIONS */
/* tui.c */
Index: tuiData.h
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiData.h,v
retrieving revision 1.3
diff -u -p -r1.3 tuiData.h
--- tuiData.h 2001/07/14 19:01:25 1.3
+++ tuiData.h 2001/07/16 21:52:09
@@ -22,6 +22,29 @@
#ifndef TUI_DATA_H
#define TUI_DATA_H
+#if defined (HAVE_NCURSES_H)
+#include <ncurses.h>
+#elif defined (HAVE_CURSES_H)
+#include <curses.h>
+#endif
+
+/* Generic window information */
+ typedef struct _TuiGenWinInfo
+ {
+ WINDOW *handle; /* window handle */
+ TuiWinType type; /* type of window */
+ int width; /* window width */
+ int height; /* window height */
+ TuiPoint origin; /* origin of window */
+ OpaquePtr content; /* content of window */
+ int contentSize; /* Size of content (# of elements) */
+ int contentInUse; /* Can it be used, or is it already used? */
+ int viewportHeight; /* viewport height */
+ int lastVisibleLine; /* index of last visible line */
+ int isVisible; /* whether the window is visible or not */
+ }
+TuiGenWinInfo, *TuiGenWinInfoPtr;
+
/* Constant definitions */
#define DEFAULT_TAB_LEN 8
#define NO_SRC_STRING "[ No Source Available ]"
@@ -314,9 +337,9 @@ extern int winElementHeight (TuiGenWinIn
extern TuiLayoutType currentLayout (void);
extern void setCurrentLayoutTo (TuiLayoutType);
extern int termHeight (void);
-extern void setTermHeight (int);
+extern void setTermHeightTo (int);
extern int termWidth (void);
-extern void setTermWidth (int);
+extern void setTermWidthTo (int);
extern int historyLimit (void);
extern void setHistoryLimit (int);
extern void setGenWinOrigin (TuiGenWinInfoPtr, int, int);
@@ -343,6 +366,5 @@ extern void tuiSetWinResizedTo (int);
extern TuiWinInfoPtr tuiNextWin (TuiWinInfoPtr);
extern TuiWinInfoPtr tuiPrevWin (TuiWinInfoPtr);
-
#endif /* TUI_DATA_H */