bsddialog.h (b319d934379f5b819cd195be7e03dbd407566fd4) bsddialog.h (84823cc70824c8d842f503d8c2e6d7b0c2d95b61)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause
3 *
4 * Copyright (c) 2021-2022 Alfonso Sabato Siciliano
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 16 unchanged lines hidden (view full) ---

25 * SUCH DAMAGE.
26 */
27
28#ifndef _LIBBSDDIALOG_H_
29#define _LIBBSDDIALOG_H_
30
31#include <stdbool.h>
32
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause
3 *
4 * Copyright (c) 2021-2022 Alfonso Sabato Siciliano
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 16 unchanged lines hidden (view full) ---

25 * SUCH DAMAGE.
26 */
27
28#ifndef _LIBBSDDIALOG_H_
29#define _LIBBSDDIALOG_H_
30
31#include <stdbool.h>
32
33#define LIBBSDDIALOG_VERSION "0.3"
33#define LIBBSDDIALOG_VERSION "0.4"
34
35/* Exit status */
36#define BSDDIALOG_ERROR -1
37#define BSDDIALOG_OK 0
38#define BSDDIALOG_YES BSDDIALOG_OK
39#define BSDDIALOG_CANCEL 1
40#define BSDDIALOG_NO BSDDIALOG_CANCEL
41#define BSDDIALOG_HELP 2

--- 89 unchanged lines hidden (view full) ---

131 const char *prefix;
132 bool on;
133 unsigned int depth;
134 const char *name;
135 const char *desc;
136 const char *bottomdesc;
137};
138
34
35/* Exit status */
36#define BSDDIALOG_ERROR -1
37#define BSDDIALOG_OK 0
38#define BSDDIALOG_YES BSDDIALOG_OK
39#define BSDDIALOG_CANCEL 1
40#define BSDDIALOG_NO BSDDIALOG_CANCEL
41#define BSDDIALOG_HELP 2

--- 89 unchanged lines hidden (view full) ---

131 const char *prefix;
132 bool on;
133 unsigned int depth;
134 const char *name;
135 const char *desc;
136 const char *bottomdesc;
137};
138
139enum bsddialog_grouptype {
139enum bsddialog_menutype {
140 BSDDIALOG_CHECKLIST,
141 BSDDIALOG_RADIOLIST,
142 BSDDIALOG_SEPARATOR,
143};
144
145struct bsddialog_menugroup {
140 BSDDIALOG_CHECKLIST,
141 BSDDIALOG_RADIOLIST,
142 BSDDIALOG_SEPARATOR,
143};
144
145struct bsddialog_menugroup {
146 enum bsddialog_grouptype type;
146 enum bsddialog_menutype type;
147 unsigned int nitems;
148 struct bsddialog_menuitem *items;
149};
150
151struct bsddialog_formitem {
152 const char *label;
153 unsigned int ylabel;
154 unsigned int xlabel;

--- 14 unchanged lines hidden (view full) ---

169int bsddialog_end(void);
170int bsddialog_backtitle(struct bsddialog_conf *conf, const char *backtitle);
171int bsddialog_initconf(struct bsddialog_conf *conf);
172int bsddialog_clearterminal(void);
173const char *bsddialog_geterror(void);
174
175/* Dialogs */
176int
147 unsigned int nitems;
148 struct bsddialog_menuitem *items;
149};
150
151struct bsddialog_formitem {
152 const char *label;
153 unsigned int ylabel;
154 unsigned int xlabel;

--- 14 unchanged lines hidden (view full) ---

169int bsddialog_end(void);
170int bsddialog_backtitle(struct bsddialog_conf *conf, const char *backtitle);
171int bsddialog_initconf(struct bsddialog_conf *conf);
172int bsddialog_clearterminal(void);
173const char *bsddialog_geterror(void);
174
175/* Dialogs */
176int
177bsddialog_calendar(struct bsddialog_conf *conf, const char *text, int rows,
178 int cols, unsigned int *yy, unsigned int *mm, unsigned int *dd);
179
180int
177bsddialog_checklist(struct bsddialog_conf *conf, const char *text, int rows,
178 int cols, unsigned int menurows, unsigned int nitems,
179 struct bsddialog_menuitem *items, int *focusitem);
180
181int
182bsddialog_datebox(struct bsddialog_conf *conf, const char *text, int rows,
183 int cols, unsigned int *yy, unsigned int *mm, unsigned int *dd);
184

--- 58 unchanged lines hidden ---
181bsddialog_checklist(struct bsddialog_conf *conf, const char *text, int rows,
182 int cols, unsigned int menurows, unsigned int nitems,
183 struct bsddialog_menuitem *items, int *focusitem);
184
185int
186bsddialog_datebox(struct bsddialog_conf *conf, const char *text, int rows,
187 int cols, unsigned int *yy, unsigned int *mm, unsigned int *dd);
188

--- 58 unchanged lines hidden ---