Mercurial > pidgin
comparison src/protocols/msn/command.c @ 9198:ab6636c5a136
[gaim-migrate @ 9993]
Updated all the copyright headers for all the *.[ch] files -- all 63. No
fun, but I receive great satisfaction in knowing that you all have to
recompile this, again.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sun, 06 Jun 2004 03:42:55 +0000 |
parents | 502707ca1836 |
children | a1aa681f1448 |
comparison
equal
deleted
inserted
replaced
9197:ec417d2f9666 | 9198:ab6636c5a136 |
---|---|
1 /** | 1 /** |
2 * @file command.c MSN command functions | 2 * @file command.c MSN command functions |
3 * | 3 * |
4 * gaim | 4 * gaim |
5 * | 5 * |
6 * Copyright (C) 2003, Christian Hammond <chipx86@gnupdate.org> | 6 * Gaim is the legal property of its developers, whose names are too numerous |
7 * to list here. Please refer to the COPYRIGHT file distributed with this | |
8 * source distribution. | |
7 * | 9 * |
8 * This program is free software; you can redistribute it and/or modify | 10 * This program is free software; you can redistribute it and/or modify |
9 * it under the terms of the GNU General Public License as published by | 11 * it under the terms of the GNU General Public License as published by |
10 * the Free Software Foundation; either version 2 of the License, or | 12 * the Free Software Foundation; either version 2 of the License, or |
11 * (at your option) any later version. | 13 * (at your option) any later version. |
46 tmp = g_strdup(string); | 48 tmp = g_strdup(string); |
47 param_start = strchr(tmp, ' '); | 49 param_start = strchr(tmp, ' '); |
48 | 50 |
49 cmd = g_new0(MsnCommand, 1); | 51 cmd = g_new0(MsnCommand, 1); |
50 cmd->command = tmp; | 52 cmd->command = tmp; |
51 | 53 |
52 if (param_start) | 54 if (param_start) |
53 { | 55 { |
54 char *param; | 56 char *param; |
55 int c; | 57 int c; |
56 | 58 |
57 *param_start++ = '\0'; | 59 *param_start++ = '\0'; |
58 cmd->params = g_strsplit(param_start, " ", 0); | 60 cmd->params = g_strsplit(param_start, " ", 0); |
59 | 61 |
60 for (c = 0; cmd->params[c]; c++); | 62 for (c = 0; cmd->params[c]; c++); |
61 cmd->param_count = c; | 63 cmd->param_count = c; |
62 | 64 |
63 param = cmd->params[0]; | 65 param = cmd->params[0]; |
64 | 66 |
65 cmd->trId = is_num(param) ? atoi(param) : 0; | 67 cmd->trId = is_num(param) ? atoi(param) : 0; |
66 } | 68 } |
67 else | 69 else |
68 cmd->trId = 0; | 70 cmd->trId = 0; |
69 | 71 |
70 msn_command_ref(cmd); | 72 msn_command_ref(cmd); |
71 | 73 |
72 return cmd; | 74 return cmd; |
73 } | 75 } |
74 | 76 |
75 void | 77 void |
76 msn_command_destroy(MsnCommand *cmd) | 78 msn_command_destroy(MsnCommand *cmd) |
77 { | 79 { |
78 g_return_if_fail(cmd != NULL); | 80 g_return_if_fail(cmd != NULL); |
79 | 81 |
80 if (cmd->ref_count > 0) | 82 if (cmd->ref_count > 0) |
81 { | 83 { |
82 msn_command_unref(cmd); | 84 msn_command_unref(cmd); |
83 return; | 85 return; |
84 } | 86 } |