aboutsummaryrefslogtreecommitdiff
path: root/src/lib/seq-range-array.c
AgeCommit message (Collapse)AuthorLines
2020-10-22lib: seq-range-array - Assert-crash if array becomes 0..(uint32_t)-1Timo Sirainen-11/+32
2020-10-22lib: seq_range_array_add() - Reorder code flowTimo Sirainen-12/+8
2020-10-22lib: seq-range-array - Split off seq_range_array_add_slow_path()Timo Sirainen-26/+38
2020-10-22lib: seq-range-array - Use seq_range_length() internallyTimo Sirainen-2/+2
2020-02-06lib: Add seq_range_array_merge_n()Timo Sirainen-0/+24
2019-01-15global: Use array_push_frontAki Tuomi-1/+1
Re-run of 70540d8b3e0799113fa4c47e3b778efb4679f24f due to bad spatch usage
2019-01-15global: Use array_pop_frontAki Tuomi-1/+1
Re-run of 9b726934956ed9ca02077a82f7b2a1d74b7c9146 due to bad spatch usage.
2019-01-15global: Use array_push_back instead of array_appendAki Tuomi-4/+4
2018-01-01Updated copyright notices to include the year 2018.Stephan Bosch-1/+1
2017-01-01Updated copyright notices to include the year 2017.Stephan Bosch-1/+1
2016-12-24global: Replaced all instances of memset(p, 0, sizeof(*p)) with the new ↵Stephan Bosch-1/+1
i_zero() macro. Used the following script: C_FILES=`git ls-files *.c` H_FILES=`git ls-files *.h` for F in "$C_FILES $H_FILES"; do echo "$F" perl -p -i -e 's/safe_memset\(&\(?([^,]*)\)?,\s*0,\s*sizeof\(\g1\)\)/i_zero_safe(&$1)/g' $F perl -p -i -e 's/safe_memset\(([^,]*),\s*0,\s*sizeof\(\*\g1\)\)/i_zero_safe($1)/g' $F perl -p -i -e 's/memset\(&\(?([^,]*)\)?,\s*0,\s*sizeof\(\g1\)\)/i_zero(&$1)/g' $F perl -p -i -e 's/memset\(([^,]*),\s*0,\s*sizeof\(\*\g1\)\)/i_zero($1)/g' $F done
2016-12-08lib: Fix seq_range_array_invert() when input contains 2^32-1Timo Sirainen-5/+14
This caused next_min_seq to be wrapped to 0, which was handled wrong later on. Fixes: Panic: file mail-index-map.c: line 549 (mail_index_map_lookup_seq_range): assertion failed: (first_uid > 0)
2016-12-02lib: seq_range_array_*(): Fix seq2=2^32-1 handlingTimo Sirainen-1/+1
Adding/merging it when it already existed added duplicated seq_range.
2016-01-13global: freshen copyrightTimo Sirainen-1/+1
git ls-files | xargs perl -p -i -e 's/(\d+)-201[0-5]/$1-2016/g;s/ (201[0-5]) Dovecot/ $1-2016 Dovecot/'
2015-01-21lib: seq-range-array - add range changesPhil Carmody-2/+54
Pull the _add_range() guts into a private helper function, and add a new _add_range_count() helper which also returns the number of SEQs added. Expand the tests to test this new functionality. Signed-off-by: Phil Carmody <phil@dovecot.fi>
2015-01-05global: freshen copyrightPhil Carmody-1/+1
Robomatically: git ls-files | xargs perl -p -i -e 's/(\d+)-201[0-4]/$1-2015/g;s/ (201[0-4]) Dovecot/ $1-2015 Dovecot/' Happy 2015 everyone! Signed-off-by: Phil Carmody <phil@dovecot.fi>
2014-05-05Added seq_range_array_remove_nth()Timo Sirainen-0/+22
2014-02-04Updated copyright notices to include year 2014.Timo Sirainen-1/+1
2013-05-15Added asserts to binary searches to make sure we don't go to infinite loop.Timo Sirainen-0/+2
Using idx=left+(right-left)/2 would have worked also to allow 4GB sizes, but since none of the places in the code are likely to reach 2GB we might as well just add an assert. (Also if they do reach 2GB, it could be possible that they could reach also above 4GB and cause problems. Better to see an early error.)
2013-02-24seq_range_array_add(): Fixed handling sequence ranges that contain zeros.Timo Sirainen-12/+12
2013-02-02Oops :) Update copyrights to 2013 without breaking all .c files.Timo Sirainen-1/+1
2013-02-02Updated copyright notices to include year 2013.Timo Sirainen-1/+1
2012-06-25seq-range-array: Reverted most of recent API changes.Timo Sirainen-44/+23
Added ATTR_NOWARN_UNUSED_RESULT for the functions whose return value can safely be ignored.
2012-06-25Make sure we check all the functions' return values. Minor API changes to ↵Timo Sirainen-14/+25
simplify this. Checked using a patched clang that adds attribute(warn_unused_result) to all functions. This commit fixes several error handling mistakes.
2012-06-24seq_range_array_remove() now returns void. Added seq_ranger_array_try_remove().Timo Sirainen-3/+8
2012-06-24seq_range_array_add() API changed. Added other functions to provide the less ↵Timo Sirainen-5/+14
common use cases.
2012-04-30seq_range_array_add(): Ranges weren't always merged when they could have.Timo Sirainen-9/+13
This didn't break anything, but it used up more memory than necessary.
2012-02-12Updated copyright notices to include year 2012.Timo Sirainen-1/+1
2011-03-04Updated copyright notices to include year 2011.Timo Sirainen-1/+1
2010-04-19seq_range_array_add() returns now TRUE if seq was already in array.Timo Sirainen-7/+8
--HG-- branch : HEAD
2010-04-05Removed dead code.Timo Sirainen-1/+1
--HG-- branch : HEAD
2010-01-25Updated copyright notices to include year 2010.Timo Sirainen-1/+1
--HG-- branch : HEAD
2009-10-08Use array_foreach*() in some useful places.Timo Sirainen-13/+8
--HG-- branch : HEAD
2009-01-06Updated copyright notices to include year 2009.Timo Sirainen-1/+1
--HG-- branch : HEAD
2008-06-20Added seq_range_array_have_common().Timo Sirainen-0/+21
--HG-- branch : HEAD
2008-06-18Renamed seq_range_array_remove_invert_range() to seq_range_array_intersect().Timo Sirainen-2/+2
--HG-- branch : HEAD
2008-06-09Added seq_range_count().Timo Sirainen-0/+11
--HG-- branch : HEAD
2008-06-05Added seq_range_array_merge()Timo Sirainen-0/+16
--HG-- branch : HEAD
2008-03-15Added seq_range_array_iter_nth()Timo Sirainen-0/+34
--HG-- branch : HEAD
2008-02-29Implemented optimized seq_range_array_add_range().Timo Sirainen-9/+37
--HG-- branch : HEAD
2008-01-06Added unoptimized seq_range_array_add_range()Timo Sirainen-0/+8
--HG-- branch : HEAD
2008-01-01Updated copyright notices to include year 2008.Timo Sirainen-1/+1
--HG-- branch : HEAD
2007-12-02Added seq_range_array_remove_seq_range() andTimo Sirainen-0/+38
seq_range_array_remove_invert_range(). --HG-- branch : HEAD
2007-11-24seq_range_array_remove_range(): Don't break if seq2 is -1U.Timo Sirainen-2/+3
--HG-- branch : HEAD
2007-11-10Added seq_range_array_invert()Timo Sirainen-0/+50
--HG-- branch : HEAD
2007-09-16Replaced my Copyright notices. The year range always ends with 2007 now.Timo Sirainen-1/+1
My name was replaced with "Dovecot authors". In many cases I didn't really even own the copyright, so this is more correct. --HG-- branch : HEAD
2007-07-19seq_range_array_remove_range() sometimes didn't remove one sequence from theTimo Sirainen-1/+1
middle. --HG-- branch : HEAD
2007-07-17seq_range_array_remove_range() returns now how many sequences were removed.Timo Sirainen-8/+13
--HG-- branch : HEAD
2007-07-16Recent flag handling rewrite. Still not perfect with maildir.Timo Sirainen-7/+8
--HG-- branch : HEAD
2006-12-20Added seq_range_array_remove_range()Timo Sirainen-0/+35
--HG-- branch : HEAD