Mercurial > pidgin.yaz
annotate src/protocols/novell/nmrequest.h @ 9230:b83905afbb55
[gaim-migrate @ 10026]
memory leaks are bad
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Mon, 07 Jun 2004 05:29:36 +0000 |
parents | 6663ad2386d9 |
children | d77537e8bfe5 |
rev | line source |
---|---|
8675 | 1 /* |
2 * nmrequest.h | |
3 * | |
8933 | 4 * Copyright (c) 2004 Novell, Inc. All Rights Reserved. |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; version 2 of the License. | |
8675 | 9 * |
8933 | 10 * This program is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 * GNU General Public License for more details. | |
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
14 * |
8933 | 15 * You should have received a copy of the GNU General Public License |
16 * along with this program; if not, write to the Free Software | |
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
8675 | 18 * |
19 */ | |
20 | |
21 #ifndef __NM_REQUEST_H__ | |
22 #define __NM_REQUEST_H__ | |
23 | |
24 typedef struct _NMRequest NMRequest; | |
25 | |
26 #include "nmuser.h" | |
27 | |
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
28 /** |
8675 | 29 * Create a new request object. Object must be release with nm_release_object. |
30 * | |
31 * @param cmd The request command string (e.g. "login") | |
32 * @param trans_id The request transaction id | |
33 * @param gmt The time in seconds that the request was created | |
34 * | |
35 * @return The new request object | |
36 */ | |
37 NMRequest *nm_create_request(const char *cmd, int trans_id, int gmt); | |
38 | |
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
39 /** |
8675 | 40 * Release a request object. |
41 * | |
42 * @param req The request to release | |
43 */ | |
44 void nm_release_request(NMRequest * req); | |
45 | |
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
46 /** |
8675 | 47 * Add a new reference to this object. This reference must be released by |
48 * a call to nm_release_object. | |
49 * | |
50 * @param req The request object | |
51 */ | |
52 void nm_request_add_ref(NMRequest * req); | |
53 | |
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
54 /** |
8675 | 55 * Set the response callback for this request object. This is the callback |
56 * that will be made when we get a response from the server. | |
57 * | |
58 * @param req The request object | |
59 * @param callback The response callback | |
60 * | |
61 */ | |
62 void nm_request_set_callback(NMRequest * req, nm_response_cb callback); | |
63 | |
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
64 /** |
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
65 * Set the response data. This will be set differently depending on |
8675 | 66 * the request type (for example to nm_send_get_details will set this |
67 * to be the newly create NMUserRecord object). | |
68 * | |
69 * @param req The request object | |
70 * @param data Pointer to some data | |
71 * | |
72 */ | |
73 void nm_request_set_data(NMRequest * req, gpointer data); | |
74 | |
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
75 /** |
8675 | 76 * Set the user defined data. This is the data that the client |
77 * passes to the various nm_send_* functions. We will pass it | |
78 * back when we make the callback. | |
79 * | |
80 * @param req The request object | |
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
81 * @param user_define Pointer to some data |
8675 | 82 * |
83 */ | |
84 void nm_request_set_user_define(NMRequest * req, gpointer user_define); | |
85 | |
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
86 /** |
8735
92cbf9713795
[gaim-migrate @ 9490]
Christian Hammond <chipx86@chipx86.com>
parents:
8684
diff
changeset
|
87 * Set the return code. This is the return code that we received in |
8675 | 88 * the server response fields. |
89 * | |
90 * @param req The request object | |
91 * @param rc The return code to set | |
92 */ | |
93 void nm_request_set_ret_code(NMRequest * req, NMERR_T rc); | |
94 | |
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
95 /** |
8675 | 96 * Get the transaction id for this request. |
97 * | |
98 * @param req The request object | |
99 * | |
100 * @return The transaction id. | |
101 */ | |
102 int nm_request_get_trans_id(NMRequest * req); | |
103 | |
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
104 /** |
8675 | 105 * Get the command (request type) for this request. |
106 * | |
107 * @param req The request object | |
108 * | |
109 * @return The request cmd | |
110 */ | |
111 const char *nm_request_get_cmd(NMRequest * req); | |
112 | |
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
113 /** |
8675 | 114 * Get the response data for this request |
115 * | |
116 * @param req The request object | |
117 * | |
118 * @return The response data | |
119 */ | |
120 gpointer nm_request_get_data(NMRequest * req); | |
121 | |
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
122 /** |
8675 | 123 * Get the user defined data for this request |
124 * | |
125 * @param req The request object | |
126 * | |
127 * @return The user defined data | |
128 */ | |
129 gpointer nm_request_get_user_define(NMRequest * req); | |
130 | |
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
131 /** |
8675 | 132 * Get the response callback for this request |
133 * | |
134 * @param req The request object | |
135 * | |
136 * @return The response callback | |
137 */ | |
138 nm_response_cb nm_request_get_callback(NMRequest * req); | |
139 | |
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
140 /** |
8675 | 141 * Get the return code |
142 * | |
143 * @param req The request object | |
144 * | |
145 * @return The return code (from the response fields) | |
146 */ | |
147 NMERR_T nm_request_get_ret_code(NMRequest * req); | |
148 | |
149 #endif |