summaryrefslogtreecommitdiff
path: root/lib/string-map.c
AgeCommit message (Collapse)Author
2023-11-28lib/string_map: simulate stable sortingDavid Bremner
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
2021-03-13lib: run uncrustifyuncrustify
This is the result of running $ uncrustify --replace --config ../devel/uncrustify.cfg *.c *.h *.cc in the lib directory
2021-02-06lib: add _notmuch_string_map_setDavid Bremner
This will be used (and tested) by the configuration caching code to be added in the next commit.
2019-03-05lib/string_map: fix return type of string_cmpDavid Bremner
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.
2018-05-03move more http -> httpsDaniel Kahn Gillmor
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.
2017-10-09lib: convert notmuch_bool_t to stdbool internallyJani Nikula
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.
2016-09-24lib: add talloc reference from string map iterator to mapDavid Bremner
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.
2016-09-21lib: extend private string map API with iteratorsDavid Bremner
Support for prefix based iterators is perhaps overengineering, but I wanted to mimic the existing database_config API.
2016-09-21lib: private string map (associative array) APIDavid Bremner
The choice of array implementation is deliberate, for future iterator support