Commit Graph

31 Commits

Author SHA1 Message Date
188989e067 Update copyright year 2024-01-07 12:41:02 +01:00
15ba1db248 Update copyrights 2023-08-31 12:57:30 +02:00
3dc7f71098 Update copyright year 2022-02-25 17:46:43 +01:00
22162f82b2 Update copyright year 2021-01-22 21:58:38 +01:00
59d9ecd9c0 * Update copyright year to 2020 2020-01-10 00:33:02 +01:00
4b9edbad2d Update Copyright statements to be compatible with update-copyright module 2019-09-10 23:41:56 +02:00
500a370ac2 Rename wget_hashmap types
* include/wget/wget.h: Rename wget_hashmap types
* libwget/dns_cache.c: Likewise
* libwget/hashmap.c: Likewise
* libwget/hpkp.c: Likewise
* libwget/hsts.c: Likewise
* libwget/http.c: Likewise
* libwget/netrc.c: Likewise
* libwget/ocsp.c: Likewise
* libwget/stringmap.c: Likewise
* libwget/tls_session.c: Likewise
* src/blacklist.c: Likewise
* src/host.c: Likewise
* src/wget.c: Likewise
2019-08-12 11:12:27 +02:00
12f1a03693 Changed G_GNUC_WGET prefix to WGET_GCC
* include/wget/wget.h: Changed G_GNUC_WGET prefix to WGET_GCC
* */*.[ch]: Likewise
2019-08-08 17:13:24 +02:00
2750a09f77 Rename wget_stringmap_t -> wget_stringmap
* include/wget/wget.h: Rename wget_stringmap_t -> wget_stringmap
* libwget/stringmap.c: Likewise
* src/options.c: Likewise
* src/plugin.c: Likewise
* src/wget.c: Likewise
* unit-tests/stringmap_perf.c: Likewise
* unit-tests/test.c: Likewise
2019-07-18 12:42:19 +02:00
6a3f1d53c0 Typedef hashmap functions not as pointer
* include/wget/wget.h: Remove '*' signature from function typedefs
* libwget/*.c: Amend casts
* src/*.c: Likewise
* unit-tests/stringmap_perf.c: Likewise
2019-07-17 12:11:09 +02:00
144d40beab Inline most of stringmap API
* include/wget/wget.h: Add stringmap API (mostly) as static inline functions
* libwget/stringmap.c: Remove stringmap implementation (mostly)
2019-06-21 16:04:36 +02:00
39d6f15873 Add memory checks and error return value to hashmap API
* include/wget/wget.h: wget_hashmap_sethashfunc() returns int
* libwget/hashmap.c: Check memory allocations
* libwget/stringmap.c: wget_stringmap_sethashfunc() returns int
2019-06-21 16:04:33 +02:00
d55c540b1b Simplify hashmap and stringmap API
* include/wget/wget.h: Replace _put() by _put_noalloc() functions to
  keep memory allocations outside the library functions.
* libwget/stringmap.c: Likewise
* libwget/hashmap.c: Likewise
* libwget/*.c: Likewise
* src/*.c: Likewise
* unit-tests/*.c: Likewise
2019-06-21 16:04:29 +02:00
e4c660ebc1 Fix hashmap + stringmap docs
* include/wget/wget.h: Add docs for hashmap/stringmap typedefs,
  fix argument of wget_hashmap_iterator_free()
* libwget/hashmap.c: Add docs, fix wget_hashmap_iterator_free()
* libwget/stringmap.c: Add docs
* unit-tests/test.c: Fix call to wget_stringmap_iterator_free()
2019-01-04 13:19:29 +01:00
7537c9fd86 Add iterators for hashmap and stringmap
* include/wget/wget.h: New functions wget_hashmap_iterator_alloc(),
  wget_hashmap_iterator_free(), wget_hashmap_iterator_next(),
  also for stringmap.
* libwget/hashmap.c: Implementation of the above functions
* libwget/stringmap.c: Add wget_stringmap_iterator_next()
* unit-tests/test.c: Add tests using stringmap iterator

This functionality is sometimes more handy than the *_browse() API
with callback functions and context variables.
2019-01-03 14:14:07 +01:00
744fa13072 Rename container set functions
* include/wget/wget.h:
  rename wget_vector_set_growth_policy() to wget_vector_set_resize_factor(),
  rename wget_hashmap_set_growth_policy() to wget_hashmap_set_resize_factor(),
  rename wget_hashmap_setloadfactor() to wget_hashmap_set_load_factor(),
  rename wget_stringmap_setloadfactor() to wget_stringmap_set_load_factor(),
  rename wget_stringmap_set_growth_policy() to wget_stringmap_set_resize_factor().
* libwget/hashmap.c: Likewise
* libwget/stringmap.c: Likewise
* libwget/vector.c: Likewise
2019-01-02 17:18:14 +01:00
1328e17609 Simplify hasmap/stringmap/vector API
* include/wget/wget.h: Remove wget_hashmap_get_null() and
  wget_stringmap_get_null(),
  change params and return value of wget_hashmap_get() and
  wget_stringmap_get().
* libwget/hashmap.c: Remove wget_hashmap_get_null(),
  change params and return value of wget_hashmap_get(),
  simplify hashmap_find_entry().
* libwget/stringmap.c: Remove wget_stringmap_get(),
  change params and return value of wget_stringmap_get().
* libwget/dns_cache.c: Amend for new API
* libwget/hpkp.c: Likewise
* libwget/hsts.c: Likewise
* libwget/http.c: Likewise
* libwget/netrc.c: Likewise
* libwget/ocsp.c: Likewise
* libwget/tls_session.c: Likewise
* src/host.c: Likewise
* src/options.c: Likewise
* src/plugin.c: Likewise
* src/stats_site.c: Likewise
* unit-tests/test.c: Likewise
2019-01-02 16:35:11 +01:00
8a96e670ad Use float for container growth policy
* include/wget/wget.h: Use float for *_set_growth_policy()
* libwget/hashmap.c: Use float for wget_hashmap_set_growth_policy()
* libwget/stringmap.c: Use float for wget_stringmap_set_growth_policy()
* libwget/vector.c: Use float for wget_vector_set_growth_policy()

Additionally, the +/- logic has been reversed in the above functions.
2019-01-02 13:20:50 +01:00
cdb3600791 Update copyrigght to 2019 2019-01-02 12:42:53 +01:00
3ab8e40ffe Document hashmap and stringmap
* include/wget/wget.h: Cleanups
* libwget/hashmap.c: Documentation + cleanups
* libwget/stringmap.c: Documentation + cleanups
* libwget/vector.c: Fix doxygen issue
2018-03-27 16:46:00 +02:00
012728057e * libwget/stringmap.c: Suppress clang warning about integer overflow
The hash functions rely on integer overflow.
Found by fuzzing.
2017-08-01 12:12:19 +02:00
623e3754fa Allow setting destructor to keys to wget_stringmap_t
* include/wget/wget.h: Add wget_stringmap_key_destructor_t and
                       wget_stringmap_set_key_destructor() declaration.
* libwget/stringmap.c: Add wget_stringmap_set_key_destructor()
                       definition.
2017-06-11 16:44:01 +00:00
08ed5088f8 Remove rarely used parameter 'off' from wget_hashmap_create()
* libwget/hashmap.c: Remove 'off' parameter, now defaults to -2,
                     Add wget_hashmap_set_growth_policy() to set 'off'
* include/wget/wget.h: likewise
* libwget/hpkp.c: Adapt to the change in wget_hashmap_create()
* libwget/hsts.c: Likewise
* libwget/netrc.c: Likewise
* libwget/ocsp.c: Likewise
* libwget/stringmap.c: Likewise
* libwget/test_linking.c: Likewise
* libwget/tls_session.c: Likewise
* src/blacklist.c: Likewise
* src/host.c: Likewise
* src/wget.c: Likewise
2017-06-11 16:13:14 +00:00
c6ee3d79ad Fix syntax-check 'sc_prohibit_have_config_h'
* cfg.mk: Remove sc_prohibit_have_config_h from local-checks-to-skip
* libwget/*.c: Include <config.h> unconditionally
* src/*.c: Likewise
* tests/*.c: Likewise
2017-04-30 22:01:34 +02:00
ec396c577f Fix URLs to HTTPS where possible 2017-02-28 15:31:30 +01:00
bfcd65c12b Use typedefs for function pointer arguments
* include/wget/wget.h: Add typedefs
* libwget/cookie.c: Use typedefs
* libwget/css.c: Likewise
* libwget/css_url.c: Likewise
* libwget/decompressor.c: Likewise
* libwget/hashmap.c: Likewise
* libwget/hsts.c: Likewise
* libwget/http.c: Likewise
* libwget/init.c: Likewise
* libwget/io.c: Likewise
* libwget/list.c: Likewise
* libwget/logger.c: Likewise
* libwget/metalink.c: Likewise
* libwget/net.c: Likewise
* libwget/netrc.c: Likewise
* libwget/ocsp.c: Likewise
* libwget/private.h: Likewise
* libwget/robots.c: Likewise
* libwget/stringmap.c: Likewise
* libwget/tls_session.c: Likewise
* libwget/vector.c: Likewise
* libwget/xml.c: Likewise
* src/blacklist.c: Likewise
* src/host.c: Likewise
* src/options.c: Likewise
* src/wget.c: Likewise
* tests/stringmap_perf.c: Likewise
* tests/test.c: Likewise
2017-01-23 14:43:17 +01:00
9568b0c87e Rename include/libwget.h to include/wget/wget.h+wgetver.h 2016-09-30 09:47:32 +02:00
dd3c2f63b2 Updated copyright year for all relevant files 2016-01-25 13:06:21 +01:00
1e8c3848d0 Call wget_str(n)casecmp_ascii instead of str(n)casecmp
* examples/print_css_urls2.c, libwget/cookie.c, libwget/css.c,
  libwget/html_url.c, libwget/http.c, libwget/iri.c, libwget/metalink.c,
  libwget/net.c, libwget/robots.c, libwget/ssl_gnutls.c,
  libwget/stringmap.c, libwget/xml.c, src/job.c, src/options.c, src/wget.c:
  Call wget_str(n)casecmp_ascii instead of str(n)casecmp
2016-01-11 16:26:25 +01:00
0f8e49128a Transfer copyright to Free Software Foundation, Inc. 2015-09-22 11:50:06 +02:00
c6b0e461a1 Transform Mget into Wget 2015-09-19 22:54:38 +02:00