+#define COMPARE_EVENTS(x,y) (compare_events(x,y)>0)
+#define COMPARE_EVENTS_SIMPLE(x,y) (compare_events_simple(x,y)>0)
+HEAP_DEFINE(queue,event_t,COMPARE_EVENTS);
+HEAP_DEFINE(hqueue,event_t,COMPARE_EVENTS_SIMPLE);
+
+typedef struct _status {
+ int32_t y;
+ actlist_t*actlist;
+ queue_t queue;
+ xrow_t*xrow;
+ windrule_t*windrule;
+ windcontext_t*context;
+ segment_t*ending_segments;
+
+ gfxpolystroke_t*strokes;
+#ifdef CHECKS
+ dict_t*seen_crossings; //list of crossing we saw so far
+ dict_t*intersecting_segs; //list of segments intersecting in this scanline
+ dict_t*segs_with_point; //lists of segments that received a point in this scanline
+#endif
+} status_t;
+
+
+int gfxpoly_num_segments(gfxpoly_t*poly)
+{
+ gfxpolystroke_t*stroke = poly->strokes;
+ int count = 0;
+ for(;stroke;stroke=stroke->next) {
+ count++;
+ }
+ return count;
+}