2 * $Id: conftype.h 1155 2008-08-21 18:33:21Z hubert@u.washington.edu $
4 * ========================================================================
5 * Copyright 2006-2008 University of Washington
6 * Copyright 2013 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 PITH_CONFTYPE_INCLUDED
18 #define PITH_CONFTYPE_INCLUDED
21 #include "../pith/helptext.h"
22 #include "../pith/remtype.h"
25 typedef enum {Sapling
, Seedling
, Seasoned
} FeatureLevel
;
29 * The array is initialized in pith/conf.c so the order of that initialization
30 * must correspond to the order of the values here. The order is
31 * significant in that it determines the order that the variables
32 * are written into the pinerc file and the order they show up in in the
35 typedef enum { V_PERSONAL_NAME
= 0
44 , V_DEFAULT_SAVE_FOLDER
46 , V_READ_MESSAGE_FOLDER
59 , V_SAVED_MSG_NAME_RULE
70 , V_THREAD_INDEX_STYLE
73 , V_THREAD_LASTREPLY_CHAR
74 , V_THREAD_DISP_STYLE_RULES
75 , V_THREAD_INDEX_STYLE_RULES
81 , V_REPLY_INDENT_RULES
82 , V_REPLY_LEADIN_RULES
92 #endif /* ! _WINDOWS */
101 , V_QUOTE_REPLACE_STRING
105 , V_USE_ONLY_DOMAIN_NAME
113 , V_FORCED_ABOOK_ENTRY
114 , V_KBLOCK_PASSWD_COUNT
126 , V_ACTIVE_MSG_INTERVAL
139 , V_UPLOAD_CMD_PREFIX
141 , V_DOWNLOAD_CMD_PREFIX
149 , V_INC2NDCHECKINTERVAL
152 #if !defined(DOS) && !defined(OS2) && !defined(LEAVEOUTFIFO)
157 * Starting here, the rest of the variables are hidden by default in config
158 * screen. They are exposed with expose-hidden-config feature.
167 , V_LAST_TIME_PRUNE_QUESTION
173 , V_DEBUGMEM
/* obsolete */
177 , V_TCPWRITEWARNTIMEO
188 , V_REMOTE_ABOOK_METADATA
189 , V_REMOTE_ABOOK_HISTORY
190 , V_REMOTE_ABOOK_VALIDITY
192 , V_PERSONAL_PRINT_COMMAND
193 , V_PERSONAL_PRINT_CATEGORY
194 , V_PATTERNS
/* obsolete */
197 , V_PAT_FILTS_OLD
/* obsolete */
199 , V_PAT_SCORES_OLD
/* obsolete */
203 , V_ELM_STYLE_SAVE
/* obsolete */
204 , V_HEADER_IN_REPLY
/* obsolete */
205 , V_FEATURE_LEVEL
/* obsolete */
206 , V_OLD_STYLE_REPLY
/* obsolete */
207 , V_COMPOSE_MIME
/* obsolete */
208 , V_SHOW_ALL_CHARACTERS
/* obsolete */
209 , V_SAVE_BY_SENDER
/* obsolete */
210 #if defined(DOS) || defined(OS2)
217 , V_INDEX_COLOR_STYLE
218 , V_TITLEBAR_COLOR_STYLE
225 , V_TITLECLOSED_FORE_COLOR
226 , V_TITLECLOSED_BACK_COLOR
227 , V_FOLDER_FORE_COLOR
228 , V_FOLDER_BACK_COLOR
229 , V_DIRECTORY_FORE_COLOR
230 , V_DIRECTORY_BACK_COLOR
231 , V_FOLDER_LIST_FORE_COLOR
232 , V_FOLDER_LIST_BACK_COLOR
233 , V_STATUS_FORE_COLOR
234 , V_STATUS_BACK_COLOR
235 , V_KEYLABEL_FORE_COLOR
236 , V_KEYLABEL_BACK_COLOR
237 , V_KEYNAME_FORE_COLOR
238 , V_KEYNAME_BACK_COLOR
239 , V_SLCTBL_FORE_COLOR
240 , V_SLCTBL_BACK_COLOR
241 , V_METAMSG_FORE_COLOR
242 , V_METAMSG_BACK_COLOR
243 , V_QUOTE1_FORE_COLOR
244 , V_QUOTE1_BACK_COLOR
245 , V_QUOTE2_FORE_COLOR
246 , V_QUOTE2_BACK_COLOR
247 , V_QUOTE3_FORE_COLOR
248 , V_QUOTE3_BACK_COLOR
249 , V_INCUNSEEN_FORE_COLOR
250 , V_INCUNSEEN_BACK_COLOR
251 , V_SIGNATURE_FORE_COLOR
252 , V_SIGNATURE_BACK_COLOR
253 , V_SPECIAL_TEXT_FORE_COLOR
254 , V_SPECIAL_TEXT_BACK_COLOR
255 , V_PROMPT_FORE_COLOR
256 , V_PROMPT_BACK_COLOR
257 , V_HEADER_GENERAL_FORE_COLOR
258 , V_HEADER_GENERAL_BACK_COLOR
259 , V_IND_PLUS_FORE_COLOR
260 , V_IND_PLUS_BACK_COLOR
261 , V_IND_IMP_FORE_COLOR
262 , V_IND_IMP_BACK_COLOR
263 , V_IND_DEL_FORE_COLOR
264 , V_IND_DEL_BACK_COLOR
265 , V_IND_ANS_FORE_COLOR
266 , V_IND_ANS_BACK_COLOR
267 , V_IND_NEW_FORE_COLOR
268 , V_IND_NEW_BACK_COLOR
269 , V_IND_REC_FORE_COLOR
270 , V_IND_REC_BACK_COLOR
271 , V_IND_FWD_FORE_COLOR
272 , V_IND_FWD_BACK_COLOR
273 , V_IND_UNS_FORE_COLOR
274 , V_IND_UNS_BACK_COLOR
275 , V_IND_HIPRI_FORE_COLOR
276 , V_IND_HIPRI_BACK_COLOR
277 , V_IND_LOPRI_FORE_COLOR
278 , V_IND_LOPRI_BACK_COLOR
279 , V_IND_ARR_FORE_COLOR
280 , V_IND_ARR_BACK_COLOR
281 , V_IND_SUBJ_FORE_COLOR
282 , V_IND_SUBJ_BACK_COLOR
283 , V_IND_FROM_FORE_COLOR
284 , V_IND_FROM_BACK_COLOR
285 , V_IND_OP_FORE_COLOR
286 , V_IND_OP_BACK_COLOR
287 , V_INDEX_TOKEN_COLORS
290 #if defined(DOS) || defined(OS2)
299 , V_PRINT_FONT_CHAR_SET
306 , V_PUBLICCERT_CONTAINER
308 , V_PRIVATEKEY_CONTAINER
313 , V_LDAP_SERVERS
/* should be last so make will work right */
325 #define V_LAST_VAR (V_DUMMY - 1)
329 * The list of feature numbers (which bit goes with which feature).
330 * The order of the features is not significant.
336 F_ENABLE_TAB_COMPLETE
,
352 F_AUTO_READ_MSGS_RULES
,
354 F_READ_IN_NEWSRC_ORDER
,
356 F_SAVE_PARTIAL_WO_CONFIRM
,
357 F_NEXT_THRD_WO_CONFIRM
,
363 F_UNSELECT_WONT_ADVANCE
,
371 F_AUTO_OPEN_NEXT_UNREAD
,
373 F_DISABLE_INDEX_LOCALE_DATES
,
374 F_SELECTED_SHOWN_BOLD
,
376 F_AUTO_INCLUDE_IN_REPLY
,
377 F_DISABLE_CONFIG_SCREEN
,
378 F_DISABLE_PASSWORD_CACHING
,
380 F_DISABLE_PASSWORD_CMD
,
381 F_DISABLE_UPDATE_CMD
,
382 F_DISABLE_KBLOCK_CMD
,
383 F_DISABLE_SIGEDIT_CMD
,
384 F_DISABLE_ROLES_SETUP
,
385 F_DISABLE_ROLES_SIGEDIT
,
386 F_DISABLE_ROLES_TEMPLEDIT
,
387 F_DISABLE_PIPES_IN_SIGS
,
388 F_DISABLE_PIPES_IN_TEMPLATES
,
389 F_ATTACHMENTS_IN_REPLY
,
391 F_ENABLE_INCOMING_CHECKING
,
392 F_INCOMING_CHECKING_TOTAL
,
393 F_INCOMING_CHECKING_RECENT
,
394 F_NO_NEWS_VALIDATION
,
395 F_QUELL_EXTRA_POST_PROMPT
,
396 F_DISABLE_TAKE_LASTFIRST
,
397 F_DISABLE_TAKE_FULLNAMES
,
398 F_DISABLE_TERM_RESET_DISP
,
401 F_QUELL_LOCAL_LOOKUP
,
402 F_COMPOSE_TO_NEWSGRP
,
403 F_PRESERVE_START_STOP
,
404 F_COMPOSE_REJECTS_UNQUAL
,
412 F_PASS_CONTROL_CHARS
,
413 F_PASS_C1_CONTROL_CHARS
,
414 F_SINGLE_FOLDER_LIST
,
415 F_VERTICAL_FOLDER_LIST
,
417 F_COURIER_FOLDER_LIST
,
427 F_DISABLE_SAVE_INPUT_HISTORY
,
436 F_ENABLE_DOT_FOLDERS
,
437 F_FIRST_SEND_FILTER_DFLT
,
438 F_ALWAYS_LAST_FLDR_DFLT
,
442 F_WARN_ABOUT_NO_SUBJECT
,
444 F_WARN_ABOUT_NO_TO_OR_CC
,
447 F_QUELL_LOCK_FAILURE_MSGS
,
448 F_ENABLE_SPACE_AS_TAB
,
449 F_USE_BORING_SPINNER
,
450 F_ENABLE_TAB_DELETES
,
451 F_FLAG_SCREEN_KW_SHORTCUT
,
453 F_ENABLE_XTERM_NEWMAIL
,
454 F_ENABLE_NEWMAIL_SHORT_TEXT
,
455 F_EXPANDED_DISTLISTS
,
458 F_DISABLE_SETLOCALE_COLLATE
,
459 F_FROM_DELIM_IN_PRINT
,
463 F_ENABLE_SEARCH_AND_REPL
,
468 F_ENABLE_STRIP_SIGDASHES
,
469 F_NEW_THREAD_ON_BLANK_SUBJECT
,
470 F_QUELL_PARTIAL_FETCH
,
471 F_QUELL_PERSONAL_NAME_PROMPT
,
472 F_QUELL_USER_ID_PROMPT
,
480 F_QUELL_CHARSET_WARNING
,
482 F_ENABLE_EDIT_REPLY_INDENT
,
484 F_ALLOW_CHANGING_FROM
,
486 F_ENABLE_LESSTHAN_EXIT
,
487 F_ENABLE_FAST_RECENT
,
490 F_ENABLE_TAKE_EXPORT
,
491 F_QUELL_ATTACH_EXTRA_PROMPT
,
493 F_QUELL_ATTACH_EXT_WARN
,
495 F_QUELL_FILTER_DONE_MSG
,
499 F_PREDICT_NNTP_SERVER
,
502 F_QUELL_INTERNAL_MSG
,
505 F_SEPARATE_FLDR_AS_DIR
,
509 F_EXPANDED_ADDRBOOKS
,
512 F_SHOW_TEXTPLAIN_INT
,
513 F_ROLE_CONFIRM_DEFAULT
,
516 F_RET_INBOX_NO_CONFIRM
,
522 F_DO_MAILCAP_PARAM_SUBST
,
524 F_SLCTBL_ITEM_NOBOLD
,
525 F_QUELL_PINGS_COMPOSING
,
526 F_QUELL_PINGS_COMPOSING_INBOX
,
527 F_QUELL_BEZERK_TIMEZONE
,
529 F_QUELL_MAILDOMAIN_WARNING
,
530 F_DISABLE_SHARED_NAMESPACES
,
532 F_MAILDROPS_PRESERVE_STATE
,
533 F_EXPOSE_HIDDEN_CONFIG
,
537 F_ALWAYS_SPELL_CHECK
,
540 F_COLOR_LINE_IMPORTANT
,
543 F_ENABLE_FULL_HDR_AND_TEXT
,
544 F_QUELL_FULL_HDR_RESET
,
546 F_MULNEWSRC_HOSTNAMES_AS_TYPED
,
547 F_STRIP_WS_BEFORE_SEND
,
549 F_COMPOSE_ALWAYS_DOWNGRADE
,
550 F_SORT_DEFAULT_FCC_ALPHA
,
551 F_SORT_DEFAULT_SAVE_ALPHA
,
552 F_QUOTE_REPLACE_NOFLOW
,
554 F_SEND_CONFIRM_ON_EXPAND
,
555 F_ENABLE_NEWMAIL_SOUND
,
556 F_RENDER_HTML_INTERNALLY
,
558 F_FORWARD_AS_ATTACHMENT
,
559 F_PRESERVE_ORIGINAL_FIELD
,
562 #endif /* ! _WINDOWS */
563 F_QUELL_HOST_AFTER_URL
,
564 F_NNTP_SEARCH_USES_OVERVIEW
,
565 F_THREAD_SORTS_BY_ARRIVAL
,
568 F_QUELL_SSL_LARGEBLOCKS
,
569 F_STORE_WINPOS_IN_CONFIG
,
577 F_ENCRYPT_DEFAULT_ON
,
578 F_REMEMBER_SMIME_PASSPHRASE
,
580 F_PUBLICCERTS_IN_KEYCHAIN
,
583 F_FEATURE_LIST_COUNT
/* Number of features */
587 typedef struct init_err
{
588 int flags
, min_time
, max_time
;
595 unsigned is_obsolete
:1; /* variable read in, not written unless set */
596 unsigned is_used
:1; /* Some variables are disabled */
597 unsigned been_written
:1;
599 unsigned is_global
:1;
600 unsigned is_list
:1; /* flag indicating variable is a list */
601 unsigned is_fixed
:1; /* sys mgr has fixed this variable */
602 unsigned is_onlymain
:1; /* read and written from main_user_val */
603 unsigned is_outermost
:1; /* read and written from outermost pinerc */
604 unsigned del_quotes
:1; /* remove double quotes */
605 unsigned is_changed_val
:1; /* WP: use the changed val instead of cur val */
606 char *dname
; /* display name */
607 char *descrip
; /* description */
609 char *p
; /* pointer to single string value */
610 char **l
; /* pointer to list of string values */
613 char *p
; /* pointer to single string value */
614 char **l
; /* pointer to list of string values */
615 } main_user_val
; /* from pinerc */
617 char *p
; /* pointer to single string value */
618 char **l
; /* pointer to list of string values */
619 } changed_val
; /* currently different from pinerc */
621 char *p
; /* pointer to single string value */
622 char **l
; /* pointer to list of string values */
623 } post_user_val
; /* from pinerc */
625 char *p
; /* pointer to single string value */
626 char **l
; /* pointer to list of string values */
627 } global_val
; /* from default or pine.conf */
629 char *p
; /* pointer to single string value */
630 char **l
; /* pointer to list of string values */
631 } fixed_val
; /* fixed value assigned in pine.conf.fixed */
633 char *p
; /* pointer to single string value */
634 char **l
; /* pointer to list of string values */
635 } cmdline_val
; /* user typed as cmdline arg */
639 typedef struct feature_entry
{
641 char *dname
; /* display name, same as name if NULL */
644 int section
; /* for grouping in config screen */
645 int defval
; /* default value, 0 or 1 */
649 typedef struct pinerc_line
{
651 struct variable
*var
;
652 unsigned int is_var
:1;
653 unsigned int is_quoted
:1;
654 unsigned int obsolete_var
:1;
659 * Each pinerc has one of these.
661 typedef struct pinerc_s
{
662 RemType type
; /* type of pinerc, remote or local */
663 char *name
; /* file name or remote name */
664 REMDATA_S
*rd
; /* remote data structure */
665 time_t pinerc_written
;
667 unsigned outstanding_pinerc_changes
:1;
668 unsigned quit_to_edit
:1;
669 PINERC_LINE
*pinerc_lines
;
673 typedef enum {ParsePers
, ParsePersPost
, ParseGlobal
, ParseFixed
} ParsePinerc
;
676 /* data stored in a line in the metadata file */
677 typedef struct remote_data_meta
{
678 char *local_cache_file
;
679 imapuid_t uidvalidity
;
683 char read_status
; /* 'R' for readonly, 'W' for readwrite */
689 * Generic name/value pair structure
691 typedef struct nameval
{
692 char *name
; /* the name that goes on the screen */
693 char *shortname
; /* if non-NULL, name that goes in config file */
694 int value
; /* the internal bit number */
698 typedef enum {Main
, Post
, None
} EditWhich
;
703 typedef enum {Directory
, Container
, Keychain
, Nada
} SmimeHolderType
;
705 typedef struct certlist
{
707 void *x509_cert
; /* this is type (X509 *) */
708 struct certlist
*next
;
711 typedef struct smime_stuff
{
713 unsigned do_sign
:1; /* set true if signing */
714 unsigned do_encrypt
:1; /* set true if encrypting */
715 unsigned need_passphrase
:1; /* set true if loading a key failed due to lack of passphrase */
716 unsigned entered_passphrase
:1; /* user entered a passphrase */
717 unsigned already_auto_asked
:1; /* asked for passphrase automatically, not again */
718 volatile char passphrase
[100]; /* storage for the entered passphrase */
719 char *passphrase_emailaddr
; /* pointer to allocated storage */
722 * If we are using the Container type it is easiest if we
723 * read in and maintain a list of certs and then write them
724 * out all at once. For Directory type we just leave the data
725 * in the individual files and read or write the individual
726 * files when needed, so we don't have a list of all the certs.
728 SmimeHolderType publictype
;
731 CertList
*publiccertlist
;
733 SmimeHolderType privatetype
;
735 char *privatecontent
;
736 void *personal_certs
; /* this is type (PERSONAL_CERT *) */
738 SmimeHolderType catype
;
747 /* exported protoypes */
749 #define DF_THREAD_SORT_KEY "thread"
751 #endif /* PITH_CONFTYPE_INCLUDED */