diff --git a/resolver.c b/resolver.c index 34a0bb6..54acc7b 100644 --- a/resolver.c +++ b/resolver.c @@ -36,7 +36,7 @@ typedef struct g_proxy_resolver_s { // Library reference count int32_t ref_count; // Proxy resolver interface - proxy_resolver_i_s *proxy_resolver_i; + const proxy_resolver_i_s *proxy_resolver_i; // Thread pool void *threadpool; } g_proxy_resolver_s; diff --git a/resolver_gnome3.c b/resolver_gnome3.c index 0c25e4d..c593ea6 100644 --- a/resolver_gnome3.c +++ b/resolver_gnome3.c @@ -260,8 +260,8 @@ bool proxy_resolver_gnome3_global_cleanup(void) { return true; } -proxy_resolver_i_s *proxy_resolver_gnome3_get_interface(void) { - static proxy_resolver_i_s proxy_resolver_gnome3_i = { +const proxy_resolver_i_s *proxy_resolver_gnome3_get_interface(void) { + static const proxy_resolver_i_s proxy_resolver_gnome3_i = { proxy_resolver_gnome3_get_proxies_for_url, proxy_resolver_gnome3_get_list, proxy_resolver_gnome3_get_error, diff --git a/resolver_gnome3.h b/resolver_gnome3.h index 1b55c51..dfe8b76 100644 --- a/resolver_gnome3.h +++ b/resolver_gnome3.h @@ -12,4 +12,4 @@ bool proxy_resolver_gnome3_delete(void **ctx); bool proxy_resolver_gnome3_global_init(void); bool proxy_resolver_gnome3_global_cleanup(void); -proxy_resolver_i_s *proxy_resolver_gnome3_get_interface(void); +const proxy_resolver_i_s *proxy_resolver_gnome3_get_interface(void); diff --git a/resolver_mac.c b/resolver_mac.c index d2c7db1..b63423e 100644 --- a/resolver_mac.c +++ b/resolver_mac.c @@ -243,8 +243,8 @@ bool proxy_resolver_mac_global_cleanup(void) { return true; } -proxy_resolver_i_s *proxy_resolver_mac_get_interface(void) { - static proxy_resolver_i_s proxy_resolver_mac_i = { +const proxy_resolver_i_s *proxy_resolver_mac_get_interface(void) { + static const proxy_resolver_i_s proxy_resolver_mac_i = { proxy_resolver_mac_get_proxies_for_url, proxy_resolver_mac_get_list, proxy_resolver_mac_get_error, diff --git a/resolver_mac.h b/resolver_mac.h index 3af06d7..1a2ad4e 100644 --- a/resolver_mac.h +++ b/resolver_mac.h @@ -12,4 +12,4 @@ bool proxy_resolver_mac_delete(void **ctx); bool proxy_resolver_mac_global_init(void); bool proxy_resolver_mac_global_cleanup(void); -proxy_resolver_i_s *proxy_resolver_mac_get_interface(void); +const proxy_resolver_i_s *proxy_resolver_mac_get_interface(void); diff --git a/resolver_posix.c b/resolver_posix.c index d0cac3c..ee13520 100644 --- a/resolver_posix.c +++ b/resolver_posix.c @@ -287,8 +287,8 @@ bool proxy_resolver_posix_global_cleanup(void) { return true; } -proxy_resolver_i_s *proxy_resolver_posix_get_interface(void) { - static proxy_resolver_i_s proxy_resolver_posix_i = { +const proxy_resolver_i_s *proxy_resolver_posix_get_interface(void) { + static const proxy_resolver_i_s proxy_resolver_posix_i = { proxy_resolver_posix_get_proxies_for_url, proxy_resolver_posix_get_list, proxy_resolver_posix_get_error, diff --git a/resolver_posix.h b/resolver_posix.h index e7884e4..5eb677b 100644 --- a/resolver_posix.h +++ b/resolver_posix.h @@ -14,4 +14,4 @@ bool proxy_resolver_posix_global_init(void); bool proxy_resolver_posix_init_ex(void *threadpool); bool proxy_resolver_posix_global_cleanup(void); -proxy_resolver_i_s *proxy_resolver_posix_get_interface(void); +const proxy_resolver_i_s *proxy_resolver_posix_get_interface(void); diff --git a/resolver_win8.c b/resolver_win8.c index 41dd9f2..60f8508 100644 --- a/resolver_win8.c +++ b/resolver_win8.c @@ -355,8 +355,8 @@ bool proxy_resolver_win8_global_cleanup(void) { return true; } -proxy_resolver_i_s *proxy_resolver_win8_get_interface(void) { - static proxy_resolver_i_s proxy_resolver_win8_i = { +const proxy_resolver_i_s *proxy_resolver_win8_get_interface(void) { + static const proxy_resolver_i_s proxy_resolver_win8_i = { proxy_resolver_win8_get_proxies_for_url, proxy_resolver_win8_get_list, proxy_resolver_win8_get_error, diff --git a/resolver_win8.h b/resolver_win8.h index a48c183..97b193c 100644 --- a/resolver_win8.h +++ b/resolver_win8.h @@ -12,4 +12,4 @@ bool proxy_resolver_win8_delete(void **ctx); bool proxy_resolver_win8_global_init(void); bool proxy_resolver_win8_global_cleanup(void); -proxy_resolver_i_s *proxy_resolver_win8_get_interface(void); +const proxy_resolver_i_s *proxy_resolver_win8_get_interface(void); diff --git a/resolver_winrt.c b/resolver_winrt.c index 1365951..0be22e3 100644 --- a/resolver_winrt.c +++ b/resolver_winrt.c @@ -409,17 +409,18 @@ bool proxy_resolver_winrt_global_cleanup(void) { return true; } -proxy_resolver_i_s *proxy_resolver_winrt_get_interface(void) { - static proxy_resolver_i_s proxy_resolver_winrt_i = {proxy_resolver_winrt_get_proxies_for_url, - proxy_resolver_winrt_get_list, - proxy_resolver_winrt_get_error, - proxy_resolver_winrt_wait, - proxy_resolver_winrt_cancel, - proxy_resolver_winrt_create, - proxy_resolver_winrt_delete, - true, // get_proxies_for_url is handled asynchronously - true, // get_proxies_for_url takes into account system config - proxy_resolver_winrt_global_init, - proxy_resolver_winrt_global_cleanup}; +const proxy_resolver_i_s *proxy_resolver_winrt_get_interface(void) { + static const proxy_resolver_i_s proxy_resolver_winrt_i = { + proxy_resolver_winrt_get_proxies_for_url, + proxy_resolver_winrt_get_list, + proxy_resolver_winrt_get_error, + proxy_resolver_winrt_wait, + proxy_resolver_winrt_cancel, + proxy_resolver_winrt_create, + proxy_resolver_winrt_delete, + true, // get_proxies_for_url is handled asynchronously + false, // get_proxies_for_url does not take into account system config + proxy_resolver_winrt_global_init, + proxy_resolver_winrt_global_cleanup}; return &proxy_resolver_winrt_i; } diff --git a/resolver_winrt.h b/resolver_winrt.h index 3726566..a3e125c 100644 --- a/resolver_winrt.h +++ b/resolver_winrt.h @@ -13,4 +13,4 @@ bool proxy_resolver_winrt_delete(void **ctx); bool proxy_resolver_winrt_global_init(void); bool proxy_resolver_winrt_global_cleanup(void); -proxy_resolver_i_s *proxy_resolver_winrt_get_interface(void); +const proxy_resolver_i_s *proxy_resolver_winrt_get_interface(void); diff --git a/resolver_winxp.c b/resolver_winxp.c index 2b80759..d72a64a 100644 --- a/resolver_winxp.c +++ b/resolver_winxp.c @@ -225,8 +225,8 @@ bool proxy_resolver_winxp_global_cleanup(void) { return true; } -proxy_resolver_i_s *proxy_resolver_winxp_get_interface(void) { - static proxy_resolver_i_s proxy_resolver_winxp_i = { +const proxy_resolver_i_s *proxy_resolver_winxp_get_interface(void) { + static const proxy_resolver_i_s proxy_resolver_winxp_i = { proxy_resolver_winxp_get_proxies_for_url, proxy_resolver_winxp_get_list, proxy_resolver_winxp_get_error, diff --git a/resolver_winxp.h b/resolver_winxp.h index 02389a7..1b9642f 100644 --- a/resolver_winxp.h +++ b/resolver_winxp.h @@ -12,4 +12,4 @@ bool proxy_resolver_winxp_delete(void **ctx); bool proxy_resolver_winxp_global_init(void); bool proxy_resolver_winxp_global_cleanup(void); -proxy_resolver_i_s *proxy_resolver_winxp_get_interface(void); +const proxy_resolver_i_s *proxy_resolver_winxp_get_interface(void);