| 76 void (*_purple_reserved3)(void); |
76 void (*_purple_reserved3)(void); |
| 77 void (*_purple_reserved4)(void); |
77 void (*_purple_reserved4)(void); |
| 78 } PurpleSrvTxtQueryUiOps; |
78 } PurpleSrvTxtQueryUiOps; |
| 79 |
79 |
| 80 /** |
80 /** |
| 81 * @param resp An array of PurpleSrvResponse of size results. The array |
81 * @resp: An array of PurpleSrvResponse of size results. The array |
| 82 * is sorted based on the order described in the DNS SRV RFC. |
82 * is sorted based on the order described in the DNS SRV RFC. |
| 83 * Users of this API should try each record in resp in order, |
83 * Users of this API should try each record in resp in order, |
| 84 * starting at the beginning. |
84 * starting at the beginning. |
| 85 */ |
85 */ |
| 86 typedef void (*PurpleSrvCallback)(PurpleSrvResponse *resp, int results, gpointer data); |
86 typedef void (*PurpleSrvCallback)(PurpleSrvResponse *resp, int results, gpointer data); |
| 87 |
87 |
| 88 /** |
88 /** |
| 89 * Callback that returns the data retrieved from a DNS TXT lookup. |
89 * Callback that returns the data retrieved from a DNS TXT lookup. |
| 90 * |
90 * |
| 91 * @param responses A GList of PurpleTxtResponse objects. |
91 * @responses: A GList of PurpleTxtResponse objects. |
| 92 * @param data The extra data passed to purple_txt_resolve. |
92 * @data: The extra data passed to purple_txt_resolve. |
| 93 */ |
93 */ |
| 94 typedef void (*PurpleTxtCallback)(GList *responses, gpointer data); |
94 typedef void (*PurpleTxtCallback)(GList *responses, gpointer data); |
| 95 |
95 |
| 96 G_BEGIN_DECLS |
96 G_BEGIN_DECLS |
| 97 |
97 |
| 98 /** |
98 /** |
| 99 * Queries an SRV record. |
99 * Queries an SRV record. |
| 100 * |
100 * |
| 101 * @param account The account that the query is being done for (or NULL) |
101 * @account: The account that the query is being done for (or NULL) |
| 102 * @param protocol Name of the protocol (e.g. "sip") |
102 * @protocol: Name of the protocol (e.g. "sip") |
| 103 * @param transport Name of the transport ("tcp" or "udp") |
103 * @transport: Name of the transport ("tcp" or "udp") |
| 104 * @param domain Domain name to query (e.g. "blubb.com") |
104 * @domain: Domain name to query (e.g. "blubb.com") |
| 105 * @param cb A callback which will be called with the results |
105 * @cb: A callback which will be called with the results |
| 106 * @param extradata Extra data to be passed to the callback |
106 * @extradata: Extra data to be passed to the callback |
| 107 * |
107 * |
| 108 * @return NULL if there was an error, otherwise return a reference to |
108 * Returns: NULL if there was an error, otherwise return a reference to |
| 109 * a data structure that can be used to cancel the pending |
109 * a data structure that can be used to cancel the pending |
| 110 * DNS query, if needed. |
110 * DNS query, if needed. |
| 111 */ |
111 */ |
| 112 PurpleSrvTxtQueryData *purple_srv_resolve(PurpleAccount *account, const char *protocol, const char *transport, const char *domain, PurpleSrvCallback cb, gpointer extradata); |
112 PurpleSrvTxtQueryData *purple_srv_resolve(PurpleAccount *account, const char *protocol, const char *transport, const char *domain, PurpleSrvCallback cb, gpointer extradata); |
| 113 |
113 |
| 114 /** |
114 /** |
| 115 * Queries an TXT record. |
115 * Queries an TXT record. |
| 116 * |
116 * |
| 117 * @param account The account that the query is being done for (or NULL) |
117 * @account: The account that the query is being done for (or NULL) |
| 118 * @param owner Name of the protocol (e.g. "_xmppconnect") |
118 * @owner: Name of the protocol (e.g. "_xmppconnect") |
| 119 * @param domain Domain name to query (e.g. "blubb.com") |
119 * @domain: Domain name to query (e.g. "blubb.com") |
| 120 * @param cb A callback which will be called with the results |
120 * @cb: A callback which will be called with the results |
| 121 * @param extradata Extra data to be passed to the callback |
121 * @extradata: Extra data to be passed to the callback |
| 122 * |
122 * |
| 123 * @return NULL if there was an error, otherwise return a reference to |
123 * Returns: NULL if there was an error, otherwise return a reference to |
| 124 * a data structure that can be used to cancel the pending |
124 * a data structure that can be used to cancel the pending |
| 125 * DNS query, if needed. |
125 * DNS query, if needed. |
| 126 */ |
126 */ |
| 127 PurpleSrvTxtQueryData *purple_txt_resolve(PurpleAccount *account, const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata); |
127 PurpleSrvTxtQueryData *purple_txt_resolve(PurpleAccount *account, const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata); |
| 128 |
128 |
| 129 /** |
129 /** |
| 130 * Get the value of the current TXT record. |
130 * Get the value of the current TXT record. |
| 131 * |
131 * |
| 132 * @param response The TXT response record |
132 * @response: The TXT response record |
| 133 * |
133 * |
| 134 * @return The value of the current TXT record. |
134 * Returns: The value of the current TXT record. |
| 135 */ |
135 */ |
| 136 const gchar *purple_txt_response_get_content(PurpleTxtResponse *response); |
136 const gchar *purple_txt_response_get_content(PurpleTxtResponse *response); |
| 137 |
137 |
| 138 /** |
138 /** |
| 139 * Destroy a TXT DNS response object. |
139 * Destroy a TXT DNS response object. |
| 140 * |
140 * |
| 141 * @param response The PurpleTxtResponse to destroy. |
141 * @response: The PurpleTxtResponse to destroy. |
| 142 */ |
142 */ |
| 143 void purple_txt_response_destroy(PurpleTxtResponse *response); |
143 void purple_txt_response_destroy(PurpleTxtResponse *response); |
| 144 |
144 |
| 145 /** |
145 /** |
| 146 * Cancel a SRV/TXT query and destroy the associated data structure. |
146 * Cancel a SRV/TXT query and destroy the associated data structure. |
| 147 * |
147 * |
| 148 * @param query_data The SRV/TXT query to cancel. This data structure |
148 * @query_data: The SRV/TXT query to cancel. This data structure |
| 149 * is freed by this function. |
149 * is freed by this function. |
| 150 */ |
150 */ |
| 151 void purple_srv_txt_query_destroy(PurpleSrvTxtQueryData *query_data); |
151 void purple_srv_txt_query_destroy(PurpleSrvTxtQueryData *query_data); |
| 152 |
152 |
| 153 /** |
153 /** |
| 154 * Sets the UI operations structure to be used when doing a SRV/TXT |
154 * Sets the UI operations structure to be used when doing a SRV/TXT |
| 155 * resolve. The UI operations need only be set if the UI wants to |
155 * resolve. The UI operations need only be set if the UI wants to |
| 156 * handle the resolve itself; otherwise, leave it as NULL. |
156 * handle the resolve itself; otherwise, leave it as NULL. |
| 157 * |
157 * |
| 158 * @param ops The UI operations structure. |
158 * @ops: The UI operations structure. |
| 159 */ |
159 */ |
| 160 void purple_srv_txt_query_set_ui_ops(PurpleSrvTxtQueryUiOps *ops); |
160 void purple_srv_txt_query_set_ui_ops(PurpleSrvTxtQueryUiOps *ops); |
| 161 |
161 |
| 162 /** |
162 /** |
| 163 * Returns the UI operations structure to be used when doing a SRV/TXT |
163 * Returns the UI operations structure to be used when doing a SRV/TXT |
| 164 * resolve. |
164 * resolve. |
| 165 * |
165 * |
| 166 * @return The UI operations structure. |
166 * Returns: The UI operations structure. |
| 167 */ |
167 */ |
| 168 PurpleSrvTxtQueryUiOps *purple_srv_txt_query_get_ui_ops(void); |
168 PurpleSrvTxtQueryUiOps *purple_srv_txt_query_get_ui_ops(void); |
| 169 |
169 |
| 170 /** |
170 /** |
| 171 * Get the query from a PurpleSrvTxtQueryData |
171 * Get the query from a PurpleSrvTxtQueryData |
| 172 * |
172 * |
| 173 * @param query_data The SRV/TXT query |
173 * @query_data: The SRV/TXT query |
| 174 * @return The query. |
174 * Returns: The query. |
| 175 */ |
175 */ |
| 176 char *purple_srv_txt_query_get_query(PurpleSrvTxtQueryData *query_data); |
176 char *purple_srv_txt_query_get_query(PurpleSrvTxtQueryData *query_data); |
| 177 |
177 |
| 178 /** |
178 /** |
| 179 * Get the type from a PurpleSrvTxtQueryData (TXT or SRV) |
179 * Get the type from a PurpleSrvTxtQueryData (TXT or SRV) |
| 180 * |
180 * |
| 181 * @param query_data The query |
181 * @query_data: The query |
| 182 * @return The query. |
182 * Returns: The query. |
| 183 */ |
183 */ |
| 184 int purple_srv_txt_query_get_type(PurpleSrvTxtQueryData *query_data); |
184 int purple_srv_txt_query_get_type(PurpleSrvTxtQueryData *query_data); |
| 185 |
185 |
| 186 G_END_DECLS |
186 G_END_DECLS |
| 187 |
187 |