18static int gt(
const void *a,
const void *b);
21 intersections_t *ilist) {
25 struct vertex *pt1, *pt2, *templ;
30 pvertex[i] = vertex_list + i;
38 templ = pt2 =
prior(pvertex[i]);
39 for (k = 0; k < 2; k++) {
40 switch (
gt(&pt1, &pt2)) {
43 for (
size_t j = 0; j <
LIST_SIZE(&all); ++j) {
59 "\n***ERROR***\n trying to delete a non line\n");
70 pt2 =
after(pvertex[i]);
78static int gt(
const void *a,
const void *b) {
79 const struct vertex *
const *i = a;
80 const struct vertex *
const *j = b;
81 if ((*i)->pos.x > (*j)->pos.x) {
84 if ((*i)->pos.x < (*j)->pos.x) {
87 if ((*i)->pos.y > (*j)->pos.y) {
90 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[], size_t nvertices, intersections_t *ilist)
static int find_intersection(vertex *l, vertex *m)
type-generic dynamically expanding list
#define LIST_APPEND(list, item)
#define LIST_REMOVE(list, item)
#define LIST_GET(list, index)