* Update to packages/alpine.spec to account for the new location of man
[alpine.git] / alpine / conftype.h
blob34bf220811bd83baaf6d1ef8f9ace96ac4dd7a07
1 /*
2 * $Id: conftype.h 1012 2008-03-26 00:44:22Z hubert@u.washington.edu $
4 * ========================================================================
5 * Copyright 2006-2008 University of Washington
6 * Copyright 2013-2017 Eduardo Chappa
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_CONFTYPE_INCLUDED
18 #define PINE_CONFTYPE_INCLUDED
21 #include "keymenu.h"
22 #include "help.h"
23 #include "flagmaint.h"
24 #include "context.h"
25 #include "listsel.h"
26 #include "../pith/pattern.h"
27 #include "../pith/conf.h"
28 #include "../pith/ldap.h"
31 typedef enum {ListMode, SingleMode} ScreenMode;
34 typedef struct edit_arb {
35 struct variable *v;
36 ARBHDR_S *a;
37 struct edit_arb *next;
38 } EARB_S;
41 typedef struct conf_line {
42 char *varname, /* alloc'd var name string */
43 *value; /* alloc'd var value string */
44 short varoffset; /* offset from screen left */
45 short valoffset; /* offset from screen left */
46 short val2offset; /* offset from screen left */
47 struct variable *var; /* pointer to pinerc var */
48 long varmem; /* value's index, if list */
49 /* tool to manipulate values */
50 int (*tool)(struct pine *, int, struct conf_line **, unsigned);
51 struct key_menu *keymenu; /* tool-specific keymenu */
52 HelpType help; /* variable's help text */
53 char *help_title;
54 unsigned flags;
55 struct conf_line *varnamep; /* pointer to varname */
56 struct conf_line *headingp; /* pointer to heading */
57 struct conf_line *next, *prev;
58 union flag_or_context_data {
59 struct flag_conf {
60 struct flag_table **ftbl; /* address of start of table */
61 struct flag_table *fp; /* pointer into table for each row */
62 } f;
63 #ifdef SMIME
64 struct smime_data {
65 WhichCerts ctype;
66 int deleted;
67 char address[MAILTMPLEN];
68 } s;
69 #endif /* SMIME */
70 struct context_and_screen {
71 CONTEXT_S *ct;
72 CONT_SCR_S *cs;
73 } c;
74 struct role_conf {
75 PAT_LINE_S *patline;
76 PAT_S *pat;
77 PAT_S **selected;
78 int *change_def;
79 } r;
80 struct abook_conf {
81 char **selected;
82 char *abookname;
83 } b;
84 EARB_S **earb;
85 struct list_select {
86 LIST_SEL_S *lsel;
87 ScreenMode *listmode;
88 } l;
89 #ifdef ENABLE_LDAP
90 struct entry_and_screen {
91 LDAP *ld;
92 LDAPMessage *entry;
93 LDAP_SERV_S *info_used;
94 char *serv;
95 ADDR_CHOOSE_S *ac;
96 } a;
97 #endif
98 struct take_export_val {
99 int selected;
100 char *exportval;
101 ScreenMode *listmode;
102 } t;
103 } d;
104 } CONF_S;
108 * Valid for flags argument of config screen tools or flags field in CONF_S
110 #define CF_CHANGES 0x0001 /* Have been earlier changes */
111 #define CF_NOSELECT 0x0002 /* This line is unselectable */
112 #define CF_NOHILITE 0x0004 /* Don't highlight varname */
113 #define CF_NUMBER 0x0008 /* Input should be numeric */
114 #define CF_INVISIBLEVAR 0x0010 /* Don't show the varname */
115 #define CF_PRINTER 0x0020 /* Printer config line */
116 #define CF_H_LINE 0x0040 /* Horizontal line */
117 #define CF_B_LINE 0x0080 /* Blank line */
118 #define CF_CENTERED 0x0100 /* Centered text */
119 #define CF_STARTITEM 0x0200 /* Start of an "item" */
120 #define CF_PRIVATE 0x0400 /* Private flag for tool */
121 #define CF_DOUBLEVAR 0x0800 /* Line has 2 settable vars */
122 #define CF_VAR2 0x1000 /* Cursor on 2nd of 2 vars */
123 #define CF_COLORSAMPLE 0x2000 /* Show color sample here */
124 #define CF_POT_SLCTBL 0x4000 /* Potentially selectable */
125 #define CF_INHERIT 0x8000 /* Inherit Defaults line */
128 typedef struct save_config {
129 union {
130 char *p;
131 char **l;
132 } saved_user_val;
133 } SAVED_CONFIG_S;
136 typedef struct conf_screen {
137 CONF_S *current,
138 *prev,
139 *top_line;
140 int ro_warning,
141 deferred_ro_warning;
142 } OPT_SCREEN_S;
145 /* exported protoypes */
148 #endif /* PINE_CONFTYPE_INCLUDED */