2 * SPDX-License-Identifier: CC0-1.0
4 * Written in 2021 by Alfonso Sabato Siciliano.
5 * To the extent possible under law, the author has dedicated all copyright
6 * and related and neighboring rights to this software to the public domain
7 * worldwide. This software is distributed without any warranty, see:
8 * <http://creativecommons.org/publicdomain/zero/1.0/>.
11 #include <bsddialog.h>
18 unsigned int yy, mm, dd;
19 struct bsddialog_conf conf;
24 localtm = localtime(&cal);
25 yy = localtm->tm_year + 1900;
26 mm = localtm->tm_mon + 1;
27 dd = localtm->tm_mday;
29 if (bsddialog_init() == BSDDIALOG_ERROR) {
30 printf("Error: %s\n", bsddialog_geterror());
33 bsddialog_initconf(&conf);
34 conf.title = "datebox";
35 output = bsddialog_datebox(&conf, "Example", 9, 35, &yy, &mm, &dd);
37 if (output == BSDDIALOG_ERROR) {
38 printf("Error: %s\n", bsddialog_geterror());
41 printf("Date: %u/%u/%u\n", yy, mm, dd);