X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_data.c;h=6b2a2015e029a5f3bd0a7fcb45fb75bfc80e4e9d;hp=87d60edf6ed956064e19f441c73c91f8fc8c085b;hb=0be808514502f3149b379d036ab3a83cbb4d4c02;hpb=46722468f47c2b77b3987729b4bcf2321cccfd01 diff --git a/ncurses/tinfo/lib_data.c b/ncurses/tinfo/lib_data.c index 87d60edf..6b2a2015 100644 --- a/ncurses/tinfo/lib_data.c +++ b/ncurses/tinfo/lib_data.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,2007 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * ****************************************************************************/ /* @@ -40,18 +41,33 @@ #include -MODULE_ID("$Id: lib_data.c,v 1.16 2000/12/10 02:55:07 tom Exp $") +MODULE_ID("$Id: lib_data.c,v 1.19 2007/03/10 19:31:27 tom Exp $") /* * OS/2's native linker complains if we don't initialize public data when * constructing a dll (reported by J.J.G.Ripoll). */ -NCURSES_EXPORT_VAR(WINDOW *) -stdscr = 0; -NCURSES_EXPORT_VAR(WINDOW *) -curscr = 0; -NCURSES_EXPORT_VAR(WINDOW *) -newscr = 0; +#if USE_REENTRANT +NCURSES_EXPORT(WINDOW *) +NCURSES_PUBLIC_VAR(stdscr) (void) +{ + return SP ? SP->_stdscr : 0; +} +NCURSES_EXPORT(WINDOW *) +NCURSES_PUBLIC_VAR(curscr) (void) +{ + return SP ? SP->_curscr : 0; +} +NCURSES_EXPORT(WINDOW *) +NCURSES_PUBLIC_VAR(newscr) (void) +{ + return SP ? SP->_newscr : 0; +} +#else +NCURSES_EXPORT_VAR(WINDOW *) stdscr = 0; +NCURSES_EXPORT_VAR(WINDOW *) curscr = 0; +NCURSES_EXPORT_VAR(WINDOW *) newscr = 0; +#endif NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain = 0; @@ -66,7 +82,7 @@ NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain = 0; * module coupling that increases the size of the executable. */ #if BROKEN_LINKER - static SCREEN *my_screen; +static SCREEN *my_screen; NCURSES_EXPORT(SCREEN *) _nc_screen(void) @@ -81,11 +97,11 @@ _nc_alloc_screen(void) } NCURSES_EXPORT(void) -_nc_set_screen(SCREEN * sp) +_nc_set_screen(SCREEN *sp) { my_screen = sp; } #else -NCURSES_EXPORT_VAR(SCREEN *) SP = NULL; /* Some linkers require initialized data... */ +NCURSES_EXPORT_VAR(SCREEN *) SP = NULL; /* Some linkers require initialized data... */ #endif