Definitions of NeoMutt commands. More...
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | Command |
A user-callable command. More... | |
Macros | |
#define | MUTT_NAMED (1 << 0) |
#define | COMMANDS_REGISTER(cmds) commands_register(cmds, mutt_array_size(cmds)) |
Enumerations | |
enum | CommandResult { MUTT_CMD_ERROR = -1, MUTT_CMD_WARNING = -2, MUTT_CMD_SUCCESS = 0, MUTT_CMD_FINISH = 1 } |
Error codes for command_t parse functions. More... | |
enum | MuttSetCommand { MUTT_SET_SET, MUTT_SET_INV, MUTT_SET_UNSET, MUTT_SET_RESET } |
Flags for parse_set() More... | |
Functions | |
void | mutt_commands_init (void) |
void | commands_register (const struct Command *cmdv, const size_t cmds) |
Add commands to Commands array. More... | |
void | mutt_commands_free (void) |
Free Commands array. More... | |
size_t | mutt_commands_array (struct Command **first) |
Get Commands array. More... | |
struct Command * | mutt_command_get (const char *s) |
Get a Command by its name. More... | |
void | mutt_commands_apply (void *data, void(*application)(void *, const struct Command *)) |
Run a callback function on every Command. More... | |
Definitions of NeoMutt commands.
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 mutt_commands.h.
#define MUTT_NAMED (1 << 0) |
Definition at line 74 of file mutt_commands.h.
#define COMMANDS_REGISTER | ( | cmds | ) | commands_register(cmds, mutt_array_size(cmds)) |
Definition at line 77 of file mutt_commands.h.
enum CommandResult |
Error codes for command_t parse functions.
Enumerator | |
---|---|
MUTT_CMD_ERROR | Error: Can't help the user. |
MUTT_CMD_WARNING | Warning: Help given to the user. |
MUTT_CMD_SUCCESS | Success: Command worked. |
MUTT_CMD_FINISH | Finish: Stop processing this file. |
Definition at line 34 of file mutt_commands.h.
enum MuttSetCommand |
Flags for parse_set()
Enumerator | |
---|---|
MUTT_SET_SET | default is to set all vars |
MUTT_SET_INV | default is to invert all vars |
MUTT_SET_UNSET | default is to unset all vars |
MUTT_SET_RESET | default is to reset all vars to default |
Definition at line 65 of file mutt_commands.h.
void mutt_commands_init | ( | void | ) |
void commands_register | ( | const struct Command * | cmds, |
const size_t | num_cmds | ||
) |
Add commands to Commands array.
cmds | Array of Commands |
num_cmds | Number of Commands in the Array |
Definition at line 163 of file mutt_commands.c.
void mutt_commands_free | ( | void | ) |
Free Commands array.
Definition at line 175 of file mutt_commands.c.
size_t mutt_commands_array | ( | struct Command ** | first | ) |
Get Commands array.
first | Set to first element of Commands array |
size_t | Size of Commands array |
Definition at line 185 of file mutt_commands.c.
struct Command* mutt_command_get | ( | const char * | s | ) |
Get a Command by its name.
s | Command string to lookup |
ptr | Success, Command |
NULL | Error, no such command |
Definition at line 197 of file mutt_commands.c.
void mutt_commands_apply | ( | void * | data, |
void(*)(void *, const struct Command *) | application | ||
) |
Run a callback function on every Command.
data | Data to pass to the callback function |
application | Callback function |
This is used by Lua to expose all of NeoMutt's Commands.
Definition at line 216 of file mutt_commands.c.