NeoMutt  2024-11-14-34-g5aaf0d
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 ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
 Validate the "nm_default_url" config variable - Implements ConfigDef::validator() -.
 
static int nm_query_window_timebase_validator (const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
 Validate the "nm_query_window_timebase" config variable - Implements ConfigDef::validator() -.
 
bool config_init_notmuch (struct ConfigSet *cs)
 Register notmuch config variables - Implements module_init_config_t -.
 

Variables

static 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:242
const int NmUrlProtocolLen
Length of NmUrlProtocol string.
Definition: notmuch.c:103
const char NmUrlProtocol[]
Protocol string for Notmuch URLs.
Definition: notmuch.c:101
+ 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 106 of file config.c.