xref: /openbsd/lib/libcurses/nc_tparm.h (revision 3d8817e4)
1 /* $OpenBSD: nc_tparm.h,v 1.1 2010/01/12 23:21:59 nicm Exp $ */
2 
3 /****************************************************************************
4  * Copyright (c) 2006 Free Software Foundation, Inc.                        *
5  *                                                                          *
6  * Permission is hereby granted, free of charge, to any person obtaining a  *
7  * copy of this software and associated documentation files (the            *
8  * "Software"), to deal in the Software without restriction, including      *
9  * without limitation the rights to use, copy, modify, merge, publish,      *
10  * distribute, distribute with modifications, sublicense, and/or sell       *
11  * copies of the Software, and to permit persons to whom the Software is    *
12  * furnished to do so, subject to the following conditions:                 *
13  *                                                                          *
14  * The above copyright notice and this permission notice shall be included  *
15  * in all copies or substantial portions of the Software.                   *
16  *                                                                          *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
18  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
20  * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
21  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
22  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
23  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
24  *                                                                          *
25  * Except as contained in this notice, the name(s) of the above copyright   *
26  * holders shall not be used in advertising or otherwise to promote the     *
27  * sale, use or other dealings in this Software without prior written       *
28  * authorization.                                                           *
29  ****************************************************************************/
30 
31 /****************************************************************************
32  *  Author: Thomas E. Dickey                        2006                    *
33  ****************************************************************************/
34 
35 /* $Id: nc_tparm.h,v 1.1 2010/01/12 23:21:59 nicm Exp $ */
36 
37 /*
38  * Cast parameters past the formatting-string for tparm() to match the
39  * assumption of the varargs code.
40  */
41 #define TPARM_ARG long
42 #define TPARM_N(n) (TPARM_ARG)(n)
43 
44 #define TPARM_9(a,b,c,d,e,f,g,h,i,j) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i),TPARM_N(j))
45 
46 #if NCURSES_TPARM_VARARGS
47 #define TPARM_8(a,b,c,d,e,f,g,h,i) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i))
48 #define TPARM_7(a,b,c,d,e,f,g,h) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h))
49 #define TPARM_6(a,b,c,d,e,f,g) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g))
50 #define TPARM_5(a,b,c,d,e,f) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f))
51 #define TPARM_4(a,b,c,d,e) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e))
52 #define TPARM_3(a,b,c,d) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d))
53 #define TPARM_2(a,b,c) tparm(a,TPARM_N(b),TPARM_N(c))
54 #define TPARM_1(a,b) tparm(a,TPARM_N(b))
55 #define TPARM_0(a) tparm(a)
56 #else
57 #define TPARM_8(a,b,c,d,e,f,g,h,i) TPARM_9(a,b,c,d,e,f,g,h,i,0)
58 #define TPARM_7(a,b,c,d,e,f,g,h) TPARM_8(a,b,c,d,e,f,g,h,0)
59 #define TPARM_6(a,b,c,d,e,f,g) TPARM_7(a,b,c,d,e,f,g,0)
60 #define TPARM_5(a,b,c,d,e,f) TPARM_6(a,b,c,d,e,f,0)
61 #define TPARM_4(a,b,c,d,e) TPARM_5(a,b,c,d,e,0)
62 #define TPARM_3(a,b,c,d) TPARM_4(a,b,c,d,0)
63 #define TPARM_2(a,b,c) TPARM_3(a,b,c,0)
64 #define TPARM_1(a,b) TPARM_2(a,b,0)
65 #define TPARM_1(a,b) TPARM_2(a,b,0)
66 #define TPARM_0(a) TPARM_1(a,0)
67 #endif
68