Mercurial > pidgin
comparison src/protocols/oscar/oscar.h @ 13253:87a7c3077c19
[gaim-migrate @ 15619]
More cleaning up of oscar. Renamed some functions to be more clear.
Got rid of some stuff that wasn't used. Inlined some small things
in conn.c that were only used once.
The goals of all this are
1. Non-blocking I/O for all connections
2. p2p stuff won't use the same struct as oscar connections, because
that's stupid
3. The oscar PRPL should be less scary
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 12 Feb 2006 21:27:04 +0000 |
parents | 2871c385c45a |
children | e9802db22b06 |
comparison
equal
deleted
inserted
replaced
13252:2871c385c45a | 13253:87a7c3077c19 |
---|---|
28 | 28 |
29 #ifndef _OSCAR_H_ | 29 #ifndef _OSCAR_H_ |
30 #define _OSCAR_H_ | 30 #define _OSCAR_H_ |
31 | 31 |
32 #include "debug.h" | 32 #include "debug.h" |
33 #include "gaim_buffer.h" | |
33 #include "internal.h" | 34 #include "internal.h" |
34 | 35 |
35 #include <stdio.h> | 36 #include <stdio.h> |
36 #include <string.h> | 37 #include <string.h> |
37 #include <fcntl.h> | 38 #include <fcntl.h> |
388 #define AIM_FRAMETYPE_OFT 0x0001 | 389 #define AIM_FRAMETYPE_OFT 0x0001 |
389 | 390 |
390 struct _OscarConnection | 391 struct _OscarConnection |
391 { | 392 { |
392 int fd; | 393 int fd; |
394 GaimCircBuffer *buffer_outgoing; | |
393 guint16 type; | 395 guint16 type; |
394 guint16 subtype; | 396 guint16 subtype; |
395 flap_seqnum_t seqnum; | 397 flap_seqnum_t seqnum; |
396 guint32 status; | 398 guint32 status; |
397 void *priv; /* misc data the client may want to store */ | |
398 void *internal; /* internal conn-specific libfaim data */ | 399 void *internal; /* internal conn-specific libfaim data */ |
399 time_t lastactivity; /* time of last transmit */ | 400 time_t lastactivity; /* time of last transmit */ |
400 int forcedlatency; | 401 int forcedlatency; |
401 void *handlerlist; | 402 void *handlerlist; |
402 void *sessv; /* pointer to parent session */ | 403 OscarSession *sessv; /* pointer to parent session */ |
403 void *inside; /* only accessible from inside libfaim */ | 404 void *inside; /* only accessible from inside libfaim */ |
404 struct _OscarConnection *next; | 405 struct _OscarConnection *next; |
405 }; | 406 }; |
406 | 407 |
407 /* | 408 /* |
508 char server[128]; | 509 char server[128]; |
509 char username[128]; | 510 char username[128]; |
510 char password[128]; | 511 char password[128]; |
511 } socksproxy; | 512 } socksproxy; |
512 | 513 |
513 guint8 nonblocking; | |
514 | |
515 /* | 514 /* |
516 * Outstanding snac handling | 515 * Outstanding snac handling |
517 * | 516 * |
518 * XXX: Should these be per-connection? -mid | 517 * XXX: Should these be per-connection? -mid |
519 */ | 518 */ |
577 */ | 576 */ |
578 faim_export void aim_rxdispatch(OscarSession *); | 577 faim_export void aim_rxdispatch(OscarSession *); |
579 | 578 |
580 faim_export int aim_debugconn_sendconnect(OscarSession *sess, OscarConnection *conn); | 579 faim_export int aim_debugconn_sendconnect(OscarSession *sess, OscarConnection *conn); |
581 | 580 |
582 faim_export int aim_logoff(OscarSession *); | |
583 | |
584 /* the library should never call aim_conn_kill */ | 581 /* the library should never call aim_conn_kill */ |
585 faim_export void aim_conn_kill(OscarSession *sess, OscarConnection **deadconn); | 582 faim_export void aim_conn_kill(OscarSession *sess, OscarConnection **deadconn); |
586 | 583 |
587 typedef int (*aim_rxcallback_t)(OscarSession *, FlapFrame *, ...); | 584 typedef int (*aim_rxcallback_t)(OscarSession *, FlapFrame *, ...); |
588 | 585 |
634 faim_export void aim_purge_rxqueue(OscarSession *); | 631 faim_export void aim_purge_rxqueue(OscarSession *); |
635 faim_export void aim_cleansnacs(OscarSession *, int maxage); | 632 faim_export void aim_cleansnacs(OscarSession *, int maxage); |
636 | 633 |
637 #define AIM_TX_QUEUED 0 /* default */ | 634 #define AIM_TX_QUEUED 0 /* default */ |
638 #define AIM_TX_IMMEDIATE 1 | 635 #define AIM_TX_IMMEDIATE 1 |
639 #define AIM_TX_USER 2 | |
640 faim_export int aim_tx_setenqueue(OscarSession *sess, int what, int (*func)(OscarSession *, FlapFrame *)); | 636 faim_export int aim_tx_setenqueue(OscarSession *sess, int what, int (*func)(OscarSession *, FlapFrame *)); |
641 | 637 |
642 faim_export int aim_tx_flushqueue(OscarSession *); | 638 faim_export int aim_tx_flushqueue(OscarSession *); |
643 faim_export void aim_tx_purgequeue(OscarSession *); | 639 faim_export void aim_tx_purgequeue(OscarSession *); |
644 | 640 |
655 faim_export int aim_conn_isready(OscarConnection *); | 651 faim_export int aim_conn_isready(OscarConnection *); |
656 faim_export int aim_conn_setstatus(OscarConnection *, int); | 652 faim_export int aim_conn_setstatus(OscarConnection *, int); |
657 faim_export int aim_conn_completeconnect(OscarSession *sess, OscarConnection *conn); | 653 faim_export int aim_conn_completeconnect(OscarSession *sess, OscarConnection *conn); |
658 faim_export int aim_conn_isconnecting(OscarConnection *conn); | 654 faim_export int aim_conn_isconnecting(OscarConnection *conn); |
659 | 655 |
660 faim_export void aim_session_init(OscarSession *, guint8 nonblocking); | 656 OscarSession *oscar_session_new(void); |
661 faim_export void aim_session_kill(OscarSession *); | 657 void oscar_session_destroy(OscarSession *); |
658 | |
662 faim_export OscarConnection *aim_getconn_type(OscarSession *, int type); | 659 faim_export OscarConnection *aim_getconn_type(OscarSession *, int type); |
663 faim_export OscarConnection *aim_getconn_type_all(OscarSession *, int type); | 660 faim_export OscarConnection *aim_getconn_type_all(OscarSession *, int type); |
664 faim_export OscarConnection *aim_getconn_fd(OscarSession *, int fd); | 661 faim_export OscarConnection *aim_getconn_fd(OscarSession *, int fd); |
665 | 662 |
666 /* 0x0001 - family_oservice.c */ | 663 /* 0x0001 - family_oservice.c */ |