typedef enum {DIR_UP, DIR_DOWN, DIR_UNKNOWN} segment_dir_t;
typedef enum {EVENT_CROSS, EVENT_END, EVENT_START, EVENT_HORIZONTAL} eventtype_t;
typedef enum {SLOPE_POSITIVE, SLOPE_NEGATIVE} slope_t;
typedef enum {DIR_UP, DIR_DOWN, DIR_UNKNOWN} segment_dir_t;
typedef enum {EVENT_CROSS, EVENT_END, EVENT_START, EVENT_HORIZONTAL} eventtype_t;
typedef enum {SLOPE_POSITIVE, SLOPE_NEGATIVE} slope_t;