17static int gt(
const void *a,
const void *b);
26 struct vertex *pt1, *pt2, *templ;
34 for (
size_t i = 0; i < input->
nvertices; i++)
35 pvertex[i] = vertex_list + i;
41 for (
size_t i = 0; i < input->
nvertices; i++) {
43 templ = pt2 =
prior(pvertex[i]);
44 for (k = 0; k < 2; k++) {
45 switch (
gt(&pt1, &pt2)) {
50 j++, tempa = tempa->
next)
75 "\n***ERROR***\n trying to delete a non line\n");
80 else if (tempa == all.
first) {
83 }
else if (tempa == all.
final) {
87 tempa->last->next = tempa->next;
88 tempa->next->last = tempa->last;
99 pt2 =
after(pvertex[i]);
106static int gt(
const void *a,
const void *b) {
107 const struct vertex *
const *i = a;
108 const struct vertex *
const *j = b;
109 if ((*i)->pos.x > (*j)->pos.x) {
112 if ((*i)->pos.x < (*j)->pos.x) {
115 if ((*i)->pos.y > (*j)->pos.y) {
118 if ((*i)->pos.y < (*j)->pos.y) {
Memory allocation wrappers that exit on failure.
static void * gv_calloc(size_t nmemb, size_t size)
static void * gv_alloc(size_t size)
static NORETURN void graphviz_exit(int status)
static int gt(const void *a, const void *b)
void find_ints(struct vertex vertex_list[], struct data *input, struct intersection ilist[])
static int find_intersection(vertex *l, vertex *m)
struct active_edge * next
struct active_edge * last