xref: /freebsd/contrib/dialog/dlg_internals.h (revision a96ef4501919d7ac08e94e98dc34b0bdd744802b)
1*a96ef450SBaptiste Daroussin /*
2*a96ef450SBaptiste Daroussin  *  $Id: dlg_internals.h,v 1.3 2019/08/08 21:29:41 tom Exp $
3*a96ef450SBaptiste Daroussin  *
4*a96ef450SBaptiste Daroussin  *  dlg_internals.h -- runtime binding support for dialog
5*a96ef450SBaptiste Daroussin  *
6*a96ef450SBaptiste Daroussin  *  Copyright 2019 Thomas E.  Dickey
7*a96ef450SBaptiste Daroussin  *
8*a96ef450SBaptiste Daroussin  *  This program is free software; you can redistribute it and/or modify
9*a96ef450SBaptiste Daroussin  *  it under the terms of the GNU Lesser General Public License, version 2.1
10*a96ef450SBaptiste Daroussin  *  as published by the Free Software Foundation.
11*a96ef450SBaptiste Daroussin  *
12*a96ef450SBaptiste Daroussin  *  This program is distributed in the hope that it will be useful, but
13*a96ef450SBaptiste Daroussin  *  WITHOUT ANY WARRANTY; without even the implied warranty of
14*a96ef450SBaptiste Daroussin  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15*a96ef450SBaptiste Daroussin  *  Lesser General Public License for more details.
16*a96ef450SBaptiste Daroussin  *
17*a96ef450SBaptiste Daroussin  *  You should have received a copy of the GNU Lesser General Public
18*a96ef450SBaptiste Daroussin  *  License along with this program; if not, write to
19*a96ef450SBaptiste Daroussin  *	Free Software Foundation, Inc.
20*a96ef450SBaptiste Daroussin  *	51 Franklin St., Fifth Floor
21*a96ef450SBaptiste Daroussin  *	Boston, MA 02110, USA.
22*a96ef450SBaptiste Daroussin  */
23*a96ef450SBaptiste Daroussin 
24*a96ef450SBaptiste Daroussin #ifndef DLG_INTERNALS_H_included
25*a96ef450SBaptiste Daroussin #define DLG_INTERNALS_H_included 1
26*a96ef450SBaptiste Daroussin 
27*a96ef450SBaptiste Daroussin #include <dialog.h>
28*a96ef450SBaptiste Daroussin 
29*a96ef450SBaptiste Daroussin #define TableSize(name) (sizeof(name)/sizeof((name)[0]))
30*a96ef450SBaptiste Daroussin 
31*a96ef450SBaptiste Daroussin /* *INDENT-OFF* */
32*a96ef450SBaptiste Daroussin #define resizeit(name, NAME) \
33*a96ef450SBaptiste Daroussin 		name = ((NAME >= old_##NAME) \
34*a96ef450SBaptiste Daroussin 			? (NAME - (old_##NAME - old_##name)) \
35*a96ef450SBaptiste Daroussin 			: old_##name)
36*a96ef450SBaptiste Daroussin 
37*a96ef450SBaptiste Daroussin #define AddLastKey() \
38*a96ef450SBaptiste Daroussin 	if (dialog_vars.last_key) { \
39*a96ef450SBaptiste Daroussin 	    if (dlg_need_separator()) \
40*a96ef450SBaptiste Daroussin 		dlg_add_separator(); \
41*a96ef450SBaptiste Daroussin 	    dlg_add_last_key(-1); \
42*a96ef450SBaptiste Daroussin 	}
43*a96ef450SBaptiste Daroussin 
44*a96ef450SBaptiste Daroussin 
45*a96ef450SBaptiste Daroussin /* *INDENT-ON* */
46*a96ef450SBaptiste Daroussin 
47*a96ef450SBaptiste Daroussin #endif /* DLG_INTERNALS_H_included */
48