Fri, 05 Feb 2010 22:49:11 +0000
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
| 8810 | 1 | /** |
| 2 | * @file transaction.h MSN transaction functions | |
| 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:
28649
diff
changeset
|
24 | #ifndef MSN_TRANSACTION_H |
|
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
28649
diff
changeset
|
25 | #define MSN_TRANSACTION_H |
| 8810 | 26 | |
| 27 | typedef struct _MsnTransaction MsnTransaction; | |
| 28 | ||
|
29305
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
28649
diff
changeset
|
29 | #include "cmdproc.h" |
| 8810 | 30 | #include "command.h" |
| 31 | ||
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8810
diff
changeset
|
32 | typedef void (*MsnTransCb)(MsnCmdProc *cmdproc, MsnCommand *cmd); |
|
10225
0dfea1bc8695
[gaim-migrate @ 11357]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9198
diff
changeset
|
33 | typedef void (*MsnTimeoutCb)(MsnCmdProc *cmdproc, MsnTransaction *trans); |
|
0dfea1bc8695
[gaim-migrate @ 11357]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9198
diff
changeset
|
34 | typedef void (*MsnErrorCb)(MsnCmdProc *cmdproc, MsnTransaction *trans, |
|
0dfea1bc8695
[gaim-migrate @ 11357]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9198
diff
changeset
|
35 | int error); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8810
diff
changeset
|
36 | |
| 8810 | 37 | /** |
|
10225
0dfea1bc8695
[gaim-migrate @ 11357]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9198
diff
changeset
|
38 | * A transaction. A sending command that will initiate the transaction. |
| 8810 | 39 | */ |
| 40 | struct _MsnTransaction | |
| 41 | { | |
|
10225
0dfea1bc8695
[gaim-migrate @ 11357]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9198
diff
changeset
|
42 | MsnCmdProc *cmdproc; |
| 8810 | 43 | unsigned int trId; |
| 44 | ||
| 45 | char *command; | |
| 46 | char *params; | |
| 47 | ||
|
24031
f9c3efb8afa6
Fix up some types.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23444
diff
changeset
|
48 | guint timer; |
|
10225
0dfea1bc8695
[gaim-migrate @ 11357]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9198
diff
changeset
|
49 | |
|
10403
4647a87ef73b
[gaim-migrate @ 11648]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10284
diff
changeset
|
50 | void *data; /**< The data to be used on the different callbacks. */ |
|
28649
95d25c1e195d
Allow setting a destroy-function for the data. Fixes a leak.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24031
diff
changeset
|
51 | GDestroyNotify data_free; /**< The function to free 'data', or @c NULL */ |
|
95d25c1e195d
Allow setting a destroy-function for the data. Fixes a leak.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24031
diff
changeset
|
52 | |
| 8810 | 53 | GHashTable *callbacks; |
|
10284
257978b5df5b
[gaim-migrate @ 11454]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10225
diff
changeset
|
54 | gboolean has_custom_callbacks; |
|
10225
0dfea1bc8695
[gaim-migrate @ 11357]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9198
diff
changeset
|
55 | MsnErrorCb error_cb; |
|
0dfea1bc8695
[gaim-migrate @ 11357]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9198
diff
changeset
|
56 | MsnTimeoutCb timeout_cb; |
| 8810 | 57 | |
| 58 | char *payload; | |
| 59 | size_t payload_len; | |
| 60 | ||
| 61 | GQueue *queue; | |
|
10403
4647a87ef73b
[gaim-migrate @ 11648]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10284
diff
changeset
|
62 | MsnCommand *pendent_cmd; /**< The command that is waiting for the result of |
|
4647a87ef73b
[gaim-migrate @ 11648]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10284
diff
changeset
|
63 | this transaction. */ |
| 8810 | 64 | }; |
| 65 | ||
|
22670
2ad82dd45c56
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@pidgin.im>
parents:
19859
diff
changeset
|
66 | MsnTransaction *msn_transaction_new(MsnCmdProc *cmdproc, const char *command, |
|
23444
cfa3325f53a0
Payload length is an int here, so treat it as such. Get's rid of this warning:
Mark Doliner <markdoliner@pidgin.im>
parents:
22670
diff
changeset
|
67 | const char *format, ...) G_GNUC_PRINTF(3, 4); |
| 8810 | 68 | void msn_transaction_destroy(MsnTransaction *trans); |
| 69 | ||
| 70 | char *msn_transaction_to_string(MsnTransaction *trans); | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8810
diff
changeset
|
71 | void msn_transaction_queue_cmd(MsnTransaction *trans, MsnCommand *cmd); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8810
diff
changeset
|
72 | void msn_transaction_unqueue_cmd(MsnTransaction *trans, MsnCmdProc *cmdproc); |
| 8810 | 73 | void msn_transaction_set_payload(MsnTransaction *trans, |
| 74 | const char *payload, int payload_len); | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8810
diff
changeset
|
75 | void msn_transaction_set_data(MsnTransaction *trans, void *data); |
|
28649
95d25c1e195d
Allow setting a destroy-function for the data. Fixes a leak.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24031
diff
changeset
|
76 | void msn_transaction_set_data_free(MsnTransaction *trans, GDestroyNotify fn); |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8810
diff
changeset
|
77 | void msn_transaction_add_cb(MsnTransaction *trans, char *answer, |
|
10225
0dfea1bc8695
[gaim-migrate @ 11357]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9198
diff
changeset
|
78 | MsnTransCb cb); |
|
0dfea1bc8695
[gaim-migrate @ 11357]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9198
diff
changeset
|
79 | void msn_transaction_set_error_cb(MsnTransaction *trans, MsnErrorCb cb); |
|
0dfea1bc8695
[gaim-migrate @ 11357]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9198
diff
changeset
|
80 | void msn_transaction_set_timeout_cb(MsnTransaction *trans, MsnTimeoutCb cb); |
| 8810 | 81 | |
|
29305
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
28649
diff
changeset
|
82 | #endif /* MSN_TRANSACTION_H */ |