1 
2 /* @(#)$Id: save_opts.h,v 1.11 1996/08/08 19:49:19 wfp5p Exp $ */
3 
4 /*******************************************************************************
5  *  The Elm Mail System  -  $Revision: 1.11 $   $State: Exp $
6  *
7  *                      Copyright (c) 1988-1995 USENET Community Trust
8  * 			Copyright (c) 1986,1987 Dave Taylor
9  *******************************************************************************
10  * Bug reports, patches, comments, suggestions should be sent to:
11  *
12  *      Bill Pemberton, Elm Coordinator
13  *      flash@virginia.edu
14  *
15  *******************************************************************************
16  * $Log: save_opts.h,v $
17  * Revision 1.11  1996/08/08  19:49:19  wfp5p
18  * Alpha 11
19  *
20  * Revision 1.10  1996/05/09  15:51:05  wfp5p
21  * Alpha 10
22  *
23  * Revision 1.9  1996/03/14  17:27:32  wfp5p
24  * Alpha 9
25  *
26  * Revision 1.8  1995/09/29  17:40:58  wfp5p
27  * Alpha 8 (Chip's big changes)
28  *
29  * Revision 1.7  1995/09/11  15:18:50  wfp5p
30  * Alpha 7
31  *
32  * Revision 1.6  1995/07/18  18:59:48  wfp5p
33  * Alpha 6
34  *
35  * Revision 1.5  1995/06/30  14:56:21  wfp5p
36  * Alpha 5
37  *
38  * Revision 1.4  1995/06/21  15:26:37  wfp5p
39  * editflush and confirmtagsave are new in the elmrc (Keith Neufeld)
40  *
41  * Revision 1.3  1995/05/10  13:34:31  wfp5p
42  * Added mailing list stuff by Paul Close <pdc@sgi.com>
43  * And NetBSD stuff.
44  *
45  * Revision 1.2  1995/04/20  21:01:13  wfp5p
46  * Removed filter
47  *
48  * Revision 1.1.1.1  1995/04/19  20:38:31  wfp5p
49  * Initial import of elm 2.4 PL0 as base for elm 2.5.
50  *
51  ******************************************************************************/
52 
53 /*
54  *	Defines for the storage of options portion of the Elm system.
55  */
56 
57 typedef struct {
58     char letter;		/* menu letter on options screen */
59     char *menu;			/* menu prompt */
60     int  menu_msg;		/* NLS message number of menu prompt */
61     char *parm;			/* parameter to modify */
62     int  (*post)();		/* post processing function */
63     char *one_liner;		/* one line help message */
64     int  one_liner_msg;		/* NLS message number of one line help mssg */
65 } opts_menu;
66 
67 #define DT_SYN		0	/* synonym entry (old name) */
68 #define DT_STR		1	/* string */
69 #define DT_NUM		2	/* number */
70 #define DT_BOL		3	/* ON/OFF (boolean) */
71 #define DT_CHR		4	/* character */
72 #define DT_WEE		5	/* weed list */
73 #define DT_ALT		6	/* alternate addresses list */
74 #define DT_SRT		7	/* sort-by code */
75 #define DT_MLT		8	/* multiple destinations for data */
76 #define DT_ASR		9	/* sort-by code */
77 #define DT_NOP		10	/* obsolete - ignored for back-compatibility */
78 #define DT_INC          11      /* incoming folder list */
79 #define DT_MASK		037	/* mask for data type */
80 #define FL_LOCAL	(1<<5)	/* flag if changed */
81 #define FL_NOSPC	(1<<6)	/* flag if preserve blanks as "_" */
82 #define FL_SYS		(1<<7)	/* flag if only valid in system RC */
83 #define FL_OR 		(1<<8)	/* flag if boolean value may have been set */
84 #define FL_AND		(1<<9)	/* flag if boolean value may have been unset */
85 
86 typedef struct {
87 	char name[NLEN];	/* name of configuration setting*/
88         int flags;		/* DT_STR, DT_NUM, DT_BOL, etc	*/
89 	malloc_t val;		/* pointer to setting value	*/
90 } save_info_recs;
91 
92 #define SAVE_INFO(x, type)	((type)(save_info[x].val))
93 #define SAVE_INFO_STR(x)	SAVE_INFO((x), char *)
94 #define SAVE_INFO_NUM(x)	SAVE_INFO((x), int *)
95 #define SAVE_INFO_BOL(x)	SAVE_INFO((x), int *)
96 #define SAVE_INFO_CHR(x)	SAVE_INFO((x), char *)
97 #define SAVE_INFO_WEE(x)	SAVE_INFO((x), char **)
98 #define SAVE_INFO_ALT(x)	SAVE_INFO((x), struct addr_rec **)
99 #define SAVE_INFO_SRT(x)	SAVE_INFO((x), int *)
100 #define SAVE_INFO_ASR(x)	SAVE_INFO((x), int *)
101 #define SAVE_INFO_SYN(x)	SAVE_INFO((x), char *)
102 #define SAVE_INFO_MLT(x)	SAVE_INFO((x), char **)
103 
104 #ifdef SO_INTERN /*{*/
105 
106 /* "lists" for DT_MLT.  These and DT_SYN could be eliminated if support
107    of the old parameter names was dropped.
108 */
109 char *ALWAYSLEAVE[]={"alwayskeep","!alwaysstore",NULL};
110 char *ASK[]={"askdelete","askkeep","askstore",NULL};
111 char *AUTOCOPY[]={"!askreplycopy","replycopy",NULL};
112 char *SIGS[]={"remotesignature","localsignature",NULL};
113 
114 /*
115  * This list *MUST* be sorted in alphabetical order by configuration
116  * option name.  That's because the option-writing routine does a
117  * binary search to locate options in the list.
118  */
119 
120 save_info_recs save_info_data[] = {
121 
122 {"aliassortby",		DT_ASR,		(malloc_t)&alias_sortby},
123 {"allow_setuid",	DT_BOL|FL_SYS,	(malloc_t)&allow_setuid},
124 {"alteditor",		DT_STR,		(malloc_t)alternative_editor},
125 {"alternatives",	DT_ALT,		(malloc_t)&alternative_addresses},
126 {"alwaysdelete",	DT_BOL,		(malloc_t)&always_delete},
127 {"alwayskeep",		DT_BOL,		(malloc_t)&always_keep},
128 {"alwaysleave",		DT_MLT,		(malloc_t)ALWAYSLEAVE},
129 {"alwaysstore",		DT_BOL,		(malloc_t)&always_store},
130 {"arrow",		DT_BOL|FL_OR,	(malloc_t)&arrow_cursor},
131 {"ask",			DT_MLT,		(malloc_t)ASK},
132 {"askcc",		DT_BOL,		(malloc_t)&prompt_for_cc},
133 {"askdelete",		DT_BOL,		(malloc_t)&ask_delete},
134 {"askkeep",		DT_BOL,		(malloc_t)&ask_keep},
135 {"askreplycopy",	DT_BOL,		(malloc_t)&ask_reply_copy},
136 {"askstore",		DT_BOL,		(malloc_t)&ask_store},
137 {"attribution",		DT_STR,		(malloc_t)attribution},
138 {"auto_cc",		DT_SYN,		(malloc_t)"copy"},
139 {"autocopy",		DT_MLT,		(malloc_t)AUTOCOPY},
140 {"bounce",		DT_SYN,		(malloc_t)"bounceback"},
141 {"bounceback",		DT_NUM,		(malloc_t)&bounceback},
142 {"builtinlines",	DT_NUM,		(malloc_t)&builtin_lines},
143 {"calendar",		DT_STR,		(malloc_t)raw_calendar_file},
144 {"cc",			DT_SYN,		(malloc_t)"askcc"},
145 {"charset",		DT_STR,		(malloc_t)charset},
146 {"compatcharsets",	DT_STR,		(malloc_t)charset_compatlist},
147 {"configoptions",	DT_STR,		(malloc_t)config_options},
148 {"confirmappend",	DT_BOL,		(malloc_t)&confirm_append},
149 {"confirmcreate",	DT_BOL,		(malloc_t)&confirm_create},
150 {"confirmfiles",	DT_BOL,		(malloc_t)&confirm_files},
151 {"confirmfolders",	DT_BOL,		(malloc_t)&confirm_folders},
152 {"confirmtagsave",	DT_BOL,		(malloc_t)&confirm_tag_save},
153 {"copy",		DT_BOL,		(malloc_t)&auto_cc},
154 {"delete",		DT_SYN,		(malloc_t)"alwaysdelete"},
155 {"displaycharset",	DT_STR,		(malloc_t)display_charset},
156 {"easyeditor",		DT_STR,		(malloc_t)e_editor},
157 {"editflush",		DT_BOL,		(malloc_t)&edit_flush},
158 {"editor",		DT_STR,		(malloc_t)raw_editor},
159 {"escape",		DT_CHR,		(malloc_t)&escape_char},
160 {"folders",		DT_SYN,		(malloc_t)"maildir"},
161 {"forcename",		DT_BOL,		(malloc_t)&force_name},
162 {"form",		DT_SYN,		(malloc_t)"forms"},
163 {"forms",		DT_BOL,		(malloc_t)&allow_forms},
164 {"fullname",		DT_STR,		(malloc_t)user_fullname},
165 {"fwdattribution",	DT_STR,		(malloc_t)fwdattribution},
166 {"hostdomain",		DT_STR|FL_SYS,	(malloc_t)host_domain},
167 {"hostfullname",	DT_STR|FL_SYS,	(malloc_t)host_fullname},
168 {"hostname",		DT_STR|FL_SYS,	(malloc_t)host_name},
169 {"hpkeypad",		DT_NOP,		(malloc_t)NULL},
170 {"hpsoftkeys",		DT_SYN,		(malloc_t)"softkeys"},
171 {"incomingfolders",     DT_INC,         (malloc_t)magiclist},
172 {"keep",		DT_SYN,		(malloc_t)"keepempty"},
173 {"keepempty",		DT_BOL,		(malloc_t)&keep_empty_files},
174 {"keypad",		DT_NOP,		(malloc_t)NULL},
175 {"localsignature",	DT_STR,		(malloc_t)raw_local_signature},
176 {"mailbox",		DT_SYN,		(malloc_t)"receivedmail"},
177 {"maildir",		DT_STR,		(malloc_t)raw_folders},
178 {"mailedit",		DT_SYN,		(malloc_t)"editor"},
179 {"menu",		DT_BOL|FL_AND,	(malloc_t)&mini_menu},
180 {"menus",		DT_SYN,		(malloc_t)"menu"},
181 {"metoo",		DT_BOL,		(malloc_t)&metoo},
182 {"movepage",		DT_BOL,		(malloc_t)&move_when_paged},
183 {"movewhenpaged",	DT_SYN,		(malloc_t)"movepage"},
184 {"name",		DT_SYN,		(malloc_t)"fullname"},
185 {"names",		DT_BOL,		(malloc_t)&names_only},
186 {"noheader",		DT_BOL,		(malloc_t)&noheader},
187 {"page",		DT_SYN,		(malloc_t)"pager"},
188 {"pager",		DT_STR,		(malloc_t)raw_pager},
189 {"pointnew",		DT_BOL,		(malloc_t)&point_to_new},
190 {"pointtonew",		DT_SYN,		(malloc_t)"pointnew"},
191 {"precedences",		DT_STR,		(malloc_t)allowed_precedences},
192 {"prefix",		DT_STR|FL_NOSPC, (malloc_t)prefixchars},
193 {"print",		DT_STR,		(malloc_t)raw_printout},
194 {"printhdrs",		DT_STR,		(malloc_t)printhdrs},
195 {"printmail",		DT_SYN,		(malloc_t)"print"},
196 {"promptafter",		DT_BOL,		(malloc_t)&prompt_after_pager},
197 {"question",		DT_SYN,		(malloc_t)"ask"},
198 {"readmsginc",		DT_NUM,		(malloc_t)&readmsginc},
199 {"receivedmail",	DT_STR,		(malloc_t)raw_recvdmail},
200 {"remotesignature",	DT_STR,		(malloc_t)raw_remote_signature},
201 {"replycopy",		DT_BOL,		(malloc_t)&reply_copy},
202 {"resolve",		DT_BOL,		(malloc_t)&resolve_mode},
203 {"savebyalias",		DT_BOL,		(malloc_t)&save_by_alias},
204 {"savebyname",		DT_BOL,		(malloc_t)&save_by_name},
205 {"savemail",		DT_SYN,		(malloc_t)"sentmail"},
206 {"savename",		DT_SYN,		(malloc_t)"savebyname"},
207 {"saveto",		DT_SYN,		(malloc_t)"sentmail"},
208 {"sentmail",		DT_STR,		(malloc_t)raw_sentmail},
209 {"shell",		DT_STR,		(malloc_t)raw_shell},
210 {"showmlists",		DT_BOL,		(malloc_t)&show_mlists},
211 {"showreply",		DT_BOL,		(malloc_t)&show_reply},
212 {"sigdashes",		DT_BOL,		(malloc_t)&sig_dashes},
213 {"signature",		DT_MLT,		(malloc_t)SIGS},
214 {"sleepmsg",		DT_NUM,		(malloc_t)&sleepmsg},
215 {"softkeys",		DT_BOL|FL_OR,	(malloc_t)&hp_softkeys},
216 {"sort",		DT_SYN,		(malloc_t)"sortby"},
217 {"sortby",		DT_SRT,		(malloc_t)&sortby},
218 {"store",		DT_SYN,		(malloc_t)"alwaysstore"},
219 {"textencoding",	DT_NOP,		(malloc_t)NULL},
220 {"timeout",		DT_NUM,		(malloc_t)&timeout},
221 {"titles",		DT_BOL,		(malloc_t)&title_messages},
222 {"tmpdir",		DT_STR,		(malloc_t)raw_temp_dir},
223 {"tochars",		DT_STR|FL_NOSPC, (malloc_t)to_chars},
224 {"userlevel",		DT_NUM,		(malloc_t)&user_level},
225 {"username",		DT_SYN,		(malloc_t)"fullname"},
226 {"usetite",		DT_BOL|FL_AND,	(malloc_t)&use_tite},
227 {"visualeditor",	DT_STR,		(malloc_t)v_editor},
228 {"weed",		DT_BOL,		(malloc_t)&filter},
229 {"weedout",		DT_WEE,		(malloc_t)weedlist},
230 
231 };
232 
233 #define SO_EXTERN
234 #define SO_INIT(X) = X
235 
236 #else /*}!SO_INTERN{*/
237 
238 #define SO_EXTERN extern
239 #define SO_INIT(X)
240 
241 #endif /*}!SO_INTERN*/
242 
243 SO_EXTERN save_info_recs *save_info
244 	SO_INIT(save_info_data);
245 SO_EXTERN int NUMBER_OF_SAVEABLE_OPTIONS
246 	SO_INIT(sizeof(save_info_data)/sizeof(save_info_recs));
247 
248