cmds.h
Go to the documentation of this file.
1 
7 /* Copyright (C) 2003 Timothy Ringenbach <omarvo@hotmail.com>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
22  *
23  */
24 #ifndef _PURPLE_CMDS_H_
25 #define _PURPLE_CMDS_H_
26 
27 #include "conversation.h"
28 
29 /**************************************************************************/
31 /**************************************************************************/
35 typedef enum _PurpleCmdStatus {
36  PURPLE_CMD_STATUS_OK,
37  PURPLE_CMD_STATUS_FAILED,
38  PURPLE_CMD_STATUS_NOT_FOUND,
39  PURPLE_CMD_STATUS_WRONG_ARGS,
40  PURPLE_CMD_STATUS_WRONG_PRPL,
41  PURPLE_CMD_STATUS_WRONG_TYPE
43 
51 typedef enum _PurpleCmdRet {
55 } PurpleCmdRet;
56 
57 #define PURPLE_CMD_FUNC(func) ((PurpleCmdFunc)func)
58 
63 typedef PurpleCmdRet (*PurpleCmdFunc)(PurpleConversation *, const gchar *cmd,
64  gchar **args, gchar **error, void *data);
69 typedef guint PurpleCmdId;
70 
71 typedef enum _PurpleCmdPriority {
72  PURPLE_CMD_P_VERY_LOW = -1000,
73  PURPLE_CMD_P_LOW = 0,
74  PURPLE_CMD_P_DEFAULT = 1000,
75  PURPLE_CMD_P_PRPL = 2000,
76  PURPLE_CMD_P_PLUGIN = 3000,
77  PURPLE_CMD_P_ALIAS = 4000,
78  PURPLE_CMD_P_HIGH = 5000,
79  PURPLE_CMD_P_VERY_HIGH = 6000
80 } PurpleCmdPriority;
81 
88 typedef enum _PurpleCmdFlag {
98 
99 
102 #ifdef __cplusplus
103 extern "C" {
104 #endif
105 
106 /**************************************************************************/
108 /**************************************************************************/
161 PurpleCmdId purple_cmd_register(const gchar *cmd, const gchar *args, PurpleCmdPriority p, PurpleCmdFlag f,
162  const gchar *prpl_id, PurpleCmdFunc func, const gchar *helpstr, void *data);
163 
174 
193 PurpleCmdStatus purple_cmd_do_command(PurpleConversation *conv, const gchar *cmdline,
194  const gchar *markup, gchar **errormsg);
195 
209 GList *purple_cmd_list(PurpleConversation *conv);
210 
223 GList *purple_cmd_help(PurpleConversation *conv, const gchar *cmd);
224 
230 gpointer purple_cmds_get_handle(void);
231 
236 void purple_cmds_init(void);
237 
242 void purple_cmds_uninit(void);
243 
246 #ifdef __cplusplus
247 }
248 #endif
249 
250 #endif /* _PURPLE_CMDS_H_ */