stasis-aries-wal/lladd/io/rangeTracker.h

35 lines
902 B
C
Raw Normal View History

typedef struct range {
long start;
2007-01-25 22:38:22 +00:00
long stop;
} range;
typedef struct transition {
long pos;
// negative if end of range. Never zero
int delta;
// >= abs(delta). Number of times the range immediately less than
// this point is pinned.
int pins;
} transition;
typedef struct rangeTracker rangeTracker;
rangeTracker * rangeTrackerInit(int quantization);
void rangeTrackerDeinit(rangeTracker * rt);
/**
Add a new range
@return a null terminated array of newly-pinned, quantized ranges
*/
range ** rangeTrackerAdd(rangeTracker * rt, const range * r);
/**
Remove a range
@return a null terminated array of newly-unpinned, quantized ranges
*/
range ** rangeTrackerRemove(rangeTracker * rt, const range * r);
2007-01-25 22:38:22 +00:00
const transition ** rangeTrackerEnumerate(rangeTracker * rt);
char * rangeToString(const range * r);
char * transitionToString(const transition * t);