steve@cit5.cit.oz.AU (Steve Balogh) (10/09/87)
#! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files. # This archive created: Wed Oct 7 17:51:13 EST 1987 # Archived by: Steve Balogh - steve%cit5.cit.oz@uunet.uu.net export PATH; PATH=/bin:$PATH echo shar: extracting "'addch.m'" '(1157 characters)' if test -f 'addch.m' then echo shar: will not over-write existing file "'addch.m'" else sed 's/^X//' << \SHAR_EOF > 'addch.m' XNAME X newline() - line advance X waddch() addch() mvaddch() mvwaddch() - insert a character X XSYNOPSIS X #include <curses.h> X #include <curspriv.h> X X static short newline(win, lin) X WINDOW *win; X short lin; X X int waddch(win, c) X register WINDOW *win; X char c; X X int addch(c) X char c; X X int mvaddch(y,x,c) X int x; X int y; X char c; X X int mvwaddch(win,y,x,c) X WINDOW *win; X int x; X int y; X char c; X XDESCRIPTION X newline() does line advance and returns the new cursor line. X If error, return -1. X X waddch() inserts character 'c' at the current cursor posi- X tion in window 'win', and takes any actions as dictated by X the character. X X addch() inserts character 'c' at the current cursor posi- X tion in stdscr, and takes any actions as dictated by the X character. X X mvaddch() moves to position in stdscr, then inserts charac- X ter 'c' at that point, and takes any actions as dictated by X the character. X X mvwaddch() moves to position in window 'win', then inserts X character 'c' at that point in the window, and takes any X actions as dictated by the character. X XEXAMPLES X XSEE ALSO X scroll(), switch(), waddch(), newline(), wmove() X XBUGS SHAR_EOF if test 1157 -ne "`wc -c < 'addch.m'`" then echo shar: error transmitting "'addch.m'" '(should have been 1157 characters)' fi fi # end of overwriting check echo shar: extracting "'addstr.m'" '(977 characters)' if test -f 'addstr.m' then echo shar: will not over-write existing file "'addstr.m'" else sed 's/^X//' << \SHAR_EOF > 'addstr.m' XNAME X waddstr() addstr() mvaddstr() mvwaddstr() - insert a string X XSYNOPSIS X #include <curses.h> X #include <curspriv.h> X X int waddstr(win, str) X WINDOW *win; X char *str; X X int addstr(str) X char *str; X X int mvaddstr(y,x,str) X int y; X int x; X char *str; X X int mvwaddstr(win,y,x,str) X WINDOW *win; X int y; X int x; X char *str; X XDESCRIPTION X waddstr() inserts string 'str' at the current cursor posi- X tion in window 'win', and takes any actions as dictated by X the characters. X X addstr() inserts string 'str' at the current cursor posi- X tion in stdscr, and takes any actions as dictated by the X characters. X X mvaddstr() move to a new position in stdscr, then inserts X string 'str' at the new position, taking any actions as dic- X tated by the characters. X X mvwaddstr() move to a new position in window 'win', then X inserts string 'str' at the new position, taking any actions X as dictated by the characters. X XEXAMPLES X XSEE ALSO X waddch(); wmove() X XBUGS SHAR_EOF if test 977 -ne "`wc -c < 'addstr.m'`" then echo shar: error transmitting "'addstr.m'" '(should have been 977 characters)' fi fi # end of overwriting check echo shar: extracting "'backchar.m'" '(1615 characters)' if test -f 'backchar.m' then echo shar: will not over-write existing file "'backchar.m'" else sed 's/^X//' << \SHAR_EOF > 'backchar.m' XNAME X wgetstr() getstr() mvgetstr() mvwgetstr() - reads in a string X terminated by \n or \r X backchar() - character delete with screen erase X XSYNOPSIS X #include <curses.h> X #include <curspriv.h> X X int wgetstr(win,str) X WINDOW *win; X char *str; X X int getstr(str) X char *str; X X int mvgetstr(y,x,str) X int y; X int x; X char *str; X X int mvwgetstr(win,y,x,str) X WINDOW *win; X int y; X int x; X char *str; X X static char *backchar(s) X char *s; X XDESCRIPTION X wgetstr() reads in a string (terminated by \n or \r) X to the buffer pointed to by 'str', and displays the input X in window 'win'. The user's erase and kill characters are X active. X X getstr() reads in a string (terminated by \n or \r) to X the buffer pointed to by 'str', and displays the input in X stdscr. The user's erase and kill characters are active. X X mvgetstr() moves the stdscr cursor to a new position, X then reads in a string (terminated by \n or \r) to the buf- X fer pointed to by 'str', and displays the input in stdscr. X The user's erase and kill characters are active. X X mvwgetstr() moves the 'win' cursor to a new X position, then reads in a string (terminated by \n or \r) X to the buffer pointed to by 'str', and displays the input in X stdscr. The user's erase and kill characters are active. X X backchar() does a character delete with screen erase, even X up to previous lines. It will not back-scroll if the begi- X ning of the string has scrolled off the window. Steps back X pointer 's', and returns the new value. X XEXAMPLES X XSEE ALSO X wrefresh(); getch(); waddch(); wmove(); waddstr(); mvwaddch() X XBUGS SHAR_EOF if test 1615 -ne "`wc -c < 'backchar.m'`" then echo shar: error transmitting "'backchar.m'" '(should have been 1615 characters)' fi fi # end of overwriting check echo shar: extracting "'beep.m'" '(282 characters)' if test -f 'beep.m' then echo shar: will not over-write existing file "'beep.m'" else sed 's/^X//' << \SHAR_EOF > 'beep.m' XNAME X beep() flash() - alert the operator X XSYNOPSIS X #include <curses.h> X #include <curspriv.h> X X void beep() X X void flash() X XDESCRIPTION X beep() sounds the terminal bell. X flash() flashes the terminal screen. X XEXAMPLES X XSEE ALSO X cursesputc(), cursesscroll(), wrefresh() X XBUGS SHAR_EOF if test 282 -ne "`wc -c < 'beep.m'`" then echo shar: error transmitting "'beep.m'" '(should have been 282 characters)' fi fi # end of overwriting check echo shar: extracting "'box.m'" '(745 characters)' if test -f 'box.m' then echo shar: will not over-write existing file "'box.m'" else sed 's/^X//' << \SHAR_EOF > 'box.m' XNAME X wbox() box() - draw a box X XSYNOPSIS X #include <curses.h> X #include <curspriv.h> X X int wbox(win,ymin,xmin,ymax,xmax,v,h) X WINDOW *win; X int ymin; X int xmin; X int ymax; X int xmax; X char v; X char h; X X void box(win,vc,hc) X WINDOW *win; X char vc; X char hc; X XDESCRIPTION X wbox(win,ymin,xmin,ymax,xmax,v,h) draws a box in window X 'win', enclosing the area xmin-xmax and ymin-xmax. If X xmax and/or ymax is 0, the window max value is used. 'v' and X 'h' are the vertical and horizontal characters to use. If X 'v' and 'h' are PC grapics lines, wbox will make the corners X in a pretty way. X X box(win,v,h) draws a box around window window 'win'. 'v' and X 'h' are the vertical and horizontal characters to use. X XEXAMPLES X XSEE ALSO X XBUGS SHAR_EOF if test 745 -ne "`wc -c < 'box.m'`" then echo shar: error transmitting "'box.m'" '(should have been 745 characters)' fi fi # end of overwriting check echo shar: extracting "'cbreak.m'" '(830 characters)' if test -f 'cbreak.m' then echo shar: will not over-write existing file "'cbreak.m'" else sed 's/^X//' << \SHAR_EOF > 'cbreak.m' XNAME X raw() noraw() echo() noecho() cbreak() nocbreak() crmode() nocrmode() X refrbrk() - set or unset screen flags X XSYNOPSIS X #include <curses.h> X #include <curspriv.h> X X void raw() X X void noraw() X X void echo() X X void noecho() X X void nl() X X void nonl() X X void cbreak() X X void nocbreak() X X void crmode() X X void nocrmode() X X void refrbrk(bf) X bool bf; X XDESCRIPTION X raw() and noraw() sets or clears raw mode. X X echo() and noecho() sets or clears echo mode. X X cbreak(), nocbreak(), crmode() amd nocrmode() sets or clears X cbreak mode. X X refrbrk() sets or unsets the screen refresh break flag. If X this flag is set, and there is any input available, any X screen refresh will be prematurely terminated, anticipating X more screen updates. This flag is FALSE by default. X XEXAMPLES X XSEE ALSO X _cursesscb(); flushinp() X XBUGS SHAR_EOF if test 830 -ne "`wc -c < 'cbreak.m'`" then echo shar: error transmitting "'cbreak.m'" '(should have been 830 characters)' fi fi # end of overwriting check echo shar: extracting "'clear.m'" '(443 characters)' if test -f 'clear.m' then echo shar: will not over-write existing file "'clear.m'" else sed 's/^X//' << \SHAR_EOF > 'clear.m' XNAME X wclear() clear() - fill all lines with blanks X XSYNOPSIS X #include <curses.h> X #include <curspriv.h> X X void wclear(win) X WINDOW *win; X X void clear() X XDESCRIPTION X wclear() fills all lines of window 'win' with blanks, and X marks the window to be cleared at next refresh operation. X X clear() fills all lines of stdscr with blanks, and marks X marks sdtscr to be cleared at next refresh operation. X XEXAMPLES X XSEE ALSO X werase() X XBUGS SHAR_EOF if test 443 -ne "`wc -c < 'clear.m'`" then echo shar: error transmitting "'clear.m'" '(should have been 443 characters)' fi fi # end of overwriting check echo shar: extracting "'clearok.m'" '(1634 characters)' if test -f 'clearok.m' then echo shar: will not over-write existing file "'clearok.m'" else sed 's/^X//' << \SHAR_EOF > 'clearok.m' XNAME X idlok() clearok() leaveok() scrollok() nodelay() keypad() X meta() cursoff() curson() - set or clear various options and flags X XSYNOPSIS X #include <curses.h> X #include <curspriv.h> X X void idlok(win, flag) X WINDOW *win; X bool flag; X X void clearok(win, flag) X WINDOW *win; X bool flag; X X void leaveok(win, flag) X WINDOW *win; X bool flag; X X void scrollok(win, flag) X WINDOW *win; X bool flag; X X void nodelay(win, flag) X WINDOW *win; X bool flag; X X void keypad(win, flag) X WINDOW *win; X bool flag; X X void meta(win, flag) X WINDOW *win; X bool flag; X X void cursoff() X X void curson() X XDESCRIPTION X idlok() is used to set flag for using the terminal insert/ X delete line capabilities. This is not relevant for the PC X version of curses, and thus nothing is done. X X clearok() marks window 'win' to cause screen clearing and X redraw the next time a refresh is done. X X leaveok() marks window 'win' to allow the update routines X to leave the hardware cursor where it happens to be at the X end of update. Usually used in combination with cursoff(). X X scrollok() marks window 'win' to allow the scrolling region X of it to actually scroll. X X nodelay() marks the window to make character input non- X waiting, i.e. if there is no character to get, -1 will be X returned. X X keypad() marks window 'win' to use the special keypad mode. X X meta() allows use of any alternate character set allowed by X the terminal. We always allow this on the PC, so this one X does nothing. X X cursoff() turns off the hardware cursor. X X curson() turns on the hardware cursor. X XEXAMPLES X XSEE ALSO X _cursesgcmode(); _cursescmode() X XBUGS SHAR_EOF if test 1634 -ne "`wc -c < 'clearok.m'`" then echo shar: error transmitting "'clearok.m'" '(should have been 1634 characters)' fi fi # end of overwriting check echo shar: extracting "'clearscreen.m'" '(1629 characters)' if test -f 'clearscreen.m' then echo shar: will not over-write existing file "'clearscreen.m'" else sed 's/^X//' << \SHAR_EOF > 'clearscreen.m' XNAME X doupdate() clrupdate() - update screen X transformline() - update physical line X clearscreen() - clear physical screen X gotoxy() - move physical cursor to desired address X putchar() - write character with attributes to the physical screen X XSYNOPSIS X #include <curses.h> X #include <curspriv.h> X X void doupdate() X X static void clrupdate(scr) X WINDOW *scr; X X static bool transformline(lineno) X register int lineno; X X static void clearscreen() X X static void gotoxy(row,col) X int row, col; X X static void Putchar(ch) X int ch; X XDESCRIPTION X doupdate() updates the physical screen to look like _curs- X var.tmpwin if curscr is not 'Clear-marked'. Otherwise it X updates the screen to look like curscr. X X clrupdate() updates the screen by clearing it and then X redraw it in it's entirety. If _cursvar.refrbrk is TRUE, and X there is pending input characters, the update will be pre- X maturely terminated. X X transformline() updates the given physical line to look X like the corresponding line in _cursvar.tmpwin. Transform- X returns 1 if premature refresh end is allowed, and there is X an input character pending. X X clearscreen() clears the physical screen and puts the cursor X in the home position. X X gotoxy() moves the physical cursor to the desired address on X the screen. We don't optimize here - on a PC, it takes more X time to optimize than to do things directly. X X putchar() writes a character, with attributes, to the physi- X cal screen, but avoids writing to the lower right screen X position. X XEXAMPLES X XSEE ALSO X _cursespendch(); _cursesscroll(); _cursescursor(); _cursescattr() X XBUGS SHAR_EOF if test 1629 -ne "`wc -c < 'clearscreen.m'`" then echo shar: error transmitting "'clearscreen.m'" '(should have been 1629 characters)' fi fi # end of overwriting check echo shar: extracting "'clrbot.m'" '(842 characters)' if test -f 'clrbot.m' then echo shar: will not over-write existing file "'clrbot.m'" else sed 's/^X//' << \SHAR_EOF > 'clrbot.m' XNAME X wclrtobot() clrbot() mvclrtobot() mvwclrtobot() - clear to bottom X XSYNOPSIS X #include <curses.h> X #include <curspriv.h> X X int wclrtobot(win) X WINDOW *win; X X int clrbot() X X int mvclrtobot(y,x) X int y; X int x; X X int mvwclrtobot(win,y,x) X WINDOW *win; X int y; X int x; X XDESCRIPTION X wclrtobot() fills the right half of the cursor line of X window 'win', and all lines below it with blanks. X X clrbot() fills the right half of the cursor line of X stdscr, and all lines below it with blanks. X X mvclrtobot() moves the cursor to a new position in stdscr X and fills the right half of the cursor line, and all lines X below it with blanks. X X mvwclrtobot() moves the cursor to a new position in window X 'win', and fills the right half of the cursor line, and all X lines below it with blanks. X XEXAMPLES X XSEE ALSO X wmove() X XBUGS SHAR_EOF if test 842 -ne "`wc -c < 'clrbot.m'`" then echo shar: error transmitting "'clrbot.m'" '(should have been 842 characters)' fi fi # end of overwriting check echo shar: extracting "'clrtoeol.m'" '(794 characters)' if test -f 'clrtoeol.m' then echo shar: will not over-write existing file "'clrtoeol.m'" else sed 's/^X//' << \SHAR_EOF > 'clrtoeol.m' XNAME X wclrtoeol() clrtoeol() mvclrtoeol() mvwclrtoeol() - clear to end of line X XSYNOPSIS X #include <curses.h> X #include <curspriv.h> X X int wclrtoeol(win) X WINDOW *win; X X int clrtoeol() X X int mvcltoreol(y,x) X int y; X int x; X X int mvwclrtoeol(win,y,x) X WINDOW *win; X int y; X int x; X XDESCRIPTION X wclrtoeol() fills the half of the cursor line to the right X of the cursor in window 'win' with blanks. X X clrtoeol() fills the half of the cursor line to the right X of the cursor in stdscr with blanks. X X mvclrtoeol() moves the cursor to a new position in stdscr X and fills the right half of the cursor line with blanks. X X mvwclrtoeol() moves the cursor to a new position in window X 'win', and fills the right half of the cursor line with X blanks. X XEXAMPLES X XSEE ALSO X wmove() X XBUGS SHAR_EOF if test 794 -ne "`wc -c < 'clrtoeol.m'`" then echo shar: error transmitting "'clrtoeol.m'" '(should have been 794 characters)' fi fi # end of overwriting check echo shar: extracting "'curses.h'" '(12158 characters)' if test -f 'curses.h' then echo shar: will not over-write existing file "'curses.h'" else sed 's/^X//' << \SHAR_EOF > 'curses.h' X/****************************************************************/ X/* CURSES.H */ X/* Header file for definitions and declarations for the */ X/* PCcurses package. This should be #include'd in all user */ X/* programs. */ X/****************************************************************/ X/* This version of curses is based on ncurses, a curses version */ X/* originally written by Pavel Curtis at Cornell University. */ X/* I have made substantial changes to make it run on IBM PC's, */ X/* and therefore consider myself free to make it public domain. */ X/* Bjorn Larsson (...mcvax!enea!infovax!bl) */ X/****************************************************************/ X/* 1.0: Release: 870515 */ X/****************************************************************/ X X/* general definitions */ X X#define TRUE 1 /* booleans */ X#define FALSE 0 X#define ERR 1 /* general error flag */ X#define OK 0 /* general OK flag */ X X/* functions defined as macros */ X X#define getch() wgetch(stdscr) /* using macroes allows you to use */ X#define ungetch(c) wungetch(c) /* #undef getch/ungetch in your */ X /* programs to use MSC getch() and */ X /* ungetch() routines */ X X#define getyx(win,y,x) (y = (win)->_cury, x = (win)->_curx) X X#ifndef max X#define max(a,b) (((a) > (b)) ? (a) : (b)) X#endif X#ifndef min X#define min(a,b) (((a) < (b)) ? (a) : (b)) X#endif X X/* video attribute definitions */ X X#define A_ALTCHARSET 0 X#define A_BLINK 0x100 X#define A_BLANK 0x200 X#define A_BOLD 0x400 X#define A_DIM 0 X#define A_PROTECT 0 X#define A_REVERSE 0x800 X#define A_STANDOUT 0x1000 X#define A_UNDERLINE 0x2000 X X/* function and keypad key definitions */ X X#define KEY_BREAK 0x101 /* Not on PC */ X#define KEY_DOWN 0x102 /* The four arrow keys */ X#define KEY_UP 0x103 X#define KEY_LEFT 0x104 X#define KEY_RIGHT 0x105 X#define KEY_HOME 0x106 /* Home key (upward+left arrow) */ X#define KEY_BACKSPACE 0x107 /* Not on PC */ X#define KEY_F0 0x108 /* Function keys. Space for */ X#define KEY_F(n) (KEY_F0+(n)) /* 64 keys is reserved. */ X#define KEY_DL 0x148 /* Not on PC */ X#define KEY_IL 0x149 /* Insert line */ X#define KEY_DC 0x14a /* Delete character */ X#define KEY_IC 0x14b /* Insert char or enter insert mode */ X#define KEY_EIC 0x14c /* Exit insert char mode */ X#define KEY_CLEAR 0x14d /* Clear screen */ X#define KEY_EOS 0x14e /* Clear to end of screen */ X#define KEY_EOL 0x14f /* Clear to end of line */ X#define KEY_SF 0x150 /* Scroll 1 line forward */ X#define KEY_SR 0x151 /* Scroll 1 line backwards (reverse) */ X#define KEY_NPAGE 0x152 /* Next page */ X#define KEY_PPAGE 0x153 /* Previous page */ X#define KEY_STAB 0x154 /* Set tab */ X#define KEY_CTAB 0x155 /* Clear tab */ X#define KEY_CATAB 0x156 /* Clear all tabs */ X#define KEY_ENTER 0x157 /* Enter or send (unreliable) */ X#define KEY_SRESET 0x158 /* soft (partial) reset (unreliable) */ X#define KEY_RESET 0x159 /* reset or hard reset (unreliable) */ X#define KEY_PRINT 0x15a /* print or copy */ X#define KEY_LL 0x15b /* home down or bottom (lower left) */ X#define KEY_ABORT 0x15c /* Abort/Terminate key (any) */ X#define KEY_SHELP 0x15d /* Short help */ X#define KEY_LHELP 0x15e /* Long help */ X X/* type declarations */ X Xtypedef char bool; /* boolean type */ X Xtypedef struct X { X int _cury; /* current pseudo-cursor */ X int _curx; X int _maxy; /* max coordinates */ X int _maxx; X int _begy; /* origin on screen */ X int _begx; X int _flags; /* window properties */ X int _attrs; /* attributes of written characters */ X int _tabsize; /* tab character size */ X bool _clear; /* causes clear at next refresh */ X bool _leave; /* leaves cursor as it happens */ X bool _scroll; /* allows window scrolling */ X bool _nodelay; /* input character wait flag */ X bool _keypad; /* flags keypad key mode active */ X int **_line; /* pointer to line pointer array */ X int *_minchng; /* First changed character in line */ X int *_maxchng; /* Last changed character in line */ X int _regtop; /* Top/bottom of scrolling region */ X int _regbottom; X } WINDOW; X X/* External variables */ X Xextern int LINES; /* terminal height */ Xextern int COLS; /* terminal width */ Xextern WINDOW *curscr; /* the current screen image */ Xextern WINDOW *stdscr; /* the default screen window */ X X/* PCcurses function declarations */ X Xextern int addch(); /* put char in stdscr */ Xextern int addstr(); /* put string in stdscr */ Xextern void attrset(); /* set stdscr char attributes */ Xextern void attroff(); /* clear attribute(a) stdscr */ Xextern void attron(); /* add attribute(s) stdscr */ Xextern int baudrate(); /* compatibility dummy */ Xextern void beep(); /* sound bell */ Xextern void box(); /* draw a box around a window */ Xextern void cbreak(); /* set terminal cbreak mode */ Xextern void clear(); /* clear stdscr */ Xextern void clearok(); /* marks a window for screen clear */ Xextern int clrtobot(); /* clear end of stdscr */ Xextern int clrtoeol(); /* clear end of line in stdscr */ Xextern void crmode(); /* set terminal cbreak mode */ Xextern void cursoff(); /* turns off hardware cursor */ Xextern void curson(); /* turns on hardware cursor */ Xextern int delch(); /* delete a char in stdscr */ Xextern int deleteln(); /* delete a line in stdscr */ Xextern void delwin(); /* delete a window or a subwindow */ Xextern void doupdate(); /* update physical screen */ Xextern void echo(); /* set terminal echo mode */ Xextern int endwin(); /* cleanup and finitialization */ Xextern void erase(); /* erase stdscr */ Xextern int erasechar(); /* return char kill character */ Xextern int fixterm(); /* compatibility dummy */ Xextern void flash(); /* flash terminal screen */ Xextern void flushinp(); /* kill pending keyboard input */ Xextern int getstr(); /* get string to stdscr and buffer */ Xextern int gettmode(); /* compatibility dummy */ Xextern void idlok(); /* use ins/del line (dummy) */ Xextern int initscr(); /* curses initialization */ Xextern int inch(); /* get char at stdscr cursor */ Xextern int insch(); /* insert character in stdscr */ Xextern int insertln(); /* insert new line in stdscr */ Xextern void keypad(); /* marks a window for keypad usage */ Xextern int killchar(); /* return line kill character */ Xextern char *longname(); /* terminal description */ Xextern void leaveok(); /* marks window for cursor 'leave' */ Xextern void meta(); /* marks window for meta (dummy) */ Xextern int move(); /* move cursor in stdscr */ Xextern int mvaddch(); /* move & put char in stdscr */ Xextern int mvaddstr(); /* move & put string in stdscr */ Xextern int mvclrtobot(); /* move & clear end of stdscr */ Xextern int mvclrtoeol(); /* move & clear lineend in stdscr */ Xextern int mvcur(); /* move terminal cursor */ Xextern int mvdelch(); /* move & delete a char in stdscr */ Xextern int mvdeleteln(); /* move & delete a line in stdscr */ Xextern int mvgetch(); /* move & get char to stdscr */ Xextern int mvgetstr(); /* move & get string to stdscr */ Xextern int mvinch(); /* move & get char at stdscr cursor */ Xextern int mvinsch(); /* move & insert char in stdscr */ Xextern int mvinsertln(); /* move & insert new line in stdscr */ Xextern int mvprintw(); /* move & print string in stdscr */ Xextern int mvscanw(); /* move & get values via stdscr */ Xextern int mvwaddch(); /* move & put char in a window */ Xextern int mvwaddstr(); /* move & put string in a window */ Xextern int mvwclrtobot(); /* move & clear end of a window */ Xextern int mvwclrtoeol(); /* move & clear lineend in a window */ Xextern int mvwdelch(); /* move & delete a char in a window */ Xextern int mvwdeleteln(); /* move & delete a line in a window */ Xextern int mvwgetch(); /* move & get char to a window */ Xextern int mvwgetstr(); /* move & get string to a window */ Xextern int mvwinch(); /* move & get char at window cursor */ Xextern int mvwinsch(); /* move & insert char in a window */ Xextern int mvwinsertln(); /* move & insert new line in window */ Xextern int mvwin(); /* move window */ Xextern int mvwprintw(); /* move & print string in a window */ Xextern int mvwscanw(); /* move & get values via a window */ Xextern WINDOW *newwin(); /* create a window */ Xextern void nl(); /* set terminal cr-crlf map mode */ Xextern void nocbreak(); /* unset terminal cbreak mode */ Xextern void nocrmode(); /* unset terminal cbreak mode */ Xextern void nodelay(); /* marks window for no input wait */ Xextern void noecho(); /* unset terminal echo mode */ Xextern void nonl(); /* unset terminal cr-crlf map mode */ Xextern void noraw(); /* unset raw terminal mode */ Xextern void overlay(); /* overlay one window on another */ Xextern void overwrite(); /* overwrite one window on another */ Xextern int printw(); /* print string in stdscr */ Xextern void raw(); /* set raw terminal mode */ Xextern void refrbrk(); /* set screen refresh break mode */ Xextern void refresh(); /* refresh stdscr */ Xextern int resetterm(); /* compatibility dummy */ Xextern int resetty(); /* restore terminal I/O modes */ Xextern int saveoldterm(); /* compatibility dummy */ Xextern int saveterm(); /* compatibility dummy */ Xextern int savetty(); /* save terminal I/O modes */ Xextern int scanw(); /* get values via stdscr */ Xextern void scroll(); /* scroll region in a window */ Xextern void scrollok(); /* marks a window to allow scroll */ Xextern int setsrcreg(); /* define stdscr's scroll region */ Xextern int setterm(); /* compatibility dummy */ Xextern int setupterm(); /* set up terminal (no-op) */ Xextern void standend(); /* start normal chars in stdscr */ Xextern void standout(); /* start standout chars in stdscr */ Xextern WINDOW *subwin(); /* create a sub-window */ Xextern int tabsize(); /* set/get tabsize of stdscr */ Xextern void touchwin(); /* mark a window as modified */ Xextern char *unctrl(); /* char-to-string converter */ Xextern int waddch(); /* put char in a window */ Xextern int waddstr(); /* put string in a window */ Xextern void wattroff(); /* clear attribute(a) in window */ Xextern void wattron(); /* add attribute(s) in window */ Xextern void wattrset(); /* set window char attributes */ Xextern int wbox(); /* draw a box inside a window */ Xextern void wclear(); /* clear a window */ Xextern int wclrtobot(); /* clear end of a window */ Xextern int wclrtoeol(); /* clear end of line in a window */ Xextern int wdelch(); /* delete a char in a window */ Xextern int wdeleteln(); /* delete a line in a window */ Xextern void werase(); /* erase a window */ Xextern int wgetch(); /* get char to a window */ Xextern int wgetstr(); /* get string to window and buffer */ Xextern int winch(); /* get char at window cursor */ Xextern int winsch(); /* insert character in a window */ Xextern int winsertln(); /* insert new line in a window */ Xextern int wmove(); /* move cursor in a window */ Xextern void wnoutrefresh(); /* create screen image, w/o display */ Xextern int wprintw(); /* print string in a window */ Xextern void wrefresh(); /* refresh screen */ Xextern int wscanw(); /* get values via a window */ Xextern int wsetsrcreg(); /* define a window's scroll region */ Xextern void wstandend(); /* start normal chars in window */ Xextern void wstandout(); /* start standout chars in window */ Xextern int wtabsize(); /* set/get tabsize of a window */ Xextern int wungetch(); /* character push-back */ SHAR_EOF if test 12158 -ne "`wc -c < 'curses.h'`" then echo shar: error transmitting "'curses.h'" '(should have been 12158 characters)' fi fi # end of overwriting check echo shar: extracting "'cursescattr.m'" '(305 characters)' if test -f 'cursescattr.m' then echo shar: will not over-write existing file "'cursescattr.m'" else sed 's/^X//' << \SHAR_EOF > 'cursescattr.m' XNAME X _cursescattr() - write character at cursor X XSYNOPSIS X void _cursescattr(page,chr,attr,count) X int page, chr, count; X static char attr; X XDESCRIPTION X Writes char 'chr' with attributes 'attr' to the current cur- X sor location. Page is usually set to zero, and count to 1. X XEXAMPLES X XSEE ALSO X XBUGS SHAR_EOF if test 305 -ne "`wc -c < 'cursescattr.m'`" then echo shar: error transmitting "'cursescattr.m'" '(should have been 305 characters)' fi fi # end of overwriting check echo shar: extracting "'cursescmode.m'" '(264 characters)' if test -f 'cursescmode.m' then echo shar: will not over-write existing file "'cursescmode.m'" else sed 's/^X//' << \SHAR_EOF > 'cursescmode.m' XNAME X _cursescmode() - set up the cursor X XSYNOPSIS X void _cursescmode(startrow,endrow) X int startrow, endrow; X XDESCRIPTION X Sets the cursor type to begin in scan line startrow and end X in scan line endrow. Both values should be 0-31. X XEXAMPLES X XSEE ALSO X XBUGS SHAR_EOF if test 264 -ne "`wc -c < 'cursescmode.m'`" then echo shar: error transmitting "'cursescmode.m'" '(should have been 264 characters)' fi fi # end of overwriting check echo shar: extracting "'cursescursor.m'" '(302 characters)' if test -f 'cursescursor.m' then echo shar: will not over-write existing file "'cursescursor.m'" else sed 's/^X//' << \SHAR_EOF > 'cursescursor.m' XNAME X _cursescursor() - set cursor position X XSYNOPSIS X void _cursescursor(page,row,column) X int page, row, column; X XDESCRIPTION X Sets the cursor position in video page 0. 'row' and 'column' X are the cursor address. If 'row' is set to 25, no cursor at X all is displayed. X XEXAMPLES X XSEE ALSO X XBUGS SHAR_EOF if test 302 -ne "`wc -c < 'cursescursor.m'`" then echo shar: error transmitting "'cursescursor.m'" '(should have been 302 characters)' fi fi # end of overwriting check echo shar: extracting "'cursesgcb.m'" '(160 characters)' if test -f 'cursesgcb.m' then echo shar: will not over-write existing file "'cursesgcb.m'" else sed 's/^X//' << \SHAR_EOF > 'cursesgcb.m' XNAME X _cursesgcb() - MSDOS break check X XSYNOPSIS X int _cursesgcb() X XDESCRIPTION X Returns 1 if MSDOS BREAK CHECK is on, otherwise 0. X XEXAMPLES X XSEE ALSO X XBUGS SHAR_EOF if test 160 -ne "`wc -c < 'cursesgcb.m'`" then echo shar: error transmitting "'cursesgcb.m'" '(should have been 160 characters)' fi fi # end of overwriting check echo shar: extracting "'cursesgcmode.m'" '(249 characters)' if test -f 'cursesgcmode.m' then echo shar: will not over-write existing file "'cursesgcmode.m'" else sed 's/^X//' << \SHAR_EOF > 'cursesgcmode.m' XNAME X _cursesgcmode() - return current cursor type X XSYNOPSIS X int _cursesgcmode() X XDESCRIPTION X Return the current cursor type. Bits 8-15 of the return X value is the start scan row, and bits 0-7 is the end scan X row. X XEXAMPLES X XSEE ALSO X XBUGS SHAR_EOF if test 249 -ne "`wc -c < 'cursesgcmode.m'`" then echo shar: error transmitting "'cursesgcmode.m'" '(should have been 249 characters)' fi fi # end of overwriting check echo shar: extracting "'cursesgcols.m'" '(190 characters)' if test -f 'cursesgcols.m' then echo shar: will not over-write existing file "'cursesgcols.m'" else sed 's/^X//' << \SHAR_EOF > 'cursesgcols.m' XNAME X _cursesgcols() - return current number of columns on screen X XSYNOPSIS X int _cursesgcols() X XDESCRIPTION X Return the current number of columns on the screen. X XEXAMPLES X XSEE ALSO X XBUGS SHAR_EOF if test 190 -ne "`wc -c < 'cursesgcols.m'`" then echo shar: error transmitting "'cursesgcols.m'" '(should have been 190 characters)' fi fi # end of overwriting check echo shar: extracting "'curseskey.m'" '(309 characters)' if test -f 'curseskey.m' then echo shar: will not over-write existing file "'curseskey.m'" else sed 's/^X//' << \SHAR_EOF > 'curseskey.m' XNAME X _curseskey() - return next key code from keyboard X XSYNOPSIS X int _curseskey() X XDESCRIPTION X Returns the next key code struck at the keyboard. If the low X 8 bits are non-0, the uper bits contain the extended cha- X racter code. If bit 0-7 are non-zero, the upper bits = 0. X XEXAMPLES X XSEE ALSO X XBUGS SHAR_EOF if test 309 -ne "`wc -c < 'curseskey.m'`" then echo shar: error transmitting "'curseskey.m'" '(should have been 309 characters)' fi fi # end of overwriting check echo shar: extracting "'curseskeytst.m'" '(184 characters)' if test -f 'curseskeytst.m' then echo shar: will not over-write existing file "'curseskeytst.m'" else sed 's/^X//' << \SHAR_EOF > 'curseskeytst.m' XNAME X _curseskeytst() - check if input character available X XSYNOPSIS X int _curseskeytst() X XDESCRIPTION X Returns 1 if a character is available, 0 otherwise. X XEXAMPLES X XSEE ALSO X XBUGS SHAR_EOF if test 184 -ne "`wc -c < 'curseskeytst.m'`" then echo shar: error transmitting "'curseskeytst.m'" '(should have been 184 characters)' fi fi # end of overwriting check echo shar: extracting "'cursespendch.m'" '(2223 characters)' if test -f 'cursespendch.m' then echo shar: will not over-write existing file "'cursespendch.m'" else sed 's/^X//' << \SHAR_EOF > 'cursespendch.m' XNAME X getch() - ***same as wgetch()*** see curses.h X wgetch() flushinp() wungetch() mvgetch() mvwgetch() rawgetch() X sysgetch() validchar() _cursespendch() - manipulate input characters X XSYNOPSIS X #include <curses.h> X #include <curspriv.h> X X int wgetch(win) X WINDOW *win; X X void flushinp() X X int wungetch(ch) X int ch; X X int mvgetch(y,x) X int y; X int x; X X int mvwgetch(win,y,x) X WINDOW *win; X int y; X int x; X X static int rawgetch() X X static int sysgetch() X X static int validchar(c) X int c; X X bool _cursespendch() X XDESCRIPTION X wgetch(win) gets a character from the terminal, in normal, X cbreak or raw mode, optionally echoing to window 'win'. X X flushinp() kills any pending input characters. X X wungetch() pushes back it's argument on the input stream. If X OK, returns 1, otherwise returns 0. X X mvgetch() first moves the stdscr cursor to a new location, X then does a wgetch() on stdscr. X X mvwgetch() first moves the cursor of window 'win' to a new X location, then does a wgetch() in 'win'. X X rawgetch() gets a character without any interpretation at X all and returns it. If keypad mode is active for the desig- X nated window, function key translation will be performed. X Otherwise, function keys are ignored.If nodelay mode is X active in the window, then rawgetch() returns -1 if no cha- X racter is available. X X sysgetch() gets a character with normal ^S, ^Q, ^P and ^C X interpretation and returns it. If keypad mode is active for X the designated window, function key translation will be per- X formed. Otherwise, function keys are ignored. If nodelay X mode is active in the window, then sysgetch() returns -1 if X no character is available. X X validchar(c) checks that 'c' is a valid character, and X if so returns it, with function key translation applied if X 'w' has keypad mode set. If char is invalid, returns -1. X X _cursespendch() returns 1 if there is any character avai- X lable, and 0 if there is none. this is not for programmer X usage, but for the updatew routines. X XEXAMPLES X XSEE ALSO X rawgetch(); _cursesgcb(); _cursesscb(); sysgetch(); _cursesscb(); X waddch(); wrefresh(); _curseskey(); kbhit(); getch(); wmove(); X wgetch(); _curseskeytst(); validchar(); X XBUGS SHAR_EOF if test 2223 -ne "`wc -c < 'cursespendch.m'`" then echo shar: error transmitting "'cursespendch.m'" '(should have been 2223 characters)' fi fi # end of overwriting check echo shar: extracting "'cursesputc.m'" '(314 characters)' if test -f 'cursesputc.m' then echo shar: will not over-write existing file "'cursesputc.m'" else sed 's/^X//' << \SHAR_EOF > 'cursesputc.m' XNAME X _cursesputc() - output character to screen X XSYNOPSIS X void _cursesputc(chr,colour) X int chr, colour; X XDESCRIPTION X Output character 'chr' to screen in tty fashion. If a colour X mode is active, the character is written with colour X 'colour'. If inactive, then use 0 for colour. X XEXAMPLES X XSEE ALSO X XBUGS SHAR_EOF if test 314 -ne "`wc -c < 'cursesputc.m'`" then echo shar: error transmitting "'cursesputc.m'" '(should have been 314 characters)' fi fi # end of overwriting check echo shar: extracting "'cursesscb.m'" '(182 characters)' if test -f 'cursesscb.m' then echo shar: will not over-write existing file "'cursesscb.m'" else sed 's/^X//' << \SHAR_EOF > 'cursesscb.m' XNAME X _cursesscb() - set MSDOS break check X XSYNOPSIS X void _cursesscb(setting) X int setting; X XDESCRIPTION X Sets MSDOS BREAK CHECK according to 'setting'. X XEXAMPLES X XSEE ALSO X XBUGS SHAR_EOF if test 182 -ne "`wc -c < 'cursesscb.m'`" then echo shar: error transmitting "'cursesscb.m'" '(should have been 182 characters)' fi fi # end of overwriting check echo shar: extracting "'cursesscroll.m'" '(562 characters)' if test -f 'cursesscroll.m' then echo shar: will not over-write existing file "'cursesscroll.m'" else sed 's/^X//' << \SHAR_EOF > 'cursesscroll.m' XNAME X _cursesscroll() - scroll window up or down X XSYNOPSIS X void _cursesscroll(urow,lcol,lrow,rcol,lines,attr) X int urow, lcol, lrow, rcol, lines; X static char attr; X XDESCRIPTION X Scroll a window in the current page up or down. Urow, lcol, X lrow,rcol are the window coordinats. lines is the number of X lines to scroll. If 0, clears the window, if < 0 scrolls X down, > 0 scrolls up. Blanks areas that are left, and sets X character attributes to attr. If in a colour graphics mode, X fills them with the colour 'attr' instead. X XEXAMPLES X XSEE ALSO X XBUGS SHAR_EOF if test 562 -ne "`wc -c < 'cursesscroll.m'`" then echo shar: error transmitting "'cursesscroll.m'" '(should have been 562 characters)' fi fi # end of overwriting check # End of shell archive exit 0 - - - - - (It's my opinion and not my employers) Steve Balogh VK3YMY | steve@cit5.cit.oz (...oz.au) Chisholm Institute of Technology | steve%cit5.cit.oz@uunet.uu.net PO Box 197, Caulfield East | Melbourne, AUSTRALIA. 3145 | {hplabs,mcvax,uunet,ukc}!munnari\ +61 3 573 2266 (Ans Machine) | !cit5.cit.oz!steve