an edge.
.TP
\fBnxtedge_sg\fP(\fIsg\fP : \fBgraph_t\fP, \fIe\fP : \fBedge_t\fP, \fBnode_t\fP) : \fBedge_t\fP
returns the next edge after \fIe\fP in the graph \fIsg\fP.
+.TP
+\fBopp\fP(\fIe\fP : \fBedge_t\fP, \fBnode_t\fP) : \fBnode_t\fP
+returns the node on the edge \fIe\fP not equal to \fIn\fP.
+Returns NULL if \fIn\fP is not a node of \fIe\fP.
+This can be useful when using \fBfstedge\fP and \fBnxtedge\fP
+to enumerate the neighbors of \fIn\fP.
.SS "Graph I/O"
.TP
\fBwrite\fP(\fIg\fP : \fBgraph_t\fP) : \fBvoid\fP
} else
v.integer = PTR2INT(addEdge(gp, ep, 1));
break;
+ case F_opp:
+ ep = INT2PTR(Agedge_t *, args[0].integer);
+ np = INT2PTR(Agnode_t *, args[1].integer);
+ if (!ep) {
+ error(ERROR_WARNING, "NULL edge passed to opp()");
+ v.integer = 0;
+ } else if (!np) {
+ error(ERROR_WARNING, "NULL node passed to opp()");
+ v.integer = 0;
+ } else {
+ if (aghead(ep) == np)
+ np = agtail(ep);
+ else
+ np = aghead(ep);
+ v.integer = PTR2INT(np);
+ }
+ break;
case F_isedge:
key = args[2].string;
if (*key == '\0')
F_edge "edge" FUNCTION E|A(1,V)|A(2,V)|A(3,S)
F_edgesg "edge_sg" FUNCTION E|A(1,G)|A(2,V)|A(3,V)|A(4,S)
F_addedge "subedge" FUNCTION E|A(1,G)|A(2,E)
+F_opp "opp" FUNCTION V|A(1,E)|A(2,V)
F_fstout "fstout" FUNCTION E|A(1,V)
F_nxtout "nxtout" FUNCTION E|A(1,E)
F_fstin "fstin" FUNCTION E|A(1,V)