## EIntervalTree EIntervalTree — A utility for calculating intervals and recurrances |

## Functions

EIntervalTree * | e_intervaltree_new ()
gboolean | e_intervaltree_insert ()
gboolean | e_intervaltree_remove ()
GList * | e_intervaltree_search ()
void | e_intervaltree_destroy ()
void | e_intervaltree_dump ()

## Types and Values

#define | E_INTERVALTREE_DEBUG
struct | EIntervalTree
struct | EIntervalTreeClass

## Includes

    #include <libedata-cal/libedata-cal.h>

## Description

Implementation of the interval node as described in Introduction to Algorithms book by Cormen et al, chapter 14.3.

Basically, the interval tree is the red-black tree, the node key is the start of the interval.

## Functions

### e_intervaltree_new ()

    EIntervalTree *
    e_intervaltree_new (void);

Creates a new EIntervalTree.

#### Returns

The newly-created EIntervalTree.

Since 2.32

### e_intervaltree_insert ()

    gboolean
    e_intervaltree_insert (EIntervalTree *tree,
                           time_t start,
                           time_t end,
                           ECalComponent *comp);

#### Parameters

tree | interval tree |
start | start of the interval |
end | end of the interval |
comp | Component |

Since 2.32

### e_intervaltree_remove ()

    gboolean
    e_intervaltree_remove (EIntervalTree *tree,
                           const gchar *uid,
                           const gchar *rid);

#### Parameters

tree | an EIntervalTree |
uid | the uid of the component to remove |
rid | the recurrance id of the component to remove |

Since 2.32

### e_intervaltree_search ()

    GList *
    e_intervaltree_search (EIntervalTree *tree,
                           time_t start,
                           time_t end);

#### Parameters

tree | interval tree |
start | start of the interval |
end | end of the interval |

#### Returns

list of nodes that overlaps given interval or `NULL`.

Since 2.32

### e_intervaltree_destroy ()

    void
    e_intervaltree_destroy (EIntervalTree *tree);

#### Parameters

tree | an EIntervalTree |

Since 2.32

### e_intervaltree_dump ()

    void
    e_intervaltree_dump (EIntervalTree *tree);

## Types and Values

### E_INTERVALTREE_DEBUG

    #define E_INTERVALTREE_DEBUG 1

### struct EIntervalTree

    struct EIntervalTree {
    };

Contains only private data that should be read and manipulated using the functions below.

Since 2.32

### struct EIntervalTreeClass

    struct EIntervalTreeClass {
    };

Class structure for the EIntervalTree class.

Since 2.32