* Changes to make Valgrind happy. Work in progress.
[alpine.git] / alpine / radio.h
blobd0be16031957a5e089f4cf0cbea27a0291c90dc1
1 /*
2 * $Id: radio.h 1025 2008-04-08 22:59:38Z hubert@u.washington.edu $
4 * ========================================================================
5 * Copyright 2013-2018 Eduardo Chappa
6 * Copyright 2006-2008 University of Washington
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * ========================================================================
17 #ifndef PINE_RADIO_INCLUDED
18 #define PINE_RADIO_INCLUDED
20 #include "../pith/helptext.h"
22 #include "help.h"
25 /*
26 * For optionally_enter and radio_buttons, special meanings for keys.
28 typedef struct esckey {
29 long ch; /* holds all UCS values plus -1 and -2 */
30 int rval; /* return value */
31 char *name; /* short name */
32 char *label; /* long descriptive key name */
33 } ESCKEY_S;
37 * Minimum space needed after the prompt for optionally_enter() to work well.
38 * If the available width after the prompt is smaller than this then the prompt will
39 * have the leading edge cut off by optionally_enter.
40 * (note: used to be 5)
42 #define MIN_OPT_ENT_WIDTH (7)
44 /* max length prompt for optionally_enter and want_to */
45 #define MAXPROMPT (ps_global->ttyo->screen_cols - MIN_OPT_ENT_WIDTH)
48 #define SEQ_EXCEPTION (-3) /* returned when seq # change and no
49 on_ctrl_C available. */
50 #define RB_NORM 0x00 /* flags modifying radio_buttons */
51 #define RB_ONE_TRY 0x01 /* one shot answer, else default */
52 #define RB_FLUSH_IN 0x02 /* discard pending input */
53 #define RB_NO_NEWMAIL 0x04 /* Quell new mail check */
54 #define RB_SEQ_SENSITIVE 0x08 /* Sensitive to seq # changes */
55 #define RB_RET_HELP 0x10 /* Return when help key pressed */
58 #define OE_NONE 0x00 /* optionally_enter flags */
59 #define OE_DISALLOW_CANCEL 0x01 /* Turn off Cancel menu item */
60 #define OE_DISALLOW_HELP 0x02 /* Turn off Help menu item */
61 #define OE_USER_MODIFIED 0x08 /* set on return if user input */
62 #define OE_KEEP_TRAILING_SPACE 0x10 /* Allow trailing white-space */
63 #define OE_SEQ_SENSITIVE 0x20 /* Sensitive to seq # changes */
64 #define OE_APPEND_CURRENT 0x40 /* append, don't truncate */
65 #define OE_PASSWD 0x80 /* Use asterisks to echo input */
66 #define OE_PASSWD_NOAST 0x100 /* Don't echo user input at all */
68 #define WT_NORM 0x00 /* flags modifying want_to */
69 #define WT_FLUSH_IN 0x01 /* discard pending input */
70 #define WT_SEQ_SENSITIVE 0x02 /* Sensitive to seq # changes */
73 /* exported protoypes */
74 int want_to(char *, int, int, HelpType, int);
75 int one_try_want_to(char *, int, int, HelpType, int);
76 int radio_buttons(char *, int, ESCKEY_S *, int, int, HelpType, int);
77 int double_radio_buttons(char *, int, ESCKEY_S *, int, int, HelpType, int);
81 #endif /* PINE_RADIO_INCLUDED */