VgaGames4 - nodelink man-pages

[.. upper level ..]

vg4->nodelink->activate()

Activate a link between two nodes, using a stack of deactivation.

SYNTAX
void vg4->nodelink->activate(struct VG_Nodelink *ndlnk, const char *nodeid1, const char *nodeid2, VG_BOOL bidirect)

FUNCTION PARAMETERS
ndlnk Nodelink
nodeid1 Node from
nodeid2 Node to
bidirect Whether also activate link from nodeid2 to nodeid1

DESCRIPTION
Activate the link from nodeid1 to nodeid2, using a stack of deactivation. If bidirect is set to VG_TRUE, also activate the link from nodeid2 to nodeid1. (De)activation uses a stack, so that two deactivations need two activations to activate the link again.

EXAMPLE
/* NODE1 shall be linked to NODE2 */
printf("%d\n", vg4->nodelink->islink(ndlnk, "NODE1", "NODE2", VG_FALSE);  // 1 (linked)

/* deactivate the link from NODE1 to NODE2 */
vg4->nodelink->deactivate(ndlnk, "NODE1", "NODE2", VG_FALSE);
printf("%d\n", vg4->nodelink->islink(ndlnk, "NODE1", "NODE2", VG_FALSE);  // 0 (not linked)

/* deactivate the link from NODE1 to NODE2 again */
vg4->nodelink->deactivate(ndlnk, "NODE1", "NODE2", VG_FALSE);
printf("%d\n", vg4->nodelink->islink(ndlnk, "NODE1", "NODE2", VG_FALSE);  // 0 (not linked)

/* activate the link from NODE1 to NODE2 */
vg4->nodelink->activate(ndlnk, "NODE1", "NODE2", VG_FALSE);
printf("%d\n", vg4->nodelink->islink(ndlnk, "NODE1", "NODE2", VG_FALSE);  // 0 (not linked)

/* activate the link from NODE1 to NODE2 again */
vg4->nodelink->activate(ndlnk, "NODE1", "NODE2", VG_FALSE);
printf("%d\n", vg4->nodelink->islink(ndlnk, "NODE1", "NODE2", VG_FALSE);  // 1 (linked)

SEE ALSO
vg4->nodelink->deactivate() vg4->nodelink->reactivate()