3 * Mapping from user command name to function
6 * Copyright (C) 2016 Bernard Pratz <z+mutt+pub@m0g.net>
9 * This program is free software: you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License as published by the Free Software
11 * Foundation, either version 2 of the License, or (at your option) any later
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19 * You should have received a copy of the GNU General Public License along with
20 * this program. If not, see <http://www.gnu.org/licenses/>.
23 #ifndef MUTT_MUTT_COMMANDS_H
24 #define MUTT_MUTT_COMMANDS_H
29 * typedef command_t - Prototype for a function to parse a command
30 * @param buf Temporary Buffer space
31 * @param s Buffer containing string to be parsed
32 * @param data Flags associated with the command
33 * @param err Buffer for error messages
38 typedef int (*command_t)(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
41 * struct Command - A user-callable command
45 const char *name; /**< Name of the command */
46 command_t func; /**< Function to parse the command */
47 unsigned long data; /**< Data or flags to pass to the command */
50 const struct Command *mutt_command_get(const char *s);
51 void mutt_commands_apply(void *data, void (*application)(void *, const struct Command *));
53 #endif /* MUTT_MUTT_COMMANDS_H */