summaryrefslogtreecommitdiff
path: root/payloads/libpayload/curses/PDCurses-3.4/pdcurses/terminfo.c
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@secunet.com>2011-07-07 15:41:53 +0200
committerStefan Reinauer <stefan.reinauer@coreboot.org>2011-08-04 08:10:41 +0200
commit3b77b723ca209199c8a224702812441e2196d452 (patch)
treecbf3be2c724139ec80a33dbf8e002b7871ef9307 /payloads/libpayload/curses/PDCurses-3.4/pdcurses/terminfo.c
parent1ac19e28eed4f6c53a4f295eb55500c65fc80f8d (diff)
downloadcoreboot-3b77b723ca209199c8a224702812441e2196d452.tar.xz
libpayload: Add PDCurses and ncurses' libform/libmenu
PDCurses provides an alternative implementation of the curses library standard in addition to tinycurses. Where tinycurses is really tiny, PDCurses is more complete and provides virtually unlimited windows and the full API. The PDCurses code is brought in "vanilla", with all local changes residing in curses/pdcurses-backend/ In addition to a curses library, this change also provides libpanel (as part of the PDCurses code), and libform and libmenu which were derived from ncurses-5.9. As they rely on ncurses internals (and PDCurses is not ncurses), more changes were required for these libraries to work. The build system is extended to install the right set of header files depending on the selected curses implementation. Change-Id: I9e5b920f94b6510da01da2f656196a993170d1c5 Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/106 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marcj303@gmail.com>
Diffstat (limited to 'payloads/libpayload/curses/PDCurses-3.4/pdcurses/terminfo.c')
-rw-r--r--payloads/libpayload/curses/PDCurses-3.4/pdcurses/terminfo.c215
1 files changed, 215 insertions, 0 deletions
diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/terminfo.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/terminfo.c
new file mode 100644
index 0000000000..c099ada728
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/terminfo.c
@@ -0,0 +1,215 @@
+/* Public Domain Curses */
+
+#include <curspriv.h>
+
+RCSID("$Id: terminfo.c,v 1.37 2008/07/21 12:29:20 wmcbrine Exp $")
+
+/*man-start**************************************************************
+
+ Name: terminfo
+
+ Synopsis:
+ int mvcur(int oldrow, int oldcol, int newrow, int newcol);
+ int vidattr(chtype attr);
+ int vid_attr(attr_t attr, short color_pair, void *opt);
+ int vidputs(chtype attr, int (*putfunc)(int));
+ int vid_puts(attr_t attr, short color_pair, void *opt,
+ int (*putfunc)(int));
+
+ int del_curterm(TERMINAL *);
+ int putp(const char *);
+ int restartterm(const char *, int, int *);
+ TERMINAL *set_curterm(TERMINAL *);
+ int setterm(const char *term);
+ int setupterm(const char *, int, int *);
+ int tgetent(char *, const char *);
+ int tgetflag(const char *);
+ int tgetnum(const char *);
+ char *tgetstr(const char *, char **);
+ char *tgoto(const char *, int, int);
+ int tigetflag(const char *);
+ int tigetnum(const char *);
+ char *tigetstr(const char *);
+ char *tparm(const char *,long, long, long, long, long, long,
+ long, long, long);
+ int tputs(const char *, int, int (*)(int));
+
+ Description:
+ mvcur() lets you move the physical cursor without updating any
+ window cursor positions. It returns OK or ERR.
+
+ The rest of these functions are currently implemented as stubs,
+ returning the appropriate errors and doing nothing else.
+
+ Portability X/Open BSD SYS V
+ mvcur Y Y Y
+
+**man-end****************************************************************/
+
+#include <term.h>
+
+TERMINAL *cur_term = NULL;
+
+int mvcur(int oldrow, int oldcol, int newrow, int newcol)
+{
+ PDC_LOG(("mvcur() - called: oldrow %d oldcol %d newrow %d newcol %d\n",
+ oldrow, oldcol, newrow, newcol));
+
+ if ((newrow >= LINES) || (newcol >= COLS) || (newrow < 0) || (newcol < 0))
+ return ERR;
+
+ PDC_gotoyx(newrow, newcol);
+ SP->cursrow = newrow;
+ SP->curscol = newcol;
+
+ return OK;
+}
+
+int vidattr(chtype attr)
+{
+ PDC_LOG(("vidattr() - called: attr %d\n", attr));
+
+ return ERR;
+}
+
+int vid_attr(attr_t attr, short color_pair, void *opt)
+{
+ PDC_LOG(("vid_attr() - called\n"));
+
+ return ERR;
+}
+
+int vidputs(chtype attr, int (*putfunc)(int))
+{
+ PDC_LOG(("vidputs() - called: attr %d\n", attr));
+
+ return ERR;
+}
+
+int vid_puts(attr_t attr, short color_pair, void *opt, int (*putfunc)(int))
+{
+ PDC_LOG(("vid_puts() - called\n"));
+
+ return ERR;
+}
+
+int del_curterm(TERMINAL *oterm)
+{
+ PDC_LOG(("del_curterm() - called\n"));
+
+ return ERR;
+}
+
+int putp(const char *str)
+{
+ PDC_LOG(("putp() - called: str %s\n", str));
+
+ return ERR;
+}
+
+int restartterm(const char *term, int filedes, int *errret)
+{
+ PDC_LOG(("restartterm() - called\n"));
+
+ if (errret)
+ *errret = -1;
+
+ return ERR;
+}
+
+TERMINAL *set_curterm(TERMINAL *nterm)
+{
+ PDC_LOG(("set_curterm() - called\n"));
+
+ return (TERMINAL *)NULL;
+}
+
+int setterm(const char *term)
+{
+ PDC_LOG(("setterm() - called\n"));
+
+ return ERR;
+}
+
+int setupterm(const char *term, int filedes, int *errret)
+{
+ PDC_LOG(("setupterm() - called\n"));
+
+ if (errret)
+ *errret = -1;
+ else
+ fprintf(stderr, "There is no terminfo database\n");
+
+ return ERR;
+}
+
+int tgetent(char *bp, const char *name)
+{
+ PDC_LOG(("tgetent() - called: name %s\n", name));
+
+ return ERR;
+}
+
+int tgetflag(const char *id)
+{
+ PDC_LOG(("tgetflag() - called: id %s\n", id));
+
+ return ERR;
+}
+
+int tgetnum(const char *id)
+{
+ PDC_LOG(("tgetnum() - called: id %s\n", id));
+
+ return ERR;
+}
+
+char *tgetstr(const char *id, char **area)
+{
+ PDC_LOG(("tgetstr() - called: id %s\n", id));
+
+ return (char *)NULL;
+}
+
+char *tgoto(const char *cap, int col, int row)
+{
+ PDC_LOG(("tgoto() - called\n"));
+
+ return (char *)NULL;
+}
+
+int tigetflag(const char *capname)
+{
+ PDC_LOG(("tigetflag() - called: capname %s\n", capname));
+
+ return -1;
+}
+
+int tigetnum(const char *capname)
+{
+ PDC_LOG(("tigetnum() - called: capname %s\n", capname));
+
+ return -2;
+}
+
+char *tigetstr(const char *capname)
+{
+ PDC_LOG(("tigetstr() - called: capname %s\n", capname));
+
+ return (char *)(-1);
+}
+
+char *tparm(const char *cap, long p1, long p2, long p3, long p4,
+ long p5, long p6, long p7, long p8, long p9)
+{
+ PDC_LOG(("tparm() - called: cap %s\n", cap));
+
+ return (char *)NULL;
+}
+
+int tputs(const char *str, int affcnt, int (*putfunc)(int))
+{
+ PDC_LOG(("tputs() - called\n"));
+
+ return ERR;
+}