Tk Library Source Code

Artifact [f2bfc24158]
Login

Artifact f2bfc24158b0cd3594942216fdd8474c034dfb23:

Attachment "graph.n.patch" to ticket [552968ffff] added by cleverly 2002-05-07 01:35:35.
*** graph.n	Wed Oct 17 11:27:26 2001
--- graph-modified.n	Wed Jan 16 13:07:45 2002
***************
*** 59,64 ****
--- 59,68 ----
  \fIgraphName \fBdestroy\fR
  Destroy the graph, including its storage space and associated command.
  .TP
+ \fIgraphName\fR \fBarc append\fR \fIarc\fR ?\fI-key key\fR? \fIvalue\fR
+ Appends a value to one of the keyed values associated with an arc.  If no key
+ is specified, the key \fBdata\fR is assumed.  
+ .TP
  \fIgraphName\fR \fBarc delete\fR \fIarc\fR ?\fIarc\fR ...?
  Remove the specified arcs from the graph.
  .TP
***************
*** 69,80 ****
--- 73,99 ----
  Return the value associated with the key \fIkey\fR for the
  \fIarc\fR.  If no key is specified, the key \fBdata\fR is assumed.
  .TP
+ \fIgraphName\fR \fBarc getall\fR \fIarc\fR
+ Returns a serialized list of key/value pairs (suitable for use with
+ \fB[array set]\fR) for the \fIarc\fR.
+ .TP
+ \fIgraphName\fR \fBarc keys\fR \fIarc\fR
+ Returns a list of keys for the \fIarc\fR.
+ .TP
+ \fIgraphName\fR \fBarc keyexists\fR \fIarc\fR ?\fI-key key\fR?
+ Return true if the specified \fIkey\fR exists for the \fIarc\fR.  
+ If no key is specified, the key \fBdata\fR is assumed.
+ .TP
  \fIgraphName \fBarc insert\fR \fIstart\fR \fIend\fR ?\fIchild\fR?
  Insert an arc named \fIchild\fR into the graph beginning at the node
  \fIstart\fR and ending at the node \fIend\fR. If the name of the new
  arc is not specified the system will generate a unique name of the
  form \fBarc\fR\fIx\fR.
  .TP
+ \fIgraphName\fR \fBarc lappend\fR \fIarc\fR ?\fI-key key\fR? \fIvalue\fR
+ Appends a value (as a list) to one of the keyed values associated with an arc.
+ If no key is specified, the key \fBdata\fR is assumed.  
+ .TP
  \fIgraphName\fR \fBarc set\fR \fIarc\fR ?\fI-key key\fR? ?\fIvalue\fR?
  Set or get one of the keyed values associated with an arc.  If no key
  is specified, the key \fBdata\fR is assumed.  Each arc that is added
***************
*** 125,130 ****
--- 144,153 ----
  \fInodelist\fR. This is the set of arcs connecting the subgraph
  spawned by the specified nodes to the rest of the graph.
  .TP
+ \fIgraphName\fR \fBnode append\fR \fInode\fR ?\fI-key key\fR? \fIvalue\fR
+ Appends a value to one of the keyed values associated with an node.  If no key
+ is specified, the key \fBdata\fR is assumed. 
+ .TP
  \fIgraphName\fR \fBnode degree\fR ?-in|-out? \fInode\fR
  Return the number of arcs adjacent to the specified \fInode\fR. If
  one of the restrictions \fB-in\fR or \fB-out\fR is given only the
***************
*** 141,151 ****
--- 164,189 ----
  Return the value associated with the key \fIkey\fR for the
  \fInode\fR.  If no key is specified, the key \fBdata\fR is assumed.
  .TP
+ \fIgraphName\fR \fBnode getall\fR \fInode\fR
+ Returns a serialized list of key/value pairs (suitable for use with
+ \fB[array set]\fR) for the \fInode\fR.
+ .TP
+ \fIgraphName\fR \fBnode keys\fR \fInode\fR
+ Returns a list of keys for the \fInode\fR.
+ .TP
+ \fIgraphName\fR \fBnode keyexists\fR \fInode\fR ?\fI-key key\fR?
+ Return true if the specified \fIkey\fR exists for the \fInode\fR.
+ If no key is specified, the key \fBdata\fR is assumed.
+ .TP
  \fIgraphName \fBnode insert\fR ?\fIchild\fR?
  Insert a node named \fIchild\fR into the graph. The nodes has no arcs
  connected to it. If the name of the new child is not specified the
  system will generate a unique name of the form \fBnode\fR\fIx\fR.
  .TP
+ \fIgraphName\fR \fBnode lappend\fR \fInode\fR ?\fI-key key\fR? \fIvalue\fR
+ Appends a value (as a list) to one of the keyed values associated with an node.
+ If no key is specified, the key \fBdata\fR is assumed.
+ .TP
  \fIgraphName\fR \fBnode opposite\fR \fInode\fR \fIarc\fR
  Return the node at the other end of the specified \fIarc\fR, which
  has to be adjacent to the given \fInode\fR.
***************
*** 205,211 ****
  As the walk progresses, the command \fIcmd\fR will be evaluated at
  each node, with the mode of the call (\fBenter\fR or \fBleave\fR) and
  values \fIgraphName\fR and the name of the current node appended. For
! a pre-order walk all nodes are Bentered, for a post-order all nodes
  are left. In a both-order walk the first visit of a node \fBenter\fRs
  it, the second visit \fBleave\fRs it.
  
--- 243,249 ----
  As the walk progresses, the command \fIcmd\fR will be evaluated at
  each node, with the mode of the call (\fBenter\fR or \fBleave\fR) and
  values \fIgraphName\fR and the name of the current node appended. For
! a pre-order walk all nodes are \fBenter\fRed, for a post-order all nodes
  are left. In a both-order walk the first visit of a node \fBenter\fRs
  it, the second visit \fBleave\fRs it.