NeoMutt  2024-04-25-89-g194907
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
config.c File Reference

Config used by libbrowser. More...

#include "config.h"
#include <stdbool.h>
#include <stddef.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "lib.h"
#include "expando/lib.h"
+ Include dependency graph for config.c:

Go to the source code of this file.

Functions

struct ExpandoNodeparse_folder_date (const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
 Parse a Date Expando - Implements ExpandoDefinition::parse() -.
 
bool config_init_browser (struct ConfigSet *cs)
 Register browser config variables - Implements module_init_config_t -.
 

Variables

static const struct Mapping SortBrowserMethods []
 Sort methods for the folder/dir browser.
 
static const struct ExpandoDefinition FolderFormatDef []
 Expando definitions.
 
static const struct ExpandoDefinition GroupIndexFormatDef []
 Expando definitions.
 
static struct ConfigDef BrowserVars []
 Config definitions for the browser.
 

Detailed Description

Config used by libbrowser.

Authors
  • Carlos Henrique Lima Melara
  • Richard Russon
  • наб

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.c.

Variable Documentation

◆ SortBrowserMethods

const struct Mapping SortBrowserMethods[]
static
Initial value:
= {
{ "alpha", SORT_SUBJECT },
{ "count", SORT_COUNT },
{ "date", SORT_DATE },
{ "desc", SORT_DESC },
{ "new", SORT_UNREAD },
{ "unread", SORT_UNREAD },
{ "size", SORT_SIZE },
{ "unsorted", SORT_ORDER },
{ NULL, 0 },
}
@ SORT_SUBJECT
Sort by the email's subject.
Definition: sort2.h:38
@ SORT_ORDER
Sort by the order the messages appear in the mailbox.
Definition: sort2.h:40
@ SORT_SIZE
Sort by the size of the email.
Definition: sort2.h:36
@ SORT_DESC
Sort by the folder's description.
Definition: sort2.h:55
@ SORT_DATE
Sort by the date the email was sent.
Definition: sort2.h:35
@ SORT_COUNT
Sort by number of emails in a folder.
Definition: sort2.h:50
@ SORT_UNREAD
Sort by the number of unread emails.
Definition: sort2.h:51

Sort methods for the folder/dir browser.

Definition at line 42 of file config.c.

◆ FolderFormatDef

const struct ExpandoDefinition FolderFormatDef[]
static
Initial value:
= {
{ " ", "padding-space", ED_GLOBAL, ED_GLO_PADDING_SPACE, E_TYPE_STRING, NULL },
{ "a", "notify", ED_FOLDER, ED_FOL_NOTIFY, E_TYPE_NUMBER, NULL },
{ "C", "number", ED_FOLDER, ED_FOL_NUMBER, E_TYPE_NUMBER, NULL },
{ "d", "date", ED_FOLDER, ED_FOL_DATE, E_TYPE_STRING, NULL },
{ "D", "date-format", ED_FOLDER, ED_FOL_DATE_FORMAT, E_TYPE_STRING, NULL },
{ "f", "filename", ED_FOLDER, ED_FOL_FILENAME, E_TYPE_STRING, NULL },
{ "F", "file-mode", ED_FOLDER, ED_FOL_FILE_MODE, E_TYPE_STRING, NULL },
{ "g", "file-group", ED_FOLDER, ED_FOL_FILE_GROUP, E_TYPE_STRING, NULL },
{ "i", "description", ED_FOLDER, ED_FOL_DESCRIPTION, E_TYPE_STRING, NULL },
{ "l", "hard-links", ED_FOLDER, ED_FOL_HARD_LINKS, E_TYPE_STRING, NULL },
{ "m", "message-count", ED_FOLDER, ED_FOL_MESSAGE_COUNT, E_TYPE_NUMBER, NULL },
{ "n", "unread-count", ED_FOLDER, ED_FOL_UNREAD_COUNT, E_TYPE_NUMBER, NULL },
{ "N", "new-mail", ED_FOLDER, ED_FOL_NEW_MAIL, E_TYPE_STRING, NULL },
{ "p", "poll", ED_FOLDER, ED_FOL_POLL, E_TYPE_NUMBER, NULL },
{ "s", "file-size", ED_FOLDER, ED_FOL_FILE_SIZE, E_TYPE_NUMBER, NULL },
{ "t", "tagged", ED_FOLDER, ED_FOL_TAGGED, E_TYPE_STRING, NULL },
{ "u", "file-owner", ED_FOLDER, ED_FOL_FILE_OWNER, E_TYPE_STRING, NULL },
{ NULL, NULL, 0, -1, -1, NULL }
}
@ ED_FOL_POLL
FolderFile.poll_new_mail.
Definition: lib.h:134
@ ED_FOL_NOTIFY
FolderFile.notify_user.
Definition: lib.h:132
@ ED_FOL_FILE_OWNER
FolderFile.uid.
Definition: lib.h:123
@ ED_FOL_FILE_GROUP
FolderFile.gid.
Definition: lib.h:121
@ ED_FOL_FILENAME
FolderFile.name.
Definition: lib.h:120
@ ED_FOL_DATE_FORMAT
FolderFile.mtime.
Definition: lib.h:118
@ ED_FOL_UNREAD_COUNT
FolderFile.msg_unread.
Definition: lib.h:137
@ ED_FOL_FILE_MODE
FolderFile.move.
Definition: lib.h:122
@ ED_FOL_NEW_MAIL
FolderFile.has_new_mail.
Definition: lib.h:131
@ ED_FOL_FILE_SIZE
FolderFile.size.
Definition: lib.h:124
@ ED_FOL_HARD_LINKS
FolderFile.nlink.
Definition: lib.h:127
@ ED_FOL_DATE
FolderFile.mtime.
Definition: lib.h:117
@ ED_FOL_STRF
FolderFile.mtime.
Definition: lib.h:135
@ ED_FOL_TAGGED
FolderFile.tagged.
Definition: lib.h:136
@ ED_FOL_NUMBER
Folder.num.
Definition: lib.h:133
@ ED_FOL_DESCRIPTION
FolderFile.desc, FolderFile.name.
Definition: lib.h:119
@ ED_FOL_MESSAGE_COUNT
FolderFile.msg_count.
Definition: lib.h:128
@ E_TYPE_STRING
Data is a string.
Definition: definition.h:37
@ E_TYPE_NUMBER
Data is numeric.
Definition: definition.h:38
@ ED_FOLDER
Folder ED_FOL_ ExpandoDataFolder.
Definition: domain.h:43
@ ED_GLOBAL
Global ED_GLO_ ExpandoDataGlobal.
Definition: domain.h:44
struct ExpandoNode * parse_folder_date(const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
Parse a Date Expando - Implements ExpandoDefinition::parse() -.
Definition: config.c:62
struct ExpandoNode * node_padding_parse(const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
Parse a Padding Expando - Implements ExpandoDefinition::parse() -.
Definition: node_padding.c:232
@ ED_GLO_PADDING_EOL
Padding to end-of-line.
Definition: uid.h:36
@ ED_GLO_PADDING_HARD
Hard Padding.
Definition: uid.h:37
@ ED_GLO_PADDING_SOFT
Soft Padding.
Definition: uid.h:38
@ ED_GLO_PADDING_SPACE
Space Padding.
Definition: uid.h:39

Expando definitions.

Config:

  • $folder_format
  • $mailbox_folder_format

Definition at line 81 of file config.c.

◆ GroupIndexFormatDef

const struct ExpandoDefinition GroupIndexFormatDef[]
static
Initial value:
= {
{ "a", "notify", ED_FOLDER, ED_FOL_NOTIFY, E_TYPE_NUMBER, NULL },
{ "C", "number", ED_FOLDER, ED_FOL_NUMBER, E_TYPE_NUMBER, NULL },
{ "d", "description", ED_FOLDER, ED_FOL_DESCRIPTION, E_TYPE_STRING, NULL },
{ "f", "newsgroup", ED_FOLDER, ED_FOL_NEWSGROUP, E_TYPE_STRING, NULL },
{ "M", "flags", ED_FOLDER, ED_FOL_FLAGS, E_TYPE_STRING, NULL },
{ "n", "new-count", ED_FOLDER, ED_FOL_NEW_COUNT, E_TYPE_NUMBER, NULL },
{ "N", "flags2", ED_FOLDER, ED_FOL_FLAGS2, E_TYPE_STRING, NULL },
{ "p", "poll", ED_FOLDER, ED_FOL_POLL, E_TYPE_NUMBER, NULL },
{ "s", "unread-count", ED_FOLDER, ED_FOL_UNREAD_COUNT, E_TYPE_NUMBER, NULL },
{ NULL, NULL, 0, -1, -1, NULL }
}
@ ED_FOL_NEW_COUNT
FolderFile.nd (NntpMboxData)
Definition: lib.h:130
@ ED_FOL_FLAGS2
FolderFile.nd (NntpMboxData)
Definition: lib.h:126
@ ED_FOL_NEWSGROUP
FolderFile.name.
Definition: lib.h:129
@ ED_FOL_FLAGS
FolderFile.nd (NntpMboxData)
Definition: lib.h:125

Expando definitions.

Config:

  • $group_index_format

Definition at line 114 of file config.c.

◆ BrowserVars

struct ConfigDef BrowserVars[]
static
Initial value:
= {
{ "browser_abbreviate_mailboxes", DT_BOOL, true, 0, NULL,
"Abbreviate mailboxes using '~' and '=' in the browser"
},
{ "folder_format", DT_EXPANDO|D_NOT_EMPTY, IP "%2C %t %N %F %2l %-8.8u %-8.8g %8s %d %i", IP &FolderFormatDef, NULL,
"printf-like format string for the browser's display of folders"
},
{ "group_index_format", DT_EXPANDO|D_NOT_EMPTY, IP "%4C %M%N %5s %-45.45f %d", IP &GroupIndexFormatDef, NULL,
"(nntp) printf-like format string for the browser's display of newsgroups"
},
{ "mailbox_folder_format", DT_EXPANDO|D_NOT_EMPTY, IP "%2C %<n?%6n& > %6m %i", IP &FolderFormatDef, NULL,
"printf-like format string for the browser's display of mailbox folders"
},
"Only display files/dirs matching this regex in the browser"
},
{ "show_only_unread", DT_BOOL, false, 0, NULL,
"(nntp) Only show subscribed newsgroups with unread articles"
},
"Sort method for the browser"
},
{ "browser_sort_dirs_first", DT_BOOL, false, 0, NULL,
"Group directories before files in the browser"
},
{ NULL },
}
static const struct Mapping SortBrowserMethods[]
Sort methods for the folder/dir browser.
Definition: config.c:42
static const struct ExpandoDefinition GroupIndexFormatDef[]
Expando definitions.
Definition: config.c:114
static const struct ExpandoDefinition FolderFormatDef[]
Expando definitions.
Definition: config.c:81
#define IP
Definition: set.h:54
@ SORT_ALPHA
Required by makedoc.c.
Definition: sort2.h:37
#define D_REGEX_ALLOW_NOT
Regex can begin with '!'.
Definition: types.h:107
#define D_REGEX_MATCH_CASE
Case-sensitive matching.
Definition: types.h:106
@ DT_BOOL
boolean option
Definition: types.h:32
@ DT_SORT
sorting methods
Definition: types.h:44
@ DT_EXPANDO
an expando
Definition: types.h:34
@ DT_REGEX
regular expressions
Definition: types.h:42
#define D_SORT_REVERSE
Sort flag for -reverse prefix.
Definition: types.h:120
#define D_NOT_EMPTY
Empty strings are not allowed.
Definition: types.h:80
#define D_REGEX_NOSUB
Do not report what was matched (REG_NOSUB)
Definition: types.h:108

Config definitions for the browser.

Definition at line 135 of file config.c.