#ifndef _MIN_HEAP_H_
#define _MIN_HEAP_H_
#include "event.h"
#include "evutil.h"
min_heap_t;
static inline void min_heap_ctor(min_heap_t* s);
static inline void min_heap_dtor(min_heap_t* s);
static inline void min_heap_elem_init(struct event* e);
static inline int min_heap_elem_greater(struct event *a, struct event *b);
static inline int min_heap_empty(min_heap_t* s);
static inline unsigned min_heap_size(min_heap_t* s);
static inline struct event* min_heap_top(min_heap_t* s);
static inline int min_heap_reserve(min_heap_t* s, unsigned n);
static inline int min_heap_push(min_heap_t* s, struct event* e);
static inline struct event* min_heap_pop(min_heap_t* s);
static inline int min_heap_erase(min_heap_t* s, struct event* e);
static inline void min_heap_shift_up_(min_heap_t* s, unsigned hole_index, struct event* e);
static inline void min_heap_shift_down_(min_heap_t* s, unsigned hole_index, struct event* e);
int min_heap_elem_greater(struct event *a, struct event *b)
{ … }
void min_heap_ctor(min_heap_t* s) { … }
void min_heap_dtor(min_heap_t* s) { … }
void min_heap_elem_init(struct event* e) { … }
int min_heap_empty(min_heap_t* s) { … }
unsigned min_heap_size(min_heap_t* s) { … }
struct event* min_heap_top(min_heap_t* s) { … }
int min_heap_push(min_heap_t* s, struct event* e)
{ … }
struct event* min_heap_pop(min_heap_t* s)
{ … }
int min_heap_erase(min_heap_t* s, struct event* e)
{ … }
int min_heap_reserve(min_heap_t* s, unsigned n)
{ … }
void min_heap_shift_up_(min_heap_t* s, unsigned hole_index, struct event* e)
{ … }
void min_heap_shift_down_(min_heap_t* s, unsigned hole_index, struct event* e)
{ … }
#endif