GraphUnmarkEdgeForRemoval
Description
Remove a pending edge-removal mark before commit.
Parameters
| Name | Direction | Description |
|---|---|---|
g |
in,out | Graph owning the edge. |
from |
in | Source node id. |
to |
in | Destination node id. |
Success
Returns true. The removal mark on the matching edge entry has been cleared. edge_count is unchanged.
Failure
Returns false when the edge was not marked. The graph is not modified.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Ops.c:173:
result = result && GraphEdgeMarkedForRemoval(&graph, a, b);
result = result && !GraphMarkEdgeForRemoval(&graph, a, b);
result = result && GraphUnmarkEdgeForRemoval(&graph, a, b);
result = result && !GraphEdgeMarkedForRemoval(&graph, a, b);
result = result && !GraphUnmarkEdgeForRemoval(&graph, a, b);- In
Ops.c:175:
result = result && GraphUnmarkEdgeForRemoval(&graph, a, b);
result = result && !GraphEdgeMarkedForRemoval(&graph, a, b);
result = result && !GraphUnmarkEdgeForRemoval(&graph, a, b);
result = result && (GraphCommitChanges(&graph) == 0);
result = result && GraphHasEdge(&graph, a, b);- In
Ops.c:204:
result = result && GraphEdgeMarkedForRemoval(&graph, a, b);
result = result && GraphEdgeMarkedForRemoval(&graph, a, c);
result = result && GraphUnmarkEdgeForRemoval(&graph, a, b);
result = result && !GraphEdgeMarkedForRemoval(&graph, a, b);
result = result && GraphEdgeMarkedForRemoval(&graph, a, c);- In
Ops.c:546:
// false rather than aborting.
static bool test_unmark_edge_stale_from_deadend(void) {
WriteFmt("Testing GraphUnmarkEdgeForRemoval rejects a stale from id (should abort)\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Ops.c:560:
(void)GraphAddNodeR(&graph, 99); // reuse a's slot, a is now stale
(void)GraphUnmarkEdgeForRemoval(&graph, a, b);
GraphDeinit(&graph);- In
Ops.c:570:
// valid `from` with a stale `to` must abort.
static bool test_unmark_edge_stale_to_deadend(void) {
WriteFmt("Testing GraphUnmarkEdgeForRemoval rejects a stale to id (should abort)\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Ops.c:584:
(void)GraphAddNodeR(&graph, 99); // reuse b's slot, b is now stale
(void)GraphUnmarkEdgeForRemoval(&graph, a, b);
GraphDeinit(&graph);
Last updated on