1 .\" Copyright (c) 1992, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)fns.doc 8.2 (Berkeley) 6/1/94
31 .Fn addbytes "char *str" "int len"
33 This function is the low level character output function.
35 characters of the string
37 are output to the current \*y position of the window.
39 .Fn addch "chtype ch" \(dg
45 If the character is a newline
47 the line will be cleared to the end,
48 and the current \*y will be changed to the
49 beginning off the next line
50 if newline mapping is on,
51 or to the next line at the same x co-ordinate
55 will move to the beginning of the line on the window.
58 will be expanded into spaces
59 in the normal tabstop positions of
60 every eight characters.
63 .Fn addchstr "chtype *str" \(dg
65 Add the characters and attributes in the string pointed to by
67 on the window at the current \*y.
69 In this case, it will put on as much as it can.
71 .Fn addchnstr "chtype *str" "int len" \(dg
75 characters and attributes of the string pointed to by
77 on the window at the current \*y.
79 In this case, it will put on as much as it can.
81 .Fn addstr "char *str" \(dg
83 Add the string pointed to by
85 on the window at the current \*y.
87 In this case, it will put on as much as it can.
89 .Fn addnstr "char *str" "int len" \(dg
93 characters of the string pointed to by
95 on the window at the current \*y.
97 In this case, it will put on as much as it can.
99 .Fn assume_default_colors "short fore" "short back"
101 Set the curses default foreground and background colors to
106 .Fn attr_get "attr_t *attr" "short *pair" "void *opt" \(dg
108 Get the attributes and colour pair for the window.
116 argument is not used.
118 .Fn attr_off "attr_t attr" "void *opt" \(dg
120 Remove character attributes set by
125 .Fn attr_on "attr_t attr" "void *opt" \(dg
127 Add character attributes for any characters
128 added to the window (if it has that capability).
129 The attributes that can be set are \fBA_UNDERLINE\fR,
130 \fBA_REVERSE\fR, \fBA_BLINK\fR, \fBA_DIM\fR,
131 \fBA_BOLD\fR, \fBA_BLANK\fR, \fBA_PROTECT\fB,
132 \fBA_ALTCHARSET\fR and \fBCOLOR_PAIR(n)\fR.
134 .Fn attr_set "attr_t attr" "short pair" "void *opt" \(dg
136 Set character attributes and color pair for any characters
137 added to the window (if it has that capability).
139 .Fn attroff "int attribute" \(dg
141 Remove character attributes set by
145 To clear all character attributes, use
146 .Fn attroff "A_ATTRIBUTES" .
147 .Fn attroff "A_STANDOUT"
150 .Fn attroff "A_UNDERLINE"
154 .Fn attron "int attribute" \(dg
156 Add character attributes for any characters
157 added to the window (if it has that capability).
158 .Fn attron "A_STANDOUT"
161 .Fn attron "A_UNDERLINE"
165 .Fn attrset "int attribute" \(dg
167 Set character attributes for any characters
168 added to the window (if it has that capability).
172 Returns the output baud rate of the terminal.
173 This is a system dependent constant
182 Sound the terminal bell. If the terminal has no bell capability,
183 but has the ability to flash the screen, do that instead. See also
188 Sets the background rendition to
191 .Fn bkgdset "chtype ch"
193 Sets the background rendition to
195 and applies this rendition to the window.
197 .Fn border "chtype left" "chtype right" "chtype top" "chtype bottom" "chtype topleft" "chtype topright" "chtype botleft" "chtype botright"
200 Draws a border around the window using the characters:
202 for drawing the left side,
204 for drawing the left side,
206 for drawing the top edge,
208 for drawing the top edge,
210 for drawing the top-left corner,
212 for drawing the top-right corner,
214 for drawing the bottom-left corner, and
216 for drawing the bottom-right corner. If scrolling is not allowed,
217 and the window encompasses the lower right-hand corner of the terminal,
218 the corners are left blank to avoid a scroll.
220 .Fn box "WINDOW win" "chtype vert" "chtype hor"
223 Draws a box around the window using
225 as the character for drawing the vertical sides, and
227 for drawing the horizontal lines.
228 If scrolling is not allowed,
229 and the window encompasses the lower right-hand corner of the terminal,
230 the corners are left blank to avoid a scroll.
232 .Fn can_change_color ""
234 Check if terminal can change colors.
238 Set the terminal to cbreak mode.
242 Resets the entire window to blanks.
246 this sets the clear flag,
247 which will cause a clear-screen sequence to be sent
251 This also moves the current \*y
254 .Fn clearok "WINDOW *scr" "int boolf" \(dg
256 Sets the clear flag for the screen
261 this will force a clear-screen to be printed on the next
263 or stop it from doing so if
266 This only works on screens,
270 does not alter the contents of the screen.
277 call will cause a clear-screen,
278 even if the window passed to
284 Wipes the window clear from the current \*y to the bottom.
285 This does not force a clear-screen sequence on the next refresh
286 under any circumstances.
291 Wipes the window clear from the current \*y to the end of the line.
294 .Fn color_content "short color" "short *red" "short *green" "short *blue"
296 Get the red, green and blue values of color
299 .Fn color_set "short pair" "void *opt" \(dg
301 Set color pair for any characters added to the window (if it has
304 .Fn copywin "const WINDOW *src" "WINDOW *dst" "int sminrow" "int smincol" "int dminrow" "int dmincol" "int dmaxrow" "int dmaxcol" "int overlay"
306 Copies the contents of the window
311 to the destination window
316 and ending at either the end of the source window or (
319 whichever is the lesser. The parameter
321 determines the nature of the copy. If
323 is TRUE then only the non-space characters from
329 is FALSE then all characters are copied from
334 .Fn curs_set "int visibility"
336 Sets the visibility of the screen cursor. The parameter
338 can be one of three values, 0 means make the cursor invisible, 1 means
339 set the cursor to normal visibility and 2 sets the cursor to high
340 visibility. In all cases the old mode of the cursor is returned if
341 the call was successful and
343 is returned if the terminal cannot support the requested visibility
354 is retained for backwards compatibility
355 with ealier versions of the library.
357 .Fn delay_output "int ms"
361 milliseconds using the terminal pad character.
365 Save the current terminal modes as the \'in curses\' state for use with
366 .Fn reset_prog_mode .
368 .Fn def_shell_mode ""
370 Save the current terminal modes as the \'not in curses\' state for use with
371 .Fn reset_shell_mode .
373 .Fn define_key "char *sequence" "int key_symbol"
375 Assigns the character sequence given in
381 has set been set TRUE and the character sequence is found in the input
382 stream then the key symbol defined will be returned. Normally the
383 sequences are found in the
385 database but this function allows extensions to be added by the
388 is a NULL pointer then all the sequences associated with
390 will be removed, including any definitions inserted by
395 Delete the character at the current \*y.
396 Each character after it on the line shifts to the left,
397 and the last character becomes blank.
401 Delete the current line.
402 Every line below the current one will move up,
403 and the bottom line will become blank.
404 The current \*y will remain unchanged.
406 .Fn delscreen "SCREEN *screen"
408 Delete the screen and frees all associated resources.
410 .Fn delwin "WINDOW *win"
412 Deletes the window from existence.
413 All resources are freed for future use by
417 allocated window inside of it,
418 deleting the outer window
419 the subwindow is not affected,
420 even though this does invalidate it.
422 subwindows should be deleted before their
425 .Fn derwin "WINDOW *orig" "int nlines" "int ncols" "int by" "int bx"
427 Performs a function very similar to that of
429 The difference being that with
431 the origin of the child window given by (
434 is relative to the origin of the parent window
436 instead of being absolute screen coordinates as they are in
441 Synchronize the terminal screen with the virtual screen that
442 has had window contents added to it by calls to
445 .Fn dupwin "WINDOW *win"
447 Creates an exact copy of the window
452 Sets the terminal to echo characters.
454 .Fn echochar "const chtype ch" \(dg
459 at the current \*y and immediately refresh the window.
463 Finish up window routines before exit.
464 This restores the terminal to the state it was before
471 It should always be called before exiting and before the final calls to
474 This is especially useful for resetting tty stats
475 when trapping rubouts via
480 Erases the window to blanks without setting the clear flag.
483 except that it never causes a clear-screen sequence to be generated
488 .Fn erasechar "" \(dg
490 Returns the erase character
493 the character used by the user to erase a single character from the input.
497 Flash the terminal screen. If the terminal has no flash capability,
498 but has the ability to sound the bell, do that instead. See also
503 Throw away any input that has been typed by the user but has not yet
504 been read by the program.
506 .Fn flushok "WINDOW *win" "int boolf"
514 allows you to control this.
523 otherwise it will not.
525 .Fn getattrs "WINDOW *win"
527 Gets the attributes for
530 .Fn getbkgd "WINDOW *win"
532 Gets the background rendition for
535 .Fn getcap "char *name"
537 Get the terminal capability
542 Gets a character from the terminal and (if necessary)
543 echos it on the window.
545 Otherwise, the character gotten is returned.
548 has been set, then the window is left unaltered.
549 In order to retain control of the terminal,
550 it is necessary to have one of
556 If you do not set one,
557 whatever routine you call to read characters will set
560 and then reset to the original mode when finished.
562 .Fn getcury "WINDOW *win"
564 Get current y position on
567 .Fn getcurx "WINDOW *win"
569 Get current x position on
572 .Fn getbegy "WINDOW *win"
574 Get start y position on
577 .Fn getbegx "WINDOW *win"
579 Get start x position on
582 .Fn getmaxy "WINDOW *win"
584 Get maximum y position on
587 .Fn getmaxx "WINDOW *win"
589 Get maximum x position on
592 .Fn getnstr "char *str" \(dg
594 Get a string through the window
595 and put it in the location pointed to by
599 characters is returned (including the trailing null).
600 It sets tty modes if necessary,
605 to get the characters needed to fill in the string
606 until a newline or EOF is encountered.
607 The newline stripped off the string.
610 .Fn getstr "char *str" \(dg
612 Get a string through the window
613 and put it in the location pointed to by
615 which is assumed to be large enough to handle it.
616 It sets tty modes if necessary,
621 to get the characters needed to fill in the string
622 until a newline or EOF is encountered.
623 The newline stripped off the string.
626 .Fn getparx "WINDOW *win"
628 Returns the x location of the given subwindow relative to the parent
629 window. If the window is not a subwindow then -1 is returned.
631 .Fn getpary "WINDOW *win"
633 Returns the y location of the given subwindow relative to the parent
634 window. If the window is not a subwindow then -1 is returned.
636 .Fn getpary "WINDOW *win" "int y" "int x"
638 Is a macro that sets the
642 parameters to the respective coordinates of the top left hand corner
643 of the subwindow relative to the parent window. If the given window
645 is not a subwindow then both
654 This is normally called by
657 .Fn getwin "FILE *fp"
659 Creates a window from a file written by
662 .Fn getyx "WINDOW *win" "int y" "int x"
664 Puts the current \*y of
672 you do not pass the address
678 .Fn halfdelay "int timeout"
680 Sets the terminal into a mode similar to that done by
682 with the exception that the input routines will wait for
684 number of tenths of a second, if at this time there is no input then
685 ERR will be returned.
689 Check if terminal has colors.
691 .Fn hline "chtype ch" "int count"
693 Draw a horizontal line of the character ch starting at the current
694 cursor position and moving towards the rightmost column. At most
696 characters will be written, less if the edge of the screen is reached
701 .Fn idcok "WINDOW *win" "int boolf"
703 Reserved for future use.
704 This will eventually signal to
706 that it is all right to use the insert and delete char sequences
707 when updating the window.
709 .Fn idlok "WINDOW *win" "int boolf"
711 Reserved for future use.
712 This will eventually signal to
714 that it is all right to use the insert and delete line sequences
715 when updating the window.
720 Returns the character at the current position on the given window.
721 This does not make any changes to the window.
723 .Fn inchnstr "chtype *chstr" "int n"
725 Get an array of at most
727 characters and renditions starting at the current cursor position and
728 ending at the end of the line and put it in the location pointed to by
731 .Fn inchstr "chtype *chstr"
733 Get an array of characters and renditions starting at the current cursor
734 position and ending at the end of the line and put it in the location
737 which is assumed to be large enough to handle it.
739 .Fn innstr "char *str" "int n"
741 Get a string of at most
743 characters starting at the current cursor position and ending at the end
744 of the line and put it in the location pointed to by
747 .Fn init_color "short color" "short red" "short green" "short blue"
749 Set the red, green and blue values of color
752 .Fn init_pair "short pair" "short fore" "short back"
754 Set the foreground and background colors of pair
759 Initialize the screen routines.
760 This must be called before any of the screen routines are used.
761 It initializes the terminal-type data and such,
762 and without it none of the routines can operate.
763 If standard input is not a tty,
764 it sets the specifications to the terminal
765 whose name is pointed to by
773 If the system supports the
777 it is used to get the number of lines and columns for the terminal,
778 otherwise it is taken from the
787 Each character after it shifts to the right,
788 and the last character disappears.
797 lines above the current one.
798 Every line below the current line
799 will be shifted down,
802 lines will disappear.
807 lines starting from the current one.
811 The current \*y will remain unchanged.
815 Insert a line above the current one.
816 Every line below the current line
817 will be shifted down,
818 and the bottom line will disappear.
819 The current line will become blank,
820 and the current \*y will remain unchanged.
822 .Fn instr "char *str"
824 Get an string starting at the current cursor position and ending at the
825 end of the line and put it in the location pointed to by
827 which is assumed to be large enough to handle it.
829 .Fn is_linetouched "WINDOW *win" "int line"
835 has been modified since the last call to
838 .Fn is_wintouched "WINDOW *win" "int line"
840 Returns TRUE if the window
842 has been modified since the last call to
849 has been called without a subsequent call to
853 .Fn intrflush "WINDOW *win" "int boolf"
855 Sets the terminal flush on interrupt mode. If
857 is non-zero, flushing of the output buffer will occur when an
858 interrupt key is pressed. The default is inherited from the
861 .Fn keyok "int key_symbol" "bool flag"
863 Controls the recognition of the key symbol
867 to FALSE the recognition of any sequence of characters
868 that have been associated with the key symbol will be disabled.
869 By default, this flag is TRUE so sequences will be recognised.
871 .Fn keyname "int key"
873 Returns a description of the key
876 .Fn keypad "WINDOW *win" "int boolf"
878 Sets the boolean flag for interpretation of escape sequences. If
880 is non-zero, escape sequences from terminal keypad and function
881 keys will be interpreted by the library. Escape sequences are not
882 interpreted by default. The include file
884 contains the list of recognised keypad and function keys. See also
889 Returns the line kill character
892 the character used by the user to erase an entire line from the input.
894 .Fn leaveok "WINDOW *win" "int boolf" \(dg
896 Sets the boolean flag for leaving the cursor after the last change.
900 the cursor will be left after the last update on the terminal,
901 and the current \*y for
903 will be changed accordingly.
906 is 0 the cursor will be moved to the current \*y.
909 retains its value until changed by the user.
913 Returns a string containing the verbose description of the terminal.
915 .Fn meta "WINDOW *win" "bool bf"
917 Manipulates the meta mode on terminals that support this capability.
922 .Fn move "int y" "int x"
924 Change the current \*y of the window to
928 .Fn mvaddch "int y" "int x" "chtype ch"
930 Moves the cursor to the position
933 and then adds a character in the same manner as
936 .Fn mvaddchstr "int y" "int x" "chtype *str" \(dg
938 Moves the cursor to the position
941 and then adds characters and attributes in the same manner as
944 .Fn mvaddchnstr "int y" "int x" "chtype *str" \(dg
946 Moves the cursor to the position
949 and then adds characters and attributes in the same manner as
952 .Fn mvaddstr "int y" "int x" "char *str" \(dg
954 Moves the cursor to the position
957 and then adds a string in the same manner as
960 .Fn mvaddnstr "int y" "int x" "char *str" \(dg
962 Moves the cursor to the position
965 and then adds a string in the same manner as
968 .Fn mvcur "int lasty" "int lastx" "int newy" "int newx"
970 Moves the terminal's cursor from
971 .Vn lasty\*,lastx ) (
974 in an approximation of optimal fashion.
975 This routine uses the functions borrowed from
978 It is possible to use this optimization
979 without the benefit of the screen routines.
980 With the screen routines, this should not be called by the user.
984 should be used to move the cursor position,
985 so that the routines know what's going on.
987 .Fn mvderwin "WINDOW *win" "int y" "int x"
993 where the location is relative to the top left hand corner of the
994 parent window. This call will return ERR if
996 is not a subwindow or if the relocated window would lie outside the
999 .Fn mvhline "int y" "int x" "chtype ch" "int count"
1001 Moves the cursor to the position
1004 and then draws a horizontal line in the same manner as
1007 .Fn mvprintw "int y" "int x" "const char *fmt" "..."
1015 .Fn mvscanw "int y" "int x" "const char *fmt" "..."
1023 .Fn mvvline "int y" "int x" "chtype ch" "int count"
1025 Moves the cursor to the position
1028 and then draws a vertical line in the same manner as
1031 .Fn mvwhline "WINDOW *win" "int y" "int x" "chtype ch" "int count"
1033 Moves the cursor to the position
1038 and then draws a horizontal line in the same manner as
1041 .Fn mvwvline "WINDOW *win" "int y" "int x" "chtype ch" "int count"
1043 Moves the cursor to the position
1048 and then draws a horizontal line in the same manner as
1051 .Fn mvwin "WINDOW *win" "int y" "int x"
1053 Move the home position of the window
1055 from its current starting coordinates
1058 If that would put part or all of the window
1059 off the edge of the terminal screen,
1061 returns ERR and does not change anything.
1064 also returns ERR if you attempt to move it off its main window.
1065 If you move a main window,
1066 all subwindows are moved along with it.
1068 .Fn mvwprintw "WINDOW *win" "int y" "int x" "const char *fmt" "..."
1076 .Fn mvwscanw "WINDOW *win" "int y" "int x" "const char *fmt" "..."
1091 .Fn newpad "int lines" "int cols"
1093 Create a new pad with
1100 .Fn newterm "char *type" "FILE *outfd" "FILE *infd"
1102 Iinitialise the curses subsystem to use the terminal of type
1104 connected via the input and output streams
1108 is used in multi-terminal applications and returns a pointer to a
1110 structure that holds the state for that particular terminal. The
1111 application may swap between the terminals by calling the
1115 parameter is NULL then the $TERM variable is used as the terminal type.
1118 .Fn newwin "int lines" "int cols" "int begin_y" "int begin_x"
1120 Create a new window with
1124 columns starting at position
1125 .Vn begin\*_y\*,begin\*_x ). (
1131 that dimension will be set to
1132 .Vn "LINES \- begin\*_y" ) (
1134 .Vn "COLS \- begin\*_x" ) (
1136 Thus, to get a new window of dimensions
1141 .Fn newwin 0 0 0 0 .
1145 Set the terminal to nl mode,
1147 start/stop the system from mapping
1151 If the mapping is not done,
1153 can do more optimization,
1154 so it is recommended, but not required, to turn it off.
1156 .Fn no_color_video ""
1158 Return attributes that cannot be combined with color.
1162 Unset the terminal from cbreak mode.
1164 .Fn nocrmode "" \(dg
1170 is retained for backwards compatibility
1171 with ealier versions of the library.
1173 .Fn nodelay "WINDOW *win1" "int boolf"
1175 Sets the boolean flag for non-blocking
1181 will return ERR is no input is waiting. The default
1184 to block indefinitely. See also
1189 Turn echoing of characters off.
1193 Unset the terminal to from nl mode. See
1199 Unset the terminal flush on interrupt mode.
1200 This is equivalent to
1201 .Fn intrflush stdscr FALSE .
1205 Unset the terminal from raw mode. See
1208 .Fn notimeout "WINDOW *win1" "int boolf"
1210 Sets the boolean flag for inter-key timeouts
1211 for escape sequences interpreted when
1216 sets a timer while waiting for the next character of
1222 will wait indefinitely between escape sequence characters,
1223 or until a delay set by
1227 .Fn overlay "WINDOW *win1" "WINDOW *win2"
1235 insofar as they fit,
1238 at their starting \*y.
1239 This is done non-destructively,
1242 leave the contents of the space on
1244 untouched. Note that all non-blank characters are overwritten
1245 destructively in the overlay.
1247 .Fn overwrite "WINDOW *win1" "WINDOW *win2"
1255 insofar as they fit,
1258 at their starting \*y.
1259 This is done destructively,
1266 .Fn pair_content "short pair" "short *fore" "short *back"
1268 Get the foreground and background colors of pair
1271 .Fn pechochar "const chtype ch" \(dg
1276 at the current \*y and immediately refresh the pad.
1278 .Fn pnoutrefresh "WINDOW *pad" "int pbeg_y" "int pbeg_x" "int sbeg_y" "int sbeg_x" "int smax_y" "int smax_x"
1280 Add the pad contents to a virtual screen. Several pads can be added
1283 thus allowing the screen to updated in an efficient manner.
1285 .Fn prefresh "WINDOW *pad" "int pbeg_y" "int pbeg_x" "int sbeg_y" "int sbeg_x" "int smax_y" "int smax_x"
1287 Synchronize the terminal screen with the desired pad.
1289 .Fn printw "char *fmt" "..."
1293 on the window starting at the current \*y.
1296 to add the string on the window.
1297 It is often advisable to use the field width options of
1299 to avoid leaving things on the window from earlier calls.
1302 .Fn putwin "WINDOW *win" "FILE *fp"
1304 Writes the window data to a file.
1308 Set the terminal flush on interrupt mode.
1309 This is equivalent to
1310 .Fn intrflush stdscr TRUE .
1314 Set the terminal to raw mode.
1320 is a trademark of Unix System Laboratories.
1322 this also turns off newline mapping
1326 .Fn redrawwin "WINDOW *win" \(dg
1328 Mark the entire window as having been corrupted.
1329 This is equivalent to the
1335 Synchronize the terminal screen with the desired window.
1336 If the window is not a screen,
1337 only that part covered by it is updated.
1339 In this case, it will update whatever it can
1340 without causing the scroll.
1345 is called with the window
1347 the screen is cleared
1348 and repainted as it is currently.
1349 This is very useful for allowing the redrawing of the screen
1350 when the user has garbage dumped on his terminal.
1352 .Fn reset_prog_mode ""
1354 Restore the terminal to the \'in curses\' state.
1356 .Fn reset_shell_mode ""
1358 Restore the terminal to the \'not in curses\' state.
1363 restores them to what
1366 These functions are performed automatically by
1370 This function should not be used by the user.
1372 .Fn resizeterm "int lines" "int columns" \(dg
1374 Resizes the curses terminal to the given size. All internal curses
1375 structures are resized to the new dimensions and all curses windows that
1376 would have boundaries outside the new terminal size will be resized to fit
1377 within the new boundaries. All windows will be cleared and it is expected
1378 that the application will redraw the window contents.
1383 saves the current tty characteristic flags. See
1385 This function should not be used by the user.
1387 .Fn scanw "char *fmt" "..."
1391 through the window using
1393 It does this using consecutive calls to
1402 Scroll the window by
1406 is positive, scroll upward, otherwise
1409 .Fn scroll "WINDOW *win"
1411 Scroll the window upward one line.
1412 This is normally not used by the user.
1414 .Fn scrollok "WINDOW *win" "int boolf" \(dg
1416 Set the scroll flag for the given window.
1419 is 0, scrolling is not allowed.
1420 This is its default setting.
1423 .Fn set_term "SCREEN *new"
1425 Sets the current screen for input and output to be the one given. The
1427 structure must be one that has been previously created by the
1431 function returns the previous screen on successful completion.
1433 .Fn standend "" \(dg
1435 End standout mode initiated by
1437 This function is provided for compatibility
1438 with older curses implementations.
1440 .Fn standout "" \(dg
1442 Causes any characters added to the window
1443 to be put in standout mode on the terminal
1444 (if it has that capability). This function
1445 is provided for compatibility with older curses
1446 implementations. A larger range of character
1447 attributes supported by modern terminals can be
1455 Initialize the color routines.
1456 This must be called before any of the color routines are used.
1457 The terminal is setup to use the curses default colors of white foreground
1458 on black background, unless
1459 .Fn assume_default_colors
1461 .Fn use_default_colors
1465 .Fn subpad "WINDOW *win" "int lines" "int cols" "int begin_y" "int begin_x"
1467 Create a new pad with
1471 columns starting at position
1472 .Vn begin\*_y\*,begin\*_x ) (
1475 This means that any change made to either pad
1477 by the subpad will be made on both pads.
1478 .Vn begin\*_y\*,begin\*_x
1479 are specified relative to the relative (0\*,0) of
1483 .Fn subwin "WINDOW *win" "int lines" "int cols" "int begin_y" "int begin_x"
1485 Create a new window with
1489 columns starting at position
1490 .Vn begin\*_y\*,begin\*_x ) (
1493 This means that any change made to either window
1495 by the subwindow will be made on both windows.
1496 .Vn begin\*_y\*,begin\*_x
1497 are specified relative to the overall screen,
1498 not the relative (0\*,0) of
1505 that dimension will be set to
1506 .Vn "LINES \- begin\*_y" ) (
1508 .Vn "COLS \- begin\*_x" ) (
1513 Returns the attributes that can be applied to the screen.
1517 Returns the wide attributes that can be applied to the screen.
1519 .Fn timeout "int delay" \(dg
1521 Sets blocking or non-blocking
1529 milliseconds before returning. If
1533 will return ERR is no input is waiting. If
1537 will block indefinitely. See also
1543 .Fn touchline "WINDOW *win" "int y" "int startx" "int endx"
1545 This function performs a function similar to
1548 It marks the first change for the given line
1551 if it is before the current first change mark,
1553 the last change mark is set to be
1555 if it is currently less than
1558 .Fn touchoverlap "WINDOW *win1" "WINDOW *win2"
1562 in the area which overlaps with
1564 If they do not overlap,
1565 no changes are made.
1567 .Fn touchwin "WINDOW *win"
1569 Make it appear that the every location on the window
1571 This is usually only needed for refreshes with overlapping windows.
1576 will save the current tty state
1577 and then put the process to sleep.
1578 When the process gets restarted,
1579 it restores the saved tty state
1581 .Fn wrefresh "curscr"
1582 to redraw the screen.
1586 to trap to this routine.
1588 .Fn unctrl "char *ch" \(dg
1590 Returns a string which is an ASCII representation of
1592 Characters are 8 bits long.
1594 .Fn unctrllen "char *ch" \(dg
1596 Returns the length of the ASCII representation of
1600 .Fn underend "" \(dg
1602 End underscore mode initiated by
1604 This is equivalent to
1605 .Fn attroff "A_UNDERLINE" .
1607 .Fn underscore "" \(dg
1609 Causes any characters added to the window
1610 to be put in underscore mode on the terminal
1611 (if it has that capability).
1612 This is equivalent to
1613 .Fn attron "A_UNDERLINE" .
1617 Places the contents of
1619 converted to a character back into the input queue. Only one
1620 character of push back before a subsequent call to
1624 is guaranteed to function correctly. The results of attempting more
1625 than one character of push back is undefined.
1627 .Fn untouchwin "WINDOW *win"
1629 Make the window appear to have not been updated even if it has been.
1631 .Fn use_default_colors ""
1633 Use the terminal foreground and background colors as the curses default
1634 foreground and background colors.
1636 .Fn vline "chtype ch" "int count"
1638 Draws a vertical line of character
1640 starting at the current cursor location and moving towards the bottom
1641 of the screen. At most
1643 characters are drawn, less if the bottom of the screen is reached
1648 .Fn vwprintw "WINDOW *win" "const char *fmt" "va_list ap"
1652 except that it takes both a window specification and a pointer to a variable
1653 length argument list.
1655 .Fn vwscanw "WINDOW *win" "const char *fmt" "va_list ap"
1659 except that it takes both a window specification and a pointer to a variable
1660 length argument list.
1662 .Fn wnoutrefresh "WINDOW *win"
1664 Add the window contents to a virtual screen. Several windows can be added
1667 thus allowing the screen to updated in an efficient manner.
1669 .Fn wredrawln "WINDOW *win" "int line" "int n" \(dg
1675 in the window as corrupted.
1676 This is equivalent to
1677 .Fn wtouchln "win" "line" "n" "1" .
1679 .Fn wresize "WINDOW *win" "int lines" "int columns"
1681 Resize the specified window to the given dimensions. The window will be
1682 cleared and the application is expected to redraw the window contents.
1684 .Fn wtouchln "WINDOW *win" "int line" "int n" "int changed"
1692 in the window are touched. If
1698 in the window are untouched.
1701 \fIThe following functions differ from the standard functions only in their
1702 specification of a window, rather than the use of the default
1705 .Fn waddbytes "WINDOW *win" "char* str" "int len"
1706 .Fn waddch "WINDOW *win" "chtype ch"
1707 .Fn waddchnstr "WINDOW *win" "chtype *str" "int len"
1708 .Fn waddchstr "WINDOW *win" "chtype *str" "int len"
1709 .Fn waddnstr "WINDOW *win" "char *str" "int len"
1710 .Fn waddstr "WINDOW *win" "char *str"
1711 .Fn wattroff "WINDOW *win" "int attr"
1712 .Fn wattron "WINDOW *win" "int attr"
1713 .Fn wattrset "WINDOW *win" "int attr"
1714 .Fn wbkgd "WINDOW *win" "chtype ch"
1715 .Fn wbkgdset "WINDOW *win" "chtype ch"
1716 .Fn wborder "WINDOW *win" "chtype left" "chtype right" "chtype top" "chtype bottom" "chtype topleft" "chtype topright" "chtype botleft" "chtype botright"
1717 .Fn wclear "WINDOW *win"
1718 .Fn wclrtobot "WINDOW *win"
1719 .Fn wclrtoeol "WINDOW *win"
1720 .Fn wdelch "WINDOW *win"
1721 .Fn wdeleteln "WINDOW *win"
1722 .Fn wechochar "WINDOW *win" "chtype ch"
1723 .Fn werase "WINDOW *win"
1724 .Fn wgetch "WINDOW *win"
1725 .Fn wgetnstr "WINDOW *win" "char *str" "int len"
1726 .Fn wgetstr "WINDOW *win" "char *str"
1727 .Fn whline "WINDOW *win" "chtype ch" "int count"
1728 .Fn winch "WINDOW *win" \(dg
1729 .Fn winchnstr "WINDOW *win" "chtype *chstr" "int n"
1730 .Fn winchstr "WINDOW *win" "chtype *chstr"
1731 .Fn winnstr "WINDOW *win" "char *str" "int n"
1732 .Fn winsch "WINDOW *win" "char c"
1733 .Fn winsdelln "WINDOW *win" "int n"
1734 .Fn winsertln "WINDOW *win"
1735 .Fn winstr "WINDOW *win" "char *str"
1736 .Fn wmove "WINDOW *win" "int y" int x"
1737 .Fn wprintw "WINDOW *win" "char *fmt" "..."
1738 .Fn wrefresh "WINDOW *win"
1739 .Fn wscanw "WINDOW *win" "char *fmt" "..."
1740 .Fn wscrl "WINDOW *win" "int n"
1741 .Fn wstandend "WINDOW *win"
1742 .Fn wstandout "WINDOW *win"
1743 .Fn wtimeout "WINDOW *win" "int delay"
1744 .Fn wunderend "WINDOW *win"
1745 .Fn wunderscore "WINDOW *win"
1746 .Fn wvline "WINDOW *win" "chtype ch" "int count"
1747 .Fn mvwaddch "WINDOW *win" "int y" "int x" "chtype ch"
1748 .Fn mvwaddchstr "WINDOW *win" "int y" "int x" "chtype *str" \(dg
1749 .Fn mvwaddchnstr "WINDOW *win" "int y" "int x" "chtype *str" \(dg
1750 .Fn mvwaddnstr "WINDOW *win" "int y" "int x" "char *str" "int len"
1751 .Fn mvwaddstr "WINDOW *win" "int y" "int x" "char *str"
1752 .Fn mvwgetnstr "WINDOW *win" "int y" "int x" "char *str" "int len"
1753 .Fn mvwgetstr "WINDOW *win" "int y" "int x" "char *str"
1754 .Fn mvwhline "WINDOW *win" "int y" "int x" "chtype ch" "int count"
1755 .Fn mvwvline "WINDOW *win" "int y" "int x" "chtype ch" "int count"