47#if defined BUILDING_LIBWGET && HAVE_VISIBILITY
48# define WGETAPI __attribute__ ((__visibility__("default")))
49#elif defined BUILDING_LIBWGET && (defined _MSC_VER || defined __OS2__) && !defined LIBWGET_STATIC
50# define WGETAPI __declspec(dllexport)
51#elif defined _MSC_VER && !defined LIBWGET_STATIC
52# define WGETAPI __declspec(dllimport)
69#if defined __GNUC__ && defined __GNUC_MINOR__
70# define GCC_VERSION_AT_LEAST(major, minor) ((__GNUC__ > (major)) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
72# define GCC_VERSION_AT_LEAST(major, minor) 0
75#if defined __clang_major__ && defined __clang_minor__
76# define CLANG_VERSION_AT_LEAST(major, minor) ((__clang_major__ > (major)) || (__clang_major__ == (major) && __clang_minor__ >= (minor)))
78# define CLANG_VERSION_AT_LEAST(major, minor) 0
81#if GCC_VERSION_AT_LEAST(2,5)
82# define WGET_GCC_CONST __attribute__ ((const))
84# define WGET_GCC_CONST
87#define WGET_GCC_NORETURN_FUNCPTR
88#if GCC_VERSION_AT_LEAST(2,8) || __SUNPRO_C >= 0x5110
89# define WGET_GCC_NORETURN __attribute__ ((__noreturn__))
90# undef WGET_GCC_NORETURN_FUNCPTR
91# define G_GNUC_NORETURN_FUNCPTR WGET_GCC_NORETURN
93# define WGET_GCC_NORETURN __declspec (noreturn)
94#elif __STDC_VERSION__ >= 201112
95# define WGET_GCC_NORETURN _Noreturn
97# define WGET_GCC_NORETURN
100#if GCC_VERSION_AT_LEAST(2,95)
101# define WGET_GCC_PRINTF_FORMAT(a, b) __attribute__ ((format (printf, a, b)))
102# define WGET_GCC_UNUSED __attribute__ ((unused))
104# define WGET_GCC_PRINTF_FORMAT(a, b)
105# define WGET_GCC_UNUSED
108#if GCC_VERSION_AT_LEAST(2,96)
109# define WGET_GCC_PURE __attribute__ ((pure))
111# define WGET_GCC_PURE
114#if GCC_VERSION_AT_LEAST(3,0)
115# define WGET_GCC_MALLOC __attribute__ ((malloc))
116# define unlikely(expr) __builtin_expect(!!(expr), 0)
117# define likely(expr) __builtin_expect(!!(expr), 1)
119# define WGET_GCC_MALLOC
120# define unlikely(expr) expr
121# define likely(expr) expr
124#if GCC_VERSION_AT_LEAST(3,1)
125# define WGET_GCC_ALWAYS_INLINE __attribute__ ((always_inline))
126# define WGET_GCC_FLATTEN __attribute__ ((flatten))
127# define WGET_GCC_DEPRECATED __attribute__ ((deprecated))
129# define WGET_GCC_ALWAYS_INLINE
130# define WGET_GCC_FLATTEN
131# define WGET_GCC_DEPRECATED
138#if GCC_VERSION_AT_LEAST(3,3)
139# define WGET_GCC_NONNULL_ALL __attribute__ ((nonnull))
140# define WGET_GCC_NONNULL(a) __attribute__ ((nonnull a))
142# define WGET_GCC_NONNULL_ALL
143# define WGET_GCC_NONNULL(a)
146#if GCC_VERSION_AT_LEAST(3,4)
147# define WGET_GCC_UNUSED_RESULT __attribute__ ((warn_unused_result))
149# define WGET_GCC_UNUSED_RESULT
152#if GCC_VERSION_AT_LEAST(4,0)
153# define WGET_GCC_NULL_TERMINATED __attribute__((__sentinel__))
155# define WGET_GCC_NULL_TERMINATED
158#if GCC_VERSION_AT_LEAST(4,9) || CLANG_VERSION_AT_LEAST(7,0)
159# define WGET_GCC_RETURNS_NONNULL __attribute__((returns_nonnull))
161# define WGET_GCC_RETURNS_NONNULL
164#if GCC_VERSION_AT_LEAST(4,3) || CLANG_VERSION_AT_LEAST(6,0)
165# define WGET_GCC_ALLOC_SIZE(a) __attribute__ ((__alloc_size__(a)))
166# define WGET_GCC_ALLOC_SIZE2(a, b) __attribute__ ((__alloc_size__(a, b)))
168# define WGET_GCC_ALLOC_SIZE(a)
169# define WGET_GCC_ALLOC_SIZE2(a, b)
172#ifdef BUILDING_LIBWGET
173# define LIBWGET_WARN_UNUSED_RESULT WGET_GCC_UNUSED_RESULT
175# define LIBWGET_WARN_UNUSED_RESULT
180# define WGET_BEGIN_DECLS extern "C" {
181# define WGET_END_DECLS }
183# define WGET_BEGIN_DECLS
184# define WGET_END_DECLS
188#ifdef MALLOC_RETURNS_NONNULL
189# define RETURNS_NONNULL WGET_GCC_RETURNS_NONNULL
192# define RETURNS_NONNULL
193# if defined __clang_major__ && defined WGET_MANYWARNINGS
194# define NULLABLE _Nullable
200#undef GCC_VERSION_AT_LEAST
201#undef CLANG_VERSION_AT_LEAST
211#define WGET_DEBUG_STREAM 1000
212#define WGET_DEBUG_FUNC 1001
213#define WGET_DEBUG_FILE 1002
214#define WGET_ERROR_STREAM 1003
215#define WGET_ERROR_FUNC 1004
216#define WGET_ERROR_FILE 1005
217#define WGET_INFO_STREAM 1006
218#define WGET_INFO_FUNC 1007
219#define WGET_INFO_FILE 1008
220#define WGET_DNS_CACHING 1009
221#define WGET_COOKIE_SUFFIXES 1010
222#define WGET_COOKIES_ENABLED 1011
223#define WGET_COOKIE_FILE 1012
224#define WGET_COOKIE_DB 1013
225#define WGET_COOKIE_KEEPSESSIONCOOKIES 1014
226#define WGET_BIND_ADDRESS 1015
227#define WGET_NET_FAMILY_EXCLUSIVE 1016
228#define WGET_NET_FAMILY_PREFERRED 1017
229#define WGET_TCP_FASTFORWARD 1018
230#define WGET_BIND_INTERFACE 1019
232#define WGET_HTTP_URL 2000
233#define WGET_HTTP_URL_ENCODING 2001
234#define WGET_HTTP_URI 2002
235#define WGET_HTTP_COOKIE_STORE 2003
236#define WGET_HTTP_HEADER_ADD 2004
240#define WGET_HTTP_CONNECTION_PTR 2008
241#define WGET_HTTP_RESPONSE_KEEPHEADER 2009
242#define WGET_HTTP_MAX_REDIRECTIONS 2010
243#define WGET_HTTP_BODY_SAVEAS_STREAM 2011
244#define WGET_HTTP_BODY_SAVEAS_FILE 2012
245#define WGET_HTTP_BODY_SAVEAS_FD 2013
246#define WGET_HTTP_BODY_SAVEAS_FUNC 2014
247#define WGET_HTTP_HEADER_FUNC 2015
248#define WGET_HTTP_SCHEME 2016
249#define WGET_HTTP_BODY 2017
250#define WGET_HTTP_BODY_SAVEAS 2018
251#define WGET_HTTP_USER_DATA 2019
252#define WGET_HTTP_RESPONSE_IGNORELENGTH 2020
253#define WGET_HTTP_DEBUG_SKIP_BODY 2021
263 WGET_E_HANDSHAKE = -6,
264 WGET_E_CERTIFICATE = -7,
265 WGET_E_TLS_DISABLED = -8,
266 WGET_E_XML_PARSE_ERR = -9,
269 WGET_E_UNSUPPORTED = -12,
270 WGET_E_XML_MAX_DEPTH = -13,
276typedef void wget_global_func(
const char *,
size_t);
279 wget_global_init(
int key, ...);
281 wget_global_deinit(
void);
282WGETAPI
const void * NULLABLE
283 wget_global_get_ptr(
int key);
285 wget_global_get_int(
int key);
286WGETAPI wget_global_func *
287 wget_global_get_func(
int key);
300#define WGET_IO_READABLE 1
301#define WGET_IO_WRITABLE 2
304#define WGET_RESTRICT_NAMES_NONE 0
305#define WGET_RESTRICT_NAMES_UNIX 1<<0
306#define WGET_RESTRICT_NAMES_WINDOWS 1<<1
307#define WGET_RESTRICT_NAMES_NOCONTROL 1<<2
308#define WGET_RESTRICT_NAMES_ASCII 1<<3
309#define WGET_RESTRICT_NAMES_UPPERCASE 1<<4
310#define WGET_RESTRICT_NAMES_LOWERCASE 1<<5
312typedef int wget_update_load_fn(
void *, FILE *fp);
313typedef int wget_update_save_fn(
void *, FILE *fp);
322 wget_strcmp(
const char *s1,
const char *s2) WGET_GCC_PURE;
332 wget_strncmp(
const char *s1,
const char *s2,
size_t n) WGET_GCC_PURE;
336 wget_memtohex(
const unsigned char * __restrict src,
size_t src_len,
char * __restrict dst,
size_t dst_size);
344 wget_match_tail(
const char *s,
const char *tail) WGET_GCC_PURE WGET_GCC_NONNULL_ALL;
347WGETAPI
char * NULLABLE
348 wget_strnglob(
const char *str,
size_t n,
int flags) WGET_GCC_PURE;
352 wget_get_screen_size(
int *width,
int *height);
353WGETAPI
char * NULLABLE
354 wget_path_sanitize(
const char *path) WGET_GCC_MALLOC;
359WGETAPI FILE * NULLABLE
360 wget_vpopenf(
const char *type,
const char *__restrict fmt, va_list args) WGET_GCC_PRINTF_FORMAT(2,0);
361WGETAPI FILE * NULLABLE
362 wget_popenf(
const char *type,
const char *__restrict fmt, ...) WGET_GCC_PRINTF_FORMAT(2,3);
363WGETAPI FILE * NULLABLE
364 wget_popen2f(FILE **fpin, FILE **fpout, const
char *__restrict fmt, ...) WGET_GCC_PRINTF_FORMAT(3,4);
366 wget_fd_popen3(
int *fdin,
int *fdout,
int *fderr, const
char *const *argv);
368 wget_popen3(FILE **fpin, FILE **fpout, FILE **fperr, const
char *const *argv);
369WGETAPI
char * NULLABLE
372 wget_update_file(const
char *fname, wget_update_load_fn *load_func, wget_update_save_fn *save_func,
void *context);
376 wget_local_charset_encoding(
void);
378 wget_memiconv(const
char *src_encoding, const
void *src,
size_t srclen, const
char *dst_encoding,
char **out,
size_t *outlen);
379WGETAPI
char * NULLABLE
380 wget_striconv(const
char *src, const
char *src_encoding, const
char *dst_encoding) WGET_GCC_MALLOC;
382 wget_str_needs_encoding(const
char *s) WGET_GCC_PURE;
384 wget_str_is_valid_utf8(const
char *utf8) WGET_GCC_PURE;
385WGETAPI
char * NULLABLE
386 wget_str_to_utf8(const
char *src, const
char *encoding) WGET_GCC_MALLOC;
387WGETAPI
char * NULLABLE
388 wget_utf8_to_str(const
char *src, const
char *encoding) WGET_GCC_MALLOC;
390 wget_str_to_ascii(const
char *src);
399 wget_strlcpy(
char *__restrict dst, const
char *__restrict src,
size_t size);
401 wget_strscpy(
char *__restrict dst, const
char *__restrict src,
size_t size);
409typedef
int wget_list_browse_fn(
void *context,
void *elem);
411WGETAPI
void * NULLABLE
413WGETAPI
void * NULLABLE
415WGETAPI
void * NULLABLE
417WGETAPI
void * NULLABLE
419WGETAPI
void * NULLABLE
436#define wget_xfree(a) do { if (a) { wget_free((void *)(a)); a=NULL; } } while (0)
457RETURNS_NONNULL LIBWGET_WARN_UNUSED_RESULT WGET_GCC_ALLOC_SIZE(1) WGET_GCC_MALLOC
458static inline
void * NULLABLE wget_malloc(
size_t size)
460 return wget_malloc_fn(size);
463RETURNS_NONNULL LIBWGET_WARN_UNUSED_RESULT WGET_GCC_ALLOC_SIZE2(1,2) WGET_GCC_MALLOC
464static inline
void * NULLABLE wget_calloc(
size_t nmemb,
size_t size)
466 return wget_calloc_fn(nmemb, size);
469RETURNS_NONNULL LIBWGET_WARN_UNUSED_RESULT WGET_GCC_ALLOC_SIZE(2)
470static inline
void * NULLABLE wget_realloc(
void *ptr,
size_t size)
472 return wget_realloc_fn(ptr, size);
481LIBWGET_WARN_UNUSED_RESULT WGET_GCC_ALLOC_SIZE(2)
482WGETAPI
void * NULLABLE
485LIBWGET_WARN_UNUSED_RESULT WGET_GCC_MALLOC
486WGETAPI
char * NULLABLE
489LIBWGET_WARN_UNUSED_RESULT WGET_GCC_ALLOC_SIZE(2)
490WGETAPI
char * NULLABLE
494 wget_strmemcpy(
char *__restrict s,
size_t ssize, const
void *__restrict m,
size_t n);
496LIBWGET_WARN_UNUSED_RESULT WGET_GCC_NONNULL_ALL
497WGETAPI
void * NULLABLE
511 wget_base64_decode(
char *__restrict dst, const
char *__restrict src,
size_t n) WGET_GCC_NONNULL_ALL;
513 wget_base64_encode(
char *__restrict dst, const
char *__restrict src,
size_t n) WGET_GCC_NONNULL_ALL;
515 wget_base64_urlencode(
char *__restrict dst, const
char *__restrict src,
size_t n) WGET_GCC_NONNULL_ALL;
516WGETAPI
char * NULLABLE
518WGETAPI
char * NULLABLE
520WGETAPI
char * NULLABLE
521 wget_base64_encode_vprintf_alloc(const
char *__restrict fmt, va_list args) WGET_GCC_PRINTF_FORMAT(1,0) WGET_GCC_NONNULL_ALL;
522WGETAPI
char * NULLABLE
523 wget_base64_encode_printf_alloc(const
char *__restrict fmt, ...) WGET_GCC_PRINTF_FORMAT(1,2) WGET_GCC_NONNULL_ALL;
562 wget_buffer_alloc(
size_t size) WGET_GCC_MALLOC WGET_GCC_ALLOC_SIZE(1) RETURNS_NONNULL LIBWGET_WARN_UNUSED_RESULT;
592 wget_buffer_vprintf_append(
wget_buffer *buf, const
char *__restrict fmt, va_list args) WGET_GCC_PRINTF_FORMAT(2,0);
594 wget_buffer_printf_append(
wget_buffer *buf, const
char *__restrict fmt, ...) WGET_GCC_PRINTF_FORMAT(2,3);
596 wget_buffer_vprintf(
wget_buffer *buf, const
char *__restrict fmt, va_list args) WGET_GCC_PRINTF_FORMAT(2,0);
598 wget_buffer_printf(
wget_buffer *buf, const
char *__restrict fmt, ...) WGET_GCC_PRINTF_FORMAT(2,3);
605 wget_vasprintf(
char **__restrict strp, const
char *__restrict fmt, va_list args) WGET_GCC_PRINTF_FORMAT(2,0);
607 wget_asprintf(
char **__restrict strp, const
char *__restrict fmt, ...) WGET_GCC_PRINTF_FORMAT(2,3);
608WGETAPI
char * NULLABLE
609 wget_vaprintf(const
char *__restrict fmt, va_list args) WGET_GCC_PRINTF_FORMAT(1,0);
610WGETAPI
char * NULLABLE
611 wget_aprintf(const
char *__restrict fmt, ...) WGET_GCC_PRINTF_FORMAT(1,2);
613 wget_vfprintf(FILE *__restrict fp, const
char *__restrict fmt, va_list args) WGET_GCC_PRINTF_FORMAT(2,0);
615 wget_fprintf(FILE *__restrict fp, const
char *__restrict fmt, ...) WGET_GCC_PRINTF_FORMAT(2,3);
617 wget_printf(const
char *__restrict fmt, ...) WGET_GCC_PRINTF_FORMAT(1,2);
619 wget_vsnprintf(
char *__restrict str,
size_t size, const
char *__restrict fmt, va_list args) WGET_GCC_PRINTF_FORMAT(3,0);
621 wget_snprintf(
char *__restrict str,
size_t size, const
char *__restrict fmt, ...) WGET_GCC_PRINTF_FORMAT(3,4);
627typedef struct wget_logger_st wget_logger;
628typedef
void wget_logger_func(const
char *buf ,
size_t len) WGET_GCC_NONNULL_ALL;
631 wget_logger_set_func(wget_logger *logger, wget_logger_func *func);
633 wget_logger_set_stream(wget_logger *logger, FILE *fp);
635 wget_logger_set_file(wget_logger *logger, const
char *fname);
636WGETAPI wget_logger_func * NULLABLE
637 wget_logger_get_func(wget_logger *logger) WGET_GCC_PURE;
638WGETAPI FILE * NULLABLE
639 wget_logger_get_stream(wget_logger *logger) WGET_GCC_PURE;
640WGETAPI const
char * NULLABLE
641 wget_logger_get_file(wget_logger *logger) WGET_GCC_PURE;
643 wget_logger_is_active(wget_logger *logger) WGET_GCC_PURE;
649#define WGET_LOGGER_INFO 1
650#define WGET_LOGGER_ERROR 2
651#define WGET_LOGGER_DEBUG 3
654 wget_info_vprintf(
const char *__restrict fmt, va_list args) WGET_GCC_NONNULL_ALL WGET_GCC_PRINTF_FORMAT(1,0);
656 wget_info_printf(
const char *__restrict fmt, ...) WGET_GCC_NONNULL((1)) WGET_GCC_PRINTF_FORMAT(1,2);
658 wget_error_vprintf(const
char *__restrict fmt, va_list args) WGET_GCC_NONNULL_ALL WGET_GCC_PRINTF_FORMAT(1,0);
660 wget_error_printf(const
char *__restrict fmt, ...) WGET_GCC_NONNULL((1)) WGET_GCC_PRINTF_FORMAT(1,2);
661WGETAPI
void WGET_GCC_NONNULL((1)) WGET_GCC_NORETURN WGET_GCC_PRINTF_FORMAT(1,2)
662 wget_error_printf_exit(const
char *__restrict fmt, ...);
664 wget_debug_vprintf(const
char *__restrict fmt, va_list args) WGET_GCC_NONNULL_ALL WGET_GCC_PRINTF_FORMAT(1,0);
666 wget_debug_printf(const
char *__restrict fmt, ...) WGET_GCC_NONNULL((1)) WGET_GCC_PRINTF_FORMAT(1,2);
668 wget_debug_write(const
char *buf,
size_t len) WGET_GCC_NONNULL_ALL;
670 wget_get_logger(
int id) WGET_GCC_CONST;
677typedef
int wget_vector_compare_fn(const
void *elem1, const
void *elem2);
678typedef
int wget_vector_find_fn(
void *elem);
679typedef
int wget_vector_browse_fn(
void *ctx,
void *elem);
680typedef
void wget_vector_destructor(
void *elem);
682WGETAPI wget_vector * NULLABLE
687 wget_vector_find(const wget_vector *v, const
void *elem) WGET_GCC_NONNULL((2));
689 wget_vector_findext(const wget_vector *v,
int start,
int direction, wget_vector_find_fn *find) WGET_GCC_NONNULL((4));
699 wget_vector_add(wget_vector *v, const
void *elem) WGET_GCC_NONNULL((2));
701 wget_vector_add_vprintf(wget_vector *v, const
char *__restrict fmt, va_list args) WGET_GCC_PRINTF_FORMAT(2,0);
703 wget_vector_add_printf(wget_vector *v, const
char *__restrict fmt, ...) WGET_GCC_PRINTF_FORMAT(2,3);
717 wget_vector_browse(const wget_vector *v, wget_vector_browse_fn *browse,
void *ctx) WGET_GCC_NONNULL((2));
724WGETAPI
void * NULLABLE
773 wget_hashmap_get(const
wget_hashmap *h, const
void *key,
void **value) WGET_GCC_UNUSED_RESULT;
774#define wget_hashmap_get(a, b, c) wget_hashmap_get((a), (b), (void **)(c))
795WGETAPI wget_hashmap_iterator * NULLABLE
799WGETAPI
void * NULLABLE
812typedef int wget_stringmap_compare_fn(
const char *key1,
const char *key2);
815typedef unsigned int wget_stringmap_hash_fn(
const char *key);
818typedef int wget_stringmap_browse_fn(
void *ctx,
const char *key,
void *value);
821typedef void wget_stringmap_key_destructor(
char *key);
824typedef void wget_stringmap_value_destructor(
void *value);
827typedef wget_hashmap_iterator wget_stringmap_iterator;
830#define wget_stringmap_iterator_alloc wget_hashmap_iterator_alloc
832#define wget_stringmap_iterator_free wget_hashmap_iterator_free
864int wget_stringmap_put(
wget_stringmap *h,
const char *key,
const void *value)
879static inline WGET_GCC_UNUSED_RESULT
880int wget_stringmap_get(
const wget_stringmap *h,
const char *key,
void **value)
882 return wget_hashmap_get(h, key, value);
884#define wget_stringmap_get(h, k, v) wget_stringmap_get((h), (k), (void **)(v))
894int wget_stringmap_contains(
const wget_stringmap *h,
const char *key)
925int wget_stringmap_remove_nofree(
wget_stringmap *h,
const char *key)
982int wget_stringmap_browse(
const wget_stringmap *h, wget_stringmap_browse_fn *browse,
void *ctx)
994void wget_stringmap_setcmpfunc(
wget_stringmap *h, wget_stringmap_compare_fn *cmp)
1008int wget_stringmap_sethashfunc(
wget_stringmap *h, wget_stringmap_hash_fn *hash)
1022void wget_stringmap_set_key_destructor(
wget_hashmap *h, wget_stringmap_key_destructor *destructor)
1036void wget_stringmap_set_value_destructor(
wget_hashmap *h, wget_stringmap_value_destructor *destructor)
1057void wget_stringmap_set_load_factor(
wget_stringmap *h,
float factor)
1075void wget_stringmap_set_resize_factor(
wget_stringmap *h,
float factor)
1091void * NULLABLE wget_stringmap_iterator_next(wget_stringmap_iterator *h,
void **value)
1102typedef unsigned long wget_thread_id;
1108 wget_thread_start(wget_thread *thread,
void *(*start_routine)(
void *),
void *arg,
int flags);
1118 wget_thread_kill(wget_thread thread,
int sig);
1120 wget_thread_cancel(wget_thread thread);
1131WGETAPI wget_thread_id
1141typedef int wget_decompressor_sink_fn(
void *context,
const char *data,
size_t length);
1142typedef int wget_decompressor_error_handler(wget_decompressor *dc,
int err);
1145 wget_content_encoding_unknown = -1,
1146 wget_content_encoding_identity = 0,
1147 wget_content_encoding_gzip = 1,
1148 wget_content_encoding_deflate = 2,
1149 wget_content_encoding_xz = 3,
1150 wget_content_encoding_lzma = 4,
1151 wget_content_encoding_bzip2 = 5,
1152 wget_content_encoding_brotli = 6,
1153 wget_content_encoding_zstd = 7,
1154 wget_content_encoding_lzip = 8,
1155 wget_content_encoding_max = 9
1156} wget_content_encoding;
1158WGETAPI WGET_GCC_PURE wget_content_encoding
1159 wget_content_encoding_by_name(
const char *name);
1160WGETAPI WGET_GCC_PURE
const char * NULLABLE
1161 wget_content_encoding_to_name(wget_content_encoding type);
1162WGETAPI wget_decompressor * NULLABLE
1163 wget_decompress_open(wget_content_encoding encoding, wget_decompressor_sink_fn *data_sink,
void *context);
1165 wget_decompress_close(wget_decompressor *dc);
1167 wget_decompress(wget_decompressor *dc,
const char *src,
size_t srclen);
1169 wget_decompress_set_error_handler(wget_decompressor *dc, wget_decompressor_error_handler *error_handler);
1170WGETAPI
void * NULLABLE
1171 wget_decompress_get_context(wget_decompressor *dc);
1178 WGET_IRI_SCHEME_HTTP = 0,
1179 WGET_IRI_SCHEME_HTTPS = 1
1183#define WGET_IRI_WITH_QUERY 1
1186#define WGET_IRI_KEEP_AS_IS 2
1295 wget_iri_test(
void);
1301 wget_iri_set_defaultpage(
const char *page);
1303 wget_iri_set_defaultport(wget_iri_scheme
scheme,
unsigned short port);
1315 wget_iri_compare(
const wget_iri *iri1,
const wget_iri *iri2) WGET_GCC_PURE;
1324WGETAPI wget_iri * NULLABLE
1325 wget_iri_parse_base(
const wget_iri *base,
const char *url,
const char *encoding,
int flags);
1326WGETAPI wget_iri * NULLABLE
1328WGETAPI
const char * NULLABLE
1343 wget_iri_get_path(
const wget_iri *iri,
wget_buffer *buf,
const char *encoding) WGET_GCC_NONNULL((1,2));
1345 wget_iri_get_query_as_filename(
const wget_iri *iri,
wget_buffer *buf,
const char *encoding) WGET_GCC_NONNULL((1,2));
1347 wget_iri_get_basename(
const wget_iri *iri,
wget_buffer *buf,
const char *encoding,
int flags) WGET_GCC_NONNULL((1,2));
1348WGETAPI wget_iri_scheme
1350WGETAPI
const char * NULLABLE
1361typedef struct wget_cookie_st wget_cookie;
1363WGETAPI wget_cookie * NULLABLE
1364 wget_cookie_init(wget_cookie *cookie);
1366 wget_cookie_deinit(wget_cookie *cookie);
1368 wget_cookie_free(wget_cookie **cookie);
1370 wget_cookie_to_setcookie(wget_cookie *cookie);
1372 wget_cookie_parse_setcookie(
const char *s, wget_cookie **cookie) WGET_GCC_NONNULL((1));
1374 wget_cookie_normalize_cookies(
const wget_iri *iri,
const wget_vector *cookies);
1376 wget_cookie_store_cookie(wget_cookie_db *cookie_db, wget_cookie *cookie);
1378 wget_cookie_store_cookies(wget_cookie_db *cookie_db, wget_vector *cookies);
1380 wget_cookie_normalize(
const wget_iri *iri, wget_cookie *cookie);
1382 wget_cookie_check_psl(
const wget_cookie_db *cookie_db,
const wget_cookie *cookie);
1383WGETAPI wget_cookie_db * NULLABLE
1384 wget_cookie_db_init(wget_cookie_db *cookie_db);
1386 wget_cookie_db_deinit(wget_cookie_db *cookie_db);
1388 wget_cookie_db_free(wget_cookie_db **cookie_db);
1390 wget_cookie_set_keep_session_cookies(wget_cookie_db *cookie_db,
bool keep);
1392 wget_cookie_db_save(wget_cookie_db *cookie_db,
const char *fname);
1394 wget_cookie_db_load(wget_cookie_db *cookie_db,
const char *fname);
1396 wget_cookie_db_load_psl(wget_cookie_db *cookie_db,
const char *fname);
1398 wget_cookie_create_request_header(wget_cookie_db *cookie_db,
const wget_iri *iri);
1420typedef void wget_hsts_db_deinit_fn(
wget_hsts_db *hsts_db);
1421typedef void wget_hsts_db_free_fn(
wget_hsts_db **hsts_db);
1422typedef void wget_hsts_db_add_fn(
wget_hsts_db *hsts_db,
const char *host, int64_t maxage,
bool include_subdomains);
1423typedef int wget_hsts_db_save_fn(
wget_hsts_db *hsts_db);
1424typedef int wget_hsts_db_load_fn(
wget_hsts_db *hsts_db);
1425typedef void wget_hsts_db_set_fname_fn(
wget_hsts_db *hsts_db,
const char *fname);
1445WGETAPI wget_hsts_db_init_fn wget_hsts_db_init;
1446WGETAPI wget_hsts_db_deinit_fn wget_hsts_db_deinit;
1447WGETAPI wget_hsts_db_free_fn wget_hsts_db_free;
1448WGETAPI wget_hsts_db_add_fn wget_hsts_db_add;
1449WGETAPI wget_hsts_db_load_fn wget_hsts_db_load;
1450WGETAPI wget_hsts_db_save_fn wget_hsts_db_save;
1481#define WGET_HPKP_OK 0
1483#define WGET_HPKP_ERROR -1
1485#define WGET_HPKP_ENTRY_EXPIRED -2
1487#define WGET_HPKP_WAS_DELETED -3
1489#define WGET_HPKP_NOT_ENOUGH_PINS -4
1491#define WGET_HPKP_ENTRY_EXISTS -5
1493#define WGET_HPKP_ERROR_FILE_OPEN -6
1504typedef void wget_hpkp_db_deinit_fn(
wget_hpkp_db *hpkp_db);
1505typedef void wget_hpkp_db_free_fn(
wget_hpkp_db **hpkp_db);
1506typedef int wget_hpkp_db_check_pubkey_fn(
wget_hpkp_db *hpkp_db,
const char *host,
const void *pubkey,
size_t pubkeysize);
1508typedef int wget_hpkp_db_load_fn(
wget_hpkp_db *hpkp_db);
1509typedef int wget_hpkp_db_save_fn(
wget_hpkp_db *hpkp_db);
1554WGETAPI wget_hpkp_db_deinit_fn wget_hpkp_db_deinit;
1555WGETAPI wget_hpkp_db_free_fn wget_hpkp_db_free;
1556WGETAPI wget_hpkp_db_check_pubkey_fn wget_hpkp_db_check_pubkey;
1557WGETAPI wget_hpkp_db_add_fn wget_hpkp_db_add;
1558WGETAPI wget_hpkp_db_load_fn wget_hpkp_db_load;
1559WGETAPI wget_hpkp_db_save_fn wget_hpkp_db_save;
1561 wget_hpkp_db_set_fname(
wget_hpkp_db *hpkp_db,
const char *fname);
1573WGETAPI wget_tls_session * NULLABLE
1574 wget_tls_session_init(wget_tls_session *tls_session);
1576 wget_tls_session_deinit(wget_tls_session *tls_session);
1578 wget_tls_session_free(wget_tls_session *tls_session);
1579WGETAPI wget_tls_session * NULLABLE
1580 wget_tls_session_new(
const char *host, int64_t maxage,
const void *data,
size_t data_size);
1582 wget_tls_session_get(
const wget_tls_session_db *tls_session_db,
const char *host,
void **data,
size_t *size);
1583WGETAPI wget_tls_session_db * NULLABLE
1584 wget_tls_session_db_init(wget_tls_session_db *tls_session_db);
1586 wget_tls_session_db_deinit(wget_tls_session_db *tls_session_db);
1588 wget_tls_session_db_free(wget_tls_session_db **tls_session_db);
1590 wget_tls_session_db_add(wget_tls_session_db *tls_session_db, wget_tls_session *tls_session);
1592 wget_tls_session_db_save(wget_tls_session_db *tls_session_db,
const char *fname);
1594 wget_tls_session_db_load(wget_tls_session_db *tls_session_db,
const char *fname);
1596 wget_tls_session_db_changed(wget_tls_session_db *tls_session_db) WGET_GCC_PURE;
1617typedef void wget_ocsp_db_deinit_fn(
wget_ocsp_db *ocsp_db);
1618typedef void wget_ocsp_db_free_fn(
wget_ocsp_db **ocsp_db);
1619typedef bool wget_ocsp_fingerprint_in_cache_fn(
const wget_ocsp_db *ocsp_db,
const char *fingerprint,
int *valid);
1620typedef bool wget_ocsp_hostname_is_valid_fn(
const wget_ocsp_db *ocsp_db,
const char *hostname);
1621typedef void wget_ocsp_db_add_fingerprint_fn(
wget_ocsp_db *ocsp_db,
const char *fingerprint, int64_t maxage,
bool valid);
1622typedef void wget_ocsp_db_add_host_fn(
wget_ocsp_db *ocsp_db,
const char *host, int64_t maxage);
1623typedef int wget_ocsp_db_save_fn(
wget_ocsp_db *ocsp_db);
1624typedef int wget_ocsp_db_load_fn(
wget_ocsp_db *ocsp_db);
1648WGETAPI wget_ocsp_db_deinit_fn wget_ocsp_db_deinit;
1649WGETAPI wget_ocsp_db_free_fn wget_ocsp_db_free;
1650WGETAPI wget_ocsp_fingerprint_in_cache_fn wget_ocsp_fingerprint_in_cache;
1651WGETAPI wget_ocsp_hostname_is_valid_fn wget_ocsp_hostname_is_valid;
1652WGETAPI wget_ocsp_db_add_fingerprint_fn wget_ocsp_db_add_fingerprint;
1653WGETAPI wget_ocsp_db_add_host_fn wget_ocsp_db_add_host;
1654WGETAPI wget_ocsp_db_save_fn wget_ocsp_db_save;
1655WGETAPI wget_ocsp_db_load_fn wget_ocsp_db_load;
1690WGETAPI wget_netrc * NULLABLE
1691 wget_netrc_init(wget_netrc *netrc);
1693 wget_netrc_deinit(wget_netrc *netrc);
1695 wget_netrc_free(wget_netrc *netrc);
1696WGETAPI wget_netrc * NULLABLE
1697 wget_netrc_new(
const char *machine,
const char *
login,
const char *
password);
1698WGETAPI wget_netrc_db *
1699 wget_netrc_db_init(wget_netrc_db *netrc_db);
1701 wget_netrc_db_deinit(wget_netrc_db *netrc_db);
1703 wget_netrc_db_free(wget_netrc_db **netrc_db);
1705 wget_netrc_db_add(wget_netrc_db *netrc_db, wget_netrc *netrc);
1706WGETAPI wget_netrc * NULLABLE
1707 wget_netrc_get(
const wget_netrc_db *netrc_db,
const char *
host);
1709 wget_netrc_db_load(wget_netrc_db *netrc_db,
const char *fname);
1727typedef void wget_css_parse_uri_callback(
void *user_ctx,
const char *
url,
size_t len,
size_t pos);
1728typedef void wget_css_parse_encoding_callback(
void *user_ctx,
const char *
url,
size_t len);
1731 wget_css_parse_buffer(
1734 wget_css_parse_uri_callback *callback_uri,
1735 wget_css_parse_encoding_callback *callback_encoding,
1736 void *user_ctx) WGET_GCC_NONNULL((1));
1738 wget_css_parse_file(
1740 wget_css_parse_uri_callback *callback_uri,
1741 wget_css_parse_encoding_callback *callback_encoding,
1742 void *user_ctx) WGET_GCC_NONNULL((1));
1743WGETAPI wget_vector *
1747 const wget_iri *base,
1748 const char **encoding) WGET_GCC_NONNULL((1));
1749WGETAPI wget_vector *
1750 wget_css_get_urls_from_localfile(
1753 const char **encoding) WGET_GCC_NONNULL((1));
1799 wget_html_get_urls_inline(
const char *html, wget_vector *additional_tags, wget_vector *ignore_tags);
1807 wget_rss_get_urls_inline(
const char *rss, wget_vector **urls);
1813#define XML_FLG_BEGIN (1<<0)
1814#define XML_FLG_CLOSE (1<<1)
1815#define XML_FLG_END (1<<2)
1816#define XML_FLG_ATTRIBUTE (1<<3)
1817#define XML_FLG_CONTENT (1<<4)
1818#define XML_FLG_COMMENT (1<<5)
1820#define XML_FLG_PROCESSING (1<<7)
1821#define XML_FLG_SPECIAL (1<<8)
1823#define XML_HINT_REMOVE_EMPTY_CONTENT (1<<0)
1824#define XML_HINT_HTML (1<<1)
1826#define HTML_HINT_REMOVE_EMPTY_CONTENT XML_HINT_REMOVE_EMPTY_CONTENT
1828typedef void wget_xml_callback(
void *,
int,
const char *,
const char *,
const char *,
size_t,
size_t);
1833 wget_xml_callback *callback,
1835 int hints) WGET_GCC_NONNULL((1));
1839 wget_xml_callback *callback,
1841 int hints) WGET_GCC_NONNULL((1));
1845 wget_xml_callback *callback,
1847 int hints) WGET_GCC_NONNULL((1));
1851 wget_xml_callback *callback,
1853 int hints) WGET_GCC_NONNULL((1));
1867WGETAPI
struct addrinfo * NULLABLE
1870 wget_dns_cache_add(wget_dns_cache *cache,
const char *host, uint16_t port,
struct addrinfo **addrinfo);
1886WGETAPI wget_dns_cache * NULLABLE
1888WGETAPI
struct addrinfo * NULLABLE
1889 wget_dns_resolve(wget_dns *dns,
const char *host, uint16_t port,
int family,
int preferred_family);
1893 wget_dns_cache_ip(wget_dns *dns,
const char *ip,
const char *name, uint16_t port);
1899#define WGET_NET_FAMILY_ANY 0
1900#define WGET_NET_FAMILY_IPV4 1
1901#define WGET_NET_FAMILY_IPV6 2
1903#define WGET_PROTOCOL_HTTP_1_1 0
1904#define WGET_PROTOCOL_HTTP_2_0 1
1906typedef struct wget_tcp_st wget_tcp;
1912WGETAPI wget_tcp * NULLABLE
1934WGETAPI
const char * NULLABLE
1941 wget_tcp_set_ssl_ca_file(wget_tcp *tcp,
const char *cafile);
1943 wget_tcp_set_ssl_key_file(wget_tcp *tcp,
const char *certfile,
const char *keyfile);
1957 wget_tcp_set_debug(wget_tcp *tcp,
int debug);
1975 wget_tcp_vprintf(wget_tcp *tcp,
const char *__restrict fmt, va_list args) WGET_GCC_PRINTF_FORMAT(2,0);
1977 wget_tcp_printf(wget_tcp *tcp,
const char *__restrict fmt, ...) WGET_GCC_PRINTF_FORMAT(2,3);
1992#define WGET_SSL_X509_FMT_PEM 0
1993#define WGET_SSL_X509_FMT_DER 1
1995#define WGET_SSL_SECURE_PROTOCOL 1
1996#define WGET_SSL_CA_DIRECTORY 2
1997#define WGET_SSL_CA_FILE 3
1998#define WGET_SSL_CERT_FILE 4
1999#define WGET_SSL_KEY_FILE 5
2000#define WGET_SSL_CA_TYPE 6
2001#define WGET_SSL_CERT_TYPE 7
2002#define WGET_SSL_KEY_TYPE 8
2003#define WGET_SSL_CHECK_CERTIFICATE 9
2004#define WGET_SSL_CHECK_HOSTNAME 10
2005#define WGET_SSL_PRINT_INFO 11
2006#define WGET_SSL_CRL_FILE 13
2007#define WGET_SSL_OCSP_STAPLING 14
2008#define WGET_SSL_OCSP_SERVER 15
2009#define WGET_SSL_OCSP 16
2010#define WGET_SSL_OCSP_CACHE 17
2011#define WGET_SSL_ALPN 18
2012#define WGET_SSL_SESSION_CACHE 19
2013#define WGET_SSL_HPKP_CACHE 20
2014#define WGET_SSL_OCSP_NONCE 21
2015#define WGET_SSL_OCSP_DATE 22
2016#define WGET_SSL_REPORT_INVALID_CERT 23
2017#define WGET_SSL_DANE 24
2034 wget_ssl_set_check_certificate(
char value);
2040 wget_ssl_default_cert_dir(
void);
2042 wget_ssl_default_ca_bundle_path(
void);
2070 link_rel_describedby,
2096 wget_transfer_encoding_identity = 0,
2097 wget_transfer_encoding_chunked = 1
2098} wget_transfer_encoding;
2101typedef int wget_http_header_callback(wget_http_response *,
void *);
2102typedef int wget_http_body_callback(wget_http_response *,
void *,
const char *,
size_t);
2105typedef void wget_http_free_user_data_callback(wget_http_request *);
2115 wget_http_header_callback
2117 wget_http_body_callback
2119 wget_http_free_user_data_callback
2175 content_type_encoding;
2207 wget_transfer_encoding
2212 hsts_include_subdomains,
2215 content_length_valid : 1,
2221typedef struct wget_http_connection_st wget_http_connection;
2224 wget_http_get_host(
const wget_http_connection *conn) WGET_GCC_NONNULL_ALL;
2226 wget_http_get_port(
const wget_http_connection *conn) WGET_GCC_NONNULL_ALL;
2227WGETAPI wget_iri_scheme
2228 wget_http_get_scheme(
const wget_http_connection *conn) WGET_GCC_NONNULL_ALL;
2230 wget_http_get_protocol(
const wget_http_connection *conn) WGET_GCC_NONNULL_ALL;
2233 wget_http_isseparator(
char c) WGET_GCC_CONST;
2235 wget_http_istoken(
char c) WGET_GCC_CONST;
2238 wget_http_parse_token(
const char *s,
const char **token) WGET_GCC_NONNULL_ALL;
2240 wget_http_parse_quoted_string(
const char *s,
const char **qstring) WGET_GCC_NONNULL_ALL;
2242 wget_http_parse_param(
const char *s,
const char **param,
const char **value) WGET_GCC_NONNULL_ALL;
2244 wget_http_parse_name(
const char *s,
const char **name) WGET_GCC_NONNULL_ALL;
2246 wget_parse_name_fixed(
const char *s,
const char **name,
size_t *namelen) WGET_GCC_NONNULL_ALL;
2248 wget_http_parse_full_date(
const char *s) WGET_GCC_NONNULL_ALL;
2250 wget_http_parse_link(
const char *s,
wget_http_link *link) WGET_GCC_NONNULL_ALL;
2252 wget_http_parse_digest(
const char *s,
wget_http_digest *digest) WGET_GCC_NONNULL_ALL;
2254 wget_http_parse_challenge(
const char *s,
wget_http_challenge *challenge) WGET_GCC_NONNULL_ALL;
2256 wget_http_parse_challenges(
const char *s, wget_vector *challenges) WGET_GCC_NONNULL_ALL;
2258 wget_http_parse_location(
const char *s,
const char **location) WGET_GCC_NONNULL_ALL;
2260 wget_http_parse_transfer_encoding(
const char *s, wget_transfer_encoding *transfer_encoding) WGET_GCC_NONNULL_ALL;
2262 wget_http_parse_content_type(
const char *s,
const char **content_type,
const char **charset) WGET_GCC_NONNULL((1));
2264 wget_http_parse_content_encoding(
const char *s,
char *content_encoding) WGET_GCC_NONNULL_ALL;
2266 wget_http_parse_content_disposition(
const char *s,
const char **filename) WGET_GCC_NONNULL((1));
2268 wget_http_parse_strict_transport_security(
const char *s, int64_t *maxage,
bool *include_subdomains) WGET_GCC_NONNULL_ALL;
2270 wget_http_parse_public_key_pins(
const char *s,
wget_hpkp *hpkp) WGET_GCC_NONNULL((1));
2272 wget_http_parse_connection(
const char *s,
bool *keep_alive) WGET_GCC_NONNULL_ALL;
2274 wget_http_parse_setcookie(
const char *s, wget_cookie **cookie) WGET_GCC_NONNULL((1));
2276 wget_http_parse_etag(
const char *s,
const char **etag) WGET_GCC_NONNULL((1));
2279 wget_http_print_date(int64_t t,
char *buf,
size_t bufsize) WGET_GCC_NONNULL_ALL;
2284 wget_http_add_header_vprintf(wget_http_request *req,
const char *name,
const char *__restrict fmt, va_list args) WGET_GCC_PRINTF_FORMAT(3,0) WGET_GCC_NONNULL_ALL;
2286 wget_http_add_header_printf(wget_http_request *req, const
char *name, const
char *__restrict fmt, ...) WGET_GCC_PRINTF_FORMAT(3,4) WGET_GCC_NONNULL((1,2,3));
2288 wget_http_add_header(wget_http_request *req, const
char *name, const
char *value) WGET_GCC_NONNULL_ALL;
2292 wget_http_add_credentials(wget_http_request *req,
wget_http_challenge *challenge, const
char *username, const
char *password,
int proxied) WGET_GCC_NONNULL((1));
2294 wget_http_set_http_proxy(const
char *proxy, const
char *encoding);
2296 wget_http_set_https_proxy(const
char *proxy, const
char *encoding);
2298 wget_http_set_no_proxy(const
char *no_proxy, const
char *encoding);
2299WGETAPI const wget_vector *
2300 wget_http_get_no_proxy(
void);
2302 wget_http_match_no_proxy(const wget_vector *no_proxies, const
char *host);
2304 wget_http_abort_connection(wget_http_connection *conn);
2306 wget_http_connection_receive_only(wget_http_connection *conn);
2311 wget_http_free_cookie(wget_cookie *cookie);
2320 wget_http_free_cookies(wget_vector **cookies);
2322 wget_http_free_hpkp_entries(
wget_hpkp **hpkp);
2324 wget_http_free_digests(wget_vector **digests);
2326 wget_http_free_challenges(wget_vector **challenges);
2328 wget_http_free_links(wget_vector **links);
2332 wget_http_free_request(wget_http_request **req);
2334 wget_http_free_response(wget_http_response **resp);
2337 wget_http_parse_header_line(wget_http_response *resp, const
char *name,
size_t namelen, const
char *value,
size_t valuelen);
2338WGETAPI wget_http_response * NULLABLE
2339 wget_http_parse_response_header(
char *buf) WGET_GCC_NONNULL_ALL;
2340WGETAPI wget_http_response * NULLABLE
2341 wget_http_get_response_cb(wget_http_connection *conn) WGET_GCC_NONNULL((1));
2344WGETAPI wget_http_response * NULLABLE
2345 wget_http_get_response(wget_http_connection *conn) WGET_GCC_NONNULL((1));
2348 wget_http_init(
void);
2350 wget_http_exit(
void);
2352 wget_http_open(wget_http_connection **_conn, const wget_iri *iri);
2353WGETAPI wget_http_request * NULLABLE
2354 wget_http_create_request(const wget_iri *iri, const
char *method) WGET_GCC_NONNULL_ALL;
2356 wget_http_close(wget_http_connection **conn) WGET_GCC_NONNULL_ALL;
2358 wget_http_request_set_header_cb(wget_http_request *req, wget_http_header_callback *cb,
void *user_data) WGET_GCC_NONNULL((1));
2360 wget_http_request_set_body_cb(wget_http_request *req, wget_http_body_callback *cb,
void *user_data) WGET_GCC_NONNULL((1));
2362 wget_http_request_set_free_user_data_cb(wget_http_request *req, wget_http_free_user_data_callback *cb) WGET_GCC_NONNULL((1));
2364 wget_http_request_set_int(wget_http_request *req,
int key,
int value) WGET_GCC_NONNULL((1));
2366 wget_http_request_get_int(wget_http_request *req,
int key) WGET_GCC_NONNULL((1));
2368 wget_http_request_set_ptr(wget_http_request *req,
int key,
void *value) WGET_GCC_NONNULL((1));
2370 wget_http_request_get_ptr(wget_http_request *req,
int key) WGET_GCC_NONNULL((1));
2372 wget_http_request_set_body(wget_http_request *req, const
char *mimetype,
char *body,
size_t length) WGET_GCC_NONNULL((1));
2374 wget_http_send_request(wget_http_connection *conn, wget_http_request **req) WGET_GCC_NONNULL_ALL;
2376 wget_http_request_to_buffer(wget_http_request *req,
wget_buffer *buf,
int proxied,
int port) WGET_GCC_NONNULL_ALL;
2382WGETAPI wget_http_response *
2383 wget_http_get(
int first_key, ...);
2424 wget_hash_get_algorithm(
const char *hashname);
2432 wget_hash(
wget_hash_hd *handle,
const void *text,
size_t textlen);
2441 wget_hash_file_fd(
const char *hashname,
int fd,
char *digest_hex,
size_t digest_hex_size, off_t offset, off_t length) WGET_GCC_NONNULL_ALL;
2443 wget_hash_file_offset(
const char *hashname,
const char *fname,
char *digest_hex,
size_t digest_hex_size, off_t offset, off_t length) WGET_GCC_NONNULL_ALL;
2445 wget_hash_file(
const char *hashname,
const char *fname,
char *digest_hex,
size_t digest_hex_size) WGET_GCC_NONNULL_ALL;
2452WGETAPI
void WGET_GCC_PRINTF_FORMAT(4,5) WGET_GCC_NONNULL_ALL
2497 wget_metalink_parse(
const char *xml);
2519WGETAPI
const char * NULLABLE
2528 WGET_REPORT_SPEED_BYTES,
2529 WGET_REPORT_SPEED_BITS
2534WGETAPI wget_bar * NULLABLE
2543 wget_bar_vprintf(wget_bar *bar,
int slot,
const char *__restrict fmt, va_list args) WGET_GCC_PRINTF_FORMAT(3,0) WGET_GCC_NONNULL_ALL;
2545 wget_bar_printf(wget_bar *bar,
int slot, const
char *__restrict fmt, ...) WGET_GCC_PRINTF_FORMAT(3,4) WGET_GCC_NONNULL_ALL;
2547 wget_bar_slot_begin(wget_bar *bar,
int slot, const
char *filename,
int new_file, ssize_t filesize) WGET_GCC_NONNULL((1));
2561 wget_bar_write_line_ext(wget_bar *bar, const
char *buf,
size_t len, const
char *pre, const
char *post) WGET_GCC_NONNULL_ALL;
2571 WGET_CONSOLE_COLOR_RESET = 0,
2572 WGET_CONSOLE_COLOR_WHITE = 1,
2573 WGET_CONSOLE_COLOR_BLUE = 2,
2574 WGET_CONSOLE_COLOR_GREEN = 3,
2575 WGET_CONSOLE_COLOR_RED = 4,
2576 WGET_CONSOLE_COLOR_MAGENTA = 5
2577} wget_console_color;
2584 wget_console_set_fg_color(wget_console_color colorid);
2600#if defined _WIN32 || defined __OS2__
2601# define WGET_EXPORT __declspec(dllexport)
2603# define WGET_EXPORT __attribute__ ((__visibility__("default")))
2725WGETAPI
const wget_iri *
2774 const char * (* get_name)(wget_plugin *);
2877 WGET_STATS_HPKP_NO = 0,
2878 WGET_STATS_HPKP_MATCH = 1,
2879 WGET_STATS_HPKP_NOMATCH = 2,
2880 WGET_STATS_HPKP_ERROR = 3
2881} wget_hpkp_stats_result;
2884 wget_server_stats_callback(wget_http_connection *conn, wget_http_response *resp);
2887 wget_server_set_stats_callback(wget_server_stats_callback *fn);
2890 WGET_STATS_FORMAT_HUMAN = 0,
2891 WGET_STATS_FORMAT_CSV = 1,
2900#define WGET_REGEX_TYPE_POSIX 0
2901#define WGET_REGEX_TYPE_PCRE 1
2903#undef RETURNS_NONNULL
WGETAPI size_t wget_base64_get_decoded_length(size_t len) WGET_GCC_PURE
Definition base64.c:316
WGETAPI bool wget_base64_is_string(const char *src) WGET_GCC_PURE
Definition base64.c:78
WGETAPI size_t wget_base64_get_encoded_length(size_t len) WGET_GCC_PURE
Definition base64.c:329
WGETAPI char *NULLABLE wget_base64_decode_alloc(const char *src, size_t n, size_t *outlen) WGET_GCC_NONNULL((1))
Definition base64.c:154
WGETAPI char *NULLABLE wget_base64_encode_alloc(const char *src, size_t n) WGET_GCC_NONNULL_ALL
Definition base64.c:251
WGETAPI void wget_bitmap_clear(wget_bitmap *bitmap, unsigned n)
Definition bitmap.c:79
WGETAPI void wget_bitmap_free(wget_bitmap **bitmap)
Definition bitmap.c:132
WGETAPI bool wget_bitmap_get(const wget_bitmap *bitmap, unsigned n)
Definition bitmap.c:94
WGETAPI int wget_bitmap_init(wget_bitmap **bitmap, unsigned bits)
Definition bitmap.c:110
WGETAPI void wget_bitmap_set(wget_bitmap *bitmap, unsigned n)
Definition bitmap.c:67
WGETAPI size_t wget_buffer_memset(wget_buffer *buf, char c, size_t length)
Definition buffer.c:496
WGETAPI wget_buffer * wget_buffer_alloc(size_t size) WGET_GCC_MALLOC WGET_GCC_ALLOC_SIZE(1) RETURNS_NONNULL LIBWGET_WARN_UNUSED_RESULT
Definition buffer.c:189
WGETAPI size_t wget_buffer_bufcat(wget_buffer *buf, wget_buffer *src)
Definition buffer.c:476
WGETAPI size_t wget_buffer_memset_append(wget_buffer *buf, char c, size_t length)
Definition buffer.c:515
WGETAPI int wget_buffer_ensure_capacity(wget_buffer *buf, size_t size) LIBWGET_WARN_UNUSED_RESULT
Definition buffer.c:245
WGETAPI size_t wget_buffer_strcat(wget_buffer *buf, const char *s)
Definition buffer.c:436
WGETAPI void wget_buffer_free_data(wget_buffer *buf)
Definition buffer.c:311
WGETAPI char * wget_buffer_trim(wget_buffer *buf)
Definition buffer.c:542
WGETAPI size_t wget_buffer_memcpy(wget_buffer *buf, const void *data, size_t length)
Definition buffer.c:356
WGETAPI void wget_buffer_deinit(wget_buffer *buf) WGET_GCC_NONNULL((1))
Definition buffer.c:268
WGETAPI int wget_buffer_init(wget_buffer *buf, char *data, size_t size) WGET_GCC_NONNULL((1))
Definition buffer.c:153
WGETAPI size_t wget_buffer_bufcpy(wget_buffer *buf, wget_buffer *src)
Definition buffer.c:455
WGETAPI void wget_buffer_reset(wget_buffer *buf)
Definition buffer.c:333
WGETAPI size_t wget_buffer_memcat(wget_buffer *buf, const void *data, size_t length)
Definition buffer.c:378
WGETAPI void wget_buffer_free(wget_buffer **buf)
Definition buffer.c:291
WGETAPI size_t wget_buffer_strcpy(wget_buffer *buf, const char *s)
Definition buffer.c:414
WGETAPI int wget_console_deinit(void)
Definition console.c:154
WGETAPI int wget_console_init(void)
Definition console.c:124
WGETAPI void wget_console_reset_fg_color(void)
Definition console.c:98
WGETAPI void wget_dns_cache_free(wget_dns_cache **cache)
Definition dns_cache.c:124
WGETAPI int wget_dns_cache_init(wget_dns_cache **cache)
Definition dns_cache.c:94
WGETAPI int wget_dns_cache_add(wget_dns_cache *cache, const char *host, uint16_t port, struct addrinfo **addrinfo)
Definition dns_cache.c:177
WGETAPI struct addrinfo *NULLABLE wget_dns_cache_get(wget_dns_cache *cache, const char *host, uint16_t port)
Definition dns_cache.c:142
WGETAPI void wget_dns_set_stats_callback(wget_dns *dns, wget_dns_stats_callback *fn, void *ctx)
Definition dns.c:483
WGETAPI void wget_dns_free(wget_dns **dns)
Definition dns.c:126
WGETAPI int wget_dns_init(wget_dns **dns)
Definition dns.c:97
WGETAPI struct addrinfo *NULLABLE wget_dns_resolve(wget_dns *dns, const char *host, uint16_t port, int family, int preferred_family)
Definition dns.c:347
WGETAPI void wget_dns_set_cache(wget_dns *dns, wget_dns_cache *cache)
Definition dns.c:168
WGETAPI void wget_dns_set_timeout(wget_dns *dns, int timeout)
Definition dns.c:155
WGETAPI wget_dns_cache *NULLABLE wget_dns_get_cache(wget_dns *dns) WGET_GCC_PURE
Definition dns.c:181
WGETAPI void wget_dns_freeaddrinfo(wget_dns *dns, struct addrinfo **addrinfo)
Definition dns.c:460
WGETAPI int wget_dns_cache_ip(wget_dns *dns, const char *ip, const char *name, uint16_t port)
Definition dns.c:296
WGETAPI const char * wget_strerror(wget_error err)
Definition error.c:41
void wget_hash_printf_hex(wget_digest_algorithm algorithm, char *out, size_t outsize, const char *fmt,...)
Definition hash_printf.c:56
wget_digest_algorithm
Enumeration of different hash digest algorithms.
Definition wget.h:2410
struct wget_hash_hd_st wget_hash_hd
Type for hash / digest routines.
Definition wget.h:2404
@ WGET_DIGTYPE_MD2
Definition wget.h:2415
@ WGET_DIGTYPE_RMD160
Definition wget.h:2414
@ WGET_DIGTYPE_SHA1
Definition wget.h:2413
@ WGET_DIGTYPE_MD5
Definition wget.h:2412
@ WGET_DIGTYPE_MAX
Definition wget.h:2420
@ WGET_DIGTYPE_SHA256
Definition wget.h:2416
@ WGET_DIGTYPE_SHA512
Definition wget.h:2418
@ WGET_DIGTYPE_SHA224
Definition wget.h:2419
@ WGET_DIGTYPE_UNKNOWN
Definition wget.h:2411
@ WGET_DIGTYPE_SHA384
Definition wget.h:2417
WGETAPI int wget_hashmap_contains(const wget_hashmap *h, const void *key)
Definition hashmap.c:326
WGETAPI void wget_hashmap_set_load_factor(wget_hashmap *h, float factor)
Definition hashmap.c:608
WGETAPI void wget_hashmap_clear(wget_hashmap *h)
Definition hashmap.c:451
WGETAPI void *NULLABLE wget_hashmap_iterator_next(wget_hashmap_iterator *iter, void **value)
Definition hashmap.c:125
WGETAPI wget_hashmap_iterator *NULLABLE wget_hashmap_iterator_alloc(wget_hashmap *h) WGET_GCC_MALLOC
Definition hashmap.c:94
struct wget_hashmap_st wget_hashmap
Type of the hashmap.
Definition wget.h:740
WGETAPI void wget_hashmap_set_key_destructor(wget_hashmap *h, wget_hashmap_key_destructor *destructor)
Definition hashmap.c:573
WGETAPI int wget_hashmap_put(wget_hashmap *h, const void *key, const void *value)
Definition hashmap.c:286
void wget_hashmap_key_destructor(void *key)
Type of the hashmap key destructor function.
Definition wget.h:752
WGETAPI void wget_hashmap_set_resize_factor(wget_hashmap *h, float factor)
Definition hashmap.c:629
WGETAPI int wget_hashmap_browse(const wget_hashmap *h, wget_hashmap_browse_fn *browse, void *ctx)
Definition hashmap.c:506
WGETAPI int wget_hashmap_sethashfunc(wget_hashmap *h, wget_hashmap_hash_fn *hash)
Definition hashmap.c:546
WGETAPI void wget_hashmap_set_value_destructor(wget_hashmap *h, wget_hashmap_value_destructor *destructor)
Definition hashmap.c:587
WGETAPI void wget_hashmap_iterator_free(wget_hashmap_iterator **iter)
Definition hashmap.c:109
unsigned int wget_hashmap_hash_fn(const void *key)
Type of the hashmap hash function.
Definition wget.h:746
WGETAPI void wget_hashmap_free(wget_hashmap **h)
Definition hashmap.c:435
WGETAPI void wget_hashmap_setcmpfunc(wget_hashmap *h, wget_hashmap_compare_fn *cmp)
Definition hashmap.c:530
WGETAPI wget_hashmap *NULLABLE wget_hashmap_create(int max, wget_hashmap_hash_fn *hash, wget_hashmap_compare_fn *cmp) WGET_GCC_MALLOC
Definition hashmap.c:167
void wget_hashmap_value_destructor(void *value)
Type of the hashmap value destructor function.
Definition wget.h:755
int wget_hashmap_browse_fn(void *ctx, const void *key, void *value)
Type of the hashmap browse callback function.
Definition wget.h:749
WGETAPI int wget_hashmap_remove_nofree(wget_hashmap *h, const void *key)
Definition hashmap.c:420
WGETAPI int wget_hashmap_remove(wget_hashmap *h, const void *key)
Definition hashmap.c:403
WGETAPI int wget_hashmap_size(const wget_hashmap *h) WGET_GCC_PURE
Definition hashmap.c:488
int wget_hashmap_compare_fn(const void *key1, const void *key2)
Type of the hashmap compare function.
Definition wget.h:743
WGETAPI void wget_hpkp_pin_add(wget_hpkp *hpkp, const char *pin_type, const char *pin_b64)
Definition hpkp.c:82
WGETAPI void wget_hpkp_get_pins(wget_hpkp *hpkp, const char **pin_types, size_t *sizes, const void **pins)
Definition hpkp.c:229
WGETAPI const char * wget_hpkp_get_host(wget_hpkp *hpkp)
Definition hpkp.c:251
wget_hpkp_db * wget_hpkp_db_init_fn(wget_hpkp_db *hpkp_db, const char *fname)
Definition wget.h:1503
WGETAPI void wget_hpkp_set_host(wget_hpkp *hpkp, const char *host)
Definition hpkp.c:145
WGETAPI void wget_hpkp_free(wget_hpkp *hpkp)
Definition hpkp.c:109
WGETAPI int wget_hpkp_get_n_pins(wget_hpkp *hpkp)
Definition hpkp.c:190
WGETAPI void wget_hpkp_get_pins_b64(wget_hpkp *hpkp, const char **pin_types, const char **pins_b64)
Definition hpkp.c:204
struct wget_hpkp_db_st wget_hpkp_db
Definition wget.h:1465
struct wget_hpkp_st wget_hpkp
Definition wget.h:1472
WGETAPI wget_hpkp *NULLABLE wget_hpkp_new(void)
Definition hpkp.c:129
WGETAPI void wget_hpkp_set_maxage(wget_hpkp *hpkp, int64_t maxage)
Definition hpkp.c:158
WGETAPI void wget_hpkp_set_include_subdomains(wget_hpkp *hpkp, bool include_subdomains)
Definition hpkp.c:179
WGETAPI bool wget_hpkp_get_include_subdomains(wget_hpkp *hpkp)
Definition hpkp.c:273
WGETAPI int64_t wget_hpkp_get_maxage(wget_hpkp *hpkp)
Definition hpkp.c:262
WGETAPI void wget_hsts_db_set_fname(wget_hsts_db *hsts_db, const char *fname)
Definition hsts.c:582
int wget_hsts_host_match_fn(const wget_hsts_db *hsts_db, const char *host)
Definition wget.h:1418
struct wget_hsts_db_st wget_hsts_db
Definition wget.h:1409
WGETAPI int wget_ready_2_transfer(int fd, int timeout, int mode)
Definition io.c:232
WGETAPI int wget_ready_2_read(int fd, int timeout)
Definition io.c:276
WGETAPI int wget_truncate(const char *path, off_t length)
Definition io.c:542
WGETAPI char *NULLABLE wget_read_file(const char *fname, size_t *size) WGET_GCC_MALLOC
Definition io.c:315
WGETAPI ssize_t wget_getline(char **buf, size_t *bufsize, FILE *fp)
Definition io.c:189
WGETAPI ssize_t wget_fdgetline(char **buf, size_t *bufsize, int fd)
Definition io.c:159
WGETAPI int wget_ready_2_write(int fd, int timeout)
Definition io.c:294
WGETAPI int wget_update_file(const char *fname, wget_update_load_fn *load_func, wget_update_save_fn *save_func, void *context)
Definition io.c:394
WGETAPI bool wget_ip_is_family(const char *host, int family) WGET_GCC_PURE
Definition ip.c:51
WGETAPI const char * wget_iri_relative_to_abs(const wget_iri *base, const char *val, size_t len, wget_buffer *buf)
Definition iri.c:908
WGETAPI wget_iri *NULLABLE wget_iri_parse_base(const wget_iri *base, const char *url, const char *encoding, int flags)
Definition iri.c:1003
WGETAPI const char * wget_iri_escape_query(const char *src, wget_buffer *buf) WGET_GCC_NONNULL_ALL
Definition iri.c:1155
WGETAPI char WGETAPI char WGETAPI char WGETAPI wget_iri_scheme wget_iri_set_scheme(wget_iri *iri, wget_iri_scheme scheme)
Definition iri.c:1455
WGETAPI const char * wget_iri_get_escaped_resource(const wget_iri *iri, wget_buffer *buf) WGET_GCC_NONNULL_ALL
Definition iri.c:1212
WGETAPI const char * wget_iri_get_escaped_host(const wget_iri *iri, wget_buffer *buf) WGET_GCC_NONNULL_ALL
Definition iri.c:1187
WGETAPI wget_iri * wget_iri_parse_ex(const char *uri, const char *encoding, int flags)
Definition iri.c:453
WGETAPI bool wget_iri_issubdelim(char c) WGET_GCC_CONST
Definition iri.c:238
WGETAPI char * wget_iri_unescape_inline(char *src) WGET_GCC_NONNULL_ALL
Definition iri.c:355
WGETAPI wget_iri * wget_iri_parse(const char *uri, const char *encoding)
Definition iri.c:438
WGETAPI const char *NULLABLE wget_iri_scheme_get_name(wget_iri_scheme scheme)
Definition iri.c:95
WGETAPI int wget_iri_compare(const wget_iri *iri1, const wget_iri *iri2) WGET_GCC_PURE
Definition iri.c:1035
WGETAPI bool wget_iri_isunreserved(char c) WGET_GCC_CONST
Definition iri.c:271
WGETAPI const char * wget_iri_escape_path(const char *src, wget_buffer *buf) WGET_GCC_NONNULL_ALL
Definition iri.c:1127
WGETAPI bool wget_iri_supported(const wget_iri *iri) WGET_GCC_PURE WGET_GCC_NONNULL_ALL
Definition iri.c:109
WGETAPI void wget_iri_free(wget_iri **iri)
Definition iri.c:418
WGETAPI bool wget_iri_isreserved(char c) WGET_GCC_CONST
Definition iri.c:260
WGETAPI char * wget_iri_unescape_url_inline(char *src) WGET_GCC_NONNULL_ALL
Definition iri.c:373
WGETAPI wget_iri *NULLABLE wget_iri_clone(const wget_iri *iri)
Definition iri.c:730
WGETAPI const char * wget_iri_escape(const char *src, wget_buffer *buf)
Definition iri.c:1092
WGETAPI const char *NULLABLE wget_iri_get_connection_part(const wget_iri *iri, wget_buffer *buf)
Definition iri.c:793
WGETAPI void wget_iri_free_content(wget_iri *iri)
Definition iri.c:392
WGETAPI bool wget_iri_isgendelim(char c) WGET_GCC_CONST
Definition iri.c:225
WGETAPI void *NULLABLE wget_list_append(wget_list **list, const void *data, size_t size) WGET_GCC_NONNULL_ALL
Definition list.c:96
WGETAPI void wget_list_remove(wget_list **list, void *elem) WGET_GCC_NONNULL_ALL
Definition list.c:147
WGETAPI void wget_list_free(wget_list **list) WGET_GCC_NONNULL_ALL
Definition list.c:249
WGETAPI int wget_list_browse(const wget_list *list, wget_list_browse_fn *browse, void *context) WGET_GCC_NONNULL((2))
Definition list.c:230
WGETAPI void *NULLABLE wget_list_prepend(wget_list **list, const void *data, size_t size) WGET_GCC_NONNULL_ALL
Definition list.c:132
struct wget_list_st wget_list
Definition wget.h:408
WGETAPI void *NULLABLE wget_list_getnext(const void *elem) WGET_GCC_PURE
Definition list.c:194
WGETAPI void *NULLABLE wget_list_getfirst(const wget_list *list) WGET_GCC_CONST
Definition list.c:172
WGETAPI void *NULLABLE wget_list_getlast(const wget_list *list) WGET_GCC_PURE
Definition list.c:183
char * wget_strmemdup(const void *m, size_t n)
Definition mem.c:89
LIBWGET_WARN_UNUSED_RESULT WGET_GCC_MALLOC WGETAPI char *NULLABLE wget_strdup(const char *s)
Definition mem.c:74
LIBWGET_WARN_UNUSED_RESULT WGET_GCC_NONNULL_ALL WGETAPI void *NULLABLE wget_strmemcpy_a(char *s, size_t ssize, const void *m, size_t n)
Definition mem.c:146
void * wget_memdup(const void *m, size_t n)
Definition mem.c:54
WGETAPI wget_tcp *NULLABLE wget_tcp_init(void)
Definition net.c:561
WGETAPI void wget_tcp_set_bind_interface(wget_tcp *tcp, const char *bind_interface)
Definition net.c:478
WGETAPI int wget_tcp_ready_2_transfer(wget_tcp *tcp, int flags)
Definition net.c:682
WGETAPI int wget_tcp_get_local_port(wget_tcp *tcp)
Definition net.c:348
WGETAPI ssize_t WGETAPI ssize_t WGETAPI ssize_t wget_tcp_write(wget_tcp *tcp, const char *buf, size_t count)
Definition net.c:973
WGETAPI void wget_tcp_set_ssl(wget_tcp *tcp, bool ssl)
Definition net.c:494
WGETAPI void wget_tcp_set_tls_false_start(wget_tcp *tcp, bool false_start)
Definition net.c:247
WGETAPI void wget_tcp_deinit(wget_tcp **tcp)
Definition net.c:585
WGETAPI bool wget_tcp_get_ssl(wget_tcp *tcp) WGET_GCC_PURE
Definition net.c:505
WGETAPI int wget_tcp_get_preferred_family(wget_tcp *tcp) WGET_GCC_PURE
Definition net.c:311
WGETAPI const char *NULLABLE wget_tcp_get_ip(wget_tcp *tcp) WGET_GCC_PURE
Definition net.c:516
WGETAPI void wget_tcp_set_tcp_fastopen(wget_tcp *tcp, bool tcp_fastopen)
Definition net.c:217
WGETAPI bool wget_tcp_get_tcp_fastopen(wget_tcp *tcp) WGET_GCC_PURE
Definition net.c:234
WGETAPI void wget_tcp_set_bind_address(wget_tcp *tcp, const char *bind_address)
Definition net.c:428
WGETAPI int wget_net_init(void)
Definition net.c:150
WGETAPI void wget_tcp_set_connect_timeout(wget_tcp *tcp, int timeout)
Definition net.c:385
WGETAPI void wget_tcp_close(wget_tcp *tcp)
Definition net.c:1100
WGETAPI int wget_tcp_connect(wget_tcp *tcp, const char *host, uint16_t port)
Definition net.c:773
WGETAPI void wget_tcp_set_preferred_family(wget_tcp *tcp, int family)
Definition net.c:300
WGETAPI void wget_tcp_set_dns(wget_tcp *tcp, wget_dns *dns)
Definition net.c:202
WGETAPI bool wget_tcp_get_tls_false_start(wget_tcp *tcp) WGET_GCC_PURE
Definition net.c:260
WGETAPI ssize_t wget_tcp_read(wget_tcp *tcp, char *buf, size_t count)
Definition net.c:922
WGETAPI int wget_tcp_get_family(wget_tcp *tcp) WGET_GCC_PURE
Definition net.c:337
WGETAPI void wget_tcp_set_protocol(wget_tcp *tcp, int protocol)
Definition net.c:274
WGETAPI int wget_tcp_get_timeout(wget_tcp *tcp) WGET_GCC_PURE
Definition net.c:412
WGETAPI void wget_tcp_tls_stop(wget_tcp *tcp)
Definition net.c:890
WGETAPI void wget_tcp_set_family(wget_tcp *tcp, int family)
Definition net.c:326
WGETAPI void wget_tcp_set_timeout(wget_tcp *tcp, int timeout)
Definition net.c:401
WGETAPI int wget_tcp_tls_start(wget_tcp *tcp)
Definition net.c:880
WGETAPI void wget_tcp_set_ssl_hostname(wget_tcp *tcp, const char *hostname)
Definition net.c:531
WGETAPI int wget_tcp_get_protocol(wget_tcp *tcp) WGET_GCC_PURE
Definition net.c:285
WGETAPI const char * wget_tcp_get_ssl_hostname(wget_tcp *tcp) WGET_GCC_PURE
Definition net.c:546
WGETAPI int wget_net_deinit(void)
Definition net.c:162
wget_ocsp_db * wget_ocsp_db_init_fn(wget_ocsp_db *ocsp_db, const char *fname)
Definition wget.h:1616
WGETAPI void wget_ocsp_db_set_fname(wget_ocsp_db *ocsp_db, const char *fname)
Definition ocsp.c:691
struct wget_ocsp_db_st wget_ocsp_db
Definition wget.h:1607
WGETAPI void wget_atom_get_urls_inline(const char *atom, wget_vector **urls)
Definition atom_url.c:116
WGETAPI void wget_sitemap_get_urls_inline(const char *sitemap, wget_vector **urls, wget_vector **sitemap_urls)
Definition sitemap_url.c:104
WGETAPI void wget_intercept_action_reject(wget_intercept_action *action) WGET_GCC_NONNULL_ALL
Definition plugin.c:84
WGETAPI const char * wget_plugin_get_name(wget_plugin *plugin) WGET_GCC_NONNULL_ALL
Definition plugin.c:47
WGETAPI void wget_downloaded_file_add_recurse_url(wget_downloaded_file *file, const wget_iri *iri)
Definition plugin.c:222
WGETAPI void wget_plugin_register_option_callback(wget_plugin *plugin, wget_plugin_option_callback *fn) WGET_GCC_NONNULL((1))
Definition plugin.c:72
WGETAPI const wget_iri * wget_downloaded_file_get_source_url(wget_downloaded_file *file)
Definition plugin.c:150
WGETAPI void wget_plugin_register_url_filter_callback(wget_plugin *plugin, wget_plugin_url_filter_callback *filter_fn)
Definition plugin.c:139
void wget_plugin_finalizer_fn(wget_plugin *plugin, int exit_status)
Definition wget.h:2648
int wget_plugin_option_callback(wget_plugin *plugin, const char *option, const char *value)
Definition wget.h:2668
WGETAPI void wget_intercept_action_set_alt_url(wget_intercept_action *action, const wget_iri *iri) WGET_GCC_NONNULL((1))
Definition plugin.c:108
WGETAPI int wget_downloaded_file_get_contents(wget_downloaded_file *file, const void **data, size_t *size)
Definition plugin.c:188
int wget_plugin_post_processor(wget_plugin *plugin, wget_downloaded_file *file)
Definition wget.h:2761
WGETAPI void wget_intercept_action_set_local_filename(wget_intercept_action *action, const char *local_filename) WGET_GCC_NONNULL((1))
Definition plugin.c:119
int wget_plugin_initializer_fn(wget_plugin *plugin)
Definition wget.h:2638
WGETAPI const char * wget_downloaded_file_get_local_filename(wget_downloaded_file *file)
Definition plugin.c:161
void wget_plugin_url_filter_callback(wget_plugin *plugin, const wget_iri *iri, wget_intercept_action *action)
Definition wget.h:2709
WGETAPI FILE * wget_downloaded_file_open_stream(wget_downloaded_file *file)
Definition plugin.c:199
WGETAPI uint64_t wget_downloaded_file_get_size(wget_downloaded_file *file)
Definition plugin.c:172
WGETAPI void wget_intercept_action_accept(wget_intercept_action *action) WGET_GCC_NONNULL_ALL
Definition plugin.c:97
WGETAPI void wget_plugin_register_finalizer(wget_plugin *plugin, wget_plugin_finalizer_fn *fn) WGET_GCC_NONNULL((1))
Definition plugin.c:57
WGETAPI bool wget_downloaded_file_get_recurse(wget_downloaded_file *file)
Definition plugin.c:210
WGETAPI void wget_plugin_register_post_processor(wget_plugin *plugin, wget_plugin_post_processor *fn)
Definition plugin.c:247
WGETAPI wget_bar *NULLABLE wget_bar_init(wget_bar *bar, int nslots)
Definition bar.c:469
WGETAPI void wget_bar_deinit(wget_bar *bar)
Definition bar.c:609
WGETAPI void wget_bar_slot_downloaded(wget_bar *bar, int slot, size_t nbytes)
Definition bar.c:565
WGETAPI void wget_bar_screen_resized(void)
Definition bar.c:708
WGETAPI void wget_bar_slot_deregister(wget_bar *bar, int slot) WGET_GCC_NONNULL_ALL
Definition bar.c:579
WGETAPI void wget_bar_update(wget_bar *bar) WGET_GCC_NONNULL_ALL
Definition bar.c:596
WGETAPI void wget_bar_set_speed_type(wget_report_speed type)
Definition bar.c:778
WGETAPI void wget_bar_write_line(wget_bar *bar, const char *buf, size_t len) WGET_GCC_NONNULL_ALL
Definition bar.c:725
WGETAPI void wget_bar_slot_begin(wget_bar *bar, int slot, const char *filename, int new_file, ssize_t filesize) WGET_GCC_NONNULL((1))
Definition bar.c:534
WGETAPI void wget_bar_print(wget_bar *bar, int slot, const char *s)
Definition bar.c:645
WGETAPI void wget_bar_set_slots(wget_bar *bar, int nslots) WGET_GCC_NONNULL_ALL
Definition bar.c:500
WGETAPI void wget_bar_free(wget_bar **bar)
Definition bar.c:630
WGETAPI void wget_bar_write_line_ext(wget_bar *bar, const char *buf, size_t len, const char *pre, const char *post) WGET_GCC_NONNULL_ALL
Definition bar.c:742
WGETAPI void wget_random_exit(void)
Definition random.c:94
WGETAPI void wget_srandom(unsigned int seed)
Definition random.c:130
WGETAPI void wget_random_init(void)
Definition random.c:81
WGETAPI int wget_random(void)
Definition random.c:105
WGETAPI wget_string *NULLABLE wget_robots_get_path(wget_robots *robots, int index)
Definition robots.c:235
WGETAPI const char *NULLABLE wget_robots_get_sitemap(wget_robots *robots, int index)
Definition robots.c:260
WGETAPI int wget_robots_get_path_count(wget_robots *robots)
Definition robots.c:222
WGETAPI void wget_robots_free(wget_robots **robots)
Definition robots.c:208
WGETAPI int wget_robots_get_sitemap_count(wget_robots *robots)
Definition robots.c:247
WGETAPI int wget_robots_parse(wget_robots **robots, const char *data, const char *client)
Definition robots.c:102
WGETAPI void wget_ssl_set_config_string(int key, const char *value)
Definition ssl_wolfssl.c:199
WGETAPI ssize_t wget_ssl_write_timeout(void *session, const char *buf, size_t count, int timeout) WGET_GCC_NONNULL_ALL
Definition ssl_wolfssl.c:1270
WGETAPI int wget_ssl_open(wget_tcp *tcp)
Definition ssl_wolfssl.c:930
WGETAPI void wget_ssl_set_config_int(int key, int value)
Definition ssl_wolfssl.c:280
WGETAPI void wget_ssl_set_config_object(int key, void *value)
Definition ssl_wolfssl.c:238
WGETAPI void wget_ssl_set_stats_callback_ocsp(wget_ocsp_stats_callback *fn, void *ctx)
Definition ssl_wolfssl.c:1328
WGETAPI void wget_ssl_set_stats_callback_tls(wget_tls_stats_callback *fn, void *ctx)
Definition ssl_wolfssl.c:1316
WGETAPI void wget_ssl_init(void)
Definition ssl_wolfssl.c:586
WGETAPI ssize_t wget_ssl_read_timeout(void *session, char *buf, size_t count, int timeout) WGET_GCC_NONNULL_ALL
Definition ssl_wolfssl.c:1197
WGETAPI void wget_ssl_close(void **session)
Definition ssl_wolfssl.c:1144
WGETAPI void wget_ssl_deinit(void)
Definition ssl_wolfssl.c:772
WGETAPI wget_stringmap *NULLABLE wget_stringmap_create(int max) WGET_GCC_MALLOC
Definition stringmap.c:95
wget_hashmap wget_stringmap
Type of the stringmap.
Definition wget.h:809
WGETAPI wget_stringmap *NULLABLE wget_stringmap_create_nocase(int max) WGET_GCC_MALLOC
Definition stringmap.c:112
WGETAPI void wget_thread_mutex_lock(wget_thread_mutex mutex)
Definition thread.c:115
WGETAPI bool wget_thread_support(void) WGET_GCC_CONST
Definition thread.c:298
WGETAPI int wget_thread_cond_destroy(wget_thread_cond *cond)
Definition thread.c:157
WGETAPI void wget_thread_mutex_unlock(wget_thread_mutex mutex)
Definition thread.c:125
WGETAPI int wget_thread_cond_init(wget_thread_cond *cond)
Definition thread.c:139
WGETAPI int wget_thread_join(wget_thread *thread)
Definition thread.c:270
WGETAPI int wget_thread_cond_signal(wget_thread_cond cond)
Definition thread.c:170
WGETAPI int wget_thread_cond_wait(wget_thread_cond cond, wget_thread_mutex mutex, long long ms)
Definition thread.c:185
WGETAPI wget_thread_id wget_thread_self(void) WGET_GCC_CONST
Definition thread.c:290
WGETAPI int wget_thread_mutex_destroy(wget_thread_mutex *mutex)
Definition thread.c:101
WGETAPI int wget_thread_mutex_init(wget_thread_mutex *mutex)
Definition thread.c:83
WGETAPI int wget_strcmp(const char *s1, const char *s2) WGET_GCC_PURE
Definition utils.c:77
WGETAPI int wget_match_tail(const char *s, const char *tail) WGET_GCC_PURE WGET_GCC_NONNULL_ALL
Definition utils.c:347
WGETAPI int wget_percent_unescape(char *src)
Definition utils.c:317
WGETAPI int wget_strncasecmp_ascii(const char *s1, const char *s2, size_t n) WGET_GCC_PURE
Definition utils.c:159
WGETAPI int wget_strncmp(const char *s1, const char *s2, size_t n) WGET_GCC_PURE
Definition utils.c:204
WGETAPI int wget_match_tail_nocase(const char *s, const char *tail) WGET_GCC_PURE WGET_GCC_NONNULL_ALL
Definition utils.c:367
WGETAPI int wget_strncasecmp(const char *s1, const char *s2, size_t n) WGET_GCC_PURE
Definition utils.c:231
WGETAPI int wget_strcasecmp(const char *s1, const char *s2) WGET_GCC_PURE
Definition utils.c:104
WGETAPI char *NULLABLE wget_strnglob(const char *str, size_t n, int flags) WGET_GCC_PURE
Definition utils.c:390
WGETAPI int wget_strcasecmp_ascii(const char *s1, const char *s2) WGET_GCC_PURE
Definition utils.c:131
WGETAPI long long wget_get_timemillis(void)
Definition utils.c:293
WGETAPI char * wget_human_readable(char *buf, size_t bufsize, uint64_t n)
Definition utils.c:434
WGETAPI char * wget_strtolower(char *s)
Definition utils.c:180
WGETAPI void wget_millisleep(int ms)
Definition utils.c:282
WGETAPI void wget_vector_setcmpfunc(wget_vector *v, wget_vector_compare_fn *cmp) WGET_GCC_NONNULL((2))
Definition vector.c:549
WGETAPI int WGETAPI int WGETAPI int wget_vector_replace(wget_vector *v, const void *elem, int pos) WGET_GCC_NONNULL((2))
Definition vector.c:315
WGETAPI int wget_vector_size(const wget_vector *v) WGET_GCC_PURE
Definition vector.c:497
WGETAPI int wget_vector_remove_nofree(wget_vector *v, int pos)
Definition vector.c:368
WGETAPI int wget_vector_insert(wget_vector *v, const void *elem, int pos) WGET_GCC_NONNULL((2))
Definition vector.c:164
WGETAPI bool wget_vector_contains(const wget_vector *v, const void *elem) WGET_GCC_NONNULL((2))
Definition vector.c:633
WGETAPI int wget_vector_insert_sorted(wget_vector *v, const void *elem) WGET_GCC_NONNULL((2))
Definition vector.c:182
WGETAPI int wget_vector_browse(const wget_vector *v, wget_vector_browse_fn *browse, void *ctx) WGET_GCC_NONNULL((2))
Definition vector.c:532
WGETAPI int wget_vector_move(wget_vector *v, int old_pos, int new_pos)
Definition vector.c:386
WGETAPI int wget_vector_findext(const wget_vector *v, int start, int direction, wget_vector_find_fn *find) WGET_GCC_NONNULL((4))
Definition vector.c:649
WGETAPI void wget_vector_clear_nofree(wget_vector *v)
Definition vector.c:481
WGETAPI int wget_vector_remove(wget_vector *v, int pos)
Definition vector.c:353
WGETAPI int wget_vector_add(wget_vector *v, const void *elem) WGET_GCC_NONNULL((2))
Definition vector.c:247
WGETAPI void *NULLABLE wget_vector_get(const wget_vector *v, int pos) WGET_GCC_PURE
Definition vector.c:511
WGETAPI void wget_vector_free(wget_vector **v)
Definition vector.c:442
WGETAPI int wget_vector_add_memdup(wget_vector *v, const void *elem, size_t size) WGET_GCC_NONNULL((2))
Definition vector.c:219
WGETAPI wget_vector *NULLABLE wget_vector_create(int max, wget_vector_compare_fn *cmp) WGET_GCC_MALLOC
Definition vector.c:69
WGETAPI void wget_vector_set_resize_factor(wget_vector *v, float off)
Definition vector.c:101
WGETAPI void wget_vector_sort(wget_vector *v)
Definition vector.c:586
WGETAPI int wget_vector_find(const wget_vector *v, const void *elem) WGET_GCC_NONNULL((2))
Definition vector.c:602
WGETAPI void wget_vector_clear(wget_vector *v)
Definition vector.c:459
WGETAPI int wget_vector_swap(wget_vector *v, int pos1, int pos2)
Definition vector.c:417
WGETAPI void wget_vector_set_destructor(wget_vector *v, wget_vector_destructor *destructor)
Definition vector.c:568
void * wget_malloc_function(size_t)
Type of malloc() function.
Definition wget.h:439
void * wget_calloc_function(size_t, size_t)
Type of calloc() function.
Definition wget.h:442
void * wget_realloc_function(void *, size_t)
Type of realloc() function.
Definition wget.h:445
void wget_free_function(void *)
Type of free() function.
Definition wget.h:448
WGETAPI int wget_xml_parse_buffer(const char *buf, wget_xml_callback *callback, void *user_ctx, int hints) WGET_GCC_NONNULL((1))
Definition xml.c:603
WGETAPI char * wget_xml_decode_entities_inline(char *src) WGET_GCC_NONNULL((1))
Definition xml.c:736
WGETAPI void wget_html_parse_file(const char *fname, wget_xml_callback *callback, void *user_ctx, int hints) WGET_GCC_NONNULL((1))
Definition xml.c:716
WGETAPI void wget_xml_parse_file(const char *fname, wget_xml_callback *callback, void *user_ctx, int hints) WGET_GCC_NONNULL((1))
Definition xml.c:650
WGETAPI void wget_html_parse_buffer(const char *buf, wget_xml_callback *callback, void *user_ctx, int hints) WGET_GCC_NONNULL((1))
Definition xml.c:631
size_t length
number of bytes in 'data'
Definition wget.h:550
bool release_buf
wget_buffer structure has been malloc'ed and must be freed
Definition wget.h:555
char * data
pointer to internal memory
Definition wget.h:548
bool error
a memory failure occurred, the result in 'data' is likely erroneous
Definition wget.h:556
bool release_data
'data' has been malloc'ed and must be freed
Definition wget.h:554
size_t size
capacity of 'data' (terminating 0 byte doesn't count here)
Definition wget.h:552
const char * url
zero-terminated copy the found URL
Definition wget.h:1721
size_t len
length of found URL
Definition wget.h:1717
const char * abs_url
the found URL converted into an absolute URL
Definition wget.h:1723
size_t pos
position of found URL within the scanned CSS data
Definition wget.h:1719
Definition decompressor.c:73
Definition dns_cache.c:50
const char * hostname
hostname/domain to be resolved
Definition wget.h:2804
const char * ip
resulting IP string
Definition wget.h:2805
long long dns_secs
milliseconds it took to resolve
Definition wget.h:2809
uint16_t port
port to be resolved
Definition wget.h:2807
Definition hashfile.c:685
wget_hpkp_db_load_fn * load
Callback replacing wget_hpkp_db_load().
Definition wget.h:1523
wget_hpkp_db_free_fn * free
Callback replacing wget_hpkp_db_free().
Definition wget.h:1517
wget_hpkp_db_check_pubkey_fn * check_pubkey
Callback replacing wget_hpkp_db_check_pubkey().
Definition wget.h:1519
wget_hpkp_db_deinit_fn * deinit
Callback replacing wget_hpkp_db_free().
Definition wget.h:1515
wget_hpkp_db_init_fn * init
Callback replacing wget_hpkp_db_free().
Definition wget.h:1513
wget_hpkp_db_save_fn * save
Callback replacing wget_hpkp_db_save().
Definition wget.h:1525
wget_hpkp_db_add_fn * add
Callback replacing wget_hpkp_db_add().
Definition wget.h:1521
wget_hsts_db_deinit_fn * deinit
Callback replacing wget_hsts_db_deinit().
Definition wget.h:1433
wget_hsts_db_save_fn * save
Callback replacing wget_hsts_db_save().
Definition wget.h:1441
wget_hsts_db_load_fn * load
Callback replacing wget_hsts_db_load().
Definition wget.h:1439
wget_hsts_db_free_fn * free
Callback replacing wget_hsts_db_free().
Definition wget.h:1435
wget_hsts_db_add_fn * add
Callback replacing wget_hsts_db_add().
Definition wget.h:1437
wget_hsts_db_init_fn * init
Callback replacing wget_hsts_db_init().
Definition wget.h:1431
wget_hsts_host_match_fn * host_match
Callback replacing wget_hsts_host_match().
Definition wget.h:1429
bool follow
if the 'follow' attribute was found in a META tag
Definition wget.h:1785
const char * encoding
the charset encoding set by the parsed document or NULL if none
Definition wget.h:1781
wget_vector * uris
list of found URLs (entries: wget_html_parsed_url)
Definition wget.h:1779
wget_string base
the BASE set in the document or NULL if none
Definition wget.h:1783
char attr[16]
name of the attribute containing the URL, e.g. 'href'
Definition wget.h:1768
char tag[16]
name of the HTML tag containing the URL, e.g. 'a'
Definition wget.h:1770
bool link_inline
1 = rel was 'stylesheet' or 'shortcut icon'
Definition wget.h:1772
wget_string url
URL within the parsed document (pointer and length).
Definition wget.h:1764
bool url_heap_allocated
1 = url.p was heap-allocated and needs freeing
Definition wget.h:1774
wget_string download
Value of additional 'download' attribute, the name to be saved to disk.
Definition wget.h:1766
const char * attribute
attribute of the HTML tag
Definition wget.h:1795
const char * name
name of HTML tag
Definition wget.h:1793
wget_stringmap * params
name/value pairs of the challenge
Definition wget.h:2092
const char * auth_scheme
name of the challenge, e.g. 'basic' or 'digest'
Definition wget.h:2090
const char * algorithm
name of the digest, e.g. 'md5'
Definition wget.h:2080
const char * encoded_digest
value of the digest
Definition wget.h:2082
int pri
value of pri param
Definition wget.h:2067
const char * type
value of type param or NULL
Definition wget.h:2065
const char * uri
URI reference.
Definition wget.h:2063
char method[8]
currently we just need HEAD, GET and POST
Definition wget.h:2142
wget_http_header_callback * header_callback
called after HTTP header has been received
Definition wget.h:2116
char esc_host_buf[64]
static buffer used by esc_host (avoids mallocs)
Definition wget.h:2140
bool response_keepheader
the application wants the response header data
Definition wget.h:2144
wget_iri_scheme scheme
scheme of the request for proxied connections
Definition wget.h:2136
wget_buffer esc_resource
URI escaped resource.
Definition wget.h:2128
const char * body
body data to be sent or NULL
Definition wget.h:2114
void * header_user_data
meant to be used in header callback function
Definition wget.h:2124
bool response_ignorelength
ignore the Content-Length in the response header
Definition wget.h:2146
wget_vector * headers
list of HTTP headers
Definition wget.h:2112
long long first_response_start
The time we read the first bytes back.
Definition wget.h:2152
void * body_user_data
meant to be used in body callback function
Definition wget.h:2126
wget_http_free_user_data_callback * user_data_callback
called when request object is free'd
Definition wget.h:2120
long long request_start
When this request was sent out.
Definition wget.h:2150
wget_http_body_callback * body_callback
called for each body data packet received
Definition wget.h:2118
char esc_resource_buf[256]
static buffer used by esc_resource (avoids mallocs)
Definition wget.h:2138
int32_t stream_id
HTTP2 stream id.
Definition wget.h:2134
bool debug_skip_body
if set, do not print the request body (e.g. because it's binary)
Definition wget.h:2148
wget_buffer esc_host
URI escaped host.
Definition wget.h:2130
size_t body_length
length of the body data
Definition wget.h:2132
void * user_data
user data for the request (used by async application code)
Definition wget.h:2122
const char * etag
ETag value.
Definition wget.h:2181
short major
HTTP major version.
Definition wget.h:2202
short minor
HTTP minor version.
Definition wget.h:2204
short code
request only status code
Definition wget.h:2206
wget_buffer * body
the body data
Definition wget.h:2185
wget_buffer * header
the raw header data if requested by the application
Definition wget.h:2183
bool length_inconsistent
set when length of data received is not same as Content-Length
Definition wget.h:2216
int icy_metaint
value of the SHOUTCAST header 'icy-metaint'
Definition wget.h:2200
long long response_end
when this response was received
Definition wget.h:2187
size_t content_length
length of the body data
Definition wget.h:2189
bool hsts
if hsts_maxage and hsts_include_subdomains are valid
Definition wget.h:2217
char reason[32]
reason string after the status code
Definition wget.h:2198
bool is_ip_address
If set, the hostname part is a literal IPv4/IPv6 address.
Definition wget.h:1285
bool path_allocated
If set, free path in iri_free().
Definition wget.h:1276
const char * host
Definition wget.h:1226
const char * password
Definition wget.h:1221
bool host_allocated
If set, free host in iri_free().
Definition wget.h:1273
const char * display
Definition wget.h:1211
bool fragment_allocated
If set, free fragment in iri_free().
Definition wget.h:1282
bool port_given
If set, port was explicitly given.
Definition wget.h:1270
const char * path
Definition wget.h:1231
wget_iri_scheme scheme
URI/IRI scheme (http or https).
Definition wget.h:1267
size_t msize
size of memory to hold the parsed URI, it contains 0 bytes
Definition wget.h:1261
const char * query
Definition wget.h:1236
bool keep_path_as_is
If set, the path part wasn't percent unescaped (e.g. for Location: headers in redirections).
Definition wget.h:1288
const char * userinfo
Definition wget.h:1216
const char * safe_uri
Definition wget.h:1206
bool query_allocated
If set, free query in iri_free().
Definition wget.h:1279
const char * uri
Definition wget.h:1200
const char * fragment
Definition wget.h:1241
uint16_t port
Port number.
Definition wget.h:1264
const char * connection_part
Definition wget.h:1251
size_t dirlen
Definition wget.h:1258
const char * password
password for the host
Definition wget.h:1682
uint16_t port
GNU extension: port number.
Definition wget.h:1684
const char * login
login/username for the host
Definition wget.h:1680
const char * host
hostname/domain/ip
Definition wget.h:1678
bool force
GNU extension: unused.
Definition wget.h:1686
wget_ocsp_db_add_host_fn * add_host
Callback replacing wget_ocsp_db_add_host().
Definition wget.h:1640
wget_ocsp_db_save_fn * load
Callback replacing wget_ocsp_db_load().
Definition wget.h:1642
wget_ocsp_db_deinit_fn * deinit
Callback replacing wget_ocsp_db_free().
Definition wget.h:1630
wget_ocsp_fingerprint_in_cache_fn * fingerprint_in_cache
Callback replacing wget_ocsp_db_fingerprint_in_cache().
Definition wget.h:1634
wget_ocsp_db_init_fn * init
Callback replacing wget_ocsp_db_free().
Definition wget.h:1628
wget_ocsp_db_add_fingerprint_fn * add_fingerprint
Callback replacing wget_ocsp_db_add_fingerprint().
Definition wget.h:1638
wget_ocsp_db_load_fn * save
Callback replacing wget_ocsp_db_save().
Definition wget.h:1644
wget_ocsp_hostname_is_valid_fn * hostname_is_valid
Callback replacing wget_ocsp_db_hostname_is_valid().
Definition wget.h:1636
wget_ocsp_db_free_fn * free
Callback replacing wget_ocsp_db_free().
Definition wget.h:1632
void * plugin_data
Plugin specific data. Plugins are free to assign any value to this.
Definition wget.h:2620
struct wget_plugin_vtable * vtable
Pointer to the vtable. Used by wget to implement functions.
Definition wget.h:2623
const char * p
pointer to memory region
Definition wget.h:1757
size_t len
length of memory region
Definition wget.h:1759
gl_cond_t cond
conditional
Definition thread.c:71
Definition tls_session.c:42
Definition tls_session.c:53