+ <STRONG>-1</STRONG> if the library is not initialized.
+
+
+</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
+ Applications employing <EM>ncurses</EM> extensions should condition their use on
+ the visibility of the <STRONG>NCURSES_VERSION</STRONG> preprocessor macro.
+
+ Except as noted in section "EXTENSIONS" above, X/Open Curses, Issue 4
+ describes these functions. It specifies no error conditions for them.
+
+ SVr4 <EM>curses</EM> describes a successful return value only as "an integer
+ value other than <STRONG>ERR</STRONG>".
+
+ <EM>ncurses</EM> follows X/Open Curses and the historical practice of System V
+ <EM>curses</EM>, clearing the terminal driver's "echo" flag when initializing
+ the screen. BSD <EM>curses</EM> did not, but its <EM>raw</EM> function turned it off as
+ a side effect. For best portability, call <STRONG>echo</STRONG> or <STRONG>noecho</STRONG> explicitly
+ just after initialization, even if your program remains in normal
+ ("cooked") mode.
+
+ X/Open Curses is ambiguous regarding whether <EM>raw</EM> should disable the
+ carriage return and line feed translation feature controlled by <EM>nl</EM> and
+ <EM>nonl</EM>. BSD <EM>curses</EM> did turn off these translations; System V <EM>curses</EM> did
+ not. <EM>ncurses</EM> does so, on the assumption that a programmer requesting
+ raw input wants a clean (ideally, 8-bit clean) connection that the
+ operating system will not alter.
+
+ When <STRONG>keypad</STRONG> is first enabled, <EM>ncurses</EM> loads the key definitions for the
+ current terminal description. If the terminal description includes
+ extended string capabilities, for example, by using the <STRONG>-x</STRONG> option of
+ <STRONG><A HREF="tic.1m.html">tic(1)</A></STRONG>, then <EM>ncurses</EM> also defines keys for the capabilities whose names
+ begin with "k". Corresponding key codes are generated and (depending
+ on previous loads of terminal descriptions) may differ from one
+ execution of a program to the next. The generated key codes are
+ recognized by <STRONG><A HREF="curs_util.3x.html">keyname(3x)</A></STRONG>, which then returns a name beginning with "k"
+ denoting the <EM>terminfo</EM> capability name rather than "K", used for <EM>curses</EM>
+ key names. On the other hand, an application can use <STRONG><A HREF="define_key.3x.html">define_key(3x)</A></STRONG> to
+ bind a specific key to a string of the programmer's choice. This
+ feature enables an application to check for its presence with
+ <STRONG><A HREF="curs_terminfo.3x.html">tigetstr(3x)</A></STRONG>, and reassign the key code to match its own needs.
+
+ Low-level applications can use <STRONG><A HREF="curs_terminfo.3x.html">tigetstr(3x)</A></STRONG> to obtain the definition of
+ any string capability. <EM>curses</EM> applications use the input character
+ reading function to obtain key codes from input and rely upon the order
+ in which the string capabilities are loaded. Multiple key capability
+ strings can have the same value, but the input character reading
+ function can report only one key code. Most <EM>curses</EM> implementations
+ (including <EM>ncurses</EM>) load key definitions in the order they appear in
+ the <STRONG>strfnames</STRONG> array of string capability names; see <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>.
+ The last capability read using a particular definition determines the
+ key code to be reported. In <EM>ncurses</EM>, extended capabilities can be
+ interpreted as key definitions. These are loaded after the predefined
+ keys, and if a capability's value is the same as a previously loaded
+ key definition, the later definition is the one used.
+
+
+</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
+ 4BSD <EM>curses</EM> (1980) introduced <EM>echo</EM>, <EM>noecho</EM>, <EM>nl</EM>, <EM>nonl</EM>, <EM>raw</EM>, and <EM>noraw</EM>.
+
+ SVr2 (1984) featured a new terminal driver, extending the <EM>curses</EM> API to
+ support it with <EM>cbreak</EM>, <EM>nocbreak</EM>, <EM>intrflush</EM>, <EM>keypad</EM>, <EM>meta</EM>, <EM>nodelay</EM>, and
+ <EM>typeahead</EM>.
+
+ SVr3 (1987) added <EM>halfdelay</EM>, <EM>notimeout</EM>, and <EM>wtimeout</EM>. <EM>qiflush</EM> and
+ <EM>noqiflush</EM> appeared in SVr3.1 (1987), at which point <EM>intrflush</EM> became a
+ wrapper for either of these functions, depending on the value of its
+ Boolean argument. SVr3.1 also added <EM>timeout</EM>.
+
+ <EM>ncurses</EM> 6.5 (2024) introduced <EM>is</EM><STRONG>_</STRONG><EM>cbreak</EM>, <EM>is</EM><STRONG>_</STRONG><EM>echo</EM>, <EM>is</EM><STRONG>_</STRONG><EM>nl</EM>, and <EM>is</EM><STRONG>_</STRONG><EM>raw</EM>.
+
+ Formerly, <EM>ncurses</EM> used <EM>nl</EM> and <EM>nonl</EM> to control the conversion of
+ newlines to carriage return/line feed on output as well as input.
+ X/Open Curses documents the use of these functions only for input.
+ This difference arose from converting the <EM>pcurses</EM> source (1986), which
+ used <STRONG>ioctl(2)</STRONG> calls and the <EM>sgttyb</EM> structure, to <EM>termios</EM> (the POSIX
+ terminal API). In the former, both input and output were controlled
+ via a single option "CRMOD", while the latter separates these features.
+ Because that conversion interferes with output optimization, <EM>ncurses</EM>
+ 6.2 (2020) amended <EM>nl</EM> and <EM>nonl</EM> to eliminate their effect on output.