home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / elm / elm2.4 / hdrs / save_opts.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-08  |  9.5 KB  |  248 lines

  1.  
  2. /* @(#)$Id: save_opts.h,v 5.8 1993/05/08 18:56:16 syd Exp syd $ */
  3.  
  4. /*******************************************************************************
  5.  *  The Elm Mail System  -  $Revision: 5.8 $   $State: Exp $
  6.  *
  7.  *             Copyright (c) 1988-1992 USENET Community Trust
  8.  *             Copyright (c) 1986,1987 Dave Taylor
  9.  *******************************************************************************
  10.  * Bug reports, patches, comments, suggestions should be sent to:
  11.  *
  12.  *    Syd Weinstein, Elm Coordinator
  13.  *    elm@DSI.COM            dsinc!elm
  14.  *
  15.  *******************************************************************************
  16.  * $Log: save_opts.h,v $
  17.  * Revision 5.8  1993/05/08  18:56:16  syd
  18.  * created a new elmrc variable named "readmsginc".  This specifies an
  19.  * increment by which the message count is updated.  If this variable is
  20.  * set to, say, 25, then the message count will only be updated every 25
  21.  * messages, displaying 0, 25, 50, 75, and so forth.  The default value
  22.  * of 1 will cause Elm to behave exactly as it currently does in PL21.
  23.  * From: Eric Peterson <epeterso@encore.com>
  24.  *
  25.  * Revision 5.7  1993/01/20  04:01:07  syd
  26.  * Adds a new integer parameter builtinlines.
  27.  * if (builtinlines < 0) and (the length of the message < LINES on
  28.  *       screen + builtinlines) use internal.
  29.  * if (builtinlines > 0) and (length of message < builtinlines)
  30.  *     use internal pager.
  31.  * if (builtinlines = 0) or none of the above conditions hold, use the
  32.  * external pager if defined.
  33.  * From: "John P. Rouillard" <rouilj@ra.cs.umb.edu>
  34.  *
  35.  * Revision 5.6  1992/10/25  02:43:50  syd
  36.  * fix typo
  37.  *
  38.  * Revision 5.5  1992/10/25  02:38:27  syd
  39.  * Add missing new flags for new elmrc options for confirm
  40.  * From: Syd
  41.  *
  42.  * Revision 5.4  1992/10/24  13:44:41  syd
  43.  * There is now an additional elmrc option "displaycharset", which
  44.  * sets the charset supported on your terminal. This is to prevent
  45.  * elm from calling out to metamail too often.
  46.  * Plus a slight documentation update for MIME composition (added examples)
  47.  * From: Klaus Steinberger <Klaus.Steinberger@Physik.Uni-Muenchen.DE>
  48.  *
  49.  * Revision 5.3  1992/10/17  22:58:57  syd
  50.  * patch to make elm use (or in my case, not use) termcap/terminfo ti/te.
  51.  * From: Graham Hudspith <gwh@inmos.co.uk>
  52.  *
  53.  * Revision 5.2  1992/10/17  22:42:24  syd
  54.  * Add flags to read_rc to support command line overrides of the option.
  55.  * From: Jan Djarv <Jan.Djarv@sa.erisoft.se>
  56.  *
  57.  * Revision 5.1  1992/10/03  22:34:39  syd
  58.  * Initial checkin as of 2.4 Release at PL0
  59.  *
  60.  *
  61.  ******************************************************************************/
  62.  
  63. /*
  64.  *    Defines for the storage of options portion of the Elm system.
  65.  */
  66.  
  67. typedef struct {
  68.     char letter;        /* menu letter on options screen */
  69.     char *menu;            /* menu prompt */
  70.     int  menu_msg;        /* NLS message number of menu prompt */
  71.     char *parm;            /* parameter to modify */
  72.     int (*post)();        /* post processing function */
  73.     char *one_liner;        /* one line help message */
  74.     int  one_liner_msg;     /* NLS message number of one line help message */
  75.     } opts_menu;
  76.  
  77. #define DT_SYN 0 /* synonym entry (old name) */
  78. #define DT_STR 1 /* string */
  79. #define DT_NUM 2 /* number */
  80. #define DT_BOL 3 /* ON/OFF (boolean) */
  81. #define DT_CHR 4 /* character */
  82. #define DT_WEE 5 /* weed list */
  83. #define DT_ALT 6 /* alternate addresses list */
  84. #define DT_SRT 7 /* sort-by code */
  85. #define DT_MLT 8 /* multiple destinations for data */
  86. #define DT_ASR 9 /* sort-by code */
  87. #define DT_MASK 037 /* mask for data type */
  88. #define FL_LOCAL 0040          /* flag if changed */
  89. #define FL_NOSPC 0100          /* flag if preserve blanks as "_" */
  90. #define FL_SYS   0200          /* flag if only valid in system RC */
  91. #define FL_OR    0400          /* flag if boolean value may have been set */
  92. #define FL_AND  01000          /* flag if boolean value may have been unset */
  93.  
  94. typedef struct { 
  95.     char     name[NLEN];     /* name of instruction */
  96.     long     offset;        /* offset into elmrc-info file */
  97.         int    flags;    /* DT_STR, DT_NUM, DT_BOL, etc */
  98.         union {
  99.           char     *str;
  100.           int     *num;
  101.           int     *bol;
  102.           char     *chr;
  103.           char     **weed;
  104.           struct addr_rec **alts;
  105.           int     *sort;
  106.           } val;
  107.     } save_info_recs;
  108.  
  109. /*
  110.  *    since many C compilers cannot init a union as a static
  111.  *    init, make the same structure with just the char * for
  112.  *    the union pointer.
  113.  */
  114. typedef struct { 
  115.     char     name[NLEN];     /* name of instruction */
  116.     long     offset;        /* offset into elmrc-info file */
  117.         int    flags;    /* DT_STR, DT_NUM, DT_BOL, etc */
  118.         char     *str;
  119.     } save_info_recs_init;
  120.  
  121. #define SAVE_INFO_STR(x) (save_info[x].val.str)
  122. #define SAVE_INFO_NUM(x) (save_info[x].val.num)
  123. #define SAVE_INFO_BOL(x) (save_info[x].val.bol)
  124. #define SAVE_INFO_CHR(x) (save_info[x].val.chr)
  125. #define SAVE_INFO_WEE(x) (save_info[x].val.weed)
  126. #define SAVE_INFO_ALT(x) (save_info[x].val.alts)
  127. #define SAVE_INFO_SRT(x) (save_info[x].val.sort)
  128. #define SAVE_INFO_ASR(x) (save_info[x].val.sort)
  129. #define SAVE_INFO_SYN(x) ((char *)save_info[x].val.str)
  130. #define SAVE_INFO_MLT(x) ((char **)save_info[x].val.weed)
  131.  
  132. #ifdef SAVE_OPTS
  133.  
  134. /* "lists" for DT_MLT.  These and DT_SYN could be eliminated if support
  135.    of the old parameter names was dropped.
  136. */
  137. char *SIGS[]={"remotesignature","localsignature",NULL},
  138.     *ALWAYS[]={"alwayskeep","alwaysstore",NULL};
  139.  
  140. save_info_recs_init save_info_data[] = {
  141. {"aliassortby",        -1L,DT_ASR,(char *)&alias_sortby},
  142. {"alteditor",        -1L,DT_STR,alternative_editor},
  143. {"alternatives",    -1L,DT_ALT,(char *)&alternative_addresses},
  144. {"alwaysdelete",    -1L,DT_BOL,(char *)&always_del},
  145. {"alwayskeep",        -1L,DT_BOL,(char *)&always_keep},
  146. {"alwaysleave",        -1L,DT_MLT,(char *)ALWAYS},
  147. {"alwaysstore",        -1L,DT_BOL,(char *)&always_store},
  148. {"arrow",        -1L,DT_BOL|FL_OR,(char *)&arrow_cursor},
  149. {"ask",            -1L,DT_BOL,(char *)&question_me},
  150. {"askcc",        -1L,DT_BOL,(char *)&prompt_for_cc},
  151. {"attribution",        -1L,DT_STR,attribution},
  152. {"auto_cc",        -1L,DT_SYN,"copy"},
  153. {"autocopy",        -1L,DT_BOL,(char *)&auto_copy},
  154. {"bounce",        -1L,DT_SYN,"bounceback"},
  155. {"bounceback",        -1L,DT_NUM,(char *)&bounceback},
  156. {"builtinlines",    -1L,DT_NUM,(char *)&builtin_lines},
  157. {"calendar",        -1L,DT_STR,raw_calendar_file},
  158. {"cc",            -1L,DT_SYN,"askcc"},
  159. #ifdef MIME
  160. {"charset",        -1L,DT_STR,charset},
  161. {"compatcharsets",        -1L,DT_STR,charset_compatlist},
  162. #endif
  163. {"configoptions",    -1L,DT_STR,config_options},
  164. {"confirmappend",    -1L,DT_BOL,(char *)&confirm_append},
  165. {"confirmcreate",    -1L,DT_BOL,(char *)&confirm_create},
  166. {"confirmfiles",    -1L,DT_BOL,(char *)&confirm_files},
  167. {"confirmfolders",    -1L,DT_BOL,(char *)&confirm_folders},
  168. {"copy",        -1L,DT_BOL,(char *)&auto_cc},
  169. {"delete",        -1L,DT_SYN,"alwaysdelete"},
  170. #ifdef MIME
  171. {"displaycharset",    -1L,DT_STR,display_charset},
  172. #endif
  173. {"easyeditor",        -1L,DT_STR,e_editor},
  174. {"editor",        -1L,DT_STR,raw_editor},
  175. {"escape",        -1L,DT_CHR,(char *)&escape_char},
  176. {"folders",        -1L,DT_SYN,"maildir"},
  177. {"forcename",        -1L,DT_BOL,(char *)&force_name},
  178. {"form",        -1L,DT_SYN,"forms"},
  179. {"forms",        -1L,DT_BOL,(char *)&allow_forms},
  180. {"fullname",        -1L,DT_STR,full_username},
  181. {"hostdomain",        -1L,DT_STR|FL_SYS,hostdomain},
  182. {"hostfullname",    -1L,DT_STR|FL_SYS,hostfullname},
  183. {"hostname",        -1L,DT_STR|FL_SYS,hostname},
  184. {"hpkeypad",        -1L,DT_SYN,"keypad"},
  185. {"hpsoftkeys",        -1L,DT_SYN,"softkeys"},
  186. {"keep",        -1L,DT_SYN,"keepempty"},
  187. {"keepempty",        -1L,DT_BOL,(char *)&keep_empty_files},
  188. {"keypad",        -1L,DT_BOL|FL_OR,(char *)&hp_terminal},
  189. {"localsignature",    -1L,DT_STR,raw_local_signature},
  190. {"mailbox",        -1L,DT_SYN,"receivedmail"},
  191. {"maildir",        -1L,DT_STR,raw_folders},
  192. {"mailedit",        -1L,DT_SYN,"editor"},
  193. {"menu",        -1L,DT_BOL|FL_AND,(char *)&mini_menu},
  194. {"menus",        -1L,DT_SYN,"menu"},
  195. {"metoo",        -1L,DT_BOL,(char *)&metoo},
  196. {"movepage",        -1L,DT_BOL,(char *)&move_when_paged},
  197. {"movewhenpaged",    -1L,DT_SYN,"movepage"},
  198. {"name",        -1L,DT_SYN,"fullname"},
  199. {"names",        -1L,DT_BOL,(char *)&names_only},
  200. {"noheader",        -1L,DT_BOL,(char *)&noheader},
  201. {"page",        -1L,DT_SYN,"pager"},
  202. {"pager",        -1L,DT_STR,raw_pager},
  203. {"pointnew",        -1L,DT_BOL,(char *)&point_to_new},
  204. {"pointtonew",        -1L,DT_SYN,"pointnew"},
  205. {"precedences",        -1L,DT_STR,allowed_precedences},
  206. {"prefix",        -1L,DT_STR|FL_NOSPC,prefixchars},
  207. {"print",        -1L,DT_STR,raw_printout},
  208. {"printmail",        -1L,DT_SYN,"print"},
  209. {"promptafter",        -1L,DT_BOL,(char *)&prompt_after_pager},
  210. {"question",        -1L,DT_SYN,"ask"},
  211. {"readmsginc",        -1L,DT_NUM,(char *)&readmsginc},
  212. {"receivedmail",    -1L,DT_STR,raw_recvdmail},
  213. {"remotesignature",    -1L,DT_STR,raw_remote_signature},
  214. {"resolve",        -1L,DT_BOL,(char *)&resolve_mode},
  215. {"savebyname",        -1L,DT_SYN,"savename"},
  216. {"savemail",        -1L,DT_SYN,"sentmail"},
  217. {"savename",        -1L,DT_BOL,(char *)&save_by_name},
  218. {"saveto",        -1L,DT_SYN,"sentmail"},
  219. {"sentmail",        -1L,DT_STR,raw_sentmail},
  220. {"shell",        -1L,DT_STR,raw_shell},
  221. {"sigdashes",        -1L,DT_BOL,(char *)&sig_dashes},
  222. {"signature",        -1L,DT_MLT,(char *)SIGS},
  223. {"sleepmsg",        -1L,DT_NUM,(char *)&sleepmsg},
  224. {"softkeys",        -1L,DT_BOL|FL_OR,(char *)&hp_softkeys},
  225. {"sort",        -1L,DT_SYN,"sortby"},
  226. {"sortby",        -1L,DT_SRT,(char *)&sortby},
  227. {"store",        -1L,DT_SYN,"alwaysstore"},
  228. #ifdef MIME
  229. {"textencoding", -1L,DT_STR,text_encoding},
  230. #endif
  231. {"timeout",        -1L,DT_NUM,(char *)&timeout},
  232. {"titles",        -1L,DT_BOL,(char *)&title_messages},
  233. {"tmpdir",        -1L,DT_STR,temp_dir},
  234. {"userlevel",        -1L,DT_NUM,(char *)&user_level},
  235. {"username",        -1L,DT_SYN,"fullname"},
  236. {"usetite",        -1L,DT_BOL|FL_AND,(char *)&use_tite},
  237. {"visualeditor",    -1L,DT_STR,v_editor},
  238. {"weed",        -1L,DT_BOL,(char *)&filter},
  239. {"weedout",        -1L,DT_WEE,(char *)weedlist},
  240. };
  241. int NUMBER_OF_SAVEABLE_OPTIONS=(sizeof(save_info_data)/sizeof(save_info_recs_init));
  242. save_info_recs *save_info = (save_info_recs *) save_info_data;
  243. #else
  244. extern save_info_recs *save_info;
  245. extern int NUMBER_OF_SAVEABLE_OPTIONS;
  246. #endif
  247.  
  248.