NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
config.c File Reference

Config used by libnotmuch. More...

#include "config.h"
#include <stddef.h>
#include <config/lib.h>
#include <stdbool.h>
#include <stdint.h>
#include "mutt/lib.h"
#include "notmuch/private.h"
#include "notmuch/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. More...
 
static int nm_default_url_validator (const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
 Ensure nm_default_url is of the form notmuch://[absolute path] - Implements ConfigDef::validator() -. More...
 
static int nm_query_window_timebase_validator (const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
 Ensures nm_query_window_timebase matches allowed values - Implements ConfigDef::validator() -Allowed values: More...
 
bool config_init_notmuch (struct ConfigSet *cs)
 Register notmuch config variables - Implements module_init_config_t -. More...
 

Variables

static struct ConfigDef NotmuchVars []
 

Detailed Description

Config used by libnotmuch.

Authors
  • 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.

Function Documentation

◆ is_valid_notmuch_url()

static bool is_valid_notmuch_url ( const char *  url)
static

Checks that a URL is in required form.

Return values
trueurl in form notmuch://[absolute path]
falseurl is not in required form.

Definition at line 43 of file config.c.

44 {
45  return mutt_istr_startswith(url, NmUrlProtocol) && (url[NmUrlProtocolLen] == '/');
46 }
size_t mutt_istr_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix, ignoring case.
Definition: string.c:172
const char NmUrlProtocol[]
Definition: notmuch.c:93
const int NmUrlProtocolLen
Definition: notmuch.c:94
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ NotmuchVars

struct ConfigDef NotmuchVars[]
static

Definition at line 93 of file config.c.