Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!munnari!otc!metro!basser!steve From: steve@cit5.cit.oz.AU (Steve Balogh) Newsgroups: comp.sources.misc Subject: PC curses manual pages - Part 3/4 Message-ID: <1051@basser.oz> Date: Fri, 9-Oct-87 11:16:44 EDT Article-I.D.: basser.1051 Posted: Fri Oct 9 11:16:44 1987 Date-Received: Mon, 12-Oct-87 06:01:29 EDT Sender: john@basser.oz Lines: 708 Approved: john@basser.cs.su.oz.AU #! /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:52:34 EST 1987 # Archived by: Steve Balogh - steve%cit5.cit.oz@uunet.uu.net export PATH; PATH=/bin:$PATH echo shar: extracting "'delch.m'" '(1105 characters)' if test -f 'delch.m' then echo shar: will not over-write existing file "'delch.m'" else sed 's/^X//' << \SHAR_EOF > 'delch.m' XNAME X wdelch() delch() mvdelch() mvwdelch() - delete a character X XSYNOPSIS X #include X #include X X int wdelch(win) X WINDOW *win; X X int delch() X X int mvdelch(y,x) X int y; X int x; X X int mvwdelch(win,y,x) X WINDOW *win; X int y; X int x; X XDESCRIPTION X wdelch() deletes the character at the window cursor, and the X characters to the right of it are shifted left, inserting a X space at the last position of the line. X X delch() deletes the character at the stdscr cursor, and the X characters to the right of it are shifted left, inserting a X space at the last position of the line. X X mvdelch() moves the stdscr cursor to a new position, then X deletes the character at the stdscr cursor, and the charac- X ters to the right of it are shifted left, inserting a space X at the last position of the line. X X mvwdelch() moves the cursor of window 'win' to a new posi- X tion, then deletes the character at the stdscr cursor, and X the characters to the right of it are shifted left, inser- X ting a space at the last position of the line. X XEXAMPLES X XSEE ALSO X wmove() X XBUGS SHAR_EOF if test 1105 -ne "`wc -c < 'delch.m'`" then echo shar: error transmitting "'delch.m'" '(should have been 1105 characters)' fi fi # end of overwriting check echo shar: extracting "'deleteln.m'" '(1038 characters)' if test -f 'deleteln.m' then echo shar: will not over-write existing file "'deleteln.m'" else sed 's/^X//' << \SHAR_EOF > 'deleteln.m' XNAME X wdeleteln() deleteln() mvdeleteln() mvwdeleteln() - delete a line X XSYNOPSIS X #include X #include X X int wdeleteln(win) X WINDOW *win; X X int deleteln() X X int mvdeleteln(y,x) X int y; X int x; X X int mvwdeleteln(win,y,x) X WINDOW *win; X int y; X int x; X XDESCRIPTION X wdeleteln() deletes the line at the window cursor, and the X lines below it are shifted up, inserting a blank line at X the bottom of the window. X X deleteln() deletes the line at the stdscr cursor, and the X lines below it are shifted up, inserting a blank line at X the bottom of stdscr. X X mvdeleteln() moves the cursor to a new position in stdscr, X then deletes the line at the window cursor, and the lines X below it are shifted up, inserting a blank line at the bot- X tom of stdscr. X X mvwdeleteln() moves the cursor to a new position in a win- X dow, then deletes the line at the window cursor, and the X lines below it are shifted up, inserting a blank line at X the bottom of the window. X XEXAMPLES X XSEE ALSO X wmove() X XBUGS SHAR_EOF if test 1038 -ne "`wc -c < 'deleteln.m'`" then echo shar: error transmitting "'deleteln.m'" '(should have been 1038 characters)' fi fi # end of overwriting check echo shar: extracting "'delwin.m'" '(372 characters)' if test -f 'delwin.m' then echo shar: will not over-write existing file "'delwin.m'" else sed 's/^X//' << \SHAR_EOF > 'delwin.m' XNAME X delwin() - deallocate all data allocated by 'win'. X XSYNOPSIS X #include X #include X X void delwin(win) X WINDOW *win; X XDESCRIPTION X delwin() deallocates all data allocated by 'win'. If 'win' X is a subwindow, it uses the original window's lines for sto- X rage, and thus the line arrays are not deallocated. X XEXAMPLES X XSEE ALSO X free() X XBUGS SHAR_EOF if test 372 -ne "`wc -c < 'delwin.m'`" then echo shar: error transmitting "'delwin.m'" '(should have been 372 characters)' fi fi # end of overwriting check echo shar: extracting "'endwin.m'" '(352 characters)' if test -f 'endwin.m' then echo shar: will not over-write existing file "'endwin.m'" else sed 's/^X//' << \SHAR_EOF > 'endwin.m' XNAME X endwin() - clean-up after using the PCcurses package X XSYNOPSIS X #include X #include X X int endwin() X XDESCRIPTION X endwin() does neccessary clean-up after using the PCcurses X package. It should be called before exiting the user's pro- X gram. X XEXAMPLES X XSEE ALSO X delwin(); curson(); _cursescursor(); _cursesscb() X XBUGS SHAR_EOF if test 352 -ne "`wc -c < 'endwin.m'`" then echo shar: error transmitting "'endwin.m'" '(should have been 352 characters)' fi fi # end of overwriting check echo shar: extracting "'erase.m'" '(417 characters)' if test -f 'erase.m' then echo shar: will not over-write existing file "'erase.m'" else sed 's/^X//' << \SHAR_EOF > 'erase.m' XNAME X werase() erase() - fill all lines with blanks X XSYNOPSIS X #include X #include X X void werase(win) X WINDOW *win; X X void erase() X XDESCRIPTION X werase() fills all lines of window 'win' with blanks and po- X sitions the cursor at home in the scroll region. X X erase() fills all lines of stdscr with blanks and positions X the cursor at home in the scroll region. X XEXAMPLES X XSEE ALSO X XBUGS SHAR_EOF if test 417 -ne "`wc -c < 'erase.m'`" then echo shar: error transmitting "'erase.m'" '(should have been 417 characters)' fi fi # end of overwriting check echo shar: extracting "'fixterm.m'" '(963 characters)' if test -f 'fixterm.m' then echo shar: will not over-write existing file "'fixterm.m'" else sed 's/^X//' << \SHAR_EOF > 'fixterm.m' XNAME X fixterm() resetterm() saveoldterm saveterm() gettmode() X setterm() baudrate() - function dummies for compatibility. X erasechar() killchar() - return std MSDOS erase chars. X savetty() resetty() - save and restore the terminal I/O settings. X setupterm() - sets up the terminal. X XSYNOPSIS X #include X #include X X int fixterm() X X int resetterm() X X int saveoldterm() X X int saveterm() X X int gettmode() X X int setterm(type) X char *type; X X int baudrate() X X int erasechar() X X int killchar() X X int savetty() X X int resetty() X X int setupterm() X XDESCRIPTION X fixterm(), resetterm(), saveoldterm, saveterm() gettmode(), X setterm() and baudrate() function dummies for compatibility. X erasechar(), killchar() returns std MSDOS erase chars. X X savetty() and resetty() saves and restores the terminal I/O X settings. X X setupterm() sets up the terminal. On a PC, it is always suc- X cessful, and returns 1. X XEXAMPLES X XSEE ALSO X XBUGS SHAR_EOF if test 963 -ne "`wc -c < 'fixterm.m'`" then echo shar: error transmitting "'fixterm.m'" '(should have been 963 characters)' fi fi # end of overwriting check echo shar: extracting "'flushinp.m'" '(2223 characters)' if test -f 'flushinp.m' then echo shar: will not over-write existing file "'flushinp.m'" else sed 's/^X//' << \SHAR_EOF > 'flushinp.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 X #include 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 < 'flushinp.m'`" then echo shar: error transmitting "'flushinp.m'" '(should have been 2223 characters)' fi fi # end of overwriting check echo shar: extracting "'getch.m'" '(2223 characters)' if test -f 'getch.m' then echo shar: will not over-write existing file "'getch.m'" else sed 's/^X//' << \SHAR_EOF > 'getch.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 X #include 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 < 'getch.m'`" then echo shar: error transmitting "'getch.m'" '(should have been 2223 characters)' fi fi # end of overwriting check echo shar: extracting "'inch.m'" '(673 characters)' if test -f 'inch.m' then echo shar: will not over-write existing file "'inch.m'" else sed 's/^X//' << \SHAR_EOF > 'inch.m' XNAME X winch() inch() mvinch() mvwinch() - returns a character X XSYNOPSIS X #include X #include X X int winch(win) X WINDOW *win; X X int inch() X X int mvinch(y,x) X int y; X int x; X X int mvwinch(win,y,x) X WINDOW *win; X int y; X int x; X XDESCRIPTION X winch() returns the character at the current position in X window 'win'. X X inch() returns the character at the current cursor position X in stdscr. X X mvinch() moves the stdscr cursor to a new position, then X returns the character at that position. X X mvwinch() moves the cursor of window 'win' to a new posi- X tion, then returns the character at that position. X XEXAMPLES X XSEE ALSO X wmove() X XBUGS SHAR_EOF if test 673 -ne "`wc -c < 'inch.m'`" then echo shar: error transmitting "'inch.m'" '(should have been 673 characters)' fi fi # end of overwriting check echo shar: extracting "'initscr.m'" '(334 characters)' if test -f 'initscr.m' then echo shar: will not over-write existing file "'initscr.m'" else sed 's/^X//' << \SHAR_EOF > 'initscr.m' XNAME X initscr() - initialization for the PCcurses package X XSYNOPSIS X #include X #include X X int initscr() X XDESCRIPTION X initscr() does neccessary initializations for the PCcurses X package. It MUST be called before any other curses routines. X XEXAMPLES X XSEE ALSO X _cursesgcb(); _cursesgcols(); newwin() X XBUGS SHAR_EOF if test 334 -ne "`wc -c < 'initscr.m'`" then echo shar: error transmitting "'initscr.m'" '(should have been 334 characters)' fi fi # end of overwriting check echo shar: extracting "'insch.m'" '(866 characters)' if test -f 'insch.m' then echo shar: will not over-write existing file "'insch.m'" else sed 's/^X//' << \SHAR_EOF > 'insch.m' XNAME X winsch() insch() mvinsch() mvwinsch() - insert a character X XSYNOPSIS X #include X #include X X int winsch(win, c) X WINDOW *win; X char c; X X int insch(c) X char c; X X int mvinsch(y,x,c) X int y; X int x; X char c; X X int mvwinsch(win,y,x,c) X WINDOW *win; X int y; X int x; X char c; X XDESCRIPTION X winsch() inserts character 'c' at the cursor position in X window 'win'. The cursor is advanced. X X insch() inserts character 'c' at the cursor position in X stdscr. The cursor is advanced. X X mvinsch() moves the stdscr cursor to a new position, then X inserts character 'c' at the cursor position in stdscr. The X cursor is advanced. X X mvwinsch() moves the cursor of window 'win' to a new posi- X tion, then inserts character 'c' at the cursor position in X window 'win'. The cursor is advanced. X XEXAMPLES X XSEE ALSO X waddch(), wmove() X XBUGS SHAR_EOF if test 866 -ne "`wc -c < 'insch.m'`" then echo shar: error transmitting "'insch.m'" '(should have been 866 characters)' fi fi # end of overwriting check echo shar: extracting "'insertln.m'" '(843 characters)' if test -f 'insertln.m' then echo shar: will not over-write existing file "'insertln.m'" else sed 's/^X//' << \SHAR_EOF > 'insertln.m' XNAME X winsertln() insertln() mvinsertln() mvwinsertln() - insert a blank line X XSYNOPSIS X #include X #include X X int winsertln(win) X WINDOW *win; X X int insertln() X X int mvinsert(y,x) X int y; X int x; X X int mvwinsert(win,y,x) X WINDOW *win; X int y; X int x; X XDESCRIPTION X winsertln() inserts a blank line instead of the cursor line X in window 'win' and pushes other lines down. X X insertln() inserts a blank line instead of the cursor line X in stdscr and pushes other lines down. X X mvinsertln() moves the stdscr cursor to a new positions, in- X serts a blank line instead of the cursor line and pushes X other lines down. X X mvwinsertln() moves the cursor in window 'win' to a new posi- X tions, inserts a blank line instead of the cursor line and X pushes other lines down. X XEXAMPLES X XSEE ALSO X wmove() X XBUGS SHAR_EOF if test 843 -ne "`wc -c < 'insertln.m'`" then echo shar: error transmitting "'insertln.m'" '(should have been 843 characters)' fi fi # end of overwriting check echo shar: extracting "'longname.m'" '(271 characters)' if test -f 'longname.m' then echo shar: will not over-write existing file "'longname.m'" else sed 's/^X//' << \SHAR_EOF > 'longname.m' XNAME X longname() returns a pointer to a string describing the X user terminal. X XSYNOPSIS X #include X #include X X char *longname() X XDESCRIPTION X longname() returns a pointer to a string describing the X user terminal. X XEXAMPLES X XSEE ALSO X XBUGS SHAR_EOF if test 271 -ne "`wc -c < 'longname.m'`" then echo shar: error transmitting "'longname.m'" '(should have been 271 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