Mercurial > pidgin
comparison src/protocols/oscar/msgcookie.c @ 13234:f2431a7e33aa
[gaim-migrate @ 15600]
Massive oscar shuffling. No change in functionality.
I renamed each of the files that contains stuff for a SNAC family.
I started splitting the file transfer/direct connect stuff into
peer.c and peer.h. I stopped using fu8_t, fu16_t and fu32_t and
switched to guint8, guint16 and guint32 instead. I changed the
SNAC family and subtype defines so they are more meaningful.
Added LGPL copyright header to each file. Added myself to the
AUTHORS file.
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Sat, 11 Feb 2006 21:45:18 +0000 |
| parents | 48244c196228 |
| children | f260d319bbbc |
comparison
equal
deleted
inserted
replaced
| 13233:f09c6e8df82c | 13234:f2431a7e33aa |
|---|---|
| 1 /* | |
| 2 * Gaim's oscar protocol plugin | |
| 3 * This file is the legal property of its developers. | |
| 4 * Please see the AUTHORS file distributed alongside this file. | |
| 5 * | |
| 6 * This library is free software; you can redistribute it and/or | |
| 7 * modify it under the terms of the GNU Lesser General Public | |
| 8 * License as published by the Free Software Foundation; either | |
| 9 * version 2 of the License, or (at your option) any later version. | |
| 10 * | |
| 11 * This library is distributed in the hope that it will be useful, | |
| 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 14 * Lesser General Public License for more details. | |
| 15 * | |
| 16 * You should have received a copy of the GNU Lesser General Public | |
| 17 * License along with this library; if not, write to the Free Software | |
| 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 19 */ | |
| 20 | |
| 1 /* | 21 /* |
| 2 * Cookie Caching stuff. Adam wrote this, apparently just some | 22 * Cookie Caching stuff. Adam wrote this, apparently just some |
| 3 * derivatives of n's SNAC work. I cleaned it up, added comments. | 23 * derivatives of n's SNAC work. I cleaned it up, added comments. |
| 4 * | 24 * |
| 5 */ | 25 */ |
| 9 * "1234578" for type 1 and type 2 concurrently. if i'm wrong, then we | 29 * "1234578" for type 1 and type 2 concurrently. if i'm wrong, then we |
| 10 * lose some error checking. if we assume cookies are not type-specific and are | 30 * lose some error checking. if we assume cookies are not type-specific and are |
| 11 * wrong, we get quirky behavior when cookies step on each others' toes. | 31 * wrong, we get quirky behavior when cookies step on each others' toes. |
| 12 */ | 32 */ |
| 13 | 33 |
| 14 #define FAIM_INTERNAL | 34 #include "oscar.h" |
| 15 #include <aim.h> | |
| 16 | 35 |
| 17 /** | 36 /** |
| 18 * aim_cachecookie - appends a cookie to the cookie list | 37 * aim_cachecookie - appends a cookie to the cookie list |
| 19 * | 38 * |
| 20 * if cookie->cookie for type cookie->type is found, updates the | 39 * if cookie->cookie for type cookie->type is found, updates the |
| 57 * @param sess session to grab cookie from | 76 * @param sess session to grab cookie from |
| 58 * @param cookie cookie string to look for | 77 * @param cookie cookie string to look for |
| 59 * @param type cookie type to look for | 78 * @param type cookie type to look for |
| 60 * @return if found, returns the struct; if none found (or on error), returns NULL: | 79 * @return if found, returns the struct; if none found (or on error), returns NULL: |
| 61 */ | 80 */ |
| 62 faim_internal aim_msgcookie_t *aim_uncachecookie(aim_session_t *sess, fu8_t *cookie, int type) | 81 faim_internal aim_msgcookie_t *aim_uncachecookie(aim_session_t *sess, guint8 *cookie, int type) |
| 63 { | 82 { |
| 64 aim_msgcookie_t *cur, **prev; | 83 aim_msgcookie_t *cur, **prev; |
| 65 | 84 |
| 66 if (!cookie || !sess->msgcookies) | 85 if (!cookie || !sess->msgcookies) |
| 67 return NULL; | 86 return NULL; |
| 85 * @param type cookie type to use | 104 * @param type cookie type to use |
| 86 * @param data data to be cached with the cookie | 105 * @param data data to be cached with the cookie |
| 87 * @return returns NULL on error, a pointer to the newly-allocated | 106 * @return returns NULL on error, a pointer to the newly-allocated |
| 88 * cookie on success. | 107 * cookie on success. |
| 89 */ | 108 */ |
| 90 faim_internal aim_msgcookie_t *aim_mkcookie(fu8_t *c, int type, void *data) | 109 faim_internal aim_msgcookie_t *aim_mkcookie(guint8 *c, int type, void *data) |
| 91 { | 110 { |
| 92 aim_msgcookie_t *cookie; | 111 aim_msgcookie_t *cookie; |
| 93 | 112 |
| 94 if (!c) | 113 if (!c) |
| 95 return NULL; | 114 return NULL; |
| 112 * @param type type of the cookie to look for | 131 * @param type type of the cookie to look for |
| 113 * @return returns a pointer to the cookie struct (still in the list) | 132 * @return returns a pointer to the cookie struct (still in the list) |
| 114 * on success; returns NULL on error/not found | 133 * on success; returns NULL on error/not found |
| 115 */ | 134 */ |
| 116 | 135 |
| 117 faim_internal aim_msgcookie_t *aim_checkcookie(aim_session_t *sess, const fu8_t *cookie, int type) | 136 faim_internal aim_msgcookie_t *aim_checkcookie(aim_session_t *sess, const guint8 *cookie, int type) |
| 118 { | 137 { |
| 119 aim_msgcookie_t *cur; | 138 aim_msgcookie_t *cur; |
| 120 | 139 |
| 121 for (cur = sess->msgcookies; cur; cur = cur->next) { | 140 for (cur = sess->msgcookies; cur; cur = cur->next) { |
| 122 if ((cur->type == type) && | 141 if ((cur->type == type) && |
