Function
Purplecmd_register
Declaration [src]
PurpleCmdId
purple_cmd_register (
const gchar* cmd,
const gchar* args,
PurpleCmdPriority p,
PurpleCmdFlag f,
const gchar* protocol_id,
PurpleCmdFunc func,
const gchar* helpstr,
void* data
)
Description [src]
Register a new command with the core.
The command will only happen if commands are enabled, which is a UI pref. UIs don’t have to support commands at all.
Parameters
cmd |
const gchar* |
The command. This should be a UTF-8 (or ASCII) string, with no spaces or other white space. |
|
The data is owned by the caller of the function. | |
The value is a NUL terminated UTF-8 string. | |
args |
const gchar* |
A string of characters describing to libpurple how to parse this
command’s arguments. If what the user types doesn’t match this
pattern, libpurple will keep looking for another command, unless
the flag #PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS is passed in |
|
The data is owned by the caller of the function. | |
The value is a NUL terminated UTF-8 string. | |
p |
PurpleCmdPriority |
This is the priority. Higher priority commands will be run first, and usually the first command will stop any others from being called. |
|
f |
PurpleCmdFlag |
Flags specifying various options about this command, combined with
|
|
protocol_id |
const gchar* |
If the #PURPLE_CMD_FLAG_PROTOCOL_ONLY flag is set, this is the id
of the protocol to which the command applies (such as
|
|
The data is owned by the caller of the function. | |
The value is a NUL terminated UTF-8 string. | |
func |
PurpleCmdFunc |
This is the function to call when someone enters this command. |
|
helpstr |
const gchar* |
A whitespace sensitive, UTF-8, HTML string describing how to use the command. The preferred format of this string is the command’s name, followed by a space and any arguments it accepts (if it takes any arguments, otherwise no space), followed by a colon, two spaces, and a description of the command in sentence form. Do not include a slash before the command name. |
|
The data is owned by the caller of the function. | |
The value is a NUL terminated UTF-8 string. | |
data |
void* |
User defined data to pass to the |
|
The argument can be NULL . | |
The data is owned by the caller of the function. |
Return value
Returns: | PurpleCmdId |
A |