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

  1.  
  2. /* $Id: elm.h,v 5.9 1993/05/08 20:03:12 syd Exp $ */
  3.  
  4. /*******************************************************************************
  5.  *  The Elm Mail System  -  $Revision: 5.9 $   $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: elm.h,v $
  17.  * Revision 5.9  1993/05/08  20:03:12  syd
  18.  * add sleepmsg to list
  19.  *
  20.  * Revision 5.8  1993/05/08  18:56:16  syd
  21.  * created a new elmrc variable named "readmsginc".  This specifies an
  22.  * increment by which the message count is updated.  If this variable is
  23.  * set to, say, 25, then the message count will only be updated every 25
  24.  * messages, displaying 0, 25, 50, 75, and so forth.  The default value
  25.  * of 1 will cause Elm to behave exactly as it currently does in PL21.
  26.  * From: Eric Peterson <epeterso@encore.com>
  27.  *
  28.  * Revision 5.7  1993/01/20  17:37:56  syd
  29.  * fix spacing of =- to avoid compiler warnings
  30.  *
  31.  * Revision 5.6  1993/01/20  04:01:07  syd
  32.  * Adds a new integer parameter builtinlines.
  33.  * if (builtinlines < 0) and (the length of the message < LINES on
  34.  *       screen + builtinlines) use internal.
  35.  * if (builtinlines > 0) and (length of message < builtinlines)
  36.  *     use internal pager.
  37.  * if (builtinlines = 0) or none of the above conditions hold, use the
  38.  * external pager if defined.
  39.  * From: "John P. Rouillard" <rouilj@ra.cs.umb.edu>
  40.  *
  41.  * Revision 5.5  1992/10/25  02:38:27  syd
  42.  * Add missing new flags for new elmrc options for confirm
  43.  * From: Syd
  44.  *
  45.  * Revision 5.4  1992/10/24  13:44:41  syd
  46.  * There is now an additional elmrc option "displaycharset", which
  47.  * sets the charset supported on your terminal. This is to prevent
  48.  * elm from calling out to metamail too often.
  49.  * Plus a slight documentation update for MIME composition (added examples)
  50.  * From: Klaus Steinberger <Klaus.Steinberger@Physik.Uni-Muenchen.DE>
  51.  *
  52.  * Revision 5.3  1992/10/24  13:35:39  syd
  53.  * changes found by using codecenter on Elm 2.4.3
  54.  * From: Graham Hudspith <gwh@inmos.co.uk>
  55.  *
  56.  * Revision 5.2  1992/10/17  22:58:57  syd
  57.  * patch to make elm use (or in my case, not use) termcap/terminfo ti/te.
  58.  * From: Graham Hudspith <gwh@inmos.co.uk>
  59.  *
  60.  * Revision 5.1  1992/10/03  22:34:39  syd
  61.  * Initial checkin as of 2.4 Release at PL0
  62.  *
  63.  *
  64.  ******************************************************************************/
  65.  
  66. /**  Main header file for ELM mail system.  **/
  67.  
  68.  
  69. #include <stdio.h>
  70. #include <fcntl.h>
  71. #include <errno.h>
  72. #include <signal.h>
  73.  
  74. #include "../hdrs/curses.h"
  75. #include "../hdrs/defs.h"
  76.  
  77. #ifdef    BSD
  78. #include <setjmp.h>
  79. #endif
  80.  
  81. /******** static character string containing the version number  *******/
  82.  
  83. static char ident[] = { WHAT_STRING };
  84.  
  85. /******** and another string for the copyright notice            ********/
  86.  
  87. static char copyright[] = { 
  88.         "@(#)          (C) Copyright 1986,1987, Dave Taylor\n@(#)          (C) Copyright 1988-1992, The Usenet Community Trust\n" };
  89.  
  90. /******** global variables accessable by all pieces of the program *******/
  91.  
  92. int check_size = 0;        /* don't start mailer if no mail */
  93. int current = 0;        /* current message number  */
  94. int header_page = 0;         /* current header page     */
  95. int inalias = 0;        /* TRUE if in the alias menu */
  96. int last_current = -1;        /* previous current message */
  97. int last_header_page = -1;         /* last header page        */
  98. int message_count = 0;        /* max message number      */
  99. int headers_per_page = 0;    /* number of headers/page  */
  100. int original_umask = 0;        /* original umask, for restore before subshell */
  101. int sendmail_verbose = 0;       /* Extended mail debugging */
  102. int redraw = 0,             /* do we need to rewrite the entire screen? */
  103.     nucurr = 0,             /* change list or just the current pointer...   */
  104.     nufoot = 0,             /* clear lines 16 thru bottom and new menu  */
  105.     readmsginc = 1,        /* increment of msg cnt when reading new mbox */
  106.     sleepmsg = 2;        /* time to sleep for messages being overwritten on screen */
  107. #ifdef MIME
  108. char charset[SLEN] = {0};        /* name of character set */
  109. char display_charset[SLEN] = {0};    /* the charset, the display supports */
  110. char charset_compatlist[SLEN] = {0};    /* list of charsets which are a
  111.                        superset of us-ascii */
  112. char text_encoding[SLEN] = {0};    /* default encoding for text/plain */
  113. #endif
  114. char cur_folder[SLEN] = {0};    /* name of current folder */
  115. char cur_tempfolder[SLEN] = {0};/* name of temp folder open for a mailbox */
  116. char defaultfile[SLEN] = {0};    /* name of default folder */
  117. char temp_dir[SLEN] = {0};      /* name of temp directory */
  118. char hostname[SLEN] = {0};    /* name of machine we're on*/
  119. char hostdomain[SLEN] = {0};    /* name of domain we're in */
  120. char hostfullname[SLEN] = {0};    /* name of FQDN we're in */
  121. char item[WLEN] = "message";    /* either "message" or "alias" */
  122. char items[WLEN] = "messages";    /* plural: either "messages" or "aliases" */
  123. char Item[WLEN] = "Message";    /* CAP: either "Message" or "Alias" */
  124. char Items[WLEN] = "Messages";    /* CAP-plural: either "Messages" or "Aliases" */
  125. char Prompt[WLEN] = "Command: ";    /* Menu Prompt: either "Command" or "Alias" */
  126. char username[SLEN] = {0};    /* return address name!    */
  127. char full_username[SLEN] = {0};    /* Full username - gecos   */
  128. char home[SLEN] = {0};        /* home directory of user  */
  129. char folders[SLEN] = {0};    /* folder home directory   */
  130. char raw_folders[SLEN] = {0};    /* unexpanded folder home directory   */
  131. char recvd_mail[SLEN] = {0};    /* folder for storing received mail     */
  132. char raw_recvdmail[SLEN] = {0};    /* unexpanded recvd_mail name */
  133. char editor[SLEN] = {0};    /* editor for outgoing mail*/
  134. char raw_editor[SLEN] = {0};    /* unexpanded editor for outgoing mail*/
  135. char alternative_editor[SLEN] = {0};    /* alternative editor...   */
  136. char printout[SLEN] = {0};    /* how to print messages   */
  137. char raw_printout[SLEN] = {0};    /* unexpanded how to print messages   */
  138. char sent_mail[SLEN] = {0};    /* name of file to save copies to */
  139. char raw_sentmail[SLEN] = {0};    /* unexpanded name of file to save to */
  140. char calendar_file[SLEN] = {0};    /* name of file for clndr  */
  141. char raw_calendar_file[SLEN] = {0};    /* unexpanded name of file for clndr  */
  142. char attribution[SLEN] = {0};    /* attribution string for replies     */
  143. char prefixchars[SLEN] = "> ";    /* prefix char(s) for msgs */
  144. char shell[SLEN] = {0};        /* current system shell    */
  145. char raw_shell[SLEN] = {0};    /* unexpanded current system shell    */
  146. char pager[SLEN] = {0};        /* what pager to use       */
  147. char raw_pager[SLEN] = {0};    /* unexpanded what pager to use       */
  148. char batch_subject[SLEN] = {0};    /* subject buffer for batchmail */
  149. char included_file[SLEN] = {0};    /* prepared file to include in the edit buf */
  150. char local_signature[SLEN] = {0};    /* local msg signature file     */
  151. char raw_local_signature[SLEN] = {0};    /* unexpanded local msg signature file     */
  152. char remote_signature[SLEN] = {0};    /* remote msg signature file    */
  153. char raw_remote_signature[SLEN] = {0};    /* unexpanded remote msg signature file    */
  154. char version_buff[NLEN] = {0};    /* version buffer */
  155. char e_editor[SLEN] = {0};    /* "~e" editor...   */
  156. char v_editor[SLEN] = {0};    /* "~v" editor...   */
  157. char config_options[SLEN] = {0};    /* which options are in o)ptions */
  158. char allowed_precedences[SLEN] = {0};    /* list of precedences user may specify */
  159.  
  160. char *def_ans_yes;        /* default yes answer - single char, lc    */
  161. char *def_ans_no;        /* default no answer - single char, lc    */
  162. char *nls_deleted;        /* [deleted] */
  163. char *nls_form;            /* Form */
  164. char *nls_message;        /* Message */
  165. char *nls_to;            /* To */
  166. char *nls_from;            /* From */
  167. char *nls_page;            /* Page */
  168. char *change_word;        /* change */
  169. char *save_word;        /* save */
  170. char *copy_word;        /* copy */
  171. char *cap_save_word;        /* Save */
  172. char *cap_copy_word;        /* Copy */
  173. char *saved_word;        /* saved */
  174. char *copied_word;        /* copied */
  175.  
  176. char backspace,            /* the current backspace char */
  177.      escape_char = TILDE_ESCAPE,/* '~' or something else..    */
  178.      kill_line;            /* the current kill-line char */
  179.  
  180. char up[SHORT] = {0},        /* cursor control seq's    */
  181.      down[SHORT] = {0},
  182.      left[SHORT] = {0},
  183.      right[SHORT] = {0};
  184. int  cursor_control = FALSE;    /* cursor control avail?   */
  185.  
  186. int  has_highlighting = FALSE;    /* highlighting available? */
  187.  
  188. char *weedlist[MAX_IN_WEEDLIST] = {0};
  189. int  weedcount;
  190.  
  191. int allow_forms = NO;        /* flag: are AT&T Mail forms okay?  */
  192. int mini_menu = 1;        /* flag: menu specified?        */
  193. int metoo = 0;            /* flag: copy me on mail to alias?  */
  194. int prompt_after_pager = 1;    /* flag: prompt after pager exits   */
  195. int folder_type = 0;        /* flag: type of folder            */
  196. int auto_copy = 0;        /* flag: automatically copy source? */
  197. int filter = 1;            /* flag: weed out header lines?        */
  198. int resolve_mode = 1;        /* flag: delete saved mail?        */
  199. int auto_cc = 0;        /* flag: mail copy to user?        */
  200. int noheader = 1;        /* flag: copy + header to file?     */
  201. int title_messages = 1;        /* flag: title message display?     */
  202. int forwarding = 0;        /* flag: are we forwarding the msg? */
  203. int hp_terminal = 0;        /* flag: are we on HP term?        */
  204. int hp_softkeys = 0;        /* flag: are there softkeys?        */
  205. int save_by_name = 1;        /* flag: save mail by login name?   */
  206. int force_name = 0;        /* flag: save by name forced?        */
  207. int mail_only = 0;        /* flag: send mail then leave?      */
  208. int check_only = 0;        /* flag: check aliases then leave?  */
  209. int batch_only = 0;        /* flag: send without prompting?    */
  210. int move_when_paged = 0;    /* flag: move when '+' or '-' used? */
  211. int point_to_new = 1;        /* flag: start pointing at new msg? */
  212. int builtin_lines= -3;        /* int: if < 0 use builtin if message
  213.                     shorter than LINES+builtin_lines
  214.                     else use pager. If > 0 use builtin
  215.                     if message has fewer than # of lines */
  216. int bounceback = 0;        /* flag: bounce copy off remote?    */
  217. int always_keep = 1;        /* flag: always keep unread msgs?   */
  218. int always_store = 0;        /* flag: always store read msgs?    */
  219. int always_del = 0;        /* flag: always delete marked msgs? */
  220. int arrow_cursor = 0;        /* flag: use "->" cursor regardless?*/
  221. int debug = 0;             /* flag: default is no debug!       */
  222. int user_level = 0;        /* flag: how good is the user?      */
  223. int selected = 0;        /* flag: used for select stuff      */
  224. int names_only = 1;        /* flag: display user names only?   */
  225. int question_me = 1;        /* flag: ask questions as we leave? */
  226. int keep_empty_files = 0;    /* flag: leave empty folder files? */
  227. int clear_pages = 0;        /* flag: act like "page" (more -c)? */
  228. int prompt_for_cc = 1;        /* flag: ask user for "cc:" value?  */
  229. int sig_dashes = 1;        /* flag: include dashes above sigs? */
  230. int use_tite = 1;        /* flag: use termcap/terminfo ti/te?*/
  231. int confirm_append = 0;        /* flag: confirm append to folder?  */
  232. int confirm_create = 0;        /* flag: confirm create new folder? */
  233. int confirm_files = 0;        /* flag: confirm files for append?  */
  234. int confirm_folders = 0;    /* flag: confirm folders for create?*/
  235.  
  236. int sortby = REVERSE SENT_DATE;    /* how to sort incoming mail...     */
  237. int alias_sortby = NAME_SORT;    /* how to sort aliases...           */
  238.  
  239. long timeout = 600L;        /* timeout (secs) on main prompt    */
  240.  
  241. /** set up some default values for a 'typical' terminal *snicker* **/
  242.  
  243. int LINES=23;            /** lines per screen      **/
  244. int COLUMNS=80;            /** columns per page      **/
  245. #ifdef SIGWINCH
  246. int resize_screen = 0;        /** SIGWINCH occured?      **/
  247. #endif
  248.  
  249. long size_of_pathfd;        /** size of pathfile, 0 if none **/
  250.  
  251. FILE *mailfile;            /* current folder        */
  252. FILE *debugfile;        /* file for debug output    */
  253. FILE *pathfd;            /* path alias file          */
  254. FILE *domainfd;            /* domain file            */
  255. nl_catd elm_msg_cat = 0;    /* message catalog        */
  256.  
  257. long mailfile_size;        /* size of current mailfile */
  258.  
  259. int   max_headers = 0;        /* number of headers allocated */
  260.  
  261. struct header_rec **headers;    /* array of header structure pointers */
  262.  
  263. struct alias_rec **aliases;     /* for the alias menu */
  264. int   max_aliases = 0;        /* number of aliases allocated */
  265.  
  266. struct addr_rec *alternative_addresses;    /* how else do we get mail? */
  267.  
  268. int system_data = -1;        /* fileno of system data file */
  269. int user_data = -1;        /* fileno of user data file   */
  270.  
  271. int userid;            /* uid for current user          */
  272. int groupid;            /* groupid for current user   */
  273. #ifdef SAVE_GROUP_MAILBOX_ID
  274. int mailgroupid;        /* groupid for current user   */
  275. #endif
  276.  
  277. #ifdef    BSD
  278. jmp_buf GetPromptBuf;        /* setjmp buffer */
  279. int InGetPrompt;        /* set if in GetPrompt() in read() */
  280. #endif
  281.