summaryrefslogtreecommitdiff
path: root/payloads/libpayload/curses/PDCurses-3.4/pdcurses/terminfo.c
blob: abae4f261422aec8edae80f248c1e1eef140b8c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
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;
}