NeoMutt  2024-11-14-34-g5aaf0d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
config_cache.h File Reference

Cache of config variables. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

const struct Slistcc_assumed_charset (void)
 Get the cached value of $assumed_charset.
 
const char * cc_charset (void)
 Get the cached value of $charset.
 
const char * cc_maildir_field_delimiter (void)
 Get the cached value of $maildir_field_delimiter.
 
void config_cache_cleanup (void)
 Cleanup the cache of charset config variables.
 

Detailed Description

Cache of config variables.

Authors
  • Richard Russon
  • Pietro Cerutti

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file config_cache.h.

Function Documentation

◆ cc_assumed_charset()

const struct Slist * cc_assumed_charset ( void  )

Get the cached value of $assumed_charset.

Return values
ptrValue of $assumed_charset

Definition at line 101 of file config_cache.c.

102{
103 if (!CacheActive)
104 {
105 cache_setup();
106 CachedAssumedCharset = cs_subset_slist(NeoMutt->sub, "assumed_charset");
107 }
108
110}
const struct Slist * cs_subset_slist(const struct ConfigSubset *sub, const char *name)
Get a string-list config item by name.
Definition: helpers.c:242
static void cache_setup(void)
Setup a cache of some config variables.
Definition: config_cache.c:83
static const struct Slist * CachedAssumedCharset
Cached value of $assumed_charset.
Definition: config_cache.c:41
static bool CacheActive
Is the cache enabled?
Definition: config_cache.c:39
Container for Accounts, Notifications.
Definition: neomutt.h:42
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cc_charset()

const char * cc_charset ( void  )

Get the cached value of $charset.

Return values
ptrValue of $charset

Definition at line 116 of file config_cache.c.

117{
118 if (!CacheActive)
119 {
120 cache_setup();
122 }
123
124 return CachedCharset;
125}
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:291
static const char * CachedCharset
Cached value of $charset.
Definition: config_cache.c:43
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cc_maildir_field_delimiter()

const char * cc_maildir_field_delimiter ( void  )

Get the cached value of $maildir_field_delimiter.

Return values
ptrValue of $maildir_field_delimiter

Definition at line 131 of file config_cache.c.

132{
133 if (!CacheActive)
134 {
135 cache_setup();
136 CachedMaildirFieldDelimiter = cs_subset_string(NeoMutt->sub, "maildir_field_delimiter");
137 }
138
140}
static const char * CachedMaildirFieldDelimiter
Cached value of $maildir_field_delimiter.
Definition: config_cache.c:45
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ config_cache_cleanup()

void config_cache_cleanup ( void  )

Cleanup the cache of charset config variables.

Definition at line 145 of file config_cache.c.

146{
147 if (NeoMutt)
149
150 // Don't free them, the config system owns the data
152 CachedCharset = NULL;
154
155 CacheActive = false;
156}
static int cc_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: config_cache.c:50
bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data)
Remove an observer from an object.
Definition: notify.c:230
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
Definition: subset.h:52
+ Here is the call graph for this function:
+ Here is the caller graph for this function: