1 /**
2  * @file
3  * Information commands
4  *
5  * @authors
6  * Copyright (C) 2016 Christopher John Czettel <chris@meicloud.at>
7  * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
8  *
9  * @copyright
10  * This program is free software: you can redistribute it and/or modify it under
11  * the terms of the GNU General Public License as published by the Free Software
12  * Foundation, either version 2 of the License, or (at your option) any later
13  * version.
14  *
15  * This program is distributed in the hope that it will be useful, but WITHOUT
16  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License along with
21  * this program.  If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef MUTT_ICOMMANDS_H
25 #define MUTT_ICOMMANDS_H
26 
27 #include <stdint.h>
28 #include "core/lib.h"
29 
30 struct Buffer;
31 
32 /**
33  * struct ICommand - An Informational Command
34  */
35 struct ICommand
36 {
37   char *name; ///< Name of the command
38 
39   /**
40    * parse - Function to parse information commands
41    * @param buf  Command
42    * @param s    Entire command line
43    * @param data Private data to pass to parse function
44    * @param err  Buffer for error messages
45    * @retval #CommandResult Result, e.g. #MUTT_CMD_SUCCESS
46    */
47   enum CommandResult (*parse)(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err);
48 
49   intptr_t data; ///< Private data to pass to the command
50 };
51 
52 enum CommandResult mutt_parse_icommand(/* const */ char *line, struct Buffer *err);
53 
54 #endif /* MUTT_ICOMMANDS_H */
55