*
* The return value will be used as notmuch exit status code,
* preferably EXIT_SUCCESS or EXIT_FAILURE.
*
* The return value will be used as notmuch exit status code,
* preferably EXIT_SUCCESS or EXIT_FAILURE.
-typedef int (*command_function_t) (notmuch_config_t *config, int argc, char *argv[]);
+typedef int (*command_function_t) (notmuch_config_t *config, notmuch_database_t *notmuch, int argc, char *argv[]);
-notmuch_help_command (notmuch_config_t *config, int argc, char *argv[]);
+notmuch_help_command (notmuch_config_t *config, notmuch_database_t *notmuch, int argc, char *argv[]);
-notmuch_command (notmuch_config_t *config, int argc, char *argv[]);
+notmuch_command (notmuch_config_t *config, notmuch_database_t *notmuch, int argc, char *argv[]);
- { NULL, notmuch_command, NOTMUCH_CONFIG_OPEN | NOTMUCH_CONFIG_CREATE,
+ { NULL, notmuch_command, NOTMUCH_COMMAND_CONFIG_OPEN | NOTMUCH_COMMAND_CONFIG_CREATE,
- { "setup", notmuch_setup_command, NOTMUCH_CONFIG_OPEN | NOTMUCH_CONFIG_CREATE,
+ { "setup", notmuch_setup_command, NOTMUCH_COMMAND_CONFIG_OPEN | NOTMUCH_COMMAND_CONFIG_CREATE,
- { "new", notmuch_new_command, NOTMUCH_CONFIG_OPEN,
+ { "new", notmuch_new_command, NOTMUCH_COMMAND_CONFIG_OPEN,
- { "insert", notmuch_insert_command, NOTMUCH_CONFIG_OPEN,
+ { "insert", notmuch_insert_command, NOTMUCH_COMMAND_CONFIG_OPEN,
- { "search", notmuch_search_command, NOTMUCH_CONFIG_OPEN,
+ { "search", notmuch_search_command, NOTMUCH_COMMAND_CONFIG_OPEN,
- { "address", notmuch_address_command, NOTMUCH_CONFIG_OPEN,
+ { "address", notmuch_address_command, NOTMUCH_COMMAND_CONFIG_OPEN,
- { "show", notmuch_show_command, NOTMUCH_CONFIG_OPEN,
+ { "show", notmuch_show_command, NOTMUCH_COMMAND_CONFIG_OPEN,
- { "count", notmuch_count_command, NOTMUCH_CONFIG_OPEN,
+ { "count", notmuch_count_command, NOTMUCH_COMMAND_CONFIG_OPEN,
- { "reply", notmuch_reply_command, NOTMUCH_CONFIG_OPEN,
+ { "reply", notmuch_reply_command, NOTMUCH_COMMAND_CONFIG_OPEN,
- { "tag", notmuch_tag_command, NOTMUCH_CONFIG_OPEN,
+ { "tag", notmuch_tag_command, NOTMUCH_COMMAND_CONFIG_OPEN,
- { "dump", notmuch_dump_command, NOTMUCH_CONFIG_OPEN,
+ { "dump", notmuch_dump_command, NOTMUCH_COMMAND_CONFIG_OPEN,
- { "restore", notmuch_restore_command, NOTMUCH_CONFIG_OPEN,
+ { "restore", notmuch_restore_command, NOTMUCH_COMMAND_CONFIG_OPEN,
- { "compact", notmuch_compact_command, NOTMUCH_CONFIG_OPEN,
+ { "compact", notmuch_compact_command, NOTMUCH_COMMAND_CONFIG_OPEN,
- { "reindex", notmuch_reindex_command, NOTMUCH_CONFIG_OPEN,
+ { "reindex", notmuch_reindex_command, NOTMUCH_COMMAND_CONFIG_OPEN,
- { "config", notmuch_config_command, NOTMUCH_CONFIG_OPEN,
+ { "config", notmuch_config_command, NOTMUCH_COMMAND_CONFIG_OPEN,
"Get or set settings in the notmuch configuration file." },
#if WITH_EMACS
{ "emacs-mua", NULL, 0,
"send mail with notmuch and emacs." },
#endif
"Get or set settings in the notmuch configuration file." },
#if WITH_EMACS
{ "emacs-mua", NULL, 0,
"send mail with notmuch and emacs." },
#endif
- { "help", notmuch_help_command, NOTMUCH_CONFIG_CREATE, /* create but don't save config */
+ { "help", notmuch_help_command, NOTMUCH_COMMAND_CONFIG_CREATE, /* create but don't save config */
-notmuch_help_command (unused (notmuch_config_t *config), int argc, char *argv[])
+notmuch_help_command (unused (notmuch_config_t *config), unused(notmuch_database_t *notmuch), int argc, char *argv[])
* notmuch_setup_command which will give a nice welcome message,
* and interactively guide the user through the configuration. */
if (notmuch_config_is_new (config))
* notmuch_setup_command which will give a nice welcome message,
* and interactively guide the user through the configuration. */
if (notmuch_config_is_new (config))
- return notmuch_setup_command (config, 0, NULL);
+ return notmuch_setup_command (config, NULL, 0, NULL);
/* Notmuch is already configured, but is there a database? */
db_path = talloc_asprintf (config, "%s/%s",
/* Notmuch is already configured, but is there a database? */
db_path = talloc_asprintf (config, "%s/%s",
- ret = (command->function)(config, argc - opt_index, argv + opt_index);
+ ret = (command->function)(config, NULL, argc - opt_index, argv + opt_index);