19 assert(one <= nodelist_size(list));
22 nodelist_append(list,
NULL);
26 size_t to_move =
sizeof(
node_t*) * (nodelist_size(list) - one - 1);
28 memmove(nodelist_at(list, one + 1), nodelist_at(list, one), to_move);
32 nodelist_set(list, one, n);
36 assert(np < nodelist_size(list));
37 for (
size_t i = np; i != 0; --i) {
40 nodelist_push_back(list,
head);
48 nodelist_remove(list, cn);
50 for (
size_t i = 0; i < nodelist_size(list); ++i) {
51 Agnode_t *here = nodelist_get(list, i);
66 for (
size_t i = 0; i < nodelist_size(l2); ++i) {
67 nodelist_append(l1, nodelist_get(l2, i));
79void printNodelist(nodelist_t * list)
81 for (
size_t i = 0; i < nodelist_size(list); ++i) {
82 fprintf(stderr,
"%s ",
agnameof(nodelist_get(list, i)));
char * agnameof(void *)
returns a string descriptor for the object.
#define neighbor(t, i, edim, elist)
void realignNodelist(nodelist_t *list, size_t np)
Make np new front of list, with current last hooked to current first.
void insertNodelist(nodelist_t *list, Agnode_t *cn, Agnode_t *neighbor, int pos)
void reverseAppend(nodelist_t *l1, nodelist_t *l2)
Create l1 @ (rev l2) Destroys and frees l2.
void appendNodelist(nodelist_t *list, size_t one, Agnode_t *n)
Add node after one.
static void concatNodelist(nodelist_t *l1, nodelist_t *l2)
attach l2 to l1.