Mercurial > pidgin.yaz
diff libgaim/protocols/oscar/oscar.h @ 15107:f41cd6f78c60
[gaim-migrate @ 17892]
Use GHashTable and GQueue instead of GSList in a few places in
oscar. The speed improvements probably won't be noticeable.
4 files changed, 48 insertions(+), 106 deletions(-)
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 04 Dec 2006 11:14:11 +0000 |
parents | b2b0839f57d0 |
children | 917a50335af3 |
line wrap: on
line diff
--- a/libgaim/protocols/oscar/oscar.h Mon Dec 04 07:47:50 2006 +0000 +++ b/libgaim/protocols/oscar/oscar.h Mon Dec 04 11:14:11 2006 +0000 @@ -392,11 +392,9 @@ guint16 seqnum; /**< The sequence number of most recent outgoing packet. */ GSList *groups; GSList *rateclasses; /* Contains nodes of struct rateclass. */ - /* TODO: Maybe use a GHashTable for rateclasses */ - GSList *queued_snacs; /**< Contains QueuedSnacs. */ - guint outgoing_timeout; - /* TODO: Maybe use a GQueue for outgoing_snacs */ + GQueue *queued_snacs; /**< Contains QueuedSnacs. */ + guint queued_timeout; void *internal; /* internal conn-specific libfaim data */ }; @@ -504,8 +502,7 @@ gboolean in_transaction; } ssi; - /* TODO: Implement this as a HashTable for HUGE speed improvement! */ - GSList *handlerlist; + GHashTable *handlerlist; /** A linked list containing FlapConnections. */ GSList *oscar_connections; @@ -578,8 +575,8 @@ void aim_cleansnacs(OscarData *, int maxage); -int oscar_data_addhandler(OscarData *od, guint16 family, guint16 type, aim_rxcallback_t newhandler, guint16 flags); -void aim_clearhandlers(OscarData *od); +void oscar_data_addhandler(OscarData *od, guint16 family, guint16 subtype, aim_rxcallback_t newhandler, guint16 flags); +aim_rxcallback_t aim_callhandler(OscarData *od, guint16 family, guint16 subtype); /* flap_connection.c */ FlapConnection *flap_connection_new(OscarData *, int type); @@ -1542,9 +1539,6 @@ int byte_stream_putbs(ByteStream *bs, ByteStream *srcbs, int len); int byte_stream_putcaps(ByteStream *bs, guint32 caps); -/* rxhandlers.c */ -aim_rxcallback_t aim_callhandler(OscarData *od, guint16 family, guint16 type); - /* * Generic SNAC structure. Rarely if ever used. */ @@ -1571,11 +1565,6 @@ guint16 instance; }; -struct snacpair { - guint16 group; - guint16 subtype; -}; - struct rateclass { guint16 classid; guint32 windowsize; @@ -1586,8 +1575,7 @@ guint32 current; guint32 max; guint8 unknown[5]; /* only present in versions >= 3 */ - GSList *members; /* Contains node of struct snacpair */ - /* TODO: Maybe use a GHashTable for members */ + GHashTable *members; /* Key is family and subtype, value is TRUE. */ struct timeval last; /**< The time when we last sent a SNAC of this rate class. */ };