Automatic date update in version.in
[binutils-gdb.git] / gdb / stub-termcap.c
blobff0ef992960414ff4736f347313084ed0fc7c663
1 /* A very minimal do-nothing termcap emulation stub.
3 Copyright (C) 2005-2024 Free Software Foundation, Inc.
5 Contributed by CodeSourcery, LLC.
7 This file is part of GDB.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
24 extern "C" {
26 /* -Wmissing-prototypes */
27 extern int tgetent (char *buffer, char *termtype);
28 extern int tgetnum (char *name);
29 extern int tgetflag (char *name);
30 extern char* tgetstr (char *name, char **area);
31 extern int tputs (char *string, int nlines, int (*outfun) (int));
32 extern char *tgoto (const char *cap, int col, int row);
36 /* These globals below are global termcap variables that readline
37 references.
39 Actually, depending on preprocessor conditions that we don't want
40 to mirror here (as they may change depending on readline versions),
41 readline may define these globals as well, relying on the linker
42 merging them if needed (-fcommon). That doesn't work with
43 -fno-common or C++, so instead we define the symbols as weak.
44 Don't do this on Windows though, as MinGW gcc 3.4.2 doesn't support
45 weak (later versions, e.g., 4.8, do support it). Given this stub
46 file originally was Windows only, and we only needed this when we
47 made it work on other hosts, it should be OK. */
48 #ifndef __MINGW32__
49 char PC __attribute__((weak));
50 char *BC __attribute__((weak));
51 char *UP __attribute__((weak));
52 #endif
54 /* Each of the files below is a minimal implementation of the standard
55 termcap function with the same name, suitable for use in a Windows
56 console window, or when a real termcap/curses library isn't
57 available. */
59 int
60 tgetent (char *buffer, char *termtype)
62 return -1;
65 int
66 tgetnum (char *name)
68 return -1;
71 int
72 tgetflag (char *name)
74 return -1;
77 char *
78 tgetstr (char *name, char **area)
80 return NULL;
83 int
84 tputs (char *string, int nlines, int (*outfun) (int))
86 while (*string)
87 outfun (*string++);
89 return 0;
92 char *
93 tgoto (const char *cap, int col, int row)
95 return NULL;