NeoMutt  2023-05-17-56-ga67199
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)
 Validate $nm_query_window_timebase - Implements ConfigDef::validator() -. More...
 
bool config_init_notmuch (struct ConfigSet *cs)
 Register notmuch config variables - Implements module_init_config_t -. More...
 

Variables

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

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.

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

Definition at line 45 of file config.c.

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

Variable Documentation

◆ NotmuchVars

struct ConfigDef NotmuchVars[]
static

Config definitions for the Notmuch library.

Definition at line 102 of file config.c.