conf.h
1 #ifndef CONF_H
2 #define CONF_H 1
3 
4 
5 /*! \addtogroup CONF */
6 /*! @{ */
7 
8 
9 /* ========================================================================== */
10 /* Constants */
11 
12 /*! \brief Number of entries in global configuration array */
13 #define CONF_NUM 57
14 
15 
16 /* ========================================================================== */
17 /* Data types */
18 
19 /*! \brief IDs for use as index in configuration array
20  *
21  * \attention
22  * Don't forget to modify the number of entries \ref CONF_NUM after adding or
23  * removing a configuration entry!
24  *
25  * \note
26  * A C90 compiler is required to assign the values starting from zero without
27  * holes by default. We force the default behaviour explicitly only to make
28  * it more obvious for humans what values are used.
29  */
31 {
32  CONF_POS_X = 0, /*!< Main window X position */
33  CONF_POS_Y = 1, /*!< Main window Y position */
34  CONF_SIZE_X = 2, /*!< Main window X size */
35  CONF_SIZE_Y = 3, /*!< Main window Y size */
36  CONF_TILE_X = 4, /*!< Main window X tiling */
37  CONF_TILE_Y = 5, /*!< Main window Y tiling */
38  CONF_SERVER = 6, /*!< NNTP server hostname or IP address */
39  CONF_SERVICE = 7, /*!< NNTP service name or TCP port */
40  CONF_ENC = 8, /*!< NNTP connection encryption algorithm */
41  CONF_AUTH = 9, /*!< NNTP server authentication algorithm */
42  CONF_IMMEDAUTH = 10, /*!< Flag for immediate authentication */
43  CONF_USER = 11, /*!< NNTP server authentication account */
44  CONF_PASS = 12, /*!< NNTP server authentication password */
45  CONF_CAC = 13, /*!< Clamp article count to this value */
46  CONF_FROM = 14, /*!< "From" name and E-Mail address */
47  CONF_REPLYTO = 15, /*!< "Reply-To" name and E-Mail address */
48  CONF_FQDN = 16, /*!< Fully qualified domain name (FQDN) */
49  CONF_NEWSRC = 17, /*!< Pathname of shared newsrc file */
50  CONF_SCORERC = 18, /*!< Pathname of shared scorerc file */
51  CONF_INTRO = 19, /*!< Introduction line format */
52  CONF_ORGANIZATION = 20, /*!< Organization name poster is part of */
53  CONF_TVIEW = 21, /*!< Flag for threaded view */
54  CONF_ONLYUR = 22, /*!< Flag for only unread articles */
55  CONF_CANCELKEY = 23, /*!< Secret for Cancel-Key */
56  CONF_EDITOR = 24, /*!< Pathname of external editor */
57  CONF_PPROC = 25, /*!< Pathname of external postprocessor */
58  CONF_INEWS = 26, /*!< Pathname of external inews */
59  CONF_QUOTESTYLE = 27, /*!< Quoting style (for citation) */
60  CONF_QUOTEUNIFY = 28, /*!< Unification of quoting style */
61  CONF_TESTGRP_ERE = 29, /*!< ERE pattern to match test groups */
62  CONF_TESTGRP_KWORDS = 30, /*!< Keywords to set for test groups */
63  CONF_TLS_OWNCERTS = 31, /*!< Use local TLS root certificates */
64  CONF_CRL_CHECK = 32, /*!< Use TLS certificate CRL check */
65  CONF_CRL_UPD_IV = 33, /*!< TLS certificate CRL update interval */
66  CONF_CRL_UPD_TS = 34, /*!< TLS certificate CRL update timestamp */
67  CONF_CRL_UPD_C = 35, /*!< TLS certificate CRL update choice */
68  CONF_UTVIEW_AN = 36, /*!< Sort unthreaded view by article num. */
69  CONF_INV_ORDER = 37, /*!< Sort articles with inverted order */
70  CONF_NO_OVER = 38, /*!< NNTP driver doesn't use overview */
71  CONF_DIST_SUGG = 39, /*!< Use distribution suggestions */
72  CONF_COMPRESSION = 40, /*!< NNTP driver negotiates compression */
73  CONF_SIGFILE = 41, /*!< Signature file */
74  CONF_TS_LTIME = 42, /*!< Use local time for timestamps */
75  CONF_TS_COMMENT = 43, /*!< Generate timestamps with TZ comment */
76  CONF_FLOWED_CRLF = 44, /*!< Generate empty line after paragraphs */
77  CONF_FORCE_UNICODE = 45, /*!< Force Unicode for outgoing articles */
78  CONF_SEARCH_CASE_IS = 46, /*!< Search case-insensitive */
79  CONF_ENABLE_UAGENT = 47, /*!< Enable User-Agent header field */
80  CONF_INITIAL_GREETING = 48, /*!< Initial greeting phrase */
81  CONF_REFRESH_INTERVAL = 49, /*!< Group list refresh interval */
82  CONF_UNREAD_IN_NEXT_GROUP = 50, /*!< Skip to next group for unread article */
83  CONF_COLOR_SIGNATURE = 51, /*!< Signature color */
84  CONF_COLOR_EXTERNAL = 52, /*!< External citation color */
85  CONF_COLOR_LEVEL1 = 53, /*!< Citation color level 1 */
86  CONF_COLOR_LEVEL2 = 54, /*!< Citation color level 2 */
87  CONF_COLOR_LEVEL3 = 55, /*!< Citation color level 3 */
88  CONF_COLOR_LEVEL4 = 56 /*!< Citation color level 4 */
89  /* !!! Set 'CONF_NUM' above to the first unused value !!! */
90 };
91 
92 /*! \brief Data types of configuration array entries */
94 {
95  CONF_TYPE_INT, /*!< Entry is of integer type */
96  CONF_TYPE_STRING /*!< Entry is of string type */
97 };
98 
99 /*! \brief Configuration array entry value */
101 {
102  int i; /*!< Integer entry value */
103  char* s; /*!< String entry value */
104 };
105 
106 /*! \brief Configuration array entry */
107 struct conf
108 {
109  const char* label; /*!< Name before the colon */
110  enum conf_entry_type type; /*!< Type of entry */
111  union conf_entry_val val; /*!< Value of the entry behind the colon */
112  int found; /*!< Flag indicating entry in config file */
113 };
114 
115 
116 /*! @} */
117 
118 
119 /* ========================================================================== */
120 /* Variables */
121 
122 extern struct conf config[CONF_NUM];
123 extern int conf_ephemeral_passwd;
124 
125 
126 /* ========================================================================== */
127 /* Function prototypes */
128 
129 int conf_load(struct conf*);
130 int conf_store(struct conf*);
131 void conf_delete(struct conf*);
132 int conf_string_replace(struct conf*, const char*);
133 int conf_integer_check(enum conf_entry, int, int);
134 
135 
136 #endif /* CONF_H */
137 
138 /* EOF */
CONF_COLOR_SIGNATURE
Definition: conf.h:83
CONF_INTRO
Definition: conf.h:51
CONF_FORCE_UNICODE
Definition: conf.h:77
CONF_AUTH
Definition: conf.h:41
CONF_ORGANIZATION
Definition: conf.h:52
CONF_DIST_SUGG
Definition: conf.h:71
CONF_ONLYUR
Definition: conf.h:54
CONF_SERVICE
Definition: conf.h:39
CONF_CRL_CHECK
Definition: conf.h:64
CONF_COLOR_LEVEL2
Definition: conf.h:86
CONF_EDITOR
Definition: conf.h:56
CONF_SIGFILE
Definition: conf.h:73
CONF_NUM
#define CONF_NUM
Number of entries in global configuration array.
Definition: conf.h:13
conf::type
enum conf_entry_type type
Definition: conf.h:110
CONF_POS_Y
Definition: conf.h:33
config
struct conf config[CONF_NUM]
Global configuration.
Definition: conf.c:63
conf_entry_val::s
char * s
Definition: conf.h:103
conf_store
int conf_store(struct conf *)
Store configuration to config file.
Definition: conf.c:818
CONF_FROM
Definition: conf.h:46
CONF_SIZE_X
Definition: conf.h:34
conf_string_replace
int conf_string_replace(struct conf *, const char *)
Replace configuration string.
Definition: conf.c:912
conf_entry_val
Configuration array entry value.
Definition: conf.h:100
CONF_SCORERC
Definition: conf.h:50
CONF_REFRESH_INTERVAL
Definition: conf.h:81
CONF_COLOR_LEVEL1
Definition: conf.h:85
conf_entry_type
conf_entry_type
Data types of configuration array entries.
Definition: conf.h:93
conf::found
int found
Definition: conf.h:112
CONF_COLOR_EXTERNAL
Definition: conf.h:84
CONF_REPLYTO
Definition: conf.h:47
CONF_QUOTESTYLE
Definition: conf.h:59
CONF_COLOR_LEVEL3
Definition: conf.h:87
CONF_UTVIEW_AN
Definition: conf.h:68
CONF_UNREAD_IN_NEXT_GROUP
Definition: conf.h:82
conf_entry_val::i
int i
Definition: conf.h:102
CONF_CAC
Definition: conf.h:45
CONF_INEWS
Definition: conf.h:58
conf_delete
void conf_delete(struct conf *)
Delete configuration.
Definition: conf.c:726
CONF_COMPRESSION
Definition: conf.h:72
conf_entry
conf_entry
IDs for use as index in configuration array.
Definition: conf.h:30
CONF_INITIAL_GREETING
Definition: conf.h:80
conf
Configuration array entry.
Definition: conf.h:107
conf_integer_check
int conf_integer_check(enum conf_entry, int, int)
Check integer value against lower and upper bounds.
Definition: conf.c:958
CONF_TS_LTIME
Definition: conf.h:74
CONF_TVIEW
Definition: conf.h:53
CONF_NEWSRC
Definition: conf.h:49
CONF_PASS
Definition: conf.h:44
CONF_USER
Definition: conf.h:43
conf_ephemeral_passwd
int conf_ephemeral_passwd
Flag indicating that password should not be stored in configfile.
Definition: conf.c:70
conf_load
int conf_load(struct conf *)
Load configuration from config file.
Definition: conf.c:762
CONF_POS_X
Definition: conf.h:32
CONF_COLOR_LEVEL4
Definition: conf.h:88
CONF_TILE_X
Definition: conf.h:36
CONF_TS_COMMENT
Definition: conf.h:75
CONF_TILE_Y
Definition: conf.h:37
CONF_CRL_UPD_TS
Definition: conf.h:66
CONF_INV_ORDER
Definition: conf.h:69
conf::val
union conf_entry_val val
Definition: conf.h:111
CONF_TYPE_STRING
Definition: conf.h:96
CONF_SEARCH_CASE_IS
Definition: conf.h:78
CONF_ENABLE_UAGENT
Definition: conf.h:79
CONF_TYPE_INT
Definition: conf.h:95
CONF_NO_OVER
Definition: conf.h:70
CONF_QUOTEUNIFY
Definition: conf.h:60
CONF_TESTGRP_ERE
Definition: conf.h:61
CONF_ENC
Definition: conf.h:40
CONF_CRL_UPD_C
Definition: conf.h:67
CONF_CANCELKEY
Definition: conf.h:55
CONF_SERVER
Definition: conf.h:38
CONF_FLOWED_CRLF
Definition: conf.h:76
CONF_TLS_OWNCERTS
Definition: conf.h:63
CONF_FQDN
Definition: conf.h:48
CONF_IMMEDAUTH
Definition: conf.h:42
CONF_CRL_UPD_IV
Definition: conf.h:65
CONF_TESTGRP_KWORDS
Definition: conf.h:62
CONF_SIZE_Y
Definition: conf.h:35
CONF_PPROC
Definition: conf.h:57
conf::label
const char * label
Definition: conf.h:109

Generated at 2024-04-27 using  doxygen