NeoMutt  2020-11-20
Teaching an old dog new tricks
DOXYGEN
config.c
Go to the documentation of this file.
1 
29 #include "config.h"
30 #include <stddef.h>
31 #include <config/lib.h>
32 #include <stdbool.h>
33 #include "mutt/lib.h"
34 #include "lib.h"
35 
36 // clang-format off
37 short C_History;
38 char *C_HistoryFile = NULL;
41 // clang-format on
42 
43 struct ConfigDef HistoryVars[] = {
44  // clang-format off
45  { "history", DT_NUMBER|DT_NOT_NEGATIVE, &C_History, 10, 0, NULL,
46  "Number of history entries to keep in memory per category"
47  },
48  { "history_file", DT_PATH|DT_PATH_FILE, &C_HistoryFile, IP "~/.mutthistory", 0, NULL,
49  "File to save history in"
50  },
51  { "history_remove_dups", DT_BOOL, &C_HistoryRemoveDups, false, 0, NULL,
52  "Remove duplicate entries from the history"
53  },
54  { "save_history", DT_NUMBER|DT_NOT_NEGATIVE, &C_SaveHistory, 0, 0, NULL,
55  "Number of history entries to save per category"
56  },
57  { NULL, 0, NULL, 0, 0, NULL, NULL },
58  // clang-format on
59 };
60 
65 {
66  return cs_register_variables(cs, HistoryVars, 0);
67 }
Container for lots of config items.
Definition: set.h:228
#define IP
Definition: set.h:54
#define DT_NOT_NEGATIVE
Negative numbers are not allowed.
Definition: types.h:47
Config item definition.
Definition: set.h:61
Convenience wrapper for the config headers.
#define DT_PATH_FILE
Path is a file.
Definition: types.h:54
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[], int flags)
Register a set of config items.
Definition: set.c:286
short C_History
Config: Number of history entries to keep in memory per category.
Definition: config.c:37
#define DT_PATH
a path to a file/directory
Definition: types.h:36
short C_SaveHistory
Config: Number of history entries to save per category.
Definition: config.c:40
char * C_HistoryFile
Config: File to save history in.
Definition: config.c:38
bool C_HistoryRemoveDups
Config: Remove duplicate entries from the history.
Definition: config.c:39
Convenience wrapper for the library headers.
#define DT_NUMBER
a number
Definition: types.h:35
#define DT_BOOL
boolean option
Definition: types.h:30
bool config_init_history(struct ConfigSet *cs)
Register history config variables - Implements module_init_config_t.
Definition: config.c:64