Wed, 15 Dec 2010 22:04:08 +0000
Fix typo
| 8810 | 1 | /** |
| 2 | * @file table.h MSN helper structure | |
| 3 | * | |
| 15884 | 4 | * purple |
| 8810 | 5 | * |
| 15884 | 6 | * Purple is the legal property of its developers, whose names are too numerous |
|
9198
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
7 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
8 | * source distribution. |
| 8810 | 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify | |
| 11 | * it under the terms of the GNU General Public License as published by | |
| 12 | * the Free Software Foundation; either version 2 of the License, or | |
| 13 | * (at your option) any later version. | |
| 14 | * | |
| 15 | * This program is distributed in the hope that it will be useful, | |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 18 | * GNU General Public License for more details. | |
| 19 | * | |
| 20 | * You should have received a copy of the GNU General Public License | |
| 21 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
15884
diff
changeset
|
22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 8810 | 23 | */ |
|
29305
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
24 | #ifndef MSN_TABLE_H |
|
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
25 | #define MSN_TABLE_H |
| 8810 | 26 | |
| 27 | typedef struct _MsnTable MsnTable; | |
| 28 | ||
| 29 | #include "cmdproc.h" | |
| 30 | #include "transaction.h" | |
| 31 | #include "msg.h" | |
| 32 | ||
|
10345
7d7f8cfa2b4f
[gaim-migrate @ 11556]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10225
diff
changeset
|
33 | typedef void (*MsnMsgTypeCb)(MsnCmdProc *cmdproc, MsnMessage *msg); |
| 8810 | 34 | |
| 35 | struct _MsnTable | |
| 36 | { | |
|
30919
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
37 | GHashTable *cmds; /**< Callbacks that manage command response. */ |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
38 | GHashTable *msgs; /**< Callbacks that manage incoming messages. */ |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
39 | GHashTable *errors; /**< Callbacks that manage command errors. */ |
| 8810 | 40 | |
|
30919
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
41 | GHashTable *async; /**< Callbacks that manage incoming asyncronous messages. */ |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
42 | /* TODO: Does this one is really needed? */ |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
43 | GHashTable *fallback; /**< Fallback callback. */ |
| 8810 | 44 | }; |
| 45 | ||
|
30919
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
46 | /** |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
47 | * Create a new instance of a MsnTable which map commands, errors and messages |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
48 | * with callbacks that will handle it. |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
49 | * |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
50 | * @return A new MsnTable. |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
51 | */ |
|
12323
f52908fb23b0
[gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents:
10345
diff
changeset
|
52 | MsnTable *msn_table_new(void); |
|
30919
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
53 | |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
54 | /** |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
55 | * Destroy a MsnTable. |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
56 | * |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
57 | * @param table The MsnTable to be destroyed. |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
58 | */ |
| 8810 | 59 | void msn_table_destroy(MsnTable *table); |
| 60 | ||
|
30919
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
61 | /** |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
62 | * Relate an incomming command from server with a callback able to handle |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
63 | * the event. |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
64 | * |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
65 | * @param table The MsnTable. |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
66 | * @param command If NULL this add an incoming asyncronous command set in answer. |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
67 | * Else, the command sent. |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
68 | * @param answer The server answer to 'command'. If 'command' is NULL, |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
69 | * the asyncronous command sent by the server. |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
70 | * @param cb Callback to handle this event. |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
71 | */ |
| 8810 | 72 | void msn_table_add_cmd(MsnTable *table, char *command, char *answer, |
| 73 | MsnTransCb cb); | |
|
30919
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
74 | |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
75 | /** |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
76 | * Set a callback to handle incoming command errors. |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
77 | * |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
78 | * @param table The MsnTable. |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
79 | * @param answer Incoming command with error. |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
80 | * @param cb Callback to handle this error. |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
81 | */ |
| 8810 | 82 | void msn_table_add_error(MsnTable *table, char *answer, MsnErrorCb cb); |
|
30919
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
83 | |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
84 | /** |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
85 | * Relate a message Content-type with a callback able to handle it. |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
86 | * |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
87 | * @param table The MsnTable. |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
88 | * @param type The Message Content-Type. |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
89 | * @param cb Callback to handle this Content-type. |
|
9a43c599f25d
Document MsnTable.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
29305
diff
changeset
|
90 | */ |
|
10345
7d7f8cfa2b4f
[gaim-migrate @ 11556]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10225
diff
changeset
|
91 | void msn_table_add_msg_type(MsnTable *table, char *type, MsnMsgTypeCb cb); |
| 8810 | 92 | |
|
29305
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
19859
diff
changeset
|
93 | #endif /* MSN_TABLE_H */ |