]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - man/curs_inopts.3x
ncurses 6.4 - patch 20230812
[ncurses.git] / man / curs_inopts.3x
index 473e4921aec222241890bc7d30e927d60ce8f7ea..fa753dbeb098adaf9d0ce2645184aa9c36d6df93 100644 (file)
@@ -1,5 +1,6 @@
+'\" t
 .\"***************************************************************************
-.\" Copyright 2018-2020,2021 Thomas E. Dickey                                *
+.\" Copyright 2018-2022,2023 Thomas E. Dickey                                *
 .\" Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -27,8 +28,8 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_inopts.3x,v 1.35 2021/12/25 21:49:32 tom Exp $
-.TH curs_inopts 3X ""
+.\" $Id: curs_inopts.3x,v 1.42 2023/08/12 17:07:04 tom Exp $
+.TH curs_inopts 3X 2023-08-12 "ncurses 6.4" "Library calls"
 .ie \n(.g .ds `` \(lq
 .el       .ds `` ``
 .ie \n(.g .ds '' \(rq
 .hy 0
 .SH NAME
 \fBcbreak\fP,
-\fBnocbreak\fP,
 \fBecho\fP,
-\fBnoecho\fP,
 \fBhalfdelay\fP,
 \fBintrflush\fP,
+\fBis_cbreak\fP,
+\fBis_echo\fP,
+\fBis_nl\fP,
+\fBis_raw\fP,
 \fBkeypad\fP,
 \fBmeta\fP,
 \fBnl\fP,
-\fBnonl\fP,
+\fBnocbreak\fP,
 \fBnodelay\fP,
-\fBnotimeout\fP,
-\fBraw\fP,
+\fBnoecho\fP,
+\fBnonl\fP,
+\fBnoqiflush\fP,
 \fBnoraw\fP,
+\fBnotimeout\fP,
 \fBqiflush\fP,
-\fBnoqiflush\fP,
+\fBraw\fP,
 \fBtimeout\fP,
 \fBwtimeout\fP,
 \fBtypeahead\fP \- \fBcurses\fP input options
 .br
 \fBint noecho(void);\fP
 .sp
-\fBint intrflush(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fP
+\fBint intrflush(WINDOW *\fIwin\fB, bool \fIbf\fB);\fR
 .br
-\fBint keypad(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fP
+\fBint keypad(WINDOW *\fIwin\fB, bool \fIbf\fB);\fR
 .br
-\fBint meta(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fP
+\fBint meta(WINDOW *\fIwin\fB, bool \fIbf\fB);\fR
 .br
-\fBint nodelay(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fP
+\fBint nodelay(WINDOW *\fIwin\fB, bool \fIbf\fB);\fR
 .br
-\fBint notimeout(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fP
+\fBint notimeout(WINDOW *\fIwin\fB, bool \fIbf\fB);\fR
 .sp
 \fBint nl(void);\fP
 .br
 .br
 \fBvoid noqiflush(void);\fP
 .sp
-\fBint halfdelay(int \fP\fItenths\fP\fB);\fP
+\fBint halfdelay(int \fItenths\fB);\fR
 .br
-\fBvoid timeout(int \fP\fIdelay\fP\fB);\fP
+\fBvoid timeout(int \fIdelay\fB);\fR
 .br
-\fBvoid wtimeout(WINDOW *\fP\fIwin\fP\fB, int \fP\fIdelay\fP\fB);\fP
+\fBvoid wtimeout(WINDOW *\fIwin\fB, int \fIdelay\fB);\fR
+.sp
+\fBint typeahead(int \fIfd\fB);\fR
 .sp
-\fBint typeahead(int \fP\fIfd\fP\fB);\fP
+/* extensions */
+.br
+\fBint is_cbreak(void);\fP
+.br
+\fBint is_echo(void);\fP
+.br
+\fBint is_nl(void);\fP
+.br
+\fBint is_raw(void);\fP
 .br
 .SH DESCRIPTION
 The \fBncurses\fP library provides several functions which let an application
@@ -128,7 +143,6 @@ Note that \fBcbreak\fP overrides \fBraw\fP.
 discussion of how these routines interact with \fBecho\fP and \fBnoecho\fP.]
 .\"
 .SS echo/noecho
-.PP
 The \fBecho\fP and \fBnoecho\fP routines control whether characters typed by
 the user are echoed by \fBgetch\fP(3X) as they are typed.
 Echoing by the tty
@@ -142,7 +156,6 @@ discussion of how these routines interact with \fBcbreak\fP and
 \fBnocbreak\fP.]
 .\"
 .SS halfdelay
-.PP
 The \fBhalfdelay\fP routine is used for half-delay mode, which is similar to
 \fBcbreak\fP mode in that characters typed by the user are immediately
 available to the program.
@@ -154,7 +167,6 @@ Use \fBnocbreak\fP to leave half-delay
 mode.
 .\"
 .SS intrflush
-.PP
 If the \fBintrflush\fP option is enabled (\fIbf\fP is \fBTRUE\fP), and an
 interrupt key is pressed on the keyboard (interrupt, break, quit), all output in
 the tty driver queue will be flushed, giving the effect of faster response to
@@ -166,7 +178,6 @@ The default for the option is inherited from the tty driver settings.
 The window argument is ignored.
 .\"
 .SS keypad
-.PP
 The \fBkeypad\fP option enables the keypad of the user's terminal.
 If
 enabled (\fIbf\fP is \fBTRUE\fP), the user can press a function key
@@ -183,7 +194,6 @@ called.
 The default value for keypad is \fBFALSE\fP.
 .\"
 .SS meta
-.PP
 Initially, whether the terminal returns 7 or 8 significant bits on
 input depends on the control mode of the tty driver [see \fBtermios\fP(3)].
 To force 8 bits to be returned, invoke \fBmeta\fP(\fIwin\fP,
@@ -201,28 +211,24 @@ If the terminfo capabilities \fBsmm\fP
 \fBFALSE\fP) is called.
 .\"
 .SS nl/nonl
-.PP
 The \fBnl\fP and \fBnonl\fP routines control whether the underlying display
 device translates the return key into newline on input.
 .\"
 .SS nodelay
-.PP
 The \fBnodelay\fP option causes \fBgetch\fP to be a non-blocking call.
 If no input is ready, \fBgetch\fP returns \fBERR\fP.
 If disabled
 (\fIbf\fP is \fBFALSE\fP), \fBgetch\fP waits until a key is pressed.
 .SS notimeout
-.PP
 When interpreting an escape sequence, \fBwgetch\fP(3X) sets a timer
 while waiting for the next character.
-If \fBnotimeout(\fP\fIwin\fP,
+If \fBnotimeout(\fIwin\fR,
 \fBTRUE\fP) is called, then \fBwgetch\fP does not set a timer.
 The
 purpose of the timeout is to differentiate between sequences received
 from a function key and those typed by a user.
 .\"
 .SS raw/noraw
-.PP
 The \fBraw\fP and \fBnoraw\fP routines place the terminal into or out of raw
 mode.
 Raw mode is similar to \fBcbreak\fP mode, in that characters typed are
@@ -235,7 +241,6 @@ the BREAK key depends on other bits in the tty driver that are not set by
 \fBcurses\fP.
 .\"
 .SS qiflush/noqiflush
-.PP
 When the \fBnoqiflush\fP routine is used, normal flush of input and
 output queues associated with the \fBINTR\fP, \fBQUIT\fP and
 \fBSUSP\fP characters will not be done [see \fBtermios\fP(3)].
@@ -247,7 +252,6 @@ handler if you want output to continue as though the interrupt
 had not occurred, after the handler exits.
 .\"
 .SS timeout/wtimeout
-.PP
 The \fBtimeout\fP and \fBwtimeout\fP routines set blocking or
 non-blocking read for a given window.
 If \fIdelay\fP is negative,
@@ -263,7 +267,6 @@ plus the additional capability of being able to block for only
 \fIdelay\fP milliseconds (where \fIdelay\fP is positive).
 .\"
 .SS typeahead
-.PP
 The \fBcurses\fP library does \*(``line-breakout optimization\*(''
 by looking for typeahead periodically while updating the screen.
 If input is found, and it is coming from a tty,
@@ -289,14 +292,44 @@ In this implementation,
 functions with a window parameter will return an error if it is null.
 Any function will also return an error if the terminal was not initialized.
 Also,
-.RS
+.RS 3
 .TP 5
 \fBhalfdelay\fP
 returns an error
 if its parameter is outside the range 1..255.
 .RE
+.SH EXTENSIONS
+This implementation provides four functions which may be used to detect
+if the corresponding flags were set or reset:
+.TS
+l l l
+_ _ _ _
+l l l .
+\fBQuery\fP    \fBSet\fP       \fBReset\fP
+is_cbreak      cbreak  nocbreak
+is_echo        echo    noecho
+is_nl  nl      nonl
+is_raw raw     noraw
+.TE
+.PP
+In each case, the function returns
+.TP 5
+1
+if the flag is set,
+.TP 5
+0
+if the flag is reset, or
+.TP 5
+-1
+if the curses library was not initialized.
+.PP
+These routines are specific to ncurses.
+They were not supported on Version 7, BSD or System V implementations.
+It is recommended that any code depending on ncurses extensions
+be conditioned using NCURSES_VERSION.
 .SH PORTABILITY
-These functions are described in the XSI Curses standard, Issue 4.
+Except as noted in the section on extensions,
+these functions are described in the XSI Curses standard, Issue 4.
 .PP
 The ncurses library obeys the XPG4 standard and the historical practice of the
 AT&T curses implementations, in that the echo bit is cleared when curses