xref: /minix3/lib/libcurses/unctrl.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc /*	$NetBSD: unctrl.h,v 1.5 2015/05/28 06:28:37 wiz Exp $	*/
251ffecc1SBen Gras 
351ffecc1SBen Gras /*
451ffecc1SBen Gras  * Copyright (c) 1982, 1993
551ffecc1SBen Gras  *	The Regents of the University of California.  All rights reserved.
651ffecc1SBen Gras  *
751ffecc1SBen Gras  * Redistribution and use in source and binary forms, with or without
851ffecc1SBen Gras  * modification, are permitted provided that the following conditions
951ffecc1SBen Gras  * are met:
1051ffecc1SBen Gras  * 1. Redistributions of source code must retain the above copyright
1151ffecc1SBen Gras  *    notice, this list of conditions and the following disclaimer.
1251ffecc1SBen Gras  * 2. Redistributions in binary form must reproduce the above copyright
1351ffecc1SBen Gras  *    notice, this list of conditions and the following disclaimer in the
1451ffecc1SBen Gras  *    documentation and/or other materials provided with the distribution.
1551ffecc1SBen Gras  * 3. Neither the name of the University nor the names of its contributors
1651ffecc1SBen Gras  *    may be used to endorse or promote products derived from this software
1751ffecc1SBen Gras  *    without specific prior written permission.
1851ffecc1SBen Gras  *
1951ffecc1SBen Gras  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2051ffecc1SBen Gras  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2151ffecc1SBen Gras  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2251ffecc1SBen Gras  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2351ffecc1SBen Gras  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2451ffecc1SBen Gras  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2551ffecc1SBen Gras  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2651ffecc1SBen Gras  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2751ffecc1SBen Gras  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2851ffecc1SBen Gras  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2951ffecc1SBen Gras  * SUCH DAMAGE.
3051ffecc1SBen Gras  *
3151ffecc1SBen Gras  *	@(#)unctrl.h	8.1 (Berkeley) 5/31/93
3251ffecc1SBen Gras  */
3351ffecc1SBen Gras 
3451ffecc1SBen Gras #ifndef _UNCTRL_H_
3551ffecc1SBen Gras #define _UNCTRL_H_
3651ffecc1SBen Gras 
3751ffecc1SBen Gras #include <sys/cdefs.h>
3851ffecc1SBen Gras #ifdef HAVE_WCHAR
3951ffecc1SBen Gras #include <wchar.h>
4051ffecc1SBen Gras #include <curses.h>
4151ffecc1SBen Gras #endif /* HAVE_WCHAR */
4251ffecc1SBen Gras 
4351ffecc1SBen Gras __BEGIN_DECLS
4451ffecc1SBen Gras extern const char * const  __unctrl[];		/* Control strings. */
4551ffecc1SBen Gras extern const unsigned char __unctrllen[];	/* Control strings length. */
4651ffecc1SBen Gras #ifdef HAVE_WCHAR
4751ffecc1SBen Gras extern const wchar_t * const  __wunctrl[];	/* Wide char control strings. */
4851ffecc1SBen Gras #endif /* HAVE_WCHAR */
4951ffecc1SBen Gras __END_DECLS
5051ffecc1SBen Gras 
5151ffecc1SBen Gras /* 8-bit ASCII characters. */
5251ffecc1SBen Gras #define	unctrl(c)		__unctrl[((unsigned char)c) & 0xff]
5351ffecc1SBen Gras #define	unctrllen(c)	__unctrllen[((unsigned char)c) & 0xff]
5451ffecc1SBen Gras 
5551ffecc1SBen Gras #ifdef HAVE_WCHAR
56*0a6a1f1dSLionel Sambuc #define	wunctrl(wc)		__wunctrl[( int )((wc)->vals[ 0 ]) & 0xff]
5751ffecc1SBen Gras #endif /* HAVE_WCHAR */
5851ffecc1SBen Gras #endif /* _UNCTRL_H_ */
59