1 module soup.c.functions; 2 3 import std.stdio; 4 import soup.c.types; 5 version (Windows) 6 static immutable LIBRARY_SOUP = ["libsoup-2.4-1.dll;soup-2.4-1.dll;soup-2.dll"]; 7 else version (OSX) 8 static immutable LIBRARY_SOUP = ["libsoup-2.4.1.dylib"]; 9 else 10 static immutable LIBRARY_SOUP = ["libsoup-2.4.so.1"]; 11 12 __gshared extern(C) 13 { 14 15 // soup.Address 16 17 GType soup_address_get_type(); 18 SoupAddress* soup_address_new(const(char)* name, uint port); 19 SoupAddress* soup_address_new_any(SoupAddressFamily family, uint port); 20 SoupAddress* soup_address_new_from_sockaddr(sockaddr* sa, int len); 21 int soup_address_equal_by_ip(void* addr1, void* addr2); 22 int soup_address_equal_by_name(void* addr1, void* addr2); 23 GSocketAddress* soup_address_get_gsockaddr(SoupAddress* addr); 24 const(char)* soup_address_get_name(SoupAddress* addr); 25 const(char)* soup_address_get_physical(SoupAddress* addr); 26 uint soup_address_get_port(SoupAddress* addr); 27 sockaddr* soup_address_get_sockaddr(SoupAddress* addr, int* len); 28 uint soup_address_hash_by_ip(void* addr); 29 uint soup_address_hash_by_name(void* addr); 30 int soup_address_is_resolved(SoupAddress* addr); 31 void soup_address_resolve_async(SoupAddress* addr, GMainContext* asyncContext, GCancellable* cancellable, SoupAddressCallback callback, void* userData); 32 uint soup_address_resolve_sync(SoupAddress* addr, GCancellable* cancellable); 33 34 // soup.Auth 35 36 GType soup_auth_get_type(); 37 SoupAuth* soup_auth_new(GType type, SoupMessage* msg, const(char)* authHeader); 38 void soup_auth_authenticate(SoupAuth* auth, const(char)* username, const(char)* password); 39 int soup_auth_can_authenticate(SoupAuth* auth); 40 void soup_auth_free_protection_space(SoupAuth* auth, GSList* space); 41 char* soup_auth_get_authorization(SoupAuth* auth, SoupMessage* msg); 42 const(char)* soup_auth_get_host(SoupAuth* auth); 43 char* soup_auth_get_info(SoupAuth* auth); 44 GSList* soup_auth_get_protection_space(SoupAuth* auth, SoupURI* sourceUri); 45 const(char)* soup_auth_get_realm(SoupAuth* auth); 46 const(char)* soup_auth_get_saved_password(SoupAuth* auth, const(char)* user); 47 GSList* soup_auth_get_saved_users(SoupAuth* auth); 48 const(char)* soup_auth_get_scheme_name(SoupAuth* auth); 49 void soup_auth_has_saved_password(SoupAuth* auth, const(char)* username, const(char)* password); 50 int soup_auth_is_authenticated(SoupAuth* auth); 51 int soup_auth_is_for_proxy(SoupAuth* auth); 52 int soup_auth_is_ready(SoupAuth* auth, SoupMessage* msg); 53 void soup_auth_save_password(SoupAuth* auth, const(char)* username, const(char)* password); 54 int soup_auth_update(SoupAuth* auth, SoupMessage* msg, const(char)* authHeader); 55 56 // soup.AuthBasic 57 58 GType soup_auth_basic_get_type(); 59 60 // soup.AuthDigest 61 62 GType soup_auth_digest_get_type(); 63 64 // soup.AuthDomain 65 66 GType soup_auth_domain_get_type(); 67 char* soup_auth_domain_accepts(SoupAuthDomain* domain, SoupMessage* msg); 68 void soup_auth_domain_add_path(SoupAuthDomain* domain, const(char)* path); 69 void soup_auth_domain_challenge(SoupAuthDomain* domain, SoupMessage* msg); 70 int soup_auth_domain_check_password(SoupAuthDomain* domain, SoupMessage* msg, const(char)* username, const(char)* password); 71 int soup_auth_domain_covers(SoupAuthDomain* domain, SoupMessage* msg); 72 const(char)* soup_auth_domain_get_realm(SoupAuthDomain* domain); 73 void soup_auth_domain_remove_path(SoupAuthDomain* domain, const(char)* path); 74 void soup_auth_domain_set_filter(SoupAuthDomain* domain, SoupAuthDomainFilter filter, void* filterData, GDestroyNotify dnotify); 75 void soup_auth_domain_set_generic_auth_callback(SoupAuthDomain* domain, SoupAuthDomainGenericAuthCallback authCallback, void* authData, GDestroyNotify dnotify); 76 int soup_auth_domain_try_generic_auth_callback(SoupAuthDomain* domain, SoupMessage* msg, const(char)* username); 77 78 // soup.AuthDomainBasic 79 80 GType soup_auth_domain_basic_get_type(); 81 SoupAuthDomain* soup_auth_domain_basic_new(const(char)* optname1, ... ); 82 void soup_auth_domain_basic_set_auth_callback(SoupAuthDomain* domain, SoupAuthDomainBasicAuthCallback callback, void* userData, GDestroyNotify dnotify); 83 84 // soup.AuthDomainDigest 85 86 GType soup_auth_domain_digest_get_type(); 87 SoupAuthDomain* soup_auth_domain_digest_new(const(char)* optname1, ... ); 88 char* soup_auth_domain_digest_encode_password(const(char)* username, const(char)* realm, const(char)* password); 89 void soup_auth_domain_digest_set_auth_callback(SoupAuthDomain* domain, SoupAuthDomainDigestAuthCallback callback, void* userData, GDestroyNotify dnotify); 90 91 // soup.AuthManager 92 93 GType soup_auth_manager_get_type(); 94 void soup_auth_manager_clear_cached_credentials(SoupAuthManager* manager); 95 void soup_auth_manager_use_auth(SoupAuthManager* manager, SoupURI* uri, SoupAuth* auth); 96 97 // soup.AuthNTLM 98 99 GType soup_auth_ntlm_get_type(); 100 101 // soup.AuthNegotiate 102 103 GType soup_auth_negotiate_get_type(); 104 int soup_auth_negotiate_supported(); 105 106 // soup.Buffer 107 108 GType soup_buffer_get_type(); 109 SoupBuffer* soup_buffer_new(SoupMemoryUse use, void* data, size_t length); 110 SoupBuffer* soup_buffer_new_take(char* data, size_t length); 111 SoupBuffer* soup_buffer_new_with_owner(void* data, size_t length, void* owner, GDestroyNotify ownerDnotify); 112 SoupBuffer* soup_buffer_copy(SoupBuffer* buffer); 113 void soup_buffer_free(SoupBuffer* buffer); 114 GBytes* soup_buffer_get_as_bytes(SoupBuffer* buffer); 115 void soup_buffer_get_data(SoupBuffer* buffer, ubyte** data, size_t* length); 116 void* soup_buffer_get_owner(SoupBuffer* buffer); 117 SoupBuffer* soup_buffer_new_subbuffer(SoupBuffer* parent, size_t offset, size_t length); 118 119 // soup.Cache 120 121 GType soup_cache_get_type(); 122 SoupCache* soup_cache_new(const(char)* cacheDir, SoupCacheType cacheType); 123 void soup_cache_clear(SoupCache* cache); 124 void soup_cache_dump(SoupCache* cache); 125 void soup_cache_flush(SoupCache* cache); 126 uint soup_cache_get_max_size(SoupCache* cache); 127 void soup_cache_load(SoupCache* cache); 128 void soup_cache_set_max_size(SoupCache* cache, uint maxSize); 129 130 // soup.ClientContext 131 132 GType soup_client_context_get_type(); 133 SoupAddress* soup_client_context_get_address(SoupClientContext* client); 134 SoupAuthDomain* soup_client_context_get_auth_domain(SoupClientContext* client); 135 const(char)* soup_client_context_get_auth_user(SoupClientContext* client); 136 GSocket* soup_client_context_get_gsocket(SoupClientContext* client); 137 const(char)* soup_client_context_get_host(SoupClientContext* client); 138 GSocketAddress* soup_client_context_get_local_address(SoupClientContext* client); 139 GSocketAddress* soup_client_context_get_remote_address(SoupClientContext* client); 140 SoupSocket* soup_client_context_get_socket(SoupClientContext* client); 141 GIOStream* soup_client_context_steal_connection(SoupClientContext* client); 142 143 // soup.ContentDecoder 144 145 GType soup_content_decoder_get_type(); 146 147 // soup.ContentSniffer 148 149 GType soup_content_sniffer_get_type(); 150 SoupContentSniffer* soup_content_sniffer_new(); 151 size_t soup_content_sniffer_get_buffer_size(SoupContentSniffer* sniffer); 152 char* soup_content_sniffer_sniff(SoupContentSniffer* sniffer, SoupMessage* msg, SoupBuffer* buffer, GHashTable** params); 153 154 // soup.Cookie 155 156 GType soup_cookie_get_type(); 157 SoupCookie* soup_cookie_new(const(char)* name, const(char)* value, const(char)* domain, const(char)* path, int maxAge); 158 int soup_cookie_applies_to_uri(SoupCookie* cookie, SoupURI* uri); 159 SoupCookie* soup_cookie_copy(SoupCookie* cookie); 160 int soup_cookie_domain_matches(SoupCookie* cookie, const(char)* host); 161 int soup_cookie_equal(SoupCookie* cookie1, SoupCookie* cookie2); 162 void soup_cookie_free(SoupCookie* cookie); 163 const(char)* soup_cookie_get_domain(SoupCookie* cookie); 164 SoupDate* soup_cookie_get_expires(SoupCookie* cookie); 165 int soup_cookie_get_http_only(SoupCookie* cookie); 166 const(char)* soup_cookie_get_name(SoupCookie* cookie); 167 const(char)* soup_cookie_get_path(SoupCookie* cookie); 168 SoupSameSitePolicy soup_cookie_get_same_site_policy(SoupCookie* cookie); 169 int soup_cookie_get_secure(SoupCookie* cookie); 170 const(char)* soup_cookie_get_value(SoupCookie* cookie); 171 void soup_cookie_set_domain(SoupCookie* cookie, const(char)* domain); 172 void soup_cookie_set_expires(SoupCookie* cookie, SoupDate* expires); 173 void soup_cookie_set_http_only(SoupCookie* cookie, int httpOnly); 174 void soup_cookie_set_max_age(SoupCookie* cookie, int maxAge); 175 void soup_cookie_set_name(SoupCookie* cookie, const(char)* name); 176 void soup_cookie_set_path(SoupCookie* cookie, const(char)* path); 177 void soup_cookie_set_same_site_policy(SoupCookie* cookie, SoupSameSitePolicy policy); 178 void soup_cookie_set_secure(SoupCookie* cookie, int secure); 179 void soup_cookie_set_value(SoupCookie* cookie, const(char)* value); 180 char* soup_cookie_to_cookie_header(SoupCookie* cookie); 181 char* soup_cookie_to_set_cookie_header(SoupCookie* cookie); 182 SoupCookie* soup_cookie_parse(const(char)* header, SoupURI* origin); 183 184 // soup.CookieJar 185 186 GType soup_cookie_jar_get_type(); 187 SoupCookieJar* soup_cookie_jar_new(); 188 void soup_cookie_jar_add_cookie(SoupCookieJar* jar, SoupCookie* cookie); 189 void soup_cookie_jar_add_cookie_full(SoupCookieJar* jar, SoupCookie* cookie, SoupURI* uri, SoupURI* firstParty); 190 void soup_cookie_jar_add_cookie_with_first_party(SoupCookieJar* jar, SoupURI* firstParty, SoupCookie* cookie); 191 GSList* soup_cookie_jar_all_cookies(SoupCookieJar* jar); 192 void soup_cookie_jar_delete_cookie(SoupCookieJar* jar, SoupCookie* cookie); 193 SoupCookieJarAcceptPolicy soup_cookie_jar_get_accept_policy(SoupCookieJar* jar); 194 GSList* soup_cookie_jar_get_cookie_list(SoupCookieJar* jar, SoupURI* uri, int forHttp); 195 GSList* soup_cookie_jar_get_cookie_list_with_same_site_info(SoupCookieJar* jar, SoupURI* uri, SoupURI* topLevel, SoupURI* siteForCookies, int forHttp, int isSafeMethod, int isTopLevelNavigation); 196 char* soup_cookie_jar_get_cookies(SoupCookieJar* jar, SoupURI* uri, int forHttp); 197 int soup_cookie_jar_is_persistent(SoupCookieJar* jar); 198 void soup_cookie_jar_save(SoupCookieJar* jar); 199 void soup_cookie_jar_set_accept_policy(SoupCookieJar* jar, SoupCookieJarAcceptPolicy policy); 200 void soup_cookie_jar_set_cookie(SoupCookieJar* jar, SoupURI* uri, const(char)* cookie); 201 void soup_cookie_jar_set_cookie_with_first_party(SoupCookieJar* jar, SoupURI* uri, SoupURI* firstParty, const(char)* cookie); 202 203 // soup.CookieJarDB 204 205 GType soup_cookie_jar_db_get_type(); 206 SoupCookieJar* soup_cookie_jar_db_new(const(char)* filename, int readOnly); 207 208 // soup.CookieJarText 209 210 GType soup_cookie_jar_text_get_type(); 211 SoupCookieJar* soup_cookie_jar_text_new(const(char)* filename, int readOnly); 212 213 // soup.Date 214 215 GType soup_date_get_type(); 216 SoupDate* soup_date_new(int year, int month, int day, int hour, int minute, int second); 217 SoupDate* soup_date_new_from_now(int offsetSeconds); 218 SoupDate* soup_date_new_from_string(const(char)* dateString); 219 SoupDate* soup_date_new_from_time_t(uint when); 220 SoupDate* soup_date_copy(SoupDate* date); 221 void soup_date_free(SoupDate* date); 222 int soup_date_get_day(SoupDate* date); 223 int soup_date_get_hour(SoupDate* date); 224 int soup_date_get_minute(SoupDate* date); 225 int soup_date_get_month(SoupDate* date); 226 int soup_date_get_offset(SoupDate* date); 227 int soup_date_get_second(SoupDate* date); 228 int soup_date_get_utc(SoupDate* date); 229 int soup_date_get_year(SoupDate* date); 230 int soup_date_is_past(SoupDate* date); 231 char* soup_date_to_string(SoupDate* date, SoupDateFormat format); 232 uint soup_date_to_time_t(SoupDate* date); 233 void soup_date_to_timeval(SoupDate* date, GTimeVal* time); 234 235 // soup.HSTSEnforcer 236 237 GType soup_hsts_enforcer_get_type(); 238 SoupHSTSEnforcer* soup_hsts_enforcer_new(); 239 GList* soup_hsts_enforcer_get_domains(SoupHSTSEnforcer* hstsEnforcer, int sessionPolicies); 240 GList* soup_hsts_enforcer_get_policies(SoupHSTSEnforcer* hstsEnforcer, int sessionPolicies); 241 int soup_hsts_enforcer_has_valid_policy(SoupHSTSEnforcer* hstsEnforcer, const(char)* domain); 242 int soup_hsts_enforcer_is_persistent(SoupHSTSEnforcer* hstsEnforcer); 243 void soup_hsts_enforcer_set_policy(SoupHSTSEnforcer* hstsEnforcer, SoupHSTSPolicy* policy); 244 void soup_hsts_enforcer_set_session_policy(SoupHSTSEnforcer* hstsEnforcer, const(char)* domain, int includeSubdomains); 245 246 // soup.HSTSEnforcerDB 247 248 GType soup_hsts_enforcer_db_get_type(); 249 SoupHSTSEnforcer* soup_hsts_enforcer_db_new(const(char)* filename); 250 251 // soup.HSTSPolicy 252 253 GType soup_hsts_policy_get_type(); 254 SoupHSTSPolicy* soup_hsts_policy_new(const(char)* domain, ulong maxAge, int includeSubdomains); 255 SoupHSTSPolicy* soup_hsts_policy_new_from_response(SoupMessage* msg); 256 SoupHSTSPolicy* soup_hsts_policy_new_full(const(char)* domain, ulong maxAge, SoupDate* expires, int includeSubdomains); 257 SoupHSTSPolicy* soup_hsts_policy_new_session_policy(const(char)* domain, int includeSubdomains); 258 SoupHSTSPolicy* soup_hsts_policy_copy(SoupHSTSPolicy* policy); 259 int soup_hsts_policy_equal(SoupHSTSPolicy* policy1, SoupHSTSPolicy* policy2); 260 void soup_hsts_policy_free(SoupHSTSPolicy* policy); 261 const(char)* soup_hsts_policy_get_domain(SoupHSTSPolicy* policy); 262 int soup_hsts_policy_includes_subdomains(SoupHSTSPolicy* policy); 263 int soup_hsts_policy_is_expired(SoupHSTSPolicy* policy); 264 int soup_hsts_policy_is_session_policy(SoupHSTSPolicy* policy); 265 266 // soup.Logger 267 268 GType soup_logger_get_type(); 269 SoupLogger* soup_logger_new(SoupLoggerLogLevel level, int maxBodySize); 270 void soup_logger_attach(SoupLogger* logger, SoupSession* session); 271 void soup_logger_detach(SoupLogger* logger, SoupSession* session); 272 void soup_logger_set_printer(SoupLogger* logger, SoupLoggerPrinter printer, void* printerData, GDestroyNotify destroy); 273 void soup_logger_set_request_filter(SoupLogger* logger, SoupLoggerFilter requestFilter, void* filterData, GDestroyNotify destroy); 274 void soup_logger_set_response_filter(SoupLogger* logger, SoupLoggerFilter responseFilter, void* filterData, GDestroyNotify destroy); 275 276 // soup.Message 277 278 GType soup_message_get_type(); 279 SoupMessage* soup_message_new(const(char)* method, const(char)* uriString); 280 SoupMessage* soup_message_new_from_uri(const(char)* method, SoupURI* uri); 281 uint soup_message_add_header_handler(SoupMessage* msg, const(char)* signal, const(char)* header, GCallback callback, void* userData); 282 uint soup_message_add_status_code_handler(SoupMessage* msg, const(char)* signal, uint statusCode, GCallback callback, void* userData); 283 void soup_message_content_sniffed(SoupMessage* msg, const(char)* contentType, GHashTable* params); 284 void soup_message_disable_feature(SoupMessage* msg, GType featureType); 285 void soup_message_finished(SoupMessage* msg); 286 SoupAddress* soup_message_get_address(SoupMessage* msg); 287 SoupURI* soup_message_get_first_party(SoupMessage* msg); 288 SoupMessageFlags soup_message_get_flags(SoupMessage* msg); 289 SoupHTTPVersion soup_message_get_http_version(SoupMessage* msg); 290 int soup_message_get_https_status(SoupMessage* msg, GTlsCertificate** certificate, GTlsCertificateFlags* errors); 291 int soup_message_get_is_top_level_navigation(SoupMessage* msg); 292 SoupMessagePriority soup_message_get_priority(SoupMessage* msg); 293 SoupURI* soup_message_get_site_for_cookies(SoupMessage* msg); 294 SoupRequest* soup_message_get_soup_request(SoupMessage* msg); 295 SoupURI* soup_message_get_uri(SoupMessage* msg); 296 void soup_message_got_body(SoupMessage* msg); 297 void soup_message_got_chunk(SoupMessage* msg, SoupBuffer* chunk); 298 void soup_message_got_headers(SoupMessage* msg); 299 void soup_message_got_informational(SoupMessage* msg); 300 int soup_message_is_feature_disabled(SoupMessage* msg, GType featureType); 301 int soup_message_is_keepalive(SoupMessage* msg); 302 void soup_message_restarted(SoupMessage* msg); 303 void soup_message_set_chunk_allocator(SoupMessage* msg, SoupChunkAllocator allocator, void* userData, GDestroyNotify destroyNotify); 304 void soup_message_set_first_party(SoupMessage* msg, SoupURI* firstParty); 305 void soup_message_set_flags(SoupMessage* msg, SoupMessageFlags flags); 306 void soup_message_set_http_version(SoupMessage* msg, SoupHTTPVersion version_); 307 void soup_message_set_is_top_level_navigation(SoupMessage* msg, int isTopLevelNavigation); 308 void soup_message_set_priority(SoupMessage* msg, SoupMessagePriority priority); 309 void soup_message_set_redirect(SoupMessage* msg, uint statusCode, const(char)* redirectUri); 310 void soup_message_set_request(SoupMessage* msg, const(char)* contentType, SoupMemoryUse reqUse, char* reqBody, size_t reqLength); 311 void soup_message_set_response(SoupMessage* msg, const(char)* contentType, SoupMemoryUse respUse, char* respBody, size_t respLength); 312 void soup_message_set_site_for_cookies(SoupMessage* msg, SoupURI* siteForCookies); 313 void soup_message_set_status(SoupMessage* msg, uint statusCode); 314 void soup_message_set_status_full(SoupMessage* msg, uint statusCode, const(char)* reasonPhrase); 315 void soup_message_set_uri(SoupMessage* msg, SoupURI* uri); 316 void soup_message_starting(SoupMessage* msg); 317 void soup_message_wrote_body(SoupMessage* msg); 318 void soup_message_wrote_body_data(SoupMessage* msg, SoupBuffer* chunk); 319 void soup_message_wrote_chunk(SoupMessage* msg); 320 void soup_message_wrote_headers(SoupMessage* msg); 321 void soup_message_wrote_informational(SoupMessage* msg); 322 323 // soup.MessageBody 324 325 GType soup_message_body_get_type(); 326 SoupMessageBody* soup_message_body_new(); 327 void soup_message_body_append(SoupMessageBody* body_, SoupMemoryUse use, void* data, size_t length); 328 void soup_message_body_append_buffer(SoupMessageBody* body_, SoupBuffer* buffer); 329 void soup_message_body_append_take(SoupMessageBody* body_, char* data, size_t length); 330 void soup_message_body_complete(SoupMessageBody* body_); 331 SoupBuffer* soup_message_body_flatten(SoupMessageBody* body_); 332 void soup_message_body_free(SoupMessageBody* body_); 333 int soup_message_body_get_accumulate(SoupMessageBody* body_); 334 SoupBuffer* soup_message_body_get_chunk(SoupMessageBody* body_, long offset); 335 void soup_message_body_got_chunk(SoupMessageBody* body_, SoupBuffer* chunk); 336 void soup_message_body_set_accumulate(SoupMessageBody* body_, int accumulate); 337 void soup_message_body_truncate(SoupMessageBody* body_); 338 void soup_message_body_wrote_chunk(SoupMessageBody* body_, SoupBuffer* chunk); 339 340 // soup.MessageHeaders 341 342 GType soup_message_headers_get_type(); 343 SoupMessageHeaders* soup_message_headers_new(SoupMessageHeadersType type); 344 void soup_message_headers_append(SoupMessageHeaders* hdrs, const(char)* name, const(char)* value); 345 void soup_message_headers_clean_connection_headers(SoupMessageHeaders* hdrs); 346 void soup_message_headers_clear(SoupMessageHeaders* hdrs); 347 void soup_message_headers_foreach(SoupMessageHeaders* hdrs, SoupMessageHeadersForeachFunc func, void* userData); 348 void soup_message_headers_free(SoupMessageHeaders* hdrs); 349 void soup_message_headers_free_ranges(SoupMessageHeaders* hdrs, SoupRange* ranges); 350 const(char)* soup_message_headers_get(SoupMessageHeaders* hdrs, const(char)* name); 351 int soup_message_headers_get_content_disposition(SoupMessageHeaders* hdrs, char** disposition, GHashTable** params); 352 long soup_message_headers_get_content_length(SoupMessageHeaders* hdrs); 353 int soup_message_headers_get_content_range(SoupMessageHeaders* hdrs, long* start, long* end, long* totalLength); 354 const(char)* soup_message_headers_get_content_type(SoupMessageHeaders* hdrs, GHashTable** params); 355 SoupEncoding soup_message_headers_get_encoding(SoupMessageHeaders* hdrs); 356 SoupExpectation soup_message_headers_get_expectations(SoupMessageHeaders* hdrs); 357 SoupMessageHeadersType soup_message_headers_get_headers_type(SoupMessageHeaders* hdrs); 358 const(char)* soup_message_headers_get_list(SoupMessageHeaders* hdrs, const(char)* name); 359 const(char)* soup_message_headers_get_one(SoupMessageHeaders* hdrs, const(char)* name); 360 int soup_message_headers_get_ranges(SoupMessageHeaders* hdrs, long totalLength, SoupRange** ranges, int* length); 361 int soup_message_headers_header_contains(SoupMessageHeaders* hdrs, const(char)* name, const(char)* token); 362 int soup_message_headers_header_equals(SoupMessageHeaders* hdrs, const(char)* name, const(char)* value); 363 void soup_message_headers_remove(SoupMessageHeaders* hdrs, const(char)* name); 364 void soup_message_headers_replace(SoupMessageHeaders* hdrs, const(char)* name, const(char)* value); 365 void soup_message_headers_set_content_disposition(SoupMessageHeaders* hdrs, const(char)* disposition, GHashTable* params); 366 void soup_message_headers_set_content_length(SoupMessageHeaders* hdrs, long contentLength); 367 void soup_message_headers_set_content_range(SoupMessageHeaders* hdrs, long start, long end, long totalLength); 368 void soup_message_headers_set_content_type(SoupMessageHeaders* hdrs, const(char)* contentType, GHashTable* params); 369 void soup_message_headers_set_encoding(SoupMessageHeaders* hdrs, SoupEncoding encoding); 370 void soup_message_headers_set_expectations(SoupMessageHeaders* hdrs, SoupExpectation expectations); 371 void soup_message_headers_set_range(SoupMessageHeaders* hdrs, long start, long end); 372 void soup_message_headers_set_ranges(SoupMessageHeaders* hdrs, SoupRange* ranges, int length); 373 374 // soup.MessageHeadersIter 375 376 int soup_message_headers_iter_next(SoupMessageHeadersIter* iter, char** name, char** value); 377 void soup_message_headers_iter_init(SoupMessageHeadersIter* iter, SoupMessageHeaders* hdrs); 378 379 // soup.Multipart 380 381 GType soup_multipart_get_type(); 382 SoupMultipart* soup_multipart_new(const(char)* mimeType); 383 SoupMultipart* soup_multipart_new_from_message(SoupMessageHeaders* headers, SoupMessageBody* body_); 384 void soup_multipart_append_form_file(SoupMultipart* multipart, const(char)* controlName, const(char)* filename, const(char)* contentType, SoupBuffer* body_); 385 void soup_multipart_append_form_string(SoupMultipart* multipart, const(char)* controlName, const(char)* data); 386 void soup_multipart_append_part(SoupMultipart* multipart, SoupMessageHeaders* headers, SoupBuffer* body_); 387 void soup_multipart_free(SoupMultipart* multipart); 388 int soup_multipart_get_length(SoupMultipart* multipart); 389 int soup_multipart_get_part(SoupMultipart* multipart, int part, SoupMessageHeaders** headers, SoupBuffer** body_); 390 void soup_multipart_to_message(SoupMultipart* multipart, SoupMessageHeaders* destHeaders, SoupMessageBody* destBody); 391 392 // soup.MultipartInputStream 393 394 GType soup_multipart_input_stream_get_type(); 395 SoupMultipartInputStream* soup_multipart_input_stream_new(SoupMessage* msg, GInputStream* baseStream); 396 SoupMessageHeaders* soup_multipart_input_stream_get_headers(SoupMultipartInputStream* multipart); 397 GInputStream* soup_multipart_input_stream_next_part(SoupMultipartInputStream* multipart, GCancellable* cancellable, GError** err); 398 void soup_multipart_input_stream_next_part_async(SoupMultipartInputStream* multipart, int ioPriority, GCancellable* cancellable, GAsyncReadyCallback callback, void* data); 399 GInputStream* soup_multipart_input_stream_next_part_finish(SoupMultipartInputStream* multipart, GAsyncResult* result, GError** err); 400 401 // soup.PasswordManager 402 403 GType soup_password_manager_get_type(); 404 void soup_password_manager_get_passwords_async(SoupPasswordManager* passwordManager, SoupMessage* msg, SoupAuth* auth, int retrying, GMainContext* asyncContext, GCancellable* cancellable, SoupPasswordManagerCallback callback, void* userData); 405 void soup_password_manager_get_passwords_sync(SoupPasswordManager* passwordManager, SoupMessage* msg, SoupAuth* auth, GCancellable* cancellable); 406 407 // soup.ProxyResolver 408 409 GType soup_proxy_resolver_get_type(); 410 void soup_proxy_resolver_get_proxy_async(SoupProxyResolver* proxyResolver, SoupMessage* msg, GMainContext* asyncContext, GCancellable* cancellable, SoupProxyResolverCallback callback, void* userData); 411 uint soup_proxy_resolver_get_proxy_sync(SoupProxyResolver* proxyResolver, SoupMessage* msg, GCancellable* cancellable, SoupAddress** addr); 412 413 // soup.ProxyResolverDefault 414 415 GType soup_proxy_resolver_default_get_type(); 416 417 // soup.ProxyURIResolver 418 419 GType soup_proxy_uri_resolver_get_type(); 420 void soup_proxy_uri_resolver_get_proxy_uri_async(SoupProxyURIResolver* proxyUriResolver, SoupURI* uri, GMainContext* asyncContext, GCancellable* cancellable, SoupProxyURIResolverCallback callback, void* userData); 421 uint soup_proxy_uri_resolver_get_proxy_uri_sync(SoupProxyURIResolver* proxyUriResolver, SoupURI* uri, GCancellable* cancellable, SoupURI** proxyUri); 422 423 // soup.Request 424 425 GType soup_request_get_type(); 426 long soup_request_get_content_length(SoupRequest* request); 427 const(char)* soup_request_get_content_type(SoupRequest* request); 428 SoupSession* soup_request_get_session(SoupRequest* request); 429 SoupURI* soup_request_get_uri(SoupRequest* request); 430 GInputStream* soup_request_send(SoupRequest* request, GCancellable* cancellable, GError** err); 431 void soup_request_send_async(SoupRequest* request, GCancellable* cancellable, GAsyncReadyCallback callback, void* userData); 432 GInputStream* soup_request_send_finish(SoupRequest* request, GAsyncResult* result, GError** err); 433 434 // soup.RequestData 435 436 GType soup_request_data_get_type(); 437 438 // soup.RequestFile 439 440 GType soup_request_file_get_type(); 441 GFile* soup_request_file_get_file(SoupRequestFile* file); 442 443 // soup.RequestHTTP 444 445 GType soup_request_http_get_type(); 446 SoupMessage* soup_request_http_get_message(SoupRequestHTTP* http); 447 448 // soup.Requester 449 450 GType soup_requester_get_type(); 451 SoupRequester* soup_requester_new(); 452 SoupRequest* soup_requester_request(SoupRequester* requester, const(char)* uriString, GError** err); 453 SoupRequest* soup_requester_request_uri(SoupRequester* requester, SoupURI* uri, GError** err); 454 455 // soup.Server 456 457 GType soup_server_get_type(); 458 SoupServer* soup_server_new(const(char)* optname1, ... ); 459 int soup_server_accept_iostream(SoupServer* server, GIOStream* stream, GSocketAddress* localAddr, GSocketAddress* remoteAddr, GError** err); 460 void soup_server_add_auth_domain(SoupServer* server, SoupAuthDomain* authDomain); 461 void soup_server_add_early_handler(SoupServer* server, const(char)* path, SoupServerCallback callback, void* userData, GDestroyNotify destroy); 462 void soup_server_add_handler(SoupServer* server, const(char)* path, SoupServerCallback callback, void* userData, GDestroyNotify destroy); 463 void soup_server_add_websocket_extension(SoupServer* server, GType extensionType); 464 void soup_server_add_websocket_handler(SoupServer* server, const(char)* path, const(char)* origin, char** protocols, SoupServerWebsocketCallback callback, void* userData, GDestroyNotify destroy); 465 void soup_server_disconnect(SoupServer* server); 466 GMainContext* soup_server_get_async_context(SoupServer* server); 467 SoupSocket* soup_server_get_listener(SoupServer* server); 468 GSList* soup_server_get_listeners(SoupServer* server); 469 uint soup_server_get_port(SoupServer* server); 470 GSList* soup_server_get_uris(SoupServer* server); 471 int soup_server_is_https(SoupServer* server); 472 int soup_server_listen(SoupServer* server, GSocketAddress* address, SoupServerListenOptions options, GError** err); 473 int soup_server_listen_all(SoupServer* server, uint port, SoupServerListenOptions options, GError** err); 474 int soup_server_listen_fd(SoupServer* server, int fd, SoupServerListenOptions options, GError** err); 475 int soup_server_listen_local(SoupServer* server, uint port, SoupServerListenOptions options, GError** err); 476 int soup_server_listen_socket(SoupServer* server, GSocket* socket, SoupServerListenOptions options, GError** err); 477 void soup_server_pause_message(SoupServer* server, SoupMessage* msg); 478 void soup_server_quit(SoupServer* server); 479 void soup_server_remove_auth_domain(SoupServer* server, SoupAuthDomain* authDomain); 480 void soup_server_remove_handler(SoupServer* server, const(char)* path); 481 void soup_server_remove_websocket_extension(SoupServer* server, GType extensionType); 482 void soup_server_run(SoupServer* server); 483 void soup_server_run_async(SoupServer* server); 484 int soup_server_set_ssl_cert_file(SoupServer* server, const(char)* sslCertFile, const(char)* sslKeyFile, GError** err); 485 void soup_server_unpause_message(SoupServer* server, SoupMessage* msg); 486 487 // soup.Session 488 489 GType soup_session_get_type(); 490 SoupSession* soup_session_new(); 491 SoupSession* soup_session_new_with_options(const(char)* optname1, ... ); 492 void soup_session_abort(SoupSession* session); 493 void soup_session_add_feature(SoupSession* session, SoupSessionFeature* feature); 494 void soup_session_add_feature_by_type(SoupSession* session, GType featureType); 495 void soup_session_cancel_message(SoupSession* session, SoupMessage* msg, uint statusCode); 496 void soup_session_connect_async(SoupSession* session, SoupURI* uri, GCancellable* cancellable, SoupSessionConnectProgressCallback progressCallback, GAsyncReadyCallback callback, void* userData); 497 GIOStream* soup_session_connect_finish(SoupSession* session, GAsyncResult* result, GError** err); 498 GMainContext* soup_session_get_async_context(SoupSession* session); 499 SoupSessionFeature* soup_session_get_feature(SoupSession* session, GType featureType); 500 SoupSessionFeature* soup_session_get_feature_for_message(SoupSession* session, GType featureType, SoupMessage* msg); 501 GSList* soup_session_get_features(SoupSession* session, GType featureType); 502 int soup_session_has_feature(SoupSession* session, GType featureType); 503 void soup_session_pause_message(SoupSession* session, SoupMessage* msg); 504 void soup_session_prefetch_dns(SoupSession* session, const(char)* hostname, GCancellable* cancellable, SoupAddressCallback callback, void* userData); 505 void soup_session_prepare_for_uri(SoupSession* session, SoupURI* uri); 506 void soup_session_queue_message(SoupSession* session, SoupMessage* msg, SoupSessionCallback callback, void* userData); 507 int soup_session_redirect_message(SoupSession* session, SoupMessage* msg); 508 void soup_session_remove_feature(SoupSession* session, SoupSessionFeature* feature); 509 void soup_session_remove_feature_by_type(SoupSession* session, GType featureType); 510 SoupRequest* soup_session_request(SoupSession* session, const(char)* uriString, GError** err); 511 SoupRequestHTTP* soup_session_request_http(SoupSession* session, const(char)* method, const(char)* uriString, GError** err); 512 SoupRequestHTTP* soup_session_request_http_uri(SoupSession* session, const(char)* method, SoupURI* uri, GError** err); 513 SoupRequest* soup_session_request_uri(SoupSession* session, SoupURI* uri, GError** err); 514 void soup_session_requeue_message(SoupSession* session, SoupMessage* msg); 515 GInputStream* soup_session_send(SoupSession* session, SoupMessage* msg, GCancellable* cancellable, GError** err); 516 void soup_session_send_async(SoupSession* session, SoupMessage* msg, GCancellable* cancellable, GAsyncReadyCallback callback, void* userData); 517 GInputStream* soup_session_send_finish(SoupSession* session, GAsyncResult* result, GError** err); 518 uint soup_session_send_message(SoupSession* session, SoupMessage* msg); 519 GIOStream* soup_session_steal_connection(SoupSession* session, SoupMessage* msg); 520 void soup_session_unpause_message(SoupSession* session, SoupMessage* msg); 521 void soup_session_websocket_connect_async(SoupSession* session, SoupMessage* msg, const(char)* origin, char** protocols, GCancellable* cancellable, GAsyncReadyCallback callback, void* userData); 522 SoupWebsocketConnection* soup_session_websocket_connect_finish(SoupSession* session, GAsyncResult* result, GError** err); 523 int soup_session_would_redirect(SoupSession* session, SoupMessage* msg); 524 525 // soup.SessionAsync 526 527 GType soup_session_async_get_type(); 528 SoupSession* soup_session_async_new(); 529 SoupSession* soup_session_async_new_with_options(const(char)* optname1, ... ); 530 531 // soup.SessionFeature 532 533 GType soup_session_feature_get_type(); 534 int soup_session_feature_add_feature(SoupSessionFeature* feature, GType type); 535 void soup_session_feature_attach(SoupSessionFeature* feature, SoupSession* session); 536 void soup_session_feature_detach(SoupSessionFeature* feature, SoupSession* session); 537 int soup_session_feature_has_feature(SoupSessionFeature* feature, GType type); 538 int soup_session_feature_remove_feature(SoupSessionFeature* feature, GType type); 539 540 // soup.SessionSync 541 542 GType soup_session_sync_get_type(); 543 SoupSession* soup_session_sync_new(); 544 SoupSession* soup_session_sync_new_with_options(const(char)* optname1, ... ); 545 546 // soup.Socket 547 548 GType soup_socket_get_type(); 549 SoupSocket* soup_socket_new(const(char)* optname1, ... ); 550 void soup_socket_connect_async(SoupSocket* sock, GCancellable* cancellable, SoupSocketCallback callback, void* userData); 551 uint soup_socket_connect_sync(SoupSocket* sock, GCancellable* cancellable); 552 void soup_socket_disconnect(SoupSocket* sock); 553 int soup_socket_get_fd(SoupSocket* sock); 554 SoupAddress* soup_socket_get_local_address(SoupSocket* sock); 555 SoupAddress* soup_socket_get_remote_address(SoupSocket* sock); 556 int soup_socket_is_connected(SoupSocket* sock); 557 int soup_socket_is_ssl(SoupSocket* sock); 558 int soup_socket_listen(SoupSocket* sock); 559 SoupSocketIOStatus soup_socket_read(SoupSocket* sock, void* buffer, size_t len, size_t* nread, GCancellable* cancellable, GError** err); 560 SoupSocketIOStatus soup_socket_read_until(SoupSocket* sock, void* buffer, size_t len, void* boundary, size_t boundaryLen, size_t* nread, int* gotBoundary, GCancellable* cancellable, GError** err); 561 int soup_socket_start_proxy_ssl(SoupSocket* sock, const(char)* sslHost, GCancellable* cancellable); 562 int soup_socket_start_ssl(SoupSocket* sock, GCancellable* cancellable); 563 SoupSocketIOStatus soup_socket_write(SoupSocket* sock, void* buffer, size_t len, size_t* nwrote, GCancellable* cancellable, GError** err); 564 565 // soup.URI 566 567 GType soup_uri_get_type(); 568 SoupURI* soup_uri_new(const(char)* uriString); 569 SoupURI* soup_uri_new_with_base(SoupURI* base, const(char)* uriString); 570 SoupURI* soup_uri_copy(SoupURI* uri); 571 SoupURI* soup_uri_copy_host(SoupURI* uri); 572 int soup_uri_equal(SoupURI* uri1, SoupURI* uri2); 573 void soup_uri_free(SoupURI* uri); 574 const(char)* soup_uri_get_fragment(SoupURI* uri); 575 const(char)* soup_uri_get_host(SoupURI* uri); 576 const(char)* soup_uri_get_password(SoupURI* uri); 577 const(char)* soup_uri_get_path(SoupURI* uri); 578 uint soup_uri_get_port(SoupURI* uri); 579 const(char)* soup_uri_get_query(SoupURI* uri); 580 const(char)* soup_uri_get_scheme(SoupURI* uri); 581 const(char)* soup_uri_get_user(SoupURI* uri); 582 int soup_uri_host_equal(void* v1, void* v2); 583 uint soup_uri_host_hash(void* key); 584 void soup_uri_set_fragment(SoupURI* uri, const(char)* fragment); 585 void soup_uri_set_host(SoupURI* uri, const(char)* host); 586 void soup_uri_set_password(SoupURI* uri, const(char)* password); 587 void soup_uri_set_path(SoupURI* uri, const(char)* path); 588 void soup_uri_set_port(SoupURI* uri, uint port); 589 void soup_uri_set_query(SoupURI* uri, const(char)* query); 590 void soup_uri_set_query_from_fields(SoupURI* uri, const(char)* firstField, ... ); 591 void soup_uri_set_query_from_form(SoupURI* uri, GHashTable* form); 592 void soup_uri_set_scheme(SoupURI* uri, const(char)* scheme); 593 void soup_uri_set_user(SoupURI* uri, const(char)* user); 594 char* soup_uri_to_string(SoupURI* uri, int justPathAndQuery); 595 int soup_uri_uses_default_port(SoupURI* uri); 596 char* soup_uri_decode(const(char)* part); 597 char* soup_uri_encode(const(char)* part, const(char)* escapeExtra); 598 char* soup_uri_normalize(const(char)* part, const(char)* unescapeExtra); 599 600 // soup.WebsocketConnection 601 602 GType soup_websocket_connection_get_type(); 603 SoupWebsocketConnection* soup_websocket_connection_new(GIOStream* stream, SoupURI* uri, SoupWebsocketConnectionType type, const(char)* origin, const(char)* protocol); 604 SoupWebsocketConnection* soup_websocket_connection_new_with_extensions(GIOStream* stream, SoupURI* uri, SoupWebsocketConnectionType type, const(char)* origin, const(char)* protocol, GList* extensions); 605 void soup_websocket_connection_close(SoupWebsocketConnection* self, ushort code, const(char)* data); 606 ushort soup_websocket_connection_get_close_code(SoupWebsocketConnection* self); 607 const(char)* soup_websocket_connection_get_close_data(SoupWebsocketConnection* self); 608 SoupWebsocketConnectionType soup_websocket_connection_get_connection_type(SoupWebsocketConnection* self); 609 GList* soup_websocket_connection_get_extensions(SoupWebsocketConnection* self); 610 GIOStream* soup_websocket_connection_get_io_stream(SoupWebsocketConnection* self); 611 uint soup_websocket_connection_get_keepalive_interval(SoupWebsocketConnection* self); 612 ulong soup_websocket_connection_get_max_incoming_payload_size(SoupWebsocketConnection* self); 613 const(char)* soup_websocket_connection_get_origin(SoupWebsocketConnection* self); 614 const(char)* soup_websocket_connection_get_protocol(SoupWebsocketConnection* self); 615 SoupWebsocketState soup_websocket_connection_get_state(SoupWebsocketConnection* self); 616 SoupURI* soup_websocket_connection_get_uri(SoupWebsocketConnection* self); 617 void soup_websocket_connection_send_binary(SoupWebsocketConnection* self, void* data, size_t length); 618 void soup_websocket_connection_send_message(SoupWebsocketConnection* self, SoupWebsocketDataType type, GBytes* message); 619 void soup_websocket_connection_send_text(SoupWebsocketConnection* self, const(char)* text); 620 void soup_websocket_connection_set_keepalive_interval(SoupWebsocketConnection* self, uint interval); 621 void soup_websocket_connection_set_max_incoming_payload_size(SoupWebsocketConnection* self, ulong maxIncomingPayloadSize); 622 623 // soup.WebsocketExtension 624 625 GType soup_websocket_extension_get_type(); 626 int soup_websocket_extension_configure(SoupWebsocketExtension* extension, SoupWebsocketConnectionType connectionType, GHashTable* params, GError** err); 627 char* soup_websocket_extension_get_request_params(SoupWebsocketExtension* extension); 628 char* soup_websocket_extension_get_response_params(SoupWebsocketExtension* extension); 629 GBytes* soup_websocket_extension_process_incoming_message(SoupWebsocketExtension* extension, ubyte* header, GBytes* payload, GError** err); 630 GBytes* soup_websocket_extension_process_outgoing_message(SoupWebsocketExtension* extension, ubyte* header, GBytes* payload, GError** err); 631 632 // soup.WebsocketExtensionDeflate 633 634 GType soup_websocket_extension_deflate_get_type(); 635 636 // soup.WebsocketExtensionManager 637 638 GType soup_websocket_extension_manager_get_type(); 639 640 // soup.XMLRPCParams 641 642 void soup_xmlrpc_params_free(SoupXMLRPCParams* self); 643 GVariant* soup_xmlrpc_params_parse(SoupXMLRPCParams* self, const(char)* signature, GError** err); 644 }