NeoMutt  2025-12-11-694-ga89709
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
config.c File Reference

Config used by libnotmuch. More...

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

Go to the source code of this file.

Functions

static bool is_valid_notmuch_url (const char *url)
 Checks that a URL is in required form.
 
static int nm_default_url_validator (const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
 Validate the "nm_default_url" config variable - Implements ConfigDef::validator() -.
 

Variables

struct ConfigDef NotmuchVars []
 Config definitions for the Notmuch library.
 

Detailed Description

Config used by libnotmuch.

Authors
  • Richard Russon
  • Austin Ray
  • наб

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.

Function Documentation

◆ is_valid_notmuch_url()

static bool is_valid_notmuch_url ( const char * url)
static

Checks that a URL is in required form.

Parameters
urlURL to test
Return values
trueurl in form notmuch://[absolute path]
falseurl is not in required form

Definition at line 47 of file config.c.

48{
49 return mutt_istr_startswith(url, NmUrlProtocol) && (url[NmUrlProtocolLen] == '/');
50}
size_t mutt_istr_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix, ignoring case.
Definition string.c:246
const int NmUrlProtocolLen
Length of NmUrlProtocol string.
Definition notmuch.c:104
const char NmUrlProtocol[]
Protocol string for Notmuch URLs.
Definition notmuch.c:102
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ NotmuchVars

struct ConfigDef NotmuchVars[]

Config definitions for the Notmuch library.

Definition at line 75 of file config.c.

75 {
76 // clang-format off
77 { "nm_config_file", DT_PATH|D_PATH_FILE, IP "auto", 0, NULL,
78 "(notmuch) Configuration file for notmuch. Use 'auto' to detect configuration."
79 },
80 { "nm_config_profile", DT_STRING, 0, 0, NULL,
81 "(notmuch) Configuration profile for notmuch."
82 },
83 { "nm_db_limit", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 0, 0, NULL,
84 "(notmuch) Default limit for Notmuch queries"
85 },
86 { "nm_default_url", DT_STRING, 0, 0, nm_default_url_validator,
87 "(notmuch) Path to the Notmuch database"
88 },
89 { "nm_exclude_tags", DT_STRING, 0, 0, NULL,
90 "(notmuch) Exclude messages with these tags"
91 },
92 { "nm_flagged_tag", DT_STRING, IP "flagged", 0, NULL,
93 "(notmuch) Tag to use for flagged messages"
94 },
95 { "nm_open_timeout", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 5, 0, NULL,
96 "(notmuch) Database timeout"
97 },
98 { "nm_query_type", DT_ENUM, NM_QUERY_TYPE_MESSAGES, IP &NmQueryTypeDef, NULL,
99 "(notmuch) Default query type: 'threads' or 'messages'"
100 },
101 { "nm_query_window_current_position", DT_NUMBER, 0, 0, NULL,
102 "(notmuch) Position of current search window"
103 },
104 { "nm_query_window_current_search", DT_STRING, 0, 0, NULL,
105 "(notmuch) Current search parameters"
106 },
107 { "nm_query_window_duration", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 0, 0, NULL,
108 "(notmuch) Time duration of the current search window"
109 },
110 { "nm_query_window_enable", DT_BOOL, false, 0, NULL,
111 "(notmuch) Enable query windows"
112 },
113 { "nm_query_window_or_terms", DT_STRING, 0, 0, NULL,
114 "(notmuch) Additional notmuch search terms for messages to be shown regardless of date"
115 },
116 { "nm_query_window_timebase", DT_ENUM, NMTB_WEEK, IP &NmQueryWindowTimebaseDef, NULL,
117 "(notmuch) Units for the time duration"
118 },
119 { "nm_record_tags", DT_STRING, 0, 0, NULL,
120 "(notmuch) Tags to apply to the 'record' mailbox (sent mail)"
121 },
122 { "nm_replied_tag", DT_STRING, IP "replied", 0, NULL,
123 "(notmuch) Tag to use for replied messages"
124 },
125 { "nm_unread_tag", DT_STRING, IP "unread", 0, NULL,
126 "(notmuch) Tag to use for unread messages"
127 },
128 { "virtual_spool_file", DT_BOOL, false, 0, NULL,
129 "(notmuch) Use the first virtual mailbox as a spool file"
130 },
131
132 { "vfolder_format", D_INTERNAL_DEPRECATED|DT_STRING, 0, IP "2018-11-01" },
133
134 { "nm_default_uri", DT_SYNONYM, IP "nm_default_url", IP "2021-02-11" },
135 { "virtual_spoolfile", DT_SYNONYM, IP "virtual_spool_file", IP "2025-12-08" },
136 { NULL },
137 // clang-format on
138};
#define IP
Definition set.h:55
static int nm_default_url_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "nm_default_url" config variable - Implements ConfigDef::validator() -.
Definition config.c:58
const struct EnumDef NmQueryWindowTimebaseDef
Data for the $nm_query_window_timebase enumeration.
Definition query.c:73
const struct EnumDef NmQueryTypeDef
Data for the $nm_query_type enumeration.
Definition query.c:52
@ NM_QUERY_TYPE_MESSAGES
Default: Messages only.
Definition query.h:39
@ NMTB_WEEK
Weeks.
Definition query.h:51
#define D_INTERNAL_DEPRECATED
Config item shouldn't be used any more.
Definition types.h:88
#define D_PATH_FILE
Path is a file.
Definition types.h:104
@ DT_NUMBER
a number
Definition types.h:38
@ DT_BOOL
boolean option
Definition types.h:32
@ DT_SYNONYM
synonym for another variable
Definition types.h:45
@ DT_STRING
a string
Definition types.h:44
@ DT_ENUM
an enumeration
Definition types.h:33
@ DT_PATH
a path to a file/directory
Definition types.h:39
#define D_INTEGER_NOT_NEGATIVE
Negative numbers are not allowed.
Definition types.h:101