seq-range-array.c revision ba14267101444b8f144091cefd437e1ea44d3e32
/* Copyright (c) 2005 Timo Sirainen */
#include "lib.h"
#include "array.h"
#include "seq-range-array.h"
{
/* it's already in the range */
return TRUE;
}
} else {
}
}
return FALSE;
}
{
if (!array_is_created(array))
if (count == 0) {
return;
}
/* quick checks */
/* grow last range */
return;
}
return;
}
/* grow down first range */
return;
}
return;
}
/* somewhere in the middle, array is sorted so find it with
binary search */
return;
idx++;
/* idx == count couldn't happen because we already handle it above */
/* merge */
}
/* merge */
}
} else {
}
}
{
if (!array_is_created(array))
return;
if (count == 0)
return;
/* quick checks */
/* outside the range */
return;
}
/* shrink last range */
else
return;
}
/* shrink up first range */
else
return;
}
/* somewhere in the middle, array is sorted so find it with
binary search */
else {
/* found it */
/* a single sequence range.
remove it entirely */
} else {
/* shrink the range */
}
/* shrink the range */
} else {
/* split the sequence range */
}
break;
}
}
}
{
/* remove first and last. this makes sure that everything between
can simply be deleted with array_delete().
FIXME: it would be faster if we did only one binary lookup here
and handled the splitting ourself.. */
return;
return;
/* find the beginning */
idx++;
return;
break;
}
}
{
unsigned int idx;
}