comparison src/protocols/oscar/conn.c @ 11253:7d31d61e6438

[gaim-migrate @ 13422] Get rid of faimdprintf and use gaim_debug functions instead committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 13 Aug 2005 06:43:45 +0000
parents ccb38cf22483
children 68880c90a652
comparison
equal deleted inserted replaced
11252:55356a29cdd1 11253:7d31d61e6438
80 struct snacgroup *sg; 80 struct snacgroup *sg;
81 81
82 if (!(sg = malloc(sizeof(struct snacgroup)))) 82 if (!(sg = malloc(sizeof(struct snacgroup))))
83 return; 83 return;
84 84
85 faimdprintf(aim_conn_getsess(conn), 1, "adding group 0x%04x\n", group); 85 gaim_debug_misc("oscar", "adding group 0x%04x\n", group);
86 sg->group = group; 86 sg->group = group;
87 87
88 sg->next = ins->groups; 88 sg->next = ins->groups;
89 ins->groups = sg; 89 ins->groups = sg;
90 90
506 conn->lastactivity = 0; /* reset this just to make sure */ 506 conn->lastactivity = 0; /* reset this just to make sure */
507 507
508 return 0; 508 return 0;
509 } 509 }
510 510
511 static void defaultdebugcb(aim_session_t *sess, int level, const char *format, va_list va) 511 /**
512 { 512 * Initializes a session structure by setting the initial values
513
514 vfprintf(stderr, format, va);
515
516 return;
517 }
518
519 /**
520 * Initializes a session structure by setting the initial values
521 * stuff in the aim_session_t struct. 513 * stuff in the aim_session_t struct.
522 * 514 *
523 * @param sess Session to initialize. 515 * @param sess Session to initialize.
524 * @param nonblocking Set to true if you want connections to be non-blocking. 516 * @param nonblocking Set to true if you want connections to be non-blocking.
525 * @param debuglevel Level of debugging output (zero is least). 517 */
526 */ 518 faim_export void aim_session_init(aim_session_t *sess, fu8_t nonblocking)
527 faim_export void aim_session_init(aim_session_t *sess, fu8_t nonblocking, int debuglevel)
528 { 519 {
529 520
530 if (!sess) 521 if (!sess)
531 return; 522 return;
532 523
535 sess->queue_outgoing = NULL; 526 sess->queue_outgoing = NULL;
536 sess->queue_incoming = NULL; 527 sess->queue_incoming = NULL;
537 aim_initsnachash(sess); 528 aim_initsnachash(sess);
538 sess->msgcookies = NULL; 529 sess->msgcookies = NULL;
539 sess->nonblocking = nonblocking; 530 sess->nonblocking = nonblocking;
540 sess->debug = debuglevel;
541 sess->debugcb = defaultdebugcb;
542 sess->modlistv = NULL; 531 sess->modlistv = NULL;
543 sess->snacid_next = 0x00000001; 532 sess->snacid_next = 0x00000001;
544 533
545 sess->locate.userinfo = NULL; 534 sess->locate.userinfo = NULL;
546 sess->locate.torequest = NULL; 535 sess->locate.torequest = NULL;
610 599
611 return; 600 return;
612 } 601 }
613 602
614 /** 603 /**
615 * Set the function to call when outputting debugging info.
616 *
617 * The function specified is called whenever faimdprintf() is used within
618 * libfaim, and the session's debugging level is greater tha nor equal to
619 * the value faimdprintf was called with.
620 *
621 * @param sess Session to change.
622 * @param cb Function to call.
623 * @return Returns -1 if the session does not exist, zero otherwise.
624 */
625 faim_export int aim_setdebuggingcb(aim_session_t *sess, faim_debugging_callback_t cb)
626 {
627
628 if (!sess)
629 return -1;
630
631 sess->debugcb = cb;
632
633 return 0;
634 }
635
636 /**
637 * Determine if a connection is connecting. 604 * Determine if a connection is connecting.
638 * 605 *
639 * @param conn Connection to examine. 606 * @param conn Connection to examine.
640 * @return Returns nonzero if the connection is in the process of 607 * @return Returns nonzero if the connection is in the process of
641 * connecting (or if it just completed and 608 * connecting (or if it just completed and