24#ifndef _PURPLE_CMDS_H_
25#define _PURPLE_CMDS_H_
34typedef struct _PurpleCmd PurpleCmd;
39 PURPLE_CMD_STATUS_FAILED,
40 PURPLE_CMD_STATUS_NOT_FOUND,
41 PURPLE_CMD_STATUS_WRONG_ARGS,
42 PURPLE_CMD_STATUS_WRONG_PRPL,
43 PURPLE_CMD_STATUS_WRONG_TYPE
59#define PURPLE_CMD_FUNC(func) ((PurpleCmdFunc)func)
66 gchar **args, gchar **error,
void *data);
73typedef enum _PurpleCmdPriority {
74 PURPLE_CMD_P_VERY_LOW = -1000,
76 PURPLE_CMD_P_DEFAULT = 1000,
77 PURPLE_CMD_P_PRPL = 2000,
78 PURPLE_CMD_P_PLUGIN = 3000,
79 PURPLE_CMD_P_ALIAS = 4000,
80 PURPLE_CMD_P_HIGH = 5000,
81 PURPLE_CMD_P_VERY_HIGH = 6000
111 void (*register_command)(
const gchar *name, PurpleCmdPriority priority,
113 const gchar *help, PurpleCmd *cmd);
119 void (*unregister_command)(
const gchar *name,
const gchar *prpl_id);
121 void (*_purple_reserved1)(void);
122 void (*_purple_reserved2)(void);
123 void (*_purple_reserved3)(void);
124 void (*_purple_reserved4)(void);
189 const gchar *prpl_id,
PurpleCmdFunc func,
const gchar *helpstr,
void *data);
221 const gchar *markup, gchar **errormsg);
238 const gchar *cmdline);
_PurpleCmdRet
Commands registered with the core return one of these values when run.
@ PURPLE_CMD_RET_CONTINUE
Continue, looking for other commands with the same name to call.
@ PURPLE_CMD_RET_FAILED
The command failed, but stop looking.
@ PURPLE_CMD_RET_OK
Everything's okay; Don't look for another command to call.
gboolean purple_cmd_execute(PurpleCmd *c, PurpleConversation *conv, const gchar *cmdline)
Execute a specific command.
enum _PurpleCmdRet PurpleCmdRet
Commands registered with the core return one of these values when run.
PurpleCmdStatus purple_cmd_do_command(PurpleConversation *conv, const gchar *cmdline, const gchar *markup, gchar **errormsg)
Do a command.
enum _PurpleCmdFlag PurpleCmdFlag
Flags used to set various properties of commands.
GList * purple_cmd_list(PurpleConversation *conv)
List registered commands.
GList * purple_cmd_help(PurpleConversation *conv, const gchar *cmd)
Get the help string for a command.
void purple_cmds_set_ui_ops(PurpleCommandsUiOps *ops)
Sets the UI operations structure to be used when registering and unregistering commands.
PurpleCmdRet(* PurpleCmdFunc)(PurpleConversation *, const gchar *cmd, gchar **args, gchar **error, void *data)
A function implementing a command, as passed to purple_cmd_register().
_PurpleCmdFlag
Flags used to set various properties of commands.
@ PURPLE_CMD_FLAG_PRPL_ONLY
Command is usable only for a particular prpl.
@ PURPLE_CMD_FLAG_IM
Command is usable in IMs.
@ PURPLE_CMD_FLAG_CHAT
Command is usable in multi-user chats.
@ PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS
Incorrect arguments to this command should be accepted anyway.
gpointer purple_cmds_get_handle(void)
Get the handle for the commands API.
PurpleCmdId purple_cmd_register(const gchar *cmd, const gchar *args, PurpleCmdPriority p, PurpleCmdFlag f, const gchar *prpl_id, PurpleCmdFunc func, const gchar *helpstr, void *data)
Register a new command with the core.
guint PurpleCmdId
A unique integer representing a command registered with purple_cmd_register(), which can subsequently...
_PurpleCmdStatus
The possible results of running a command with purple_cmd_do_command().
enum _PurpleCmdStatus PurpleCmdStatus
The possible results of running a command with purple_cmd_do_command().
void purple_cmds_uninit(void)
Uninitialize the commands subsystem.
void purple_cmds_init(void)
Initialize the commands subsystem.
PurpleCommandsUiOps * purple_cmds_get_ui_ops(void)
Returns the UI operations structure to be used when registering and unregistering commands.
void purple_cmd_unregister(PurpleCmdId id)
Unregister a command with the core.
Command UI operations; UIs should implement this if they want to handle commands themselves,...
A core representation of a conversation between two or more people.