#include <netdb.h>
#include <assert.h>
+#include "path-util.h"
#include "unicode-util.h"
static const char toplevel_config_comment[] =
"\n"
" For more information about notmuch, see https://notmuchmail.org";
-struct config_group {
+static const struct config_group {
const char *group_name;
const char *comment;
} group_comment_table [] = {
}
/* Try not to overwrite symlinks. */
- filename = canonicalize_file_name (config->filename);
+ filename = notmuch_canonicalize_file_name (config->filename);
if (! filename) {
if (errno == ENOENT) {
filename = strdup (config->filename);
bool (*validate)(const char *);
} config_key_info_t;
-static struct config_key
+static const struct config_key
config_key_table[] = {
{ "index.decrypt", false, NULL },
{ "index.header.", true, validate_field_name },
{ "query.", true, NULL },
};
-static config_key_info_t *
+static const config_key_info_t *
_config_key_info (const char *item)
{
for (size_t i = 0; i < ARRAY_SIZE (config_key_table); i++) {
{
notmuch_config_values_t *list;
- for (list = notmuch_config_get_values_string (notmuch, item);
- notmuch_config_values_valid (list);
- notmuch_config_values_move_to_next (list)) {
- const char *val = notmuch_config_values_get (list);
- puts (val);
+ if (STRNCMP_LITERAL (item, BUILT_WITH_PREFIX) == 0) {
+ if (notmuch_built_with (item + strlen (BUILT_WITH_PREFIX)))
+ puts ("true");
+ else
+ puts ("false");
+ } else {
+ for (list = notmuch_config_get_values_string (notmuch, item);
+ notmuch_config_values_valid (list);
+ notmuch_config_values_move_to_next (list)) {
+ const char *val = notmuch_config_values_get (list);
+ puts (val);
+ }
}
return EXIT_SUCCESS;
}
int argc, char *argv[])
{
char *group, *key;
- config_key_info_t *key_info;
+ const config_key_info_t *key_info;
notmuch_conffile_t *config;
bool update_database = false;
int opt_index, ret;