lib_wunctrl.c revision 166124
197049Speter/**************************************************************************** 2166124Srafan * Copyright (c) 2001-2003,2005 Free Software Foundation, Inc. * 397049Speter * * 497049Speter * Permission is hereby granted, free of charge, to any person obtaining a * 597049Speter * copy of this software and associated documentation files (the * 697049Speter * "Software"), to deal in the Software without restriction, including * 797049Speter * without limitation the rights to use, copy, modify, merge, publish, * 897049Speter * distribute, distribute with modifications, sublicense, and/or sell * 997049Speter * copies of the Software, and to permit persons to whom the Software is * 1097049Speter * furnished to do so, subject to the following conditions: * 1197049Speter * * 1297049Speter * The above copyright notice and this permission notice shall be included * 1397049Speter * in all copies or substantial portions of the Software. * 1497049Speter * * 1597049Speter * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 1697049Speter * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 1797049Speter * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 1897049Speter * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 1997049Speter * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 2097049Speter * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 2197049Speter * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 2297049Speter * * 2397049Speter * Except as contained in this notice, the name(s) of the above copyright * 2497049Speter * holders shall not be used in advertising or otherwise to promote the * 2597049Speter * sale, use or other dealings in this Software without prior written * 2697049Speter * authorization. * 2797049Speter ****************************************************************************/ 2897049Speter 2997049Speter/* 3097049Speter** lib_wunctrl.c 3197049Speter** 3297049Speter** The routine wunctrl(). 3397049Speter** 3497049Speter*/ 3597049Speter 3697049Speter#include <curses.priv.h> 3797049Speter 3897049Speter#if USE_WIDEC_SUPPORT 3997049Speter 40166124SrafanMODULE_ID("$Id: lib_wunctrl.c,v 1.8 2005/04/16 18:10:44 tom Exp $") 4197049Speter 4297049SpeterNCURSES_EXPORT(wchar_t *) 43166124Srafanwunctrl(cchar_t *wc) 4497049Speter{ 4597049Speter static wchar_t str[5], *sp; 4697049Speter 4797049Speter if (Charable(*wc)) { 48166124Srafan const char *p = unctrl((unsigned) _nc_to_char((wint_t) CharOf(*wc))); 49166124Srafan 50166124Srafan for (sp = str; *p;) 51166124Srafan *sp++ = _nc_to_widechar(*p++); 5297049Speter return str; 5397049Speter } else 5497049Speter return wc->chars; 5597049Speter} 5697049Speter 5797049Speter#endif 58