comparison src/protocols/oscar/rxhandlers.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 a88ca6da0b38
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 * rxhandlers.c 22 * rxhandlers.c
3 * 23 *
4 * This file contains most all of the incoming packet handlers, along 24 * This file contains most all of the incoming packet handlers, along
5 * with aim_rxdispatch(), the Rx dispatcher. Queue/list management is 25 * with aim_rxdispatch(), the Rx dispatcher. Queue/list management is
6 * actually done in aim_rxqueue.c. 26 * actually done in aim_rxqueue.c.
7 * 27 *
8 */ 28 */
9 29
10 #define FAIM_INTERNAL 30 #include "oscar.h"
11 #include <aim.h> 31 #include "peer.h"
12 32
13 struct aim_rxcblist_s { 33 struct aim_rxcblist_s {
14 fu16_t family; 34 guint16 family;
15 fu16_t type; 35 guint16 type;
16 aim_rxcallback_t handler; 36 aim_rxcallback_t handler;
17 fu16_t flags; 37 guint16 flags;
18 struct aim_rxcblist_s *next; 38 struct aim_rxcblist_s *next;
19 }; 39 };
20 40
21 faim_internal aim_module_t *aim__findmodulebygroup(aim_session_t *sess, fu16_t group) 41 faim_internal aim_module_t *aim__findmodulebygroup(aim_session_t *sess, guint16 group)
22 { 42 {
23 aim_module_t *cur; 43 aim_module_t *cur;
24 44
25 for (cur = (aim_module_t *)sess->modlistv; cur; cur = cur->next) { 45 for (cur = (aim_module_t *)sess->modlistv; cur; cur = cur->next) {
26 if (cur->family == group) 46 if (cur->family == group)
141 } 161 }
142 162
143 return 0; 163 return 0;
144 } 164 }
145 165
146 static int consumenonsnac(aim_session_t *sess, aim_frame_t *rx, fu16_t family, fu16_t subtype) 166 static int consumenonsnac(aim_session_t *sess, aim_frame_t *rx, guint16 family, guint16 subtype)
147 { 167 {
148 aim_module_t *cur; 168 aim_module_t *cur;
149 aim_modsnac_t snac; 169 aim_modsnac_t snac;
150 170
151 snac.family = family; 171 snac.family = family;
168 188
169 static int negchan_middle(aim_session_t *sess, aim_frame_t *fr) 189 static int negchan_middle(aim_session_t *sess, aim_frame_t *fr)
170 { 190 {
171 aim_tlvlist_t *tlvlist; 191 aim_tlvlist_t *tlvlist;
172 char *msg = NULL; 192 char *msg = NULL;
173 fu16_t code = 0; 193 guint16 code = 0;
174 aim_rxcallback_t userfunc; 194 aim_rxcallback_t userfunc;
175 int ret = 1; 195 int ret = 1;
176 196
177 if (aim_bstream_empty(&fr->data) == 0) { 197 if (aim_bstream_empty(&fr->data) == 0) {
178 /* XXX should do something with this */ 198 /* XXX should do something with this */
206 * Bleck functions get called when there's no non-bleck functions 226 * Bleck functions get called when there's no non-bleck functions
207 * around to cleanup the mess... 227 * around to cleanup the mess...
208 */ 228 */
209 static int bleck(aim_session_t *sess, aim_frame_t *frame, ...) 229 static int bleck(aim_session_t *sess, aim_frame_t *frame, ...)
210 { 230 {
211 fu16_t family, subtype; 231 guint16 family, subtype;
212 fu16_t maxf, maxs; 232 guint16 maxf, maxs;
213 233
214 static const char *channels[6] = { 234 static const char *channels[6] = {
215 "Invalid (0)", 235 "Invalid (0)",
216 "FLAP Version", 236 "FLAP Version",
217 "SNAC", 237 "SNAC",
389 } 409 }
390 410
391 return 1; 411 return 1;
392 } 412 }
393 413
394 faim_export int aim_conn_addhandler(aim_session_t *sess, aim_conn_t *conn, fu16_t family, fu16_t type, aim_rxcallback_t newhandler, fu16_t flags) 414 faim_export int aim_conn_addhandler(aim_session_t *sess, aim_conn_t *conn, guint16 family, guint16 type, aim_rxcallback_t newhandler, guint16 flags)
395 { 415 {
396 struct aim_rxcblist_s *newcb; 416 struct aim_rxcblist_s *newcb;
397 417
398 if (!conn) 418 if (!conn)
399 return -1; 419 return -1;
439 conn->handlerlist = NULL; 459 conn->handlerlist = NULL;
440 460
441 return 0; 461 return 0;
442 } 462 }
443 463
444 faim_internal aim_rxcallback_t aim_callhandler(aim_session_t *sess, aim_conn_t *conn, fu16_t family, fu16_t type) 464 faim_internal aim_rxcallback_t aim_callhandler(aim_session_t *sess, aim_conn_t *conn, guint16 family, guint16 type)
445 { 465 {
446 struct aim_rxcblist_s *cur; 466 struct aim_rxcblist_s *cur;
447 467
448 if (!conn) 468 if (!conn)
449 return NULL; 469 return NULL;
475 } 495 }
476 496
477 return; 497 return;
478 } 498 }
479 499
480 faim_internal int aim_callhandler_noparam(aim_session_t *sess, aim_conn_t *conn,fu16_t family, fu16_t type, aim_frame_t *ptr) 500 faim_internal int aim_callhandler_noparam(aim_session_t *sess, aim_conn_t *conn,guint16 family, guint16 type, aim_frame_t *ptr)
481 { 501 {
482 aim_rxcallback_t userfunc; 502 aim_rxcallback_t userfunc;
483 503
484 if ((userfunc = aim_callhandler(sess, conn, family, type))) 504 if ((userfunc = aim_callhandler(sess, conn, family, type)))
485 return userfunc(sess, ptr); 505 return userfunc(sess, ptr);