Mercurial > pidgin
annotate src/protocols/novell/nmrequest.h @ 8684:046dd8ef2920
[gaim-migrate @ 9437]
Excess whitespace bad, especially *that* much.
committer: Tailor Script <tailor@pidgin.im>
| author | Christian Hammond <chipx86@chipx86.com> |
|---|---|
| date | Sat, 17 Apr 2004 18:29:20 +0000 |
| parents | 9ee2542d1104 |
| children | 92cbf9713795 |
| rev | line source |
|---|---|
| 8675 | 1 /* |
| 2 * nmrequest.h | |
| 3 * | |
| 4 * Copyright © 2004 Unpublished Work of Novell, Inc. All Rights Reserved. | |
| 5 * | |
| 6 * THIS WORK IS AN UNPUBLISHED WORK OF NOVELL, INC. NO PART OF THIS WORK MAY BE | |
| 7 * USED, PRACTICED, PERFORMED, COPIED, DISTRIBUTED, REVISED, MODIFIED, | |
| 8 * TRANSLATED, ABRIDGED, CONDENSED, EXPANDED, COLLECTED, COMPILED, LINKED, | |
| 9 * RECAST, TRANSFORMED OR ADAPTED WITHOUT THE PRIOR WRITTEN CONSENT OF NOVELL, | |
| 10 * INC. ANY USE OR EXPLOITATION OF THIS WORK WITHOUT AUTHORIZATION COULD SUBJECT | |
| 11 * THE PERPETRATOR TO CRIMINAL AND CIVIL LIABILITY. | |
|
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
12 * |
| 8675 | 13 * AS BETWEEN [GAIM] AND NOVELL, NOVELL GRANTS [GAIM] THE RIGHT TO REPUBLISH |
| 14 * THIS WORK UNDER THE GPL (GNU GENERAL PUBLIC LICENSE) WITH ALL RIGHTS AND | |
| 15 * LICENSES THEREUNDER. IF YOU HAVE RECEIVED THIS WORK DIRECTLY OR INDIRECTLY | |
| 16 * FROM [GAIM] AS PART OF SUCH A REPUBLICATION, YOU HAVE ALL RIGHTS AND LICENSES | |
| 17 * GRANTED BY [GAIM] UNDER THE GPL. IN CONNECTION WITH SUCH A REPUBLICATION, IF | |
| 18 * ANYTHING IN THIS NOTICE CONFLICTS WITH THE TERMS OF THE GPL, SUCH TERMS | |
| 19 * PREVAIL. | |
| 20 * | |
| 21 */ | |
| 22 | |
| 23 #ifndef __NM_REQUEST_H__ | |
| 24 #define __NM_REQUEST_H__ | |
| 25 | |
| 26 typedef struct _NMRequest NMRequest; | |
| 27 | |
| 28 #include "nmuser.h" | |
| 29 | |
|
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
30 /** |
| 8675 | 31 * Create a new request object. Object must be release with nm_release_object. |
| 32 * | |
| 33 * @param cmd The request command string (e.g. "login") | |
| 34 * @param trans_id The request transaction id | |
| 35 * @param gmt The time in seconds that the request was created | |
| 36 * | |
| 37 * @return The new request object | |
| 38 */ | |
| 39 NMRequest *nm_create_request(const char *cmd, int trans_id, int gmt); | |
| 40 | |
|
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
41 /** |
| 8675 | 42 * Release a request object. |
| 43 * | |
| 44 * @param req The request to release | |
| 45 */ | |
| 46 void nm_release_request(NMRequest * req); | |
| 47 | |
|
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
48 /** |
| 8675 | 49 * Add a new reference to this object. This reference must be released by |
| 50 * a call to nm_release_object. | |
| 51 * | |
| 52 * @param req The request object | |
| 53 */ | |
| 54 void nm_request_add_ref(NMRequest * req); | |
| 55 | |
|
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
56 /** |
| 8675 | 57 * Set the response callback for this request object. This is the callback |
| 58 * that will be made when we get a response from the server. | |
| 59 * | |
| 60 * @param req The request object | |
| 61 * @param callback The response callback | |
| 62 * | |
| 63 */ | |
| 64 void nm_request_set_callback(NMRequest * req, nm_response_cb callback); | |
| 65 | |
|
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
66 /** |
|
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
67 * Set the response data. This will be set differently depending on |
| 8675 | 68 * the request type (for example to nm_send_get_details will set this |
| 69 * to be the newly create NMUserRecord object). | |
| 70 * | |
| 71 * @param req The request object | |
| 72 * @param data Pointer to some data | |
| 73 * | |
| 74 */ | |
| 75 void nm_request_set_data(NMRequest * req, gpointer data); | |
| 76 | |
|
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
77 /** |
| 8675 | 78 * Set the user defined data. This is the data that the client |
| 79 * passes to the various nm_send_* functions. We will pass it | |
| 80 * back when we make the callback. | |
| 81 * | |
| 82 * @param req The request object | |
|
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
83 * @param user_define Pointer to some data |
| 8675 | 84 * |
| 85 */ | |
| 86 void nm_request_set_user_define(NMRequest * req, gpointer user_define); | |
| 87 | |
|
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
88 /** |
|
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
89 * Set the return code. This is the return code that we recieved in |
| 8675 | 90 * the server response fields. |
| 91 * | |
| 92 * @param req The request object | |
| 93 * @param rc The return code to set | |
| 94 */ | |
| 95 void nm_request_set_ret_code(NMRequest * req, NMERR_T rc); | |
| 96 | |
|
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
97 /** |
| 8675 | 98 * Get the transaction id for this request. |
| 99 * | |
| 100 * @param req The request object | |
| 101 * | |
| 102 * @return The transaction id. | |
| 103 */ | |
| 104 int nm_request_get_trans_id(NMRequest * req); | |
| 105 | |
|
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
106 /** |
| 8675 | 107 * Get the command (request type) for this request. |
| 108 * | |
| 109 * @param req The request object | |
| 110 * | |
| 111 * @return The request cmd | |
| 112 */ | |
| 113 const char *nm_request_get_cmd(NMRequest * req); | |
| 114 | |
|
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
115 /** |
| 8675 | 116 * Get the response data for this request |
| 117 * | |
| 118 * @param req The request object | |
| 119 * | |
| 120 * @return The response data | |
| 121 */ | |
| 122 gpointer nm_request_get_data(NMRequest * req); | |
| 123 | |
|
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
124 /** |
| 8675 | 125 * Get the user defined data for this request |
| 126 * | |
| 127 * @param req The request object | |
| 128 * | |
| 129 * @return The user defined data | |
| 130 */ | |
| 131 gpointer nm_request_get_user_define(NMRequest * req); | |
| 132 | |
|
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
133 /** |
| 8675 | 134 * Get the response callback for this request |
| 135 * | |
| 136 * @param req The request object | |
| 137 * | |
| 138 * @return The response callback | |
| 139 */ | |
| 140 nm_response_cb nm_request_get_callback(NMRequest * req); | |
| 141 | |
|
8684
046dd8ef2920
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
142 /** |
| 8675 | 143 * Get the return code |
| 144 * | |
| 145 * @param req The request object | |
| 146 * | |
| 147 * @return The return code (from the response fields) | |
| 148 */ | |
| 149 NMERR_T nm_request_get_ret_code(NMRequest * req); | |
| 150 | |
| 151 #endif |
