Function

Purplecmd_do_command

since: 2.0

Declaration [src]

PurpleCmdStatus
purple_cmd_do_command (
  PurpleConversation* conv,
  const gchar* cmdline,
  const gchar* markup,
  gchar** errormsg
)

Description [src]

Do a command.

Normally the UI calls this to perform a command. This might also be useful if aliases are ever implemented.

Available since: 2.0

Parameters

conv

Type: PurpleConversation

The conversation the command was typed in.

The data is owned by the caller of the function.
cmdline

Type: const gchar*

The command the user typed (including all arguments) as a single string. The caller doesn’t have to do any parsing, except removing the command prefix, which the core has no knowledge of. cmd should not contain any formatting, and should be in plain text (no html entities).

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
markup

Type: const gchar*

This is the same as cmd, but is the formatted version. It should be in HTML, with < > and &, at least, escaped to html entities, and should include both the default formatting and any extra manual formatting.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
errormsg

Type: gchar**

If the command failed errormsg is filled in with the appropriate error message. It must be freed by the caller with g_free().

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

Return value

Type: PurpleCmdStatus

A PurpleCmdStatus indicating if the command succeeded or failed.