vg4->nodelink->add()
Add a link between two nodes, if not already linked.
SYNTAX
VG_BOOL
vg4->nodelink->add(struct VG_Nodelink *ndlnk,
const char *nodeid1,
const char *nodeid2,
int len,
VG_BOOL bidirect)
FUNCTION PARAMETERS
| ndlnk | Nodelink |
| nodeid1 | Node to link from |
| nodeid2 | Node to link to |
| len | Distance between the two nodes |
| bidirect | Whether also link from nodeid2 to nodeid1, if not already linked |
RETURN VALUE
Returns boolean:
- VG_TRUE: OK
- VG_FALSE: Not or just partially linked
DESCRIPTION
Add a link from nodeid1 to nodeid2, if not already linked.
If bidirect is set to VG_TRUE, also add the link from nodeid2 to nodeid1, if not already linked.
The link between two nodes can be used when moving from a start node to a destination node.
EXAMPLE
/* create a link from NODE1 to NODE2 with length 1 */ vg4->nodelink->add(ndlnk, "NODE1", "NODE2", 1, VG_FALSE); /* create a link from NODE1 to NODE2 and from NODE2 to NODE1 with length 1 */ vg4->nodelink->add(ndlnk, "NODE1", "NODE2", 1, VG_TRUE);
SEE ALSO