annotate libpurple/protocols/qq/buddy_memo.h @ 31836:8d6630912021

Add two hash tables to the oscar code that deals with your server stored buddy list. One hash table is indexed by a combination of group id and buddy id. The other hash table is indexed by a combination of item type and item name. This should reduce the number of times we iterate through a linked list by A LOT. This is a modified version of Oliver's patch from #4816. Fixes #4816.
author Mark Doliner <mark@kingant.net>
date Sun, 20 Mar 2011 20:20:52 +0000
parents 4deef745de87
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25523
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
1 /**
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
2 * @file buddy_memo.h
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
3 *
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
4 * purple
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
5 *
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
6 * Purple is the legal property of its developers, whose names are too numerous
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
8 * source distribution.
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
9 *
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
10 * This program is free software; you can redistribute it and/or modify
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
11 * it under the terms of the GNU General Public License as published by
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
13 * (at your option) any later version.
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
14 *
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
15 * This program is distributed in the hope that it will be useful,
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
18 * GNU General Public License for more details.
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
19 *
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
20 * You should have received a copy of the GNU General Public License
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
21 * along with this program; if not, write to the Free Software
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
23 */
b16a35e21a3d 2009.02.24 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25519
diff changeset
24
25517
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25515
diff changeset
25 #ifndef _QQ_BUDDY_MEMO_H_
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25515
diff changeset
26 #define _QQ_BUDDY_MEMO_H_
25515
7f903e67a995 2009.02.09 - Chengming Wang <tiger2007532246(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
diff changeset
27
7f903e67a995 2009.02.09 - Chengming Wang <tiger2007532246(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
diff changeset
28 #include <glib.h>
25517
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25515
diff changeset
29 #include "connection.h"
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25515
diff changeset
30 #include "blist.h"
31191
4deef745de87 2010.01.23 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 31085
diff changeset
31 #include "qq.h"
25515
7f903e67a995 2009.02.09 - Chengming Wang <tiger2007532246(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
diff changeset
32
25517
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25515
diff changeset
33 #define QQ_BUDDY_MEMO_REQUEST_SUCCESS 0x00
25515
7f903e67a995 2009.02.09 - Chengming Wang <tiger2007532246(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
diff changeset
34
25517
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25515
diff changeset
35 /* clan command for memo */
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25515
diff changeset
36 enum
31085
44f53d3fc54f Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents: 25523
diff changeset
37 {
25517
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25515
diff changeset
38 QQ_BUDDY_MEMO_MODIFY = 0x01, /* upload memo */
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25515
diff changeset
39 QQ_BUDDY_MEMO_REMOVE, /* remove memo */
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25515
diff changeset
40 QQ_BUDDY_MEMO_GET /* get memo */
25515
7f903e67a995 2009.02.09 - Chengming Wang <tiger2007532246(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
diff changeset
41 };
7f903e67a995 2009.02.09 - Chengming Wang <tiger2007532246(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
diff changeset
42
7f903e67a995 2009.02.09 - Chengming Wang <tiger2007532246(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
diff changeset
43
31191
4deef745de87 2010.01.23 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 31085
diff changeset
44 void qq_process_get_buddy_memo(PurpleConnection *gc, guint8* data, gint data_len, UPDCLS update_class, guint32 action);
25515
7f903e67a995 2009.02.09 - Chengming Wang <tiger2007532246(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
diff changeset
45
31191
4deef745de87 2010.01.23 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 31085
diff changeset
46 void qq_request_buddy_memo(PurpleConnection *gc, UID bd_uid, UPDCLS update_class, guint32 action);
25515
7f903e67a995 2009.02.09 - Chengming Wang <tiger2007532246(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
diff changeset
47
25517
59ed7712be5e 2009.02.21 - flos <lonicerae(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents: 25515
diff changeset
48 #endif
25515
7f903e67a995 2009.02.09 - Chengming Wang <tiger2007532246(at)gmail.com>
SHiNE CsyFeK <csyfek@gmail.com>
parents:
diff changeset
49