Mercurial > pidgin
comparison libpurple/proxy.h @ 32819:2c6510167895 default tip
propagate from branch 'im.pidgin.pidgin.2.x.y' (head 3315c5dfbd0ad16511bdcf865e5b07c02d07df24)
to branch 'im.pidgin.pidgin' (head cbd1eda6bcbf0565ae7766396bb8f6f419cb6a9a)
| author | Elliott Sales de Andrade <qulogic@pidgin.im> |
|---|---|
| date | Sat, 02 Jun 2012 02:30:49 +0000 |
| parents | 98520ee78f12 |
| children |
comparison
equal
deleted
inserted
replaced
| 32818:01ff09d4a463 | 32819:2c6510167895 |
|---|---|
| 45 } PurpleProxyType; | 45 } PurpleProxyType; |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * Information on proxy settings. | 48 * Information on proxy settings. |
| 49 */ | 49 */ |
| 50 typedef struct | 50 typedef struct _PurpleProxyInfo PurpleProxyInfo; |
| 51 { | |
| 52 PurpleProxyType type; /**< The proxy type. */ | |
| 53 | |
| 54 char *host; /**< The host. */ | |
| 55 int port; /**< The port number. */ | |
| 56 char *username; /**< The username. */ | |
| 57 char *password; /**< The password. */ | |
| 58 | |
| 59 } PurpleProxyInfo; | |
| 60 | 51 |
| 61 typedef struct _PurpleProxyConnectData PurpleProxyConnectData; | 52 typedef struct _PurpleProxyConnectData PurpleProxyConnectData; |
| 62 | 53 |
| 63 typedef void (*PurpleProxyConnectFunction)(gpointer data, gint source, const gchar *error_message); | 54 typedef void (*PurpleProxyConnectFunction)(gpointer data, gint source, const gchar *error_message); |
| 64 | 55 |
| 65 | 56 |
| 66 #include "account.h" | 57 #include "account.h" |
| 67 | 58 |
| 68 #ifdef __cplusplus | 59 G_BEGIN_DECLS |
| 69 extern "C" { | |
| 70 #endif | |
| 71 | 60 |
| 72 /**************************************************************************/ | 61 /**************************************************************************/ |
| 73 /** @name Proxy structure API */ | 62 /** @name Proxy structure API */ |
| 74 /**************************************************************************/ | 63 /**************************************************************************/ |
| 75 /*@{*/ | 64 /*@{*/ |
| 189 | 178 |
| 190 /** | 179 /** |
| 191 * Set purple's global proxy information. | 180 * Set purple's global proxy information. |
| 192 * | 181 * |
| 193 * @param info The proxy information. | 182 * @param info The proxy information. |
| 194 * @since 2.6.0 | |
| 195 */ | 183 */ |
| 196 void purple_global_proxy_set_info(PurpleProxyInfo *info); | 184 void purple_global_proxy_set_info(PurpleProxyInfo *info); |
| 197 | 185 |
| 198 /*@}*/ | 186 /*@}*/ |
| 199 | 187 |
| 314 PurpleProxyConnectData *purple_proxy_connect_socks5_account(void *handle, | 302 PurpleProxyConnectData *purple_proxy_connect_socks5_account(void *handle, |
| 315 PurpleAccount *account, PurpleProxyInfo *gpi, | 303 PurpleAccount *account, PurpleProxyInfo *gpi, |
| 316 const char *host, int port, | 304 const char *host, int port, |
| 317 PurpleProxyConnectFunction connect_cb, gpointer data); | 305 PurpleProxyConnectFunction connect_cb, gpointer data); |
| 318 | 306 |
| 319 #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PROXY_C_) | |
| 320 /** | |
| 321 * Makes a connection through a SOCKS5 proxy. | |
| 322 * | |
| 323 * @param handle A handle that should be associated with this | |
| 324 * connection attempt. The handle can be used | |
| 325 * to cancel the connection attempt using the | |
| 326 * purple_proxy_connect_cancel_with_handle() | |
| 327 * function. | |
| 328 * @param gpi The PurpleProxyInfo specifying the proxy settings | |
| 329 * @param host The destination host. | |
| 330 * @param port The destination port. | |
| 331 * @param connect_cb The function to call when the connection is | |
| 332 * established. If the connection failed then | |
| 333 * fd will be -1 and error message will be set | |
| 334 * to something descriptive (hopefully). | |
| 335 * @param data User-defined data. | |
| 336 * | |
| 337 * @return NULL if there was an error, or a reference to an | |
| 338 * opaque data structure that can be used to cancel | |
| 339 * the pending connection, if needed. | |
| 340 * @deprecated Use purple_proxy_connect_socks5_account instead | |
| 341 */ | |
| 342 PurpleProxyConnectData *purple_proxy_connect_socks5(void *handle, | |
| 343 PurpleProxyInfo *gpi, | |
| 344 const char *host, int port, | |
| 345 PurpleProxyConnectFunction connect_cb, gpointer data); | |
| 346 #endif | |
| 347 | |
| 348 /** | 307 /** |
| 349 * Cancel an in-progress connection attempt. This should be called | 308 * Cancel an in-progress connection attempt. This should be called |
| 350 * by the PRPL if the user disables an account while it is still | 309 * by the PRPL if the user disables an account while it is still |
| 351 * performing the initial sign on. Or when establishing a file | 310 * performing the initial sign on. Or when establishing a file |
| 352 * transfer, if we attempt to connect to a remote user but they | 311 * transfer, if we attempt to connect to a remote user but they |
| 363 */ | 322 */ |
| 364 void purple_proxy_connect_cancel_with_handle(void *handle); | 323 void purple_proxy_connect_cancel_with_handle(void *handle); |
| 365 | 324 |
| 366 /*@}*/ | 325 /*@}*/ |
| 367 | 326 |
| 368 #ifdef __cplusplus | 327 G_END_DECLS |
| 369 } | |
| 370 #endif | |
| 371 | 328 |
| 372 #endif /* _PURPLE_PROXY_H_ */ | 329 #endif /* _PURPLE_PROXY_H_ */ |
