1174993Srafan/****************************************************************************
2176187Srafan * Copyright (c) 2007,2008 Free Software Foundation, Inc.                   *
3174993Srafan *                                                                          *
4174993Srafan * Permission is hereby granted, free of charge, to any person obtaining a  *
5174993Srafan * copy of this software and associated documentation files (the            *
6174993Srafan * "Software"), to deal in the Software without restriction, including      *
7174993Srafan * without limitation the rights to use, copy, modify, merge, publish,      *
8174993Srafan * distribute, distribute with modifications, sublicense, and/or sell       *
9174993Srafan * copies of the Software, and to permit persons to whom the Software is    *
10174993Srafan * furnished to do so, subject to the following conditions:                 *
11174993Srafan *                                                                          *
12174993Srafan * The above copyright notice and this permission notice shall be included  *
13174993Srafan * in all copies or substantial portions of the Software.                   *
14174993Srafan *                                                                          *
15174993Srafan * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16174993Srafan * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17174993Srafan * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18174993Srafan * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19174993Srafan * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20174993Srafan * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21174993Srafan * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22174993Srafan *                                                                          *
23174993Srafan * Except as contained in this notice, the name(s) of the above copyright   *
24174993Srafan * holders shall not be used in advertising or otherwise to promote the     *
25174993Srafan * sale, use or other dealings in this Software without prior written       *
26174993Srafan * authorization.                                                           *
27174993Srafan ****************************************************************************/
28174993Srafan
29174993Srafan/****************************************************************************
30174993Srafan *     Author: Thomas E. Dickey                        2007                 *
31174993Srafan ****************************************************************************/
32174993Srafan
33174993Srafan#include <curses.priv.h>
34174993Srafan
35184989SrafanMODULE_ID("$Id: use_window.c,v 1.8 2008/06/07 14:13:46 tom Exp $")
36174993Srafan
37174993SrafanNCURSES_EXPORT(int)
38178866Srafanuse_window(WINDOW *win, NCURSES_WINDOW_CB func, void *data)
39174993Srafan{
40174993Srafan    int code = OK;
41174993Srafan
42174993Srafan    T((T_CALLED("use_window(%p,%p,%p)"), win, func, data));
43184989Srafan    _nc_lock_global(curses);
44174993Srafan    code = func(win, data);
45184989Srafan    _nc_unlock_global(curses);
46174993Srafan
47174993Srafan    returnCode(code);
48174993Srafan}
49