2 * $Id: conftype.h 1155 2008-08-21 18:33:21Z hubert@u.washington.edu $
4 * ========================================================================
5 * Copyright 2013-2014 Eduardo Chappa
6 * Copyright 2006-2008 University of Washington
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
69 , V_THREAD_INDEX_STYLE
72 , V_THREAD_LASTREPLY_CHAR
77 #endif /* ! _WINDOWS */
85 , V_QUOTE_REPLACE_STRING
89 , V_USE_ONLY_DOMAIN_NAME
97 , V_FORCED_ABOOK_ENTRY
98 , V_KBLOCK_PASSWD_COUNT
110 , V_ACTIVE_MSG_INTERVAL
120 , V_UPLOAD_CMD_PREFIX
122 , V_DOWNLOAD_CMD_PREFIX
130 , V_INC2NDCHECKINTERVAL
133 #if !defined(DOS) && !defined(OS2) && !defined(LEAVEOUTFIFO)
138 * Starting here, the rest of the variables are hidden by default in config
139 * screen. They are exposed with expose-hidden-config feature.
148 , V_LAST_TIME_PRUNE_QUESTION
154 , V_DEBUGMEM
/* obsolete */
158 , V_TCPWRITEWARNTIMEO
169 , V_REMOTE_ABOOK_METADATA
170 , V_REMOTE_ABOOK_HISTORY
171 , V_REMOTE_ABOOK_VALIDITY
173 , V_PERSONAL_PRINT_COMMAND
174 , V_PERSONAL_PRINT_CATEGORY
175 , V_PATTERNS
/* obsolete */
178 , V_PAT_FILTS_OLD
/* obsolete */
180 , V_PAT_SCORES_OLD
/* obsolete */
184 , V_ELM_STYLE_SAVE
/* obsolete */
185 , V_HEADER_IN_REPLY
/* obsolete */
186 , V_FEATURE_LEVEL
/* obsolete */
187 , V_OLD_STYLE_REPLY
/* obsolete */
188 , V_COMPOSE_MIME
/* obsolete */
189 , V_SHOW_ALL_CHARACTERS
/* obsolete */
190 , V_SAVE_BY_SENDER
/* obsolete */
191 #if defined(DOS) || defined(OS2)
198 , V_INDEX_COLOR_STYLE
199 , V_TITLEBAR_COLOR_STYLE
206 , V_TITLECLOSED_FORE_COLOR
207 , V_TITLECLOSED_BACK_COLOR
208 , V_FOLDER_FORE_COLOR
209 , V_FOLDER_BACK_COLOR
210 , V_DIRECTORY_FORE_COLOR
211 , V_DIRECTORY_BACK_COLOR
212 , V_FOLDER_LIST_FORE_COLOR
213 , V_FOLDER_LIST_BACK_COLOR
214 , V_STATUS_FORE_COLOR
215 , V_STATUS_BACK_COLOR
216 , V_KEYLABEL_FORE_COLOR
217 , V_KEYLABEL_BACK_COLOR
218 , V_KEYNAME_FORE_COLOR
219 , V_KEYNAME_BACK_COLOR
220 , V_SLCTBL_FORE_COLOR
221 , V_SLCTBL_BACK_COLOR
222 , V_METAMSG_FORE_COLOR
223 , V_METAMSG_BACK_COLOR
224 , V_QUOTE1_FORE_COLOR
225 , V_QUOTE1_BACK_COLOR
226 , V_QUOTE2_FORE_COLOR
227 , V_QUOTE2_BACK_COLOR
228 , V_QUOTE3_FORE_COLOR
229 , V_QUOTE3_BACK_COLOR
230 , V_INCUNSEEN_FORE_COLOR
231 , V_INCUNSEEN_BACK_COLOR
232 , V_SIGNATURE_FORE_COLOR
233 , V_SIGNATURE_BACK_COLOR
234 , V_PROMPT_FORE_COLOR
235 , V_PROMPT_BACK_COLOR
236 , V_HEADER_GENERAL_FORE_COLOR
237 , V_HEADER_GENERAL_BACK_COLOR
238 , V_IND_PLUS_FORE_COLOR
239 , V_IND_PLUS_BACK_COLOR
240 , V_IND_IMP_FORE_COLOR
241 , V_IND_IMP_BACK_COLOR
242 , V_IND_DEL_FORE_COLOR
243 , V_IND_DEL_BACK_COLOR
244 , V_IND_ANS_FORE_COLOR
245 , V_IND_ANS_BACK_COLOR
246 , V_IND_NEW_FORE_COLOR
247 , V_IND_NEW_BACK_COLOR
248 , V_IND_REC_FORE_COLOR
249 , V_IND_REC_BACK_COLOR
250 , V_IND_FWD_FORE_COLOR
251 , V_IND_FWD_BACK_COLOR
252 , V_IND_UNS_FORE_COLOR
253 , V_IND_UNS_BACK_COLOR
254 , V_IND_HIPRI_FORE_COLOR
255 , V_IND_HIPRI_BACK_COLOR
256 , V_IND_LOPRI_FORE_COLOR
257 , V_IND_LOPRI_BACK_COLOR
258 , V_IND_ARR_FORE_COLOR
259 , V_IND_ARR_BACK_COLOR
260 , V_IND_SUBJ_FORE_COLOR
261 , V_IND_SUBJ_BACK_COLOR
262 , V_IND_FROM_FORE_COLOR
263 , V_IND_FROM_BACK_COLOR
264 , V_IND_OP_FORE_COLOR
265 , V_IND_OP_BACK_COLOR
266 , V_INDEX_TOKEN_COLORS
269 #if defined(DOS) || defined(OS2)
278 , V_PRINT_FONT_CHAR_SET
285 , V_PUBLICCERT_CONTAINER
287 , V_PRIVATEKEY_CONTAINER
292 , V_LDAP_SERVERS
/* should be last so make will work right */
304 #define V_LAST_VAR (V_DUMMY - 1)
308 * The list of feature numbers (which bit goes with which feature).
309 * The order of the features is not significant.
315 F_ENABLE_TAB_COMPLETE
,
332 F_READ_IN_NEWSRC_ORDER
,
334 F_SAVE_PARTIAL_WO_CONFIRM
,
335 F_NEXT_THRD_WO_CONFIRM
,
341 F_UNSELECT_WONT_ADVANCE
,
348 F_AUTO_OPEN_NEXT_UNREAD
,
349 F_DISABLE_INDEX_LOCALE_DATES
,
350 F_SELECTED_SHOWN_BOLD
,
352 F_AUTO_INCLUDE_IN_REPLY
,
353 F_DISABLE_CONFIG_SCREEN
,
354 F_DISABLE_PASSWORD_CACHING
,
356 F_DISABLE_PASSWORD_CMD
,
357 F_DISABLE_UPDATE_CMD
,
358 F_DISABLE_KBLOCK_CMD
,
359 F_DISABLE_SIGEDIT_CMD
,
360 F_DISABLE_ROLES_SETUP
,
361 F_DISABLE_ROLES_SIGEDIT
,
362 F_DISABLE_ROLES_TEMPLEDIT
,
363 F_DISABLE_PIPES_IN_SIGS
,
364 F_DISABLE_PIPES_IN_TEMPLATES
,
365 F_ATTACHMENTS_IN_REPLY
,
367 F_ENABLE_INCOMING_CHECKING
,
368 F_INCOMING_CHECKING_TOTAL
,
369 F_INCOMING_CHECKING_RECENT
,
370 F_NO_NEWS_VALIDATION
,
371 F_QUELL_EXTRA_POST_PROMPT
,
372 F_DISABLE_TAKE_LASTFIRST
,
373 F_DISABLE_TAKE_FULLNAMES
,
374 F_DISABLE_TERM_RESET_DISP
,
377 F_QUELL_LOCAL_LOOKUP
,
378 F_COMPOSE_TO_NEWSGRP
,
379 F_PRESERVE_START_STOP
,
380 F_COMPOSE_REJECTS_UNQUAL
,
388 F_PASS_CONTROL_CHARS
,
389 F_PASS_C1_CONTROL_CHARS
,
390 F_SINGLE_FOLDER_LIST
,
391 F_VERTICAL_FOLDER_LIST
,
399 F_DISABLE_SAVE_INPUT_HISTORY
,
408 F_ENABLE_DOT_FOLDERS
,
409 F_FIRST_SEND_FILTER_DFLT
,
410 F_ALWAYS_LAST_FLDR_DFLT
,
413 F_WARN_ABOUT_NO_SUBJECT
,
415 F_WARN_ABOUT_NO_TO_OR_CC
,
418 F_QUELL_LOCK_FAILURE_MSGS
,
419 F_ENABLE_SPACE_AS_TAB
,
420 F_USE_BORING_SPINNER
,
421 F_ENABLE_TAB_DELETES
,
422 F_FLAG_SCREEN_KW_SHORTCUT
,
424 F_ENABLE_XTERM_NEWMAIL
,
425 F_ENABLE_NEWMAIL_SHORT_TEXT
,
426 F_EXPANDED_DISTLISTS
,
429 F_DISABLE_SETLOCALE_COLLATE
,
430 F_FROM_DELIM_IN_PRINT
,
434 F_ENABLE_SEARCH_AND_REPL
,
439 F_ENABLE_STRIP_SIGDASHES
,
440 F_NEW_THREAD_ON_BLANK_SUBJECT
,
441 F_QUELL_PARTIAL_FETCH
,
442 F_QUELL_PERSONAL_NAME_PROMPT
,
443 F_QUELL_USER_ID_PROMPT
,
450 F_QUELL_CHARSET_WARNING
,
452 F_ENABLE_EDIT_REPLY_INDENT
,
454 F_ALLOW_CHANGING_FROM
,
456 F_ENABLE_LESSTHAN_EXIT
,
457 F_ENABLE_FAST_RECENT
,
460 F_ENABLE_TAKE_EXPORT
,
461 F_QUELL_ATTACH_EXTRA_PROMPT
,
463 F_QUELL_ATTACH_EXT_WARN
,
465 F_QUELL_FILTER_DONE_MSG
,
469 F_PREDICT_NNTP_SERVER
,
472 F_QUELL_INTERNAL_MSG
,
475 F_SEPARATE_FLDR_AS_DIR
,
479 F_EXPANDED_ADDRBOOKS
,
482 F_SHOW_TEXTPLAIN_INT
,
483 F_ROLE_CONFIRM_DEFAULT
,
486 F_RET_INBOX_NO_CONFIRM
,
492 F_DO_MAILCAP_PARAM_SUBST
,
494 F_SLCTBL_ITEM_NOBOLD
,
495 F_QUELL_PINGS_COMPOSING
,
496 F_QUELL_PINGS_COMPOSING_INBOX
,
497 F_QUELL_BEZERK_TIMEZONE
,
499 F_QUELL_MAILDOMAIN_WARNING
,
500 F_DISABLE_SHARED_NAMESPACES
,
502 F_MAILDROPS_PRESERVE_STATE
,
503 F_EXPOSE_HIDDEN_CONFIG
,
506 F_ALWAYS_SPELL_CHECK
,
509 F_COLOR_LINE_IMPORTANT
,
511 F_ENABLE_FULL_HDR_AND_TEXT
,
512 F_QUELL_FULL_HDR_RESET
,
514 F_MULNEWSRC_HOSTNAMES_AS_TYPED
,
515 F_STRIP_WS_BEFORE_SEND
,
517 F_COMPOSE_ALWAYS_DOWNGRADE
,
518 F_SORT_DEFAULT_FCC_ALPHA
,
519 F_SORT_DEFAULT_SAVE_ALPHA
,
520 F_QUOTE_REPLACE_NOFLOW
,
522 F_SEND_CONFIRM_ON_EXPAND
,
523 F_ENABLE_NEWMAIL_SOUND
,
524 F_RENDER_HTML_INTERNALLY
,
526 F_FORWARD_AS_ATTACHMENT
,
527 F_PRESERVE_ORIGINAL_FIELD
,
530 #endif /* ! _WINDOWS */
531 F_QUELL_HOST_AFTER_URL
,
532 F_NNTP_SEARCH_USES_OVERVIEW
,
533 F_THREAD_SORTS_BY_ARRIVAL
,
536 F_QUELL_SSL_LARGEBLOCKS
,
537 F_STORE_WINPOS_IN_CONFIG
,
545 F_ENCRYPT_DEFAULT_ON
,
546 F_REMEMBER_SMIME_PASSPHRASE
,
548 F_PUBLICCERTS_IN_KEYCHAIN
,
551 F_FEATURE_LIST_COUNT
/* Number of features */
555 typedef struct init_err
{
556 int flags
, min_time
, max_time
;
563 unsigned is_obsolete
:1; /* variable read in, not written unless set */
564 unsigned is_used
:1; /* Some variables are disabled */
565 unsigned been_written
:1;
567 unsigned is_global
:1;
568 unsigned is_list
:1; /* flag indicating variable is a list */
569 unsigned is_fixed
:1; /* sys mgr has fixed this variable */
570 unsigned is_onlymain
:1; /* read and written from main_user_val */
571 unsigned is_outermost
:1; /* read and written from outermost pinerc */
572 unsigned del_quotes
:1; /* remove double quotes */
573 unsigned is_changed_val
:1; /* WP: use the changed val instead of cur val */
574 char *dname
; /* display name */
575 char *descrip
; /* description */
577 char *p
; /* pointer to single string value */
578 char **l
; /* pointer to list of string values */
581 char *p
; /* pointer to single string value */
582 char **l
; /* pointer to list of string values */
583 } main_user_val
; /* from pinerc */
585 char *p
; /* pointer to single string value */
586 char **l
; /* pointer to list of string values */
587 } changed_val
; /* currently different from pinerc */
589 char *p
; /* pointer to single string value */
590 char **l
; /* pointer to list of string values */
591 } post_user_val
; /* from pinerc */
593 char *p
; /* pointer to single string value */
594 char **l
; /* pointer to list of string values */
595 } global_val
; /* from default or pine.conf */
597 char *p
; /* pointer to single string value */
598 char **l
; /* pointer to list of string values */
599 } fixed_val
; /* fixed value assigned in pine.conf.fixed */
601 char *p
; /* pointer to single string value */
602 char **l
; /* pointer to list of string values */
603 } cmdline_val
; /* user typed as cmdline arg */
607 typedef struct feature_entry
{
609 char *dname
; /* display name, same as name if NULL */
612 int section
; /* for grouping in config screen */
613 int defval
; /* default value, 0 or 1 */
617 typedef struct pinerc_line
{
619 struct variable
*var
;
620 unsigned int is_var
:1;
621 unsigned int is_quoted
:1;
622 unsigned int obsolete_var
:1;
627 * Each pinerc has one of these.
629 typedef struct pinerc_s
{
630 RemType type
; /* type of pinerc, remote or local */
631 char *name
; /* file name or remote name */
632 REMDATA_S
*rd
; /* remote data structure */
633 time_t pinerc_written
;
635 unsigned outstanding_pinerc_changes
:1;
636 unsigned quit_to_edit
:1;
637 PINERC_LINE
*pinerc_lines
;
641 typedef enum {ParsePers
, ParsePersPost
, ParseGlobal
, ParseFixed
} ParsePinerc
;
644 /* data stored in a line in the metadata file */
645 typedef struct remote_data_meta
{
646 char *local_cache_file
;
647 imapuid_t uidvalidity
;
651 char read_status
; /* 'R' for readonly, 'W' for readwrite */
657 * Generic name/value pair structure
659 typedef struct nameval
{
660 char *name
; /* the name that goes on the screen */
661 char *shortname
; /* if non-NULL, name that goes in config file */
662 int value
; /* the internal bit number */
666 typedef enum {Main
, Post
, None
} EditWhich
;
671 typedef enum {Directory
, Container
, Keychain
, Nada
} SmimeHolderType
;
673 typedef enum {Public
, Private
, CACert
} WhichCerts
;
675 typedef struct certdata
{
676 unsigned deleted
:1; /* certificate is marked deleted */
677 unsigned renew
:1; /* we must renew this list, set at top cert */
680 typedef struct certlist
{
682 void *x509_cert
; /* this is type (X509 *) */
684 struct certlist
*next
;
687 typedef struct smime_stuff
{
689 unsigned do_sign
:1; /* set true if signing */
690 unsigned do_encrypt
:1; /* set true if encrypting */
691 unsigned need_passphrase
:1; /* set true if loading a key failed due to lack of passphrase */
692 unsigned entered_passphrase
:1; /* user entered a passphrase */
693 unsigned already_auto_asked
:1; /* asked for passphrase automatically, not again */
694 volatile char passphrase
[100]; /* storage for the entered passphrase */
695 char **passphrase_emailaddr
; /* pointer to allocated storage */
697 void *pwdcert
; /* this has type (PERSONAL_CERT *) */
698 #endif /* PASSFILE */
701 * If we are using the Container type it is easiest if we
702 * read in and maintain a list of certs and then write them
703 * out all at once. For Directory type we just leave the data
704 * in the individual files and read the list of files in the
707 SmimeHolderType publictype
;
710 CertList
*publiccertdata
;
711 CertList
*publiccertlist
;
713 SmimeHolderType privatetype
;
715 char *privatecontent
;
716 CertList
*privatecertdata
;
717 void *personal_certs
; /* this is type (PERSONAL_CERT *) */
719 SmimeHolderType catype
;
722 CertList
*cacertdata
;
723 CertList
*cacertlist
;
727 #define DATACERT(X) (((X) == Public ? ps_global->smime->publiccertdata \
728 : ((X) == Private ? ps_global->smime->privatecertdata \
729 : ((X) == CACert ? ps_global->smime->cacertdata : NULL))))
731 #define PATHCERTDIR(X) (((X) == Public ? ps_global->smime->publicpath \
732 : ((X) == Private ? ps_global->smime->privatepath \
733 : ((X) == CACert ? ps_global->smime->capath : NULL))))
735 #define SMHOLDERTYPE(X) (((X) == Public ? ps_global->smime->publictype \
736 : ((X) == Private ? ps_global->smime->privatetype \
737 : ((X) == CACert ? ps_global->smime->catype : Nada))))
739 #define SMCERTLIST(X) (((X) == Public ? ps_global->smime->publiccertlist \
740 : ((X) == Private ? ps_global->smime->privatecertdata \
741 : ((X) == CACert ? ps_global->smime->cacertlist : NULL))))
743 #define EXTCERT(X) (((X) == Public ? ".crt" \
744 : ((X) == Private ? ".key" \
745 : ((X) == CACert ? ".crt" : NULL))))
747 #define DELETEDCERT(X) ((X)->data.deleted)
748 #define RENEWCERT(X) ((X)->data.renew)
753 /* exported protoypes */
756 #endif /* PITH_CONFTYPE_INCLUDED */