lib/string_map: simulate stable sorting qsort(3) does not promise stability, and recent versions of glibc have been showing more unstable behaviour [2]. Michael Gruber observed [1] test breakage due to changing output order for message properties. We provide a sorting order of (key,value) pairs that _looks_ stable by breaking ties based on value if keys are equal. Internally there may be some instability in the case of duplicate (key,value) pairs, but it should not be observable via the iterator API. [1]: id:CAA19uiSHjVFmwH0pMC7WwDYCOSzu3yqNbuYhu3ZMeNNRh313eA@mail.gmail.com [2]: id:87msv3i44u.fsf@oldenburg.str.redhat.com
lib: run uncrustify This is the result of running $ uncrustify --replace --config ../devel/uncrustify.cfg *.c *.h *.cc in the lib directory
lib: add _notmuch_string_map_set This will be used (and tested) by the configuration caching code to be added in the next commit.
lib/string_map: fix return type of string_cmp I can't figure out how checking the sign of a bool ever worked. The following program demonstrates the problem (i.e. for me it prints 1). #include <stdio.h> #include <stdbool.h> int main(int argc, char **argv) { bool x; x = -1; printf("x = %d\n", x); } This seems to be mandated by the C99 standard 6.3.1.2.
move more http -> https Correct URLs that have crept into the notmuch codebase with http:// when https:// is possible. As part of this conversion, this changeset also indicates the current preferred upstream URLs for both gmime and sup. the new URLs are https-enabled, the old ones are not. This also fixes T310-emacs.sh, thanks to Bremner for catching it.
lib: convert notmuch_bool_t to stdbool internally C99 stdbool turned 18 this year. There really is no reason to use our own, except in the library interface for backward compatibility. Convert the lib internally to stdbool.
lib: add talloc reference from string map iterator to map This is needed so that when the map is modified during traversal, and thus unlinked by the database code, the map is not disposed of until the iterator is done with it.
lib: extend private string map API with iterators Support for prefix based iterators is perhaps overengineering, but I wanted to mimic the existing database_config API.
lib: private string map (associative array) API The choice of array implementation is deliberate, for future iterator support