xref: /dflybsd-src/contrib/ncurses/include/nc_tparm.h (revision 0cadad7e49c6219b0de0675ef6a6f44683d177d4)
11d102085SJan Lentfer /****************************************************************************
2*32bb5217SDaniel Fojt  * Copyright 2018,2020 Thomas E. Dickey                                     *
3*32bb5217SDaniel Fojt  * Copyright 2006-2012,2017 Free Software Foundation, Inc.                  *
41d102085SJan Lentfer  *                                                                          *
51d102085SJan Lentfer  * Permission is hereby granted, free of charge, to any person obtaining a  *
61d102085SJan Lentfer  * copy of this software and associated documentation files (the            *
71d102085SJan Lentfer  * "Software"), to deal in the Software without restriction, including      *
81d102085SJan Lentfer  * without limitation the rights to use, copy, modify, merge, publish,      *
91d102085SJan Lentfer  * distribute, distribute with modifications, sublicense, and/or sell       *
101d102085SJan Lentfer  * copies of the Software, and to permit persons to whom the Software is    *
111d102085SJan Lentfer  * furnished to do so, subject to the following conditions:                 *
121d102085SJan Lentfer  *                                                                          *
131d102085SJan Lentfer  * The above copyright notice and this permission notice shall be included  *
141d102085SJan Lentfer  * in all copies or substantial portions of the Software.                   *
151d102085SJan Lentfer  *                                                                          *
161d102085SJan Lentfer  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
171d102085SJan Lentfer  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
181d102085SJan Lentfer  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
191d102085SJan Lentfer  * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
201d102085SJan Lentfer  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
211d102085SJan Lentfer  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
221d102085SJan Lentfer  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
231d102085SJan Lentfer  *                                                                          *
241d102085SJan Lentfer  * Except as contained in this notice, the name(s) of the above copyright   *
251d102085SJan Lentfer  * holders shall not be used in advertising or otherwise to promote the     *
261d102085SJan Lentfer  * sale, use or other dealings in this Software without prior written       *
271d102085SJan Lentfer  * authorization.                                                           *
281d102085SJan Lentfer  ****************************************************************************/
291d102085SJan Lentfer 
301d102085SJan Lentfer /****************************************************************************
311d102085SJan Lentfer  *  Author: Thomas E. Dickey                        2006                    *
321d102085SJan Lentfer  ****************************************************************************/
331d102085SJan Lentfer 
34*32bb5217SDaniel Fojt /* $Id: nc_tparm.h,v 1.10 2020/02/02 23:34:34 tom Exp $ */
3500d8f3c4SJohn Marino 
3600d8f3c4SJohn Marino #ifndef NC_TPARM_included
3700d8f3c4SJohn Marino #define NC_TPARM_included 1
381d102085SJan Lentfer 
39*32bb5217SDaniel Fojt #include <ncurses_cfg.h>
40*32bb5217SDaniel Fojt #include <curses.h>
41*32bb5217SDaniel Fojt 
421d102085SJan Lentfer /*
431d102085SJan Lentfer  * Cast parameters past the formatting-string for tparm() to match the
441d102085SJan Lentfer  * assumption of the varargs code.
451d102085SJan Lentfer  */
4600d8f3c4SJohn Marino #ifndef TPARM_ARG
473468e90cSJohn Marino #ifdef NCURSES_TPARM_ARG
483468e90cSJohn Marino #define TPARM_ARG NCURSES_TPARM_ARG
493468e90cSJohn Marino #else
501d102085SJan Lentfer #define TPARM_ARG long
5100d8f3c4SJohn Marino #endif
523468e90cSJohn Marino #endif /* TPARAM_ARG */
5300d8f3c4SJohn Marino 
541d102085SJan Lentfer #define TPARM_N(n) (TPARM_ARG)(n)
551d102085SJan Lentfer 
561d102085SJan Lentfer #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))
571d102085SJan Lentfer 
581d102085SJan Lentfer #if NCURSES_TPARM_VARARGS
591d102085SJan Lentfer #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))
601d102085SJan Lentfer #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))
611d102085SJan Lentfer #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))
621d102085SJan Lentfer #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))
631d102085SJan Lentfer #define TPARM_4(a,b,c,d,e) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e))
641d102085SJan Lentfer #define TPARM_3(a,b,c,d) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d))
651d102085SJan Lentfer #define TPARM_2(a,b,c) tparm(a,TPARM_N(b),TPARM_N(c))
661d102085SJan Lentfer #define TPARM_1(a,b) tparm(a,TPARM_N(b))
671d102085SJan Lentfer #define TPARM_0(a) tparm(a)
681d102085SJan Lentfer #else
691d102085SJan Lentfer #define TPARM_8(a,b,c,d,e,f,g,h,i) TPARM_9(a,b,c,d,e,f,g,h,i,0)
701d102085SJan Lentfer #define TPARM_7(a,b,c,d,e,f,g,h) TPARM_8(a,b,c,d,e,f,g,h,0)
711d102085SJan Lentfer #define TPARM_6(a,b,c,d,e,f,g) TPARM_7(a,b,c,d,e,f,g,0)
721d102085SJan Lentfer #define TPARM_5(a,b,c,d,e,f) TPARM_6(a,b,c,d,e,f,0)
731d102085SJan Lentfer #define TPARM_4(a,b,c,d,e) TPARM_5(a,b,c,d,e,0)
741d102085SJan Lentfer #define TPARM_3(a,b,c,d) TPARM_4(a,b,c,d,0)
751d102085SJan Lentfer #define TPARM_2(a,b,c) TPARM_3(a,b,c,0)
761d102085SJan Lentfer #define TPARM_1(a,b) TPARM_2(a,b,0)
771d102085SJan Lentfer #define TPARM_0(a) TPARM_1(a,0)
781d102085SJan Lentfer #endif
7900d8f3c4SJohn Marino 
8000d8f3c4SJohn Marino #endif /* NC_TPARM_included */
81