xref: /freebsd/contrib/bsddialog/examples_library/yesno.c (revision f499134dd403eeeba8283e2640e2654c8da62430)
1*f499134dSBaptiste Daroussin /*-
2*f499134dSBaptiste Daroussin  * SPDX-License-Identifier: CC0-1.0
3*f499134dSBaptiste Daroussin  *
4*f499134dSBaptiste Daroussin  * Written in 2021 by Alfonso Sabato Siciliano.
5*f499134dSBaptiste Daroussin  * To the extent possible under law, the author has dedicated all copyright
6*f499134dSBaptiste Daroussin  * and related and neighboring rights to this software to the public domain
7*f499134dSBaptiste Daroussin  * worldwide. This software is distributed without any warranty, see:
8*f499134dSBaptiste Daroussin  *   <http://creativecommons.org/publicdomain/zero/1.0/>.
9*f499134dSBaptiste Daroussin  */
10*f499134dSBaptiste Daroussin 
11*f499134dSBaptiste Daroussin #include <stdio.h>
12*f499134dSBaptiste Daroussin #include <string.h>
13*f499134dSBaptiste Daroussin 
14*f499134dSBaptiste Daroussin #include <bsddialog.h>
15*f499134dSBaptiste Daroussin 
16*f499134dSBaptiste Daroussin int main()
17*f499134dSBaptiste Daroussin {
18*f499134dSBaptiste Daroussin 	int output;
19*f499134dSBaptiste Daroussin 	struct bsddialog_conf conf;
20*f499134dSBaptiste Daroussin 
21*f499134dSBaptiste Daroussin 	bsddialog_initconf(&conf);
22*f499134dSBaptiste Daroussin 	conf.title = "yesno";
23*f499134dSBaptiste Daroussin 
24*f499134dSBaptiste Daroussin 	if (bsddialog_init() < 0)
25*f499134dSBaptiste Daroussin 		return -1;
26*f499134dSBaptiste Daroussin 
27*f499134dSBaptiste Daroussin 	output = bsddialog_yesno(&conf, "Example", 7, 25);
28*f499134dSBaptiste Daroussin 
29*f499134dSBaptiste Daroussin 	bsddialog_end();
30*f499134dSBaptiste Daroussin 
31*f499134dSBaptiste Daroussin 	return output;
32*f499134dSBaptiste Daroussin }
33