- Old versions of curses, e.g., BSD 4.4, may have returned a
- null pointer from <STRONG>initscr</STRONG> when an error is detected,
- rather than exiting. It is safe but redundant to check
- the return value of <STRONG>initscr</STRONG> in XSI Curses.
+ Old versions of curses, e.g., BSD 4.4, would return a null pointer from
+ <STRONG>initscr</STRONG> when an error is detected, rather than exiting. It is safe but
+ redundant to check the return value of <STRONG>initscr</STRONG> in X/Open Curses.
+
+ Calling <STRONG>endwin</STRONG> does not dispose of the memory allocated in <STRONG>initscr</STRONG> or
+ <STRONG>newterm</STRONG>. Deleting a <EM>SCREEN</EM> provides a way to do this:
+
+ <STRONG>o</STRONG> X/Open Curses does not say what happens to <EM>WINDOW</EM>s when <STRONG>delscreen</STRONG>
+ "frees storage associated with the <EM>SCREEN</EM>" nor does the SVr4
+ documentation help, adding that it should be called after <STRONG>endwin</STRONG> if
+ a <EM>SCREEN</EM> is no longer needed.
+
+ <STRONG>o</STRONG> However, <EM>WINDOW</EM>s are implicitly associated with a <EM>SCREEN</EM>. so that
+ it is reasonable to expect <STRONG>delscreen</STRONG> to deal with these.
+
+ <STRONG>o</STRONG> SVr4 curses deletes the standard <EM>WINDOW</EM> structures <STRONG>stdscr</STRONG> and
+ <STRONG>curscr</STRONG> as well as a work area <STRONG>newscr</STRONG>. SVr4 curses ignores other
+ windows.
+
+ <STRONG>o</STRONG> Since version 4.0 (1996), <EM>ncurses</EM> has maintained a list of all
+ windows for each screen, using that information to delete those
+ windows when <STRONG>delscreen</STRONG> is called.
+
+ <STRONG>o</STRONG> NetBSD copied this feature of <EM>ncurses</EM> in 2001. PDCurses follows
+ the SVr4 model, deleting only the standard <EM>WINDOW</EM> structures.
+
+
+</PRE><H3><a name="h3-High-level-versus-Low-level">High-level versus Low-level</a></H3><PRE>
+ Different implementations may disagree regarding the level of some
+ functions. For example, <EM>SCREEN</EM> (returned by <STRONG>newterm</STRONG>) and <EM>TERMINAL</EM>
+ (returned by <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG>) hold file descriptors for the output
+ stream. If an application switches screens using <STRONG>set_term</STRONG>, or switches
+ terminals using <STRONG><A HREF="curs_terminfo.3x.html">set_curterm(3x)</A></STRONG>, applications which use the output file
+ descriptor can have different behavior depending on which structure
+ holds the corresponding descriptor.
+
+ For example
+
+ <STRONG>o</STRONG> NetBSD's <STRONG><A HREF="curs_termattrs.3x.html">baudrate(3x)</A></STRONG> function uses the descriptor in <EM>TERMINAL</EM>.
+ <EM>ncurses</EM> and SVr4 use the descriptor in <EM>SCREEN</EM>.