2 /***************************************************************************
4 ****************************************************************************
5 * ncurses is copyright (C) 1992-1995 *
7 * zmbenhal@netcom.com *
9 * esr@snark.thyrsus.com *
11 * Permission is hereby granted to reproduce and distribute ncurses *
12 * by any means and for any fee, whether alone or as part of a *
13 * larger distribution, in source or in binary form, PROVIDED *
14 * this notice is included with any such distribution, and is not *
15 * removed from any of its header files. Mention of ncurses in any *
16 * applications linked with it is highly appreciated. *
18 * ncurses comes AS IS with no warranty, implied or expressed. *
20 ***************************************************************************/
25 ** Common data that may/may not be allocated, but is referenced globally
29 #include <curses.priv.h>
31 MODULE_ID("$Id: lib_data.c,v 1.8 1997/01/18 23:02:54 tom Exp $")
33 WINDOW *stdscr, *curscr, *newscr;
36 * Linked-list of all windows, to support '_nc_resizeall()' and '_nc_freeall()'
38 WINDOWLIST *_nc_windows;
41 * These data correspond to the state of the idcok() and idlok() functions. A
42 * caveat is in order here: the XSI and SVr4 documentation specify that these
43 * functions apply to the window which is given as an argument. However,
44 * ncurses implements this logic only for the newscr/curscr update process,
47 bool _nc_idcok = TRUE;
48 bool _nc_idlok = FALSE;
51 * The variable 'SP' will be defined as a function on systems that cannot link
52 * data-only modules, since it is used in a lot of places within ncurses and we
53 * cannot guarantee that any application will use any particular function. We
54 * put the WINDOW variables in this module, because it appears that any
55 * application that uses them will also use 'SP'.
57 * This module intentionally does not reference other ncurses modules, to avoid
58 * module coupling that increases the size of the executable.
61 static SCREEN *my_screen;
63 SCREEN *_nc_screen(void)
68 int _nc_alloc_screen(void)
70 return ((my_screen = typeCalloc(SCREEN, 1)) != 0);
73 void _nc_set_screen(SCREEN *sp)