| 85 /*@{*/ |
85 /*@{*/ |
| 86 |
86 |
| 87 /** |
87 /** |
| 88 * Perform an asynchronous DNS query. |
88 * Perform an asynchronous DNS query. |
| 89 * |
89 * |
| 90 * @param account The account that the query is being done for (or NULL) |
90 * @account: The account that the query is being done for (or NULL) |
| 91 * @param hostname The hostname to resolve. |
91 * @hostname: The hostname to resolve. |
| 92 * @param port A port number which is stored in the struct sockaddr. |
92 * @port: A port number which is stored in the struct sockaddr. |
| 93 * @param callback The callback function to call after resolving. |
93 * @callback: The callback function to call after resolving. |
| 94 * @param data Extra data to pass to the callback function. |
94 * @data: Extra data to pass to the callback function. |
| 95 * |
95 * |
| 96 * @return NULL if there was an error, otherwise return a reference to |
96 * Returns: NULL if there was an error, otherwise return a reference to |
| 97 * a data structure that can be used to cancel the pending |
97 * a data structure that can be used to cancel the pending |
| 98 * DNS query, if needed. |
98 * DNS query, if needed. |
| 99 * |
99 * |
| 100 */ |
100 */ |
| 101 PurpleDnsQueryData *purple_dnsquery_a(PurpleAccount *account, const char *hostname, int port, PurpleDnsQueryConnectFunction callback, gpointer data); |
101 PurpleDnsQueryData *purple_dnsquery_a(PurpleAccount *account, const char *hostname, int port, PurpleDnsQueryConnectFunction callback, gpointer data); |
| 102 |
102 |
| 103 /** |
103 /** |
| 104 * Cancel a DNS query and destroy the associated data structure. |
104 * Cancel a DNS query and destroy the associated data structure. |
| 105 * |
105 * |
| 106 * @param query_data The DNS query to cancel. This data structure |
106 * @query_data: The DNS query to cancel. This data structure |
| 107 * is freed by this function. |
107 * is freed by this function. |
| 108 */ |
108 */ |
| 109 void purple_dnsquery_destroy(PurpleDnsQueryData *query_data); |
109 void purple_dnsquery_destroy(PurpleDnsQueryData *query_data); |
| 110 |
110 |
| 111 /** |
111 /** |
| 112 * Sets the UI operations structure to be used when doing a DNS |
112 * Sets the UI operations structure to be used when doing a DNS |
| 113 * resolve. The UI operations need only be set if the UI wants to |
113 * resolve. The UI operations need only be set if the UI wants to |
| 114 * handle the resolve itself; otherwise, leave it as NULL. |
114 * handle the resolve itself; otherwise, leave it as NULL. |
| 115 * |
115 * |
| 116 * @param ops The UI operations structure. |
116 * @ops: The UI operations structure. |
| 117 */ |
117 */ |
| 118 void purple_dnsquery_set_ui_ops(PurpleDnsQueryUiOps *ops); |
118 void purple_dnsquery_set_ui_ops(PurpleDnsQueryUiOps *ops); |
| 119 |
119 |
| 120 /** |
120 /** |
| 121 * Returns the UI operations structure to be used when doing a DNS |
121 * Returns the UI operations structure to be used when doing a DNS |
| 122 * resolve. |
122 * resolve. |
| 123 * |
123 * |
| 124 * @return The UI operations structure. |
124 * Returns: The UI operations structure. |
| 125 */ |
125 */ |
| 126 PurpleDnsQueryUiOps *purple_dnsquery_get_ui_ops(void); |
126 PurpleDnsQueryUiOps *purple_dnsquery_get_ui_ops(void); |
| 127 |
127 |
| 128 /** |
128 /** |
| 129 * Get the host associated with a PurpleDnsQueryData |
129 * Get the host associated with a PurpleDnsQueryData |
| 130 * |
130 * |
| 131 * @param query_data The DNS query |
131 * @query_data: The DNS query |
| 132 * @return The host. |
132 * Returns: The host. |
| 133 */ |
133 */ |
| 134 char *purple_dnsquery_get_host(PurpleDnsQueryData *query_data); |
134 char *purple_dnsquery_get_host(PurpleDnsQueryData *query_data); |
| 135 |
135 |
| 136 /** |
136 /** |
| 137 * Get the port associated with a PurpleDnsQueryData |
137 * Get the port associated with a PurpleDnsQueryData |
| 138 * |
138 * |
| 139 * @param query_data The DNS query |
139 * @query_data: The DNS query |
| 140 * @return The port. |
140 * Returns: The port. |
| 141 */ |
141 */ |
| 142 unsigned short purple_dnsquery_get_port(PurpleDnsQueryData *query_data); |
142 unsigned short purple_dnsquery_get_port(PurpleDnsQueryData *query_data); |
| 143 |
143 |
| 144 /** |
144 /** |
| 145 * Initializes the DNS query subsystem. |
145 * Initializes the DNS query subsystem. |