2 * $Id: conftype.h 1155 2008-08-21 18:33:21Z hubert@u.washington.edu $
4 * ========================================================================
5 * Copyright 2013-2022 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 */
88 , V_QUOTE_REPLACE_STRING
92 , V_USE_ONLY_DOMAIN_NAME
100 , V_FORCED_ABOOK_ENTRY
101 , V_KBLOCK_PASSWD_COUNT
113 , V_ACTIVE_MSG_INTERVAL
122 , V_UPLOAD_CMD_PREFIX
124 , V_DOWNLOAD_CMD_PREFIX
127 #if !defined(_WINDOWS) || defined(WINDOWS_UNIXSSL_CERTS)
140 , V_INC2NDCHECKINTERVAL
143 #if !defined(DOS) && !defined(OS2) && !defined(LEAVEOUTFIFO)
148 * Starting here, the rest of the variables are hidden by default in config
149 * screen. They are exposed with expose-hidden-config feature.
158 , V_LAST_TIME_PRUNE_QUESTION
164 , V_DEBUGMEM
/* obsolete */
168 , V_TCPWRITEWARNTIMEO
180 #ifdef DF_ENCRYPTION_RANGE
182 #endif /* DF_ENCRYPTION_RANGE */
183 , V_REMOTE_ABOOK_METADATA
184 , V_REMOTE_ABOOK_HISTORY
185 , V_REMOTE_ABOOK_VALIDITY
187 , V_PERSONAL_PRINT_COMMAND
188 , V_PERSONAL_PRINT_CATEGORY
190 , V_PATTERNS
/* obsolete */
193 , V_PAT_FILTS_OLD
/* obsolete */
195 , V_PAT_SCORES_OLD
/* obsolete */
199 , V_ELM_STYLE_SAVE
/* obsolete */
200 , V_HEADER_IN_REPLY
/* obsolete */
201 , V_FEATURE_LEVEL
/* obsolete */
202 , V_OLD_STYLE_REPLY
/* obsolete */
203 , V_COMPOSE_MIME
/* obsolete */
204 , V_SHOW_ALL_CHARACTERS
/* obsolete */
205 , V_SAVE_BY_SENDER
/* obsolete */
206 #if defined(DOS) || defined(OS2)
213 , V_INDEX_COLOR_STYLE
214 , V_TITLEBAR_COLOR_STYLE
221 , V_TITLECLOSED_FORE_COLOR
222 , V_TITLECLOSED_BACK_COLOR
223 , V_FOLDER_FORE_COLOR
224 , V_FOLDER_BACK_COLOR
225 , V_DIRECTORY_FORE_COLOR
226 , V_DIRECTORY_BACK_COLOR
227 , V_FOLDER_LIST_FORE_COLOR
228 , V_FOLDER_LIST_BACK_COLOR
229 , V_STATUS_FORE_COLOR
230 , V_STATUS_BACK_COLOR
231 , V_KEYLABEL_FORE_COLOR
232 , V_KEYLABEL_BACK_COLOR
233 , V_KEYNAME_FORE_COLOR
234 , V_KEYNAME_BACK_COLOR
235 , V_SLCTBL_FORE_COLOR
236 , V_SLCTBL_BACK_COLOR
237 , V_METAMSG_FORE_COLOR
238 , V_METAMSG_BACK_COLOR
239 , V_QUOTE1_FORE_COLOR
240 , V_QUOTE1_BACK_COLOR
241 , V_QUOTE2_FORE_COLOR
242 , V_QUOTE2_BACK_COLOR
243 , V_QUOTE3_FORE_COLOR
244 , V_QUOTE3_BACK_COLOR
245 , V_INCUNSEEN_FORE_COLOR
246 , V_INCUNSEEN_BACK_COLOR
247 , V_SIGNATURE_FORE_COLOR
248 , V_SIGNATURE_BACK_COLOR
249 , V_PROMPT_FORE_COLOR
250 , V_PROMPT_BACK_COLOR
251 , V_HEADER_GENERAL_FORE_COLOR
252 , V_HEADER_GENERAL_BACK_COLOR
253 , V_IND_PLUS_FORE_COLOR
254 , V_IND_PLUS_BACK_COLOR
255 , V_IND_IMP_FORE_COLOR
256 , V_IND_IMP_BACK_COLOR
257 , V_IND_DEL_FORE_COLOR
258 , V_IND_DEL_BACK_COLOR
259 , V_IND_ANS_FORE_COLOR
260 , V_IND_ANS_BACK_COLOR
261 , V_IND_NEW_FORE_COLOR
262 , V_IND_NEW_BACK_COLOR
263 , V_IND_REC_FORE_COLOR
264 , V_IND_REC_BACK_COLOR
265 , V_IND_FWD_FORE_COLOR
266 , V_IND_FWD_BACK_COLOR
267 , V_IND_UNS_FORE_COLOR
268 , V_IND_UNS_BACK_COLOR
269 , V_IND_HIPRI_FORE_COLOR
270 , V_IND_HIPRI_BACK_COLOR
271 , V_IND_LOPRI_FORE_COLOR
272 , V_IND_LOPRI_BACK_COLOR
273 , V_IND_ARR_FORE_COLOR
274 , V_IND_ARR_BACK_COLOR
275 , V_IND_SUBJ_FORE_COLOR
276 , V_IND_SUBJ_BACK_COLOR
277 , V_IND_FROM_FORE_COLOR
278 , V_IND_FROM_BACK_COLOR
279 , V_IND_OP_FORE_COLOR
280 , V_IND_OP_BACK_COLOR
281 , V_INDEX_TOKEN_COLORS
284 #if defined(DOS) || defined(OS2)
293 , V_PRINT_FONT_CHAR_SET
301 , V_PUBLICCERT_CONTAINER
303 , V_PRIVATEKEY_CONTAINER
308 , V_LDAP_SERVERS
/* should be last so make will work right */
320 #define V_LAST_VAR (V_DUMMY - 1)
324 * The list of feature numbers (which bit goes with which feature).
325 * The order of the features is not significant.
331 F_ENABLE_TAB_COMPLETE
,
348 F_READ_IN_NEWSRC_ORDER
,
350 F_SAVE_PARTIAL_WO_CONFIRM
,
351 F_NEXT_THRD_WO_CONFIRM
,
357 F_UNSELECT_WONT_ADVANCE
,
365 F_AUTO_OPEN_NEXT_UNREAD
,
366 F_DISABLE_INDEX_LOCALE_DATES
,
367 F_SELECTED_SHOWN_BOLD
,
369 F_AUTO_INCLUDE_IN_REPLY
,
370 F_DISABLE_CONFIG_SCREEN
,
371 F_DISABLE_PASSWORD_CACHING
,
372 #ifdef LOCAL_PASSWD_CACHE
373 F_DISABLE_PASSWORD_FILE_SAVING
,
374 #endif /* LOCAL_PASSWD_CACHE */
376 F_DISABLE_PASSWORD_CMD
,
377 F_DISABLE_UPDATE_CMD
,
378 F_DISABLE_KBLOCK_CMD
,
379 F_DISABLE_SIGEDIT_CMD
,
380 F_ENABLE_DEL_WHEN_WRITING
,
381 F_DISABLE_ROLES_SETUP
,
382 F_DISABLE_ROLES_SIGEDIT
,
383 F_DISABLE_ROLES_TEMPLEDIT
,
384 F_DISABLE_PIPES_IN_SIGS
,
385 F_DISABLE_PIPES_IN_TEMPLATES
,
386 F_ATTACHMENTS_IN_REPLY
,
388 F_ENABLE_INCOMING_CHECKING
,
389 F_INCOMING_CHECKING_TOTAL
,
390 F_INCOMING_CHECKING_RECENT
,
391 F_NO_NEWS_VALIDATION
,
392 F_QUELL_EXTRA_POST_PROMPT
,
393 F_DISABLE_TAKE_LASTFIRST
,
394 F_DISABLE_TAKE_FULLNAMES
,
395 F_DISABLE_TERM_RESET_DISP
,
398 F_QUELL_LOCAL_LOOKUP
,
399 F_COMPOSE_TO_NEWSGRP
,
400 F_PRESERVE_START_STOP
,
401 F_COMPOSE_REJECTS_UNQUAL
,
409 F_PASS_CONTROL_CHARS
,
410 F_PASS_C1_CONTROL_CHARS
,
411 F_SINGLE_FOLDER_LIST
,
412 F_VERTICAL_FOLDER_LIST
,
420 F_DISABLE_SAVE_INPUT_HISTORY
,
429 F_ENABLE_DOT_FOLDERS
,
430 F_FIRST_SEND_FILTER_DFLT
,
431 F_ALWAYS_LAST_FLDR_DFLT
,
434 F_WARN_ABOUT_NO_SUBJECT
,
436 F_WARN_ABOUT_NO_TO_OR_CC
,
439 F_QUELL_LOCK_FAILURE_MSGS
,
440 F_ENABLE_SPACE_AS_TAB
,
441 F_USE_BORING_SPINNER
,
442 F_ENABLE_TAB_DELETES
,
443 F_FLAG_SCREEN_KW_SHORTCUT
,
445 F_ENABLE_XTERM_NEWMAIL
,
446 F_ENABLE_NEWMAIL_SHORT_TEXT
,
447 F_EXPANDED_DISTLISTS
,
450 F_DISABLE_SETLOCALE_COLLATE
,
451 F_FROM_DELIM_IN_PRINT
,
455 F_ENABLE_SEARCH_AND_REPL
,
460 F_ENABLE_STRIP_SIGDASHES
,
461 F_NEW_THREAD_ON_BLANK_SUBJECT
,
462 F_QUELL_PARTIAL_FETCH
,
463 F_QUELL_PERSONAL_NAME_PROMPT
,
464 F_QUELL_USER_ID_PROMPT
,
470 F_EXTERNAL_INLINE_IMAGES
,
472 F_QUELL_CHARSET_WARNING
,
474 F_ENABLE_EDIT_REPLY_INDENT
,
476 F_ALLOW_CHANGING_FROM
,
478 F_ENABLE_LESSTHAN_EXIT
,
479 F_ENABLE_FAST_RECENT
,
482 F_ENABLE_TAKE_EXPORT
,
483 F_QUELL_ATTACH_EXTRA_PROMPT
,
485 F_QUELL_ATTACH_EXT_WARN
,
487 F_QUELL_FILTER_DONE_MSG
,
491 F_PREDICT_NNTP_SERVER
,
494 F_QUELL_INTERNAL_MSG
,
497 F_SEPARATE_FLDR_AS_DIR
,
501 F_EXPANDED_ADDRBOOKS
,
504 F_SHOW_TEXTPLAIN_INT
,
505 F_ROLE_CONFIRM_DEFAULT
,
508 F_RET_INBOX_NO_CONFIRM
,
514 F_DO_MAILCAP_PARAM_SUBST
,
516 F_SLCTBL_ITEM_NOBOLD
,
517 F_QUELL_PINGS_COMPOSING
,
518 F_QUELL_PINGS_COMPOSING_INBOX
,
519 F_QUELL_BEZERK_TIMEZONE
,
521 F_QUELL_MAILDOMAIN_WARNING
,
522 F_DISABLE_SHARED_NAMESPACES
,
524 F_MAILDROPS_PRESERVE_STATE
,
525 F_EXPOSE_HIDDEN_CONFIG
,
529 F_ALWAYS_SPELL_CHECK
,
532 F_COLOR_LINE_IMPORTANT
,
534 F_ENABLE_FULL_HDR_AND_TEXT
,
535 F_QUELL_FULL_HDR_RESET
,
537 F_MULNEWSRC_HOSTNAMES_AS_TYPED
,
538 F_STRIP_WS_BEFORE_SEND
,
540 F_COMPOSE_ALWAYS_DOWNGRADE
,
541 F_SORT_DEFAULT_FCC_ALPHA
,
542 F_SORT_DEFAULT_SAVE_ALPHA
,
543 F_QUOTE_REPLACE_NOFLOW
,
545 F_SEND_CONFIRM_ON_EXPAND
,
546 F_ENABLE_NEWMAIL_SOUND
,
547 F_RENDER_HTML_INTERNALLY
,
549 F_FORWARD_AS_ATTACHMENT
,
550 F_PRESERVE_ORIGINAL_FIELD
,
553 #endif /* ! _WINDOWS */
554 F_QUELL_HOST_AFTER_URL
,
555 F_NNTP_SEARCH_USES_OVERVIEW
,
556 F_THREAD_SORTS_BY_ARRIVAL
,
559 F_QUELL_SSL_LARGEBLOCKS
,
560 F_STORE_WINPOS_IN_CONFIG
,
568 F_ENCRYPT_DEFAULT_ON
,
569 F_REMEMBER_SMIME_PASSPHRASE
,
570 F_USE_CERT_STORE_ONLY
,
572 F_PUBLICCERTS_IN_KEYCHAIN
,
575 F_FEATURE_LIST_COUNT
/* Number of features */
579 typedef struct init_err
{
580 int flags
, min_time
, max_time
;
587 unsigned is_obsolete
:1; /* variable read in, not written unless set */
588 unsigned is_used
:1; /* Some variables are disabled */
589 unsigned been_written
:1;
591 unsigned is_global
:1;
592 unsigned is_list
:1; /* flag indicating variable is a list */
593 unsigned is_fixed
:1; /* sys mgr has fixed this variable */
594 unsigned is_onlymain
:1; /* read and written from main_user_val */
595 unsigned is_outermost
:1; /* read and written from outermost pinerc */
596 unsigned del_quotes
:1; /* remove double quotes */
597 unsigned is_changed_val
:1; /* WP: use the changed val instead of cur val */
598 char *dname
; /* display name */
599 char *descrip
; /* description */
601 char *p
; /* pointer to single string value */
602 char **l
; /* pointer to list of string values */
605 char *p
; /* pointer to single string value */
606 char **l
; /* pointer to list of string values */
607 } main_user_val
; /* from pinerc */
609 char *p
; /* pointer to single string value */
610 char **l
; /* pointer to list of string values */
611 } changed_val
; /* currently different from pinerc */
613 char *p
; /* pointer to single string value */
614 char **l
; /* pointer to list of string values */
615 } post_user_val
; /* from pinerc */
617 char *p
; /* pointer to single string value */
618 char **l
; /* pointer to list of string values */
619 } global_val
; /* from default or pine.conf */
621 char *p
; /* pointer to single string value */
622 char **l
; /* pointer to list of string values */
623 } fixed_val
; /* fixed value assigned in pine.conf.fixed */
625 char *p
; /* pointer to single string value */
626 char **l
; /* pointer to list of string values */
627 } cmdline_val
; /* user typed as cmdline arg */
631 typedef struct feature_entry
{
633 char *dname
; /* display name, same as name if NULL */
636 int section
; /* for grouping in config screen */
637 int defval
; /* default value, 0 or 1 */
641 typedef struct pinerc_line
{
643 struct variable
*var
;
644 unsigned int is_var
:1;
645 unsigned int is_quoted
:1;
646 unsigned int obsolete_var
:1;
651 * Each pinerc has one of these.
653 typedef struct pinerc_s
{
654 RemType type
; /* type of pinerc, remote or local */
655 char *name
; /* file name or remote name */
656 REMDATA_S
*rd
; /* remote data structure */
657 time_t pinerc_written
;
659 unsigned outstanding_pinerc_changes
:1;
660 unsigned quit_to_edit
:1;
661 PINERC_LINE
*pinerc_lines
;
665 typedef enum {ParsePers
, ParsePersPost
, ParseGlobal
, ParseFixed
} ParsePinerc
;
668 /* data stored in a line in the metadata file */
669 typedef struct remote_data_meta
{
670 char *local_cache_file
;
671 imapuid_t uidvalidity
;
675 char read_status
; /* 'R' for readonly, 'W' for readwrite */
681 * Generic name/value pair structure
683 typedef struct nameval
{
684 char *name
; /* the name that goes on the screen */
685 char *shortname
; /* if non-NULL, name that goes in config file */
686 int value
; /* the internal bit number */
690 typedef enum {Main
, Post
, None
} EditWhich
;
695 typedef enum {Directory
, Container
, Keychain
, Nada
} SmimeHolderType
;
697 typedef enum {Public
, Private
, CACert
, Password
} WhichCerts
;
699 typedef struct certdata
{
700 unsigned deleted
:1; /* certificate is marked deleted */
701 unsigned renew
:1; /* we must renew this list, set at top cert */
702 char *date_from
; /* date from which certificate is valid */
703 char *date_to
; /* date certificate expires */
704 char *md5
; /* MD5 Hash */
707 typedef struct certlist
{
708 char *name
; /* file name */
709 char *cn
; /* CN field from certificate */
710 void *x509_cert
; /* this is type (X509 *) */
712 struct certlist
*next
;
715 typedef struct smime_stuff
{
717 unsigned do_sign
:1; /* set true if signing */
718 unsigned do_encrypt
:1; /* set true if encrypting */
719 unsigned need_passphrase
:1; /* set true if loading a key failed due to lack of passphrase */
720 unsigned entered_passphrase
:1; /* user entered a passphrase */
721 unsigned already_auto_asked
:1; /* asked for passphrase automatically, not again */
722 volatile char passphrase
[100]; /* storage for the entered passphrase */
723 char **passphrase_emailaddr
; /* pointer to allocated storage */
726 * If we are using the Container type it is easiest if we
727 * read in and maintain a list of certs and then write them
728 * out all at once. For Directory type we just leave the data
729 * in the individual files and read the list of files in the
732 SmimeHolderType publictype
;
735 CertList
*publiccertlist
;
736 CertList
*backuppubliccertlist
;
738 SmimeHolderType privatetype
;
740 char *privatecontent
;
741 CertList
*privatecertlist
;
742 CertList
*backupprivatecertlist
;
743 void *personal_certs
; /* this is type (PERSONAL_CERT *) */
745 SmimeHolderType catype
;
748 CertList
*cacertlist
;
749 CertList
*backupcacertlist
;
753 #define BACKUPDATACERT(X) ((X) == Public ? ps_global->smime->backuppubliccertlist : \
754 (X) == Private ? ps_global->smime->backupprivatecertlist : \
755 (X) == CACert ? ps_global->smime->backupcacertlist : \
756 (X) == Password ? (CertList *) ps_global->backuppassword : \
759 #define DATACERT(X) ((X) == Public ? ps_global->smime->publiccertlist : \
760 (X) == Private ? ps_global->smime->privatecertlist : \
761 (X) == CACert ? ps_global->smime->cacertlist : \
762 (X) == Password ? (CertList *) ps_global->pwdcertlist : \
765 #define PATHCERTDIR(X) ((X) == Public ? ps_global->smime->publicpath : \
766 (X) == Private ? ps_global->smime->privatepath : \
767 (X) == CACert ? ps_global->smime->capath : \
768 (X) == Password ? ps_global->pwdcertdir : \
771 #define CONTENTCERTLIST(X) ((X) == Public ? ps_global->smime->publiccontent : \
772 (X) == Private ? ps_global->smime->privatecontent : \
773 (X) == CACert ? ps_global->smime->cacontent : \
774 (X) == Password ? ps_global->pwdcertcontent : \
777 #define SMHOLDERTYPE(X) ((X) == Public ? ps_global->smime->publictype : \
778 (X) == Private ? ps_global->smime->privatetype : \
779 (X) == CACert ? ps_global->smime->catype : \
780 (X) == Password ? Directory : \
783 #define EXTCERT(X) (((X) == Public ? ".crt" \
784 : ((X) == Private ? ".key" \
785 : ((X) == CACert ? ".crt" : ""))))
787 #define DELETEDCERT(X) ((X)->data.deleted)
788 #define RENEWCERT(X) ((X)->data.renew)
789 #define DATEFROMCERT(X) ((X)->data.date_from)
790 #define DATETOCERT(X) ((X)->data.date_to)
791 #define MD5CERT(X) ((X)->data.md5)
796 /* exported prototypes */
799 #endif /* PITH_CONFTYPE_INCLUDED */