comparison src/cmds.h @ 9343:5f6ba17ef9f5

[gaim-migrate @ 10151] Changes things to return and accept GaimCmdId's instead of GaimCmdId*'s. This saves 4 bytes of the heap per command, and makes grim's memory profiler happy hopefully. It probably angers plugin writers who started registering commands already. Although maybe not since they probably don't have to change any code. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Tue, 22 Jun 2004 05:03:24 +0000
parents 848aeb69250d
children d6f398e80b32
comparison
equal deleted inserted replaced
9342:33693eea90d7 9343:5f6ba17ef9f5
114 * @param helpstr This is a whitespace sensitive, UTF-8, HTML string describing how to use the command. 114 * @param helpstr This is a whitespace sensitive, UTF-8, HTML string describing how to use the command.
115 * The preferred format of this string shall be the commands name, followed by a space 115 * The preferred format of this string shall be the commands name, followed by a space
116 * and any arguments it accpets (if it takes any arguments, otherwise no space), follow 116 * and any arguments it accpets (if it takes any arguments, otherwise no space), follow
117 * by a colon, two spaces, and a description of the command in sentence form. No slash 117 * by a colon, two spaces, and a description of the command in sentence form. No slash
118 * before the command name. 118 * before the command name.
119 * @return A pointer to a GaimCmdId. This is only used for calling gaim_cmd_unregister, which frees it. 119 * @return A GaimCmdId. This is only used for calling gaim_cmd_unregister.
120 * Returns @c NULL on failure. 120 * Returns @c NULL on failure.
121 */ 121 */
122 GaimCmdId *gaim_cmd_register(const gchar *cmd, const gchar *args, GaimCmdPriority p, GaimCmdFlag f, 122 GaimCmdId gaim_cmd_register(const gchar *cmd, const gchar *args, GaimCmdPriority p, GaimCmdFlag f,
123 const gchar *prpl_id, GaimCmdFunc func, const gchar *helpstr); 123 const gchar *prpl_id, GaimCmdFunc func, const gchar *helpstr);
124 124
125 /** 125 /**
126 * Unregister a command with the core. 126 * Unregister a command with the core.
127 * 127 *
128 * All registered commands must be unregistered, if they're registered by a plugin 128 * All registered commands must be unregistered, if they're registered by a plugin
129 * or something else that might go away. Normally this is called when the plugin 129 * or something else that might go away. Normally this is called when the plugin
130 * unloads itself. 130 * unloads itself.
131 * 131 *
132 * @param id The GaimCmdId to unregister. It is freed after being unregistered. 132 * @param id The GaimCmdId to unregister.
133 */ 133 */
134 void gaim_cmd_unregister(GaimCmdId *id); 134 void gaim_cmd_unregister(GaimCmdId id);
135 135
136 /** 136 /**
137 * Do a command. 137 * Do a command.
138 * 138 *
139 * Normally the UI calls this to perform a command. This might also be useful 139 * Normally the UI calls this to perform a command. This might also be useful