comparison src/cmds.h @ 9175:3e2ea5b69605

[gaim-migrate @ 9970] W and S are now implemented for /cmds in core. This means you can do /me with colors again. This was probably the hardest part of cmds that was left to do. So the rest should be fairly easy. Hopefully there's no major bugs in this. There's some inconsist use of g_utf8_isspace vs strchr(s, ' ') I want to clean up yet that will cause some oddness if you use a tab instead of a space as your argument separater. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Sat, 05 Jun 2004 07:33:58 +0000
parents 9e3d4722d86e
children 933c7418fd03
comparison
equal deleted inserted replaced
9174:a839ef5d2f34 9175:3e2ea5b69605
95 * If what the user types doesn't match, Gaim will keep looking for another 95 * If what the user types doesn't match, Gaim will keep looking for another
96 * command, unless the flag @c GAIM_CMD_FLAG_ALLOW_WRONG_ARGS is passed in f. 96 * command, unless the flag @c GAIM_CMD_FLAG_ALLOW_WRONG_ARGS is passed in f.
97 * This string contains no whitespace, and uses a single character for each argument. 97 * This string contains no whitespace, and uses a single character for each argument.
98 * The recognized characters are: 98 * The recognized characters are:
99 * 'w' Matches a single word. 99 * 'w' Matches a single word.
100 * 'W' Matches a single word, and applies the default formatting to it. 100 * 'W' Matches a single word, with formatting.
101 * 's' Matches the rest of the arguments after this point, as a single string. 101 * 's' Matches the rest of the arguments after this point, as a single string.
102 * 'S' Same as 's' but applies the default formatting to the matched string. 102 * 'S' Same as 's' but with formatting.
103 * If args is the empty string, then the command accepts no arguments. 103 * If args is the empty string, then the command accepts no arguments.
104 * The args passed to callback func will be a @c NULL terminated array of null 104 * The args passed to callback func will be a @c NULL terminated array of null
105 * terminated strings, and will always match the number of arguments asked for, 105 * terminated strings, and will always match the number of arguments asked for,
106 * unless GAIM_CMD_FLAG_ALLOW_WRONG_ARGS is passed. 106 * unless GAIM_CMD_FLAG_ALLOW_WRONG_ARGS is passed.
107 * @param p This is the priority. Higher priority commands will be run first, and usually the 107 * @param p This is the priority. Higher priority commands will be run first, and usually the
134 * 134 *
135 * Normally the UI calls this to perform a command. This might also be useful 135 * Normally the UI calls this to perform a command. This might also be useful
136 * if aliases are ever implemented. 136 * if aliases are ever implemented.
137 * 137 *
138 * @param conv The conversation the command was typed in. 138 * @param conv The conversation the command was typed in.
139 * @param cmd The command the user typed (including all arguments) as a single string. 139 * @param cmdline The command the user typed (including all arguments) as a single string.
140 * The caller doesn't have to do any parsing, except removing the command 140 * The caller doesn't have to do any parsing, except removing the command
141 * prefix, which the core has no knowledge of. cmd should not contain the 141 * prefix, which the core has no knowledge of. cmd should not contain the
142 * default formatting, but should contain any user supplied formatting. 142 * any formatting, and should be in plain text (no html entities).
143 * @param markup This is the same as cmd, but is the formatted version. It should be in
144 * HTML, with < > and &, at least, escaped to html entities, and should
145 * include both the default formatting and any extra manual formatting.
143 * @param errormsg If the command failed and errormsg is not NULL, it is filled in with 146 * @param errormsg If the command failed and errormsg is not NULL, it is filled in with
144 * the appropriate error message. It should be freed by the caller with 147 * the appropriate error message. It should be freed by the caller with
145 * g_free(). 148 * g_free().
146 * @return A GaimCmdStatus indicated if the command succeeded or failed. 149 * @return A GaimCmdStatus indicated if the command succeeded or failed.
147 */ 150 */
148 GaimCmdStatus gaim_cmd_do_command(GaimConversation *conv, const gchar *cmd, gchar **errormsg); 151 GaimCmdStatus gaim_cmd_do_command(GaimConversation *conv, const gchar *cmdline,
152 const gchar *markup, gchar **errormsg);
149 153
150 /** 154 /**
151 * List registered commands. 155 * List registered commands.
152 * 156 *
153 * Returns a GList (which must be freed by the caller) of all commands 157 * Returns a GList (which must be freed by the caller) of all commands