// External-compilation version of r3cts table layout solver header. // Don’t use this. Use r3cts.h. // An assertion that position[end] ≥ position[start] + width. // Can only be added to one r3_system at a time. typedef struct r3_constraint { // Requirement: start < end. int start, end, width; // prev is a link to previous constraint with same `end`. struct r3_constraint *prev; } r3_constraint; typedef struct { int n; // maximum number of values to compute, at least 1 int m; // actual number of values computed; initialize to 0 r3_constraint **latest; // points to a null-initialized array of size n } r3_system; // Returns NULL on success, error message string on failure (n too small) const char *r3_add_constraint(r3_system *r3, r3_constraint *c); // Places r3->m solver results in position[]. void r3_solve_system(r3_system *r3, int position[]);