comparison libpurple/dnssrv.h @ 32477:efe38e6319f2

Clean up SRV/TXT query functions. * Rename _account functions to their regular form. * Remove the unnecessary _cancel functions.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 02 Sep 2011 03:18:15 +0000
parents 142429bcb4c8
children e1d4eea990d2
comparison
equal deleted inserted replaced
32476:ba74745ff179 32477:efe38e6319f2
97 typedef void (*PurpleTxtCallback)(GList *responses, gpointer data); 97 typedef void (*PurpleTxtCallback)(GList *responses, gpointer data);
98 98
99 /** 99 /**
100 * Queries an SRV record. 100 * Queries an SRV record.
101 * 101 *
102 * @param account the account that the query is being done for (or NULL) 102 * @param account The account that the query is being done for (or NULL)
103 * @param protocol Name of the protocol (e.g. "sip") 103 * @param protocol Name of the protocol (e.g. "sip")
104 * @param transport Name of the transport ("tcp" or "udp") 104 * @param transport Name of the transport ("tcp" or "udp")
105 * @param domain Domain name to query (e.g. "blubb.com") 105 * @param domain Domain name to query (e.g. "blubb.com")
106 * @param cb A callback which will be called with the results 106 * @param cb A callback which will be called with the results
107 * @param extradata Extra data to be passed to the callback 107 * @param extradata Extra data to be passed to the callback
108 * 108 *
109 * @since 2.8.0 109 * @return NULL if there was an error, otherwise return a reference to
110 * a data structure that can be used to cancel the pending
111 * DNS query, if needed.
110 */ 112 */
111 PurpleSrvTxtQueryData *purple_srv_resolve_account(PurpleAccount *account, const char *protocol, const char *transport, const char *domain, PurpleSrvCallback cb, gpointer extradata); 113 PurpleSrvTxtQueryData *purple_srv_resolve(PurpleAccount *account, const char *protocol, const char *transport, const char *domain, PurpleSrvCallback cb, gpointer extradata);
112
113 #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_DNSSRV_C_)
114 /**
115 * Queries an SRV record.
116 *
117 * @param protocol Name of the protocol (e.g. "sip")
118 * @param transport Name of the transport ("tcp" or "udp")
119 * @param domain Domain name to query (e.g. "blubb.com")
120 * @param cb A callback which will be called with the results
121 * @param extradata Extra data to be passed to the callback
122 *
123 * @deprecated Use purple_srv_resolve_account instead
124 */
125 PurpleSrvTxtQueryData *purple_srv_resolve(const char *protocol, const char *transport, const char *domain, PurpleSrvCallback cb, gpointer extradata);
126 #endif
127
128 /**
129 * Cancel an SRV or DNS query.
130 *
131 * @param query_data The request to cancel.
132 *
133 * @deprecated Use purple_srv_txt_query_destroy instead
134 */
135 void purple_srv_cancel(PurpleSrvTxtQueryData *query_data);
136 114
137 /** 115 /**
138 * Queries an TXT record. 116 * Queries an TXT record.
139 * 117 *
140 * @param account the account that the query is being done for (or NULL) 118 * @param account The account that the query is being done for (or NULL)
141 * @param owner Name of the protocol (e.g. "_xmppconnect") 119 * @param owner Name of the protocol (e.g. "_xmppconnect")
142 * @param domain Domain name to query (e.g. "blubb.com") 120 * @param domain Domain name to query (e.g. "blubb.com")
143 * @param cb A callback which will be called with the results 121 * @param cb A callback which will be called with the results
144 * @param extradata Extra data to be passed to the callback 122 * @param extradata Extra data to be passed to the callback
145 * 123 *
146 * @since 2.8.0 124 * @return NULL if there was an error, otherwise return a reference to
125 * a data structure that can be used to cancel the pending
126 * DNS query, if needed.
147 */ 127 */
148 PurpleSrvTxtQueryData *purple_txt_resolve_account(PurpleAccount *account, const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata); 128 PurpleSrvTxtQueryData *purple_txt_resolve(PurpleAccount *account, const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata);
149
150 #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_DNSSRV_C_)
151 /**
152 * Queries an TXT record.
153 *
154 * @param owner Name of the protocol (e.g. "_xmppconnect")
155 * @param domain Domain name to query (e.g. "blubb.com")
156 * @param cb A callback which will be called with the results
157 * @param extradata Extra data to be passed to the callback
158 *
159 * @deprecated Use purple_txt_resolve_account instead
160 *
161 * @since 2.6.0
162 */
163 PurpleSrvTxtQueryData *purple_txt_resolve(const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata);
164 #endif
165
166 /**
167 * Cancel an TXT DNS query.
168 *
169 * @param query_data The request to cancel.
170 * @since 2.6.0
171 *
172 * @deprecated Use purple_srv_txt_query_destroy instead
173 */
174 void purple_txt_cancel(PurpleSrvTxtQueryData *query_data);
175 129
176 /** 130 /**
177 * Get the value of the current TXT record. 131 * Get the value of the current TXT record.
178 * 132 *
179 * @param response The TXT response record 133 * @param response The TXT response record
180 * @returns The value of the current TXT record. 134 *
181 * @since 2.6.0 135 * @return The value of the current TXT record.
182 */ 136 */
183 const gchar *purple_txt_response_get_content(PurpleTxtResponse *response); 137 const gchar *purple_txt_response_get_content(PurpleTxtResponse *response);
184 138
185 /** 139 /**
186 * Destroy a TXT DNS response object. 140 * Destroy a TXT DNS response object.
187 * 141 *
188 * @param response The PurpleTxtResponse to destroy. 142 * @param response The PurpleTxtResponse to destroy.
189 * @since 2.6.0
190 */ 143 */
191 void purple_txt_response_destroy(PurpleTxtResponse *response); 144 void purple_txt_response_destroy(PurpleTxtResponse *response);
192 145
193 /** 146 /**
194 * Cancel a SRV/TXT query and destroy the associated data structure. 147 * Cancel a SRV/TXT query and destroy the associated data structure.
214 * @return The UI operations structure. 167 * @return The UI operations structure.
215 */ 168 */
216 PurpleSrvTxtQueryUiOps *purple_srv_txt_query_get_ui_ops(void); 169 PurpleSrvTxtQueryUiOps *purple_srv_txt_query_get_ui_ops(void);
217 170
218 /** 171 /**
219 * Get the query from a PurpleDnsQueryData 172 * Get the query from a PurpleSrvTxtQueryData
220 * 173 *
221 * @param query_data The SRV/TXT query 174 * @param query_data The SRV/TXT query
222 * @return The query. 175 * @return The query.
223 */ 176 */
224 char *purple_srv_txt_query_get_query(PurpleSrvTxtQueryData *query_data); 177 char *purple_srv_txt_query_get_query(PurpleSrvTxtQueryData *query_data);
225 178
226 /** 179 /**
227 * Get the type from a PurpleDnsQueryData (TXT or SRV) 180 * Get the type from a PurpleSrvTxtQueryData (TXT or SRV)
228 * 181 *
229 * @param query_data The query 182 * @param query_data The query
230 * @return The query. 183 * @return The query.
231 */ 184 */
232 int purple_srv_txt_query_get_type(PurpleSrvTxtQueryData *query_data); 185 int purple_srv_txt_query_get_type(PurpleSrvTxtQueryData *query_data);
234 #ifdef __cplusplus 187 #ifdef __cplusplus
235 } 188 }
236 #endif 189 #endif
237 190
238 #endif /* _PURPLE_DNSSRV_H */ 191 #endif /* _PURPLE_DNSSRV_H */
192