Files
hush3/src/cc/rogue/cursesd.h
2019-02-17 01:59:19 -11:00

159 lines
4.8 KiB
C

/******************************************************************************
* Copyright © 2014-2019 The SuperNET Developers. *
* *
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at *
* the top-level directory of this distribution for the individual copyright *
* holder information and the developer policies on copyright and licensing. *
* *
* Unless otherwise agreed in a custom licensing agreement, no part of the *
* SuperNET software, including this file may be copied, modified, propagated *
* or distributed except according to the terms contained in the LICENSE file *
* *
* Removal or modification of this copyright notice is prohibited. *
* *
******************************************************************************/
#ifndef H_CURSESD_H
#define H_CURSESD_H
#define LINES 24
#define COLS 80
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <memory.h>
#include <string.h>
#include <unistd.h>
#include <stdarg.h> /* we need va_list */
#include <stddef.h> /* we want wchar_t */
#include <stdbool.h>
#include <ctype.h>
#include <time.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <errno.h>
#define ERR (-1)
struct cursesd_info
{
uint8_t screen[LINES][COLS];
int32_t x,y;
};
typedef struct cursesd_info WINDOW;
extern WINDOW *stdscr,*curscr;
extern int32_t ESCDELAY;
typedef char chtype;
int32_t getch(void); // stub
int32_t md_readchar(void); // stub
WINDOW *initscr(void);
int32_t endwin(void);
int32_t isendwin(void);
//SCREEN *newterm(const char *type, FILE *outfd, FILE *infd);
//SCREEN *set_term(SCREEN *new);
//void delscreen(SCREEN* sp);
int32_t refresh(void);
int32_t wrefresh(WINDOW *win);
//int32_t wnoutrefresh(WINDOW *win);
//int32_t doupdate(void);
int32_t redrawwin(WINDOW *win);
int32_t wredrawln(WINDOW *win, int32_t beg_line, int32_t num_lines);
int32_t erase(void);
int32_t werase(WINDOW *win);
int32_t clear(void);
int32_t wclear(WINDOW *win);
int32_t clrtobot(void);
int32_t wclrtobot(WINDOW *win);
int32_t clrtoeol(void);
int32_t wclrtoeol(WINDOW *win);
int32_t standout(void);
int32_t standend(void);
int32_t raw(void);
int32_t noecho(void);
int32_t flushinp(void);
int32_t keypad(WINDOW *win, bool bf);
int32_t clearok(WINDOW *win, bool bf);
int32_t idlok(WINDOW *win, bool bf);
int32_t leaveok(WINDOW *win, bool bf);
WINDOW *newwin(int32_t nlines,int32_t ncols,int32_t begin_y,int32_t begin_x); // only LINES,COLS,0,0
int32_t delwin(WINDOW *win);
int32_t touchwin(WINDOW *win); // stub
WINDOW *subwin(WINDOW *orig, int32_t nlines, int32_t ncols, int32_t begin_y, int32_t begin_x); // stub
int32_t mvwin(WINDOW *win, int32_t y, int32_t x); // stub
int32_t mvcur(int32_t oldrow, int32_t oldcol, int32_t newrow, int32_t newcol);
char erasechar(void); // stub
char killchar(void); // stub
int32_t move(int32_t y, int32_t x);
int32_t wmove(WINDOW *win, int32_t y, int32_t x);
chtype inch(void);
chtype winch(WINDOW *win);
chtype mvinch(int32_t y, int32_t x);
chtype mvwinch(WINDOW *win, int32_t y, int32_t x);
int32_t addch(chtype ch);
int32_t waddch(WINDOW *win, chtype ch);
int32_t mvaddch(int32_t y, int32_t x, chtype ch);
int32_t mvwaddch(WINDOW *win, int32_t y, int32_t x, chtype ch);
int32_t addstr(const char *str);
int32_t addnstr(const char *str, int32_t n);
int32_t waddstr(WINDOW *win, const char *str);
int32_t waddnstr(WINDOW *win, const char *str, int32_t n);
int32_t mvaddstr(int32_t y, int32_t x, const char *str);
int32_t mvaddnstr(int32_t y, int32_t x, const char *str, int32_t n);
int32_t mvwaddstr(WINDOW *win, int32_t y, int32_t x, const char *str);
int32_t mvwaddnstr(WINDOW *win, int32_t y, int32_t x, const char *str, int32_t n);
int32_t wgetnstr(WINDOW *win, char *str, int32_t n); // stub
int32_t printw(char *fmt,...);
int32_t wprintw(WINDOW *win,char *fmt,...);
int32_t mvprintw(int32_t y,int32_t x,char *fmt,...);
int32_t mvwprintw(WINDOW *win,int32_t y,int32_t x,char *fmt,...);
#define A_CHARTEXT 0xff
#define baudrate() 9600
#define unctrl(a) "^x"
#define getmaxx(a) COLS
#define getmaxy(a) LINES
#define getyx(win,_argfory,_argforx) _argfory = win->y, _argforx = win->x
// functions with only visible effects
#define wrefresh(win) 0
#define wnoutrefresh(win) 0
#define doupdate() 0
#define touchwin(win) 0
#define standout() 0
#define standend() 0
#define raw() 0
#define keypad(win,bf) 0
#define noecho() 0
#define flushinp() 0
#define clearok(win,bf) 0
#define idlok(win,bf) 0
#define leaveok(win,bf) 0
#define halfdelay(x) 0
#define nocbreak() 0
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#endif