pwn 0.4.672 → 0.4.675
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +2 -2
- data/bin/pwn_nmap_discover_tcp_udp +101 -38
- data/lib/pwn/version.rb +1 -1
- metadata +4 -5
- data/.each do |bytes_matched| +0 -271
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3988112277371e7f9cafefa42d88f325db8c58a97ab35d20c2d65fde2c3bacf
|
4
|
+
data.tar.gz: b6eb594719ebab68d095d072391ddd9b747f27286cda0e30906083acf3f457ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d9c197e9286753124276f6a355d16f9edcf0b6ef85a1f2202f102bfdd862dea76f7e7892db911845d2b02622f9fd07dfbd32010b7944b211130273e7035abf5
|
7
|
+
data.tar.gz: a8a8a5061682887c2e2d5a4661685c731d0c6206691bfa0e483b076db6e0e9d67d324f8a90fee8768fe3e3f6f01f092cd49018352ce48c1f5ea954aefc678b1c
|
data/Gemfile
CHANGED
@@ -66,7 +66,7 @@ gem 'rspec', '3.12.0'
|
|
66
66
|
gem 'rtesseract', '3.1.2'
|
67
67
|
gem 'rubocop', '1.50.2'
|
68
68
|
gem 'rubocop-rake', '0.6.0'
|
69
|
-
gem 'rubocop-rspec', '2.
|
69
|
+
gem 'rubocop-rspec', '2.21.0'
|
70
70
|
gem 'ruby-audio', '1.6.1'
|
71
71
|
gem 'ruby-nmap', '1.0.1'
|
72
72
|
gem 'ruby-saml', '1.15.0'
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ $ rvm use ruby-3.2.2@pwn
|
|
37
37
|
$ rvm list gemsets
|
38
38
|
$ gem install --verbose pwn
|
39
39
|
$ pwn
|
40
|
-
pwn[v0.4.
|
40
|
+
pwn[v0.4.675]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[](https://youtu.be/G7iLUY4FzsI)
|
@@ -52,7 +52,7 @@ $ rvm use ruby-3.2.2@pwn
|
|
52
52
|
$ gem uninstall --all --executables pwn
|
53
53
|
$ gem install --verbose pwn
|
54
54
|
$ pwn
|
55
|
-
pwn[v0.4.
|
55
|
+
pwn[v0.4.675]:001 >>> PWN.help
|
56
56
|
```
|
57
57
|
|
58
58
|
|
@@ -3,6 +3,7 @@
|
|
3
3
|
|
4
4
|
require 'optparse'
|
5
5
|
require 'pwn'
|
6
|
+
require 'time'
|
6
7
|
|
7
8
|
opts = {}
|
8
9
|
OptionParser.new do |options|
|
@@ -10,8 +11,8 @@ OptionParser.new do |options|
|
|
10
11
|
#{$PROGRAM_NAME} [opts]
|
11
12
|
"
|
12
13
|
|
13
|
-
options.on('-
|
14
|
-
opts[:
|
14
|
+
options.on('-tRANGE', '--target-range=RANGE', '<Required - nmap supported host || ip range e.g. foo.bar, 192.168.1.1-20, 192.168.1.0/24, etc>') do |t|
|
15
|
+
opts[:target_range] = t
|
15
16
|
end
|
16
17
|
|
17
18
|
options.on('-eFILE', '--target-exclude-file=FILE', '<Optional - nmap excludes file>') do |e|
|
@@ -32,7 +33,13 @@ if opts.empty?
|
|
32
33
|
exit 1
|
33
34
|
end
|
34
35
|
|
35
|
-
|
36
|
+
ftimestr = '%Y-%m-%d %H:%M:%S.%N%z'
|
37
|
+
started_at = Time.now.strftime(ftimestr)
|
38
|
+
banner = '-' * 64
|
39
|
+
puts "\n\n\n#{banner}"
|
40
|
+
puts "- STARTED: #{started_at} "
|
41
|
+
|
42
|
+
target_range = opts[:target_range]
|
36
43
|
exclude_file = opts[:exclude_file]
|
37
44
|
exclude_file ||= '/tmp/nmap_targets_exclude.txt'
|
38
45
|
interface = opts[:interface]
|
@@ -49,28 +56,24 @@ nmap_results_root = File.dirname(exclude_file)
|
|
49
56
|
FileUtils.mkdir_p nmap_results_root
|
50
57
|
puts "nmap Results Saved in: #{nmap_results_root}"
|
51
58
|
|
52
|
-
|
59
|
+
discovery_tcp_ports = {
|
53
60
|
ftp: 21,
|
54
61
|
ssh: 22,
|
55
62
|
telnet: 23,
|
56
63
|
smtp: 25,
|
57
|
-
dns: 53,
|
58
64
|
http: 80,
|
59
65
|
pop3: 110,
|
60
|
-
rpc: 111,
|
61
66
|
ident: 113,
|
62
|
-
|
67
|
+
msrpc: 135,
|
63
68
|
netbios_name_service: 137,
|
64
69
|
netbios_session_service: 139,
|
65
70
|
imap: 143,
|
66
|
-
snmp: 161,
|
67
71
|
ldap: 389,
|
68
72
|
https: 443,
|
69
73
|
smb: 445,
|
70
74
|
smtps: 465,
|
71
75
|
remote_process: 512,
|
72
76
|
login: 513,
|
73
|
-
rsh: 514,
|
74
77
|
ldaps: 636,
|
75
78
|
rsync: 873,
|
76
79
|
imaps: 993,
|
@@ -84,13 +87,12 @@ discovery_ports = {
|
|
84
87
|
rdp: 3389,
|
85
88
|
meterpreter: 4444,
|
86
89
|
upnp: 5000,
|
87
|
-
sip: 5060,
|
88
90
|
postgres: 5432,
|
89
91
|
postgres_alt: 5433,
|
90
92
|
amqp: 5672,
|
91
93
|
vnc: 5900,
|
92
94
|
vncs: 5901,
|
93
|
-
|
95
|
+
x11: 6000,
|
94
96
|
irc: 6667,
|
95
97
|
http_alt: 8080,
|
96
98
|
https_alt: 8443,
|
@@ -99,10 +101,34 @@ discovery_ports = {
|
|
99
101
|
http_alt4: 9999
|
100
102
|
}
|
101
103
|
|
104
|
+
discovery_udp_ports = {
|
105
|
+
dns: 53,
|
106
|
+
dhcp: 67,
|
107
|
+
dhcp_client: 68,
|
108
|
+
tftp: 69,
|
109
|
+
nfs: 111,
|
110
|
+
ntp: 123,
|
111
|
+
snmp: 161,
|
112
|
+
snmp_traps: 162,
|
113
|
+
syslog: 514,
|
114
|
+
rip: 520,
|
115
|
+
iax: 4569,
|
116
|
+
sip: 5060,
|
117
|
+
mdns: 5353
|
118
|
+
}
|
119
|
+
|
120
|
+
discovery_sctp_ports = {
|
121
|
+
sigtran: 2905,
|
122
|
+
stl: 5000,
|
123
|
+
sap: 5004,
|
124
|
+
turn_ip: 5766,
|
125
|
+
sicc: 38_412
|
126
|
+
}
|
127
|
+
|
102
128
|
target_file = "#{nmap_results_root}/nmap_targets.txt"
|
103
|
-
latest_discovery_results = "#{nmap_results_root}/
|
104
|
-
latest_tcp_results = "#{nmap_results_root}/
|
105
|
-
latest_udp_results = "#{nmap_results_root}/
|
129
|
+
latest_discovery_results = "#{nmap_results_root}/nmap_discovery_results.xml"
|
130
|
+
latest_tcp_results = "#{nmap_results_root}/nmap_tcp_results"
|
131
|
+
latest_udp_results = "#{nmap_results_root}/nmap_udp_results"
|
106
132
|
|
107
133
|
begin
|
108
134
|
# Per man nmap:
|
@@ -124,7 +150,10 @@ begin
|
|
124
150
|
# Target Discovery Scan
|
125
151
|
# Using -T5 template to reduce number of
|
126
152
|
# retransmission attempts on filtered ports.
|
153
|
+
puts "\n\n\n#{banner}"
|
154
|
+
puts '- PHASE 1: Target Discovery'
|
127
155
|
PWN::Plugins::NmapIt.port_scan do |nmap|
|
156
|
+
nmap.verbose = true
|
128
157
|
nmap.exclude_file = exclude_file
|
129
158
|
nmap.interface = interface
|
130
159
|
nmap.insane_timing = true
|
@@ -132,13 +161,16 @@ begin
|
|
132
161
|
nmap.arp_ping = true
|
133
162
|
nmap.icmp_echo_discovery = true
|
134
163
|
nmap.icmp_timestamp_discovery = true
|
135
|
-
nmap.syn_discovery =
|
136
|
-
nmap.ack_discovery =
|
137
|
-
nmap.udp_discovery =
|
138
|
-
nmap.sctp_init_ping =
|
139
|
-
nmap.
|
140
|
-
nmap.targets =
|
164
|
+
nmap.syn_discovery = discovery_tcp_ports.values
|
165
|
+
nmap.ack_discovery = discovery_tcp_ports.values
|
166
|
+
nmap.udp_discovery = discovery_udp_ports.values
|
167
|
+
nmap.sctp_init_ping = discovery_sctp_ports.values
|
168
|
+
nmap.output_xml = latest_discovery_results
|
169
|
+
nmap.targets = target_range
|
141
170
|
nmap.randomize_hosts = true
|
171
|
+
nmap.min_parallelism = 36
|
172
|
+
nmap.max_retries = 3
|
173
|
+
nmap.max_scan_delay = 3
|
142
174
|
nmap.proxies = proxy if with_tor
|
143
175
|
end
|
144
176
|
|
@@ -146,69 +178,89 @@ begin
|
|
146
178
|
# taking into consideration IPs to skip scans
|
147
179
|
File.open(target_file, 'w') do |f|
|
148
180
|
PWN::Plugins::NmapIt.parse_xml_results(
|
149
|
-
xml_file:
|
181
|
+
xml_file: latest_discovery_results
|
150
182
|
) do |xml|
|
151
183
|
xml.each_host do |host|
|
152
|
-
|
184
|
+
next unless File.read(exclude_file).include?(host.ip)
|
185
|
+
|
186
|
+
hosts_arr = host.hostnames.map { |h| h[:name] }
|
187
|
+
f.print host.ip
|
188
|
+
f.puts " # { \"hostnames\": #{hosts_arr}}, \"mac\": \"#{host.mac}\" }"
|
153
189
|
end
|
154
190
|
end
|
155
191
|
end
|
192
|
+
|
193
|
+
# Produce a good targets.txt redacting duplicates
|
156
194
|
sorted_targets = File.readlines(target_file).sort.join
|
157
195
|
File.write(target_file, sorted_targets)
|
158
196
|
|
159
197
|
# Switch Tor Exit Node if with_tor
|
160
|
-
|
198
|
+
if with_tor
|
199
|
+
puts "\n\n\n#{banner}"
|
200
|
+
puts '- INFO: Switching to Clean Tor Circuit...'
|
201
|
+
PWN::Plugins::Tor.switch_exit_node(tor_obj: tor_obj)
|
202
|
+
end
|
161
203
|
|
162
204
|
# TCP Scan
|
163
205
|
# Using -T5 template to reduce number of
|
164
206
|
# retransmission attempts on filtered ports.
|
207
|
+
puts "\n\n\n#{banner}"
|
208
|
+
puts '- PHASE 2: TCP Port Scanning'
|
165
209
|
PWN::Plugins::NmapIt.port_scan do |nmap|
|
210
|
+
nmap.verbose = true
|
166
211
|
nmap.target_file = target_file
|
167
212
|
nmap.randomize_hosts = true
|
168
213
|
nmap.show_reason = true
|
169
214
|
nmap.exclude_file = exclude_file
|
170
215
|
nmap.interface = interface
|
171
|
-
nmap.min_host_group =
|
172
|
-
nmap.host_timeout = '
|
216
|
+
nmap.min_host_group = 9
|
217
|
+
nmap.host_timeout = '36m'
|
173
218
|
nmap.insane_timing = true
|
174
219
|
nmap.skip_discovery = true
|
175
220
|
nmap.syn_scan = true
|
176
221
|
nmap.default_script = true
|
177
222
|
nmap.update_scriptdb = true
|
178
|
-
nmap.service_scan = true
|
179
|
-
nmap.os_fingerprint = true
|
180
|
-
nmap.verbose = true
|
181
|
-
nmap.all = true
|
182
223
|
nmap.ports = [1..65_535]
|
183
224
|
nmap.output_all = latest_tcp_results
|
225
|
+
nmap.min_parallelism = 36
|
226
|
+
nmap.max_retries = 3
|
227
|
+
nmap.max_scan_delay = 3
|
184
228
|
nmap.proxies = proxy if with_tor
|
185
229
|
end
|
186
230
|
FileUtils.cp("#{latest_tcp_results}.nmap", "#{latest_tcp_results}.txt")
|
187
231
|
|
188
232
|
# Switch Tor Exit Node if with_tor
|
189
|
-
|
233
|
+
if with_tor
|
234
|
+
puts "\n\n\n#{banner}"
|
235
|
+
puts '- INFO: Switching to Clean Tor Circuit...'
|
236
|
+
PWN::Plugins::Tor.switch_exit_node(tor_obj: tor_obj)
|
237
|
+
end
|
190
238
|
|
191
239
|
# UDP Scan
|
192
240
|
# Using -T5 template to reduce number of
|
193
241
|
# retransmission attempts on filtered ports.
|
242
|
+
puts "\n\n\n#{banner}"
|
243
|
+
puts '- PHASE 3: UDP Port Scanning'
|
194
244
|
PWN::Plugins::NmapIt.port_scan do |nmap|
|
245
|
+
nmap.verbose = true
|
195
246
|
nmap.target_file = target_file
|
247
|
+
nmap.fast = true
|
196
248
|
nmap.randomize_hosts = true
|
197
249
|
nmap.show_reason = true
|
198
250
|
nmap.exclude_file = exclude_file
|
199
251
|
nmap.interface = interface
|
200
|
-
nmap.min_host_group =
|
201
|
-
nmap.host_timeout = '
|
252
|
+
nmap.min_host_group = 9
|
253
|
+
nmap.host_timeout = '3m'
|
202
254
|
nmap.insane_timing = true
|
203
255
|
nmap.skip_discovery = true
|
204
256
|
nmap.udp_scan = true
|
205
|
-
nmap.default_script = true
|
206
|
-
nmap.update_scriptdb = true
|
207
|
-
nmap.service_scan = true
|
208
|
-
nmap.os_fingerprint = true
|
209
|
-
nmap.verbose = true
|
210
|
-
nmap.all = true
|
257
|
+
nmap.default_script = true unless with_tor
|
258
|
+
nmap.update_scriptdb = true unless with_tor
|
211
259
|
nmap.output_all = latest_udp_results
|
260
|
+
nmap.min_parallelism = 36
|
261
|
+
nmap.max_retries = 0
|
262
|
+
nmap.max_scan_delay = 3
|
263
|
+
nmap.data_length = Random.rand(1..256)
|
212
264
|
nmap.proxies = proxy if with_tor
|
213
265
|
end
|
214
266
|
FileUtils.cp("#{latest_udp_results}.nmap", "#{latest_udp_results}.txt")
|
@@ -218,4 +270,15 @@ rescue StandardError => e
|
|
218
270
|
raise e
|
219
271
|
ensure
|
220
272
|
tor_obj = PWN::Plugins::Tor.stop(tor_obj: tor_obj) if with_tor
|
273
|
+
ended_at = Time.now.strftime(ftimestr)
|
274
|
+
puts "\n\n\n#{banner}"
|
275
|
+
puts "- ENDED: #{ended_at}"
|
276
|
+
|
277
|
+
started_at_parse = Time.parse(started_at)
|
278
|
+
ended_at_parse = Time.parse(ended_at)
|
279
|
+
elapsed_in_seconds = (ended_at_parse - started_at_parse).to_f
|
280
|
+
fmt_elapsed_in_seconds = format('%0.2f', elapsed_in_seconds)
|
281
|
+
puts "\n\n\n#{banner}"
|
282
|
+
puts "- SCAN COMPLETE! DURATION: #{fmt_elapsed_in_seconds} seconds"
|
283
|
+
puts banner
|
221
284
|
end
|
data/lib/pwn/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pwn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.675
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -786,14 +786,14 @@ dependencies:
|
|
786
786
|
requirements:
|
787
787
|
- - '='
|
788
788
|
- !ruby/object:Gem::Version
|
789
|
-
version: 2.
|
789
|
+
version: 2.21.0
|
790
790
|
type: :runtime
|
791
791
|
prerelease: false
|
792
792
|
version_requirements: !ruby/object:Gem::Requirement
|
793
793
|
requirements:
|
794
794
|
- - '='
|
795
795
|
- !ruby/object:Gem::Version
|
796
|
-
version: 2.
|
796
|
+
version: 2.21.0
|
797
797
|
- !ruby/object:Gem::Dependency
|
798
798
|
name: ruby-audio
|
799
799
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1143,7 +1143,6 @@ executables:
|
|
1143
1143
|
extensions: []
|
1144
1144
|
extra_rdoc_files: []
|
1145
1145
|
files:
|
1146
|
-
- ".each do |bytes_matched|"
|
1147
1146
|
- ".github/FUNDING.yml"
|
1148
1147
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
1149
1148
|
- ".gitignore"
|
data/.each do |bytes_matched|
DELETED
@@ -1,271 +0,0 @@
|
|
1
|
-
=> [[[31m[1;31m"[0m[31mstatic void gv_init(void) {[1;35m\n[0m[31m /* list of builtins, enable demand loading */[1;35m\n[0m[31m gvc = gvContextPlugins(lt_preloaded_symbols, DEMAND_LOADING);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
2
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m /* list of builtins, enable demand loading */[1;35m\n[0m[31m gvc = gvContextPlugins(lt_preloaded_symbols, DEMAND_LOADING);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
3
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
4
|
-
[[31m[1;31m"[0m[31mAgraph_t *graph(char *name)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!gvc)[1;35m\n[0m[31m gv_init();[1;35m\n[0m[31m return agopen(name, Agundirected, 0);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
5
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!gvc)[1;35m\n[0m[31m gv_init();[1;35m\n[0m[31m return agopen(name, Agundirected, 0);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
6
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
7
|
-
[[31m[1;31m"[0m[31mAgraph_t *digraph(char *name)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!gvc)[1;35m\n[0m[31m gv_init();[1;35m\n[0m[31m return agopen(name, Agdirected, 0);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
8
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!gvc)[1;35m\n[0m[31m gv_init();[1;35m\n[0m[31m return agopen(name, Agdirected, 0);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
9
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
10
|
-
[[31m[1;31m"[0m[31mAgraph_t *strictgraph(char *name)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!gvc)[1;35m\n[0m[31m gv_init();[1;35m\n[0m[31m return agopen(name, Agstrictundirected, 0);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
11
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!gvc)[1;35m\n[0m[31m gv_init();[1;35m\n[0m[31m return agopen(name, Agstrictundirected, 0);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
12
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
13
|
-
[[31m[1;31m"[0m[31mAgraph_t *strictdigraph(char *name)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!gvc)[1;35m\n[0m[31m gv_init();[1;35m\n[0m[31m return agopen(name, Agstrictdirected, 0);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
14
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!gvc)[1;35m\n[0m[31m gv_init();[1;35m\n[0m[31m return agopen(name, Agstrictdirected, 0);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
15
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
16
|
-
[[31m[1;31m"[0m[31mAgraph_t *readstring(char *string)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!gvc)[1;35m\n[0m[31m gv_init();[1;35m\n[0m[31m return agmemread(string);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
17
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!gvc)[1;35m\n[0m[31m gv_init();[1;35m\n[0m[31m return agmemread(string);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
18
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
19
|
-
[[31m[1;31m"[0m[31mAgraph_t *read(FILE *f)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!gvc)[1;35m\n[0m[31m gv_init();[1;35m\n[0m[31m return agread(f, NULL);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
20
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!gvc)[1;35m\n[0m[31m gv_init();[1;35m\n[0m[31m return agread(f, NULL);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
21
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
22
|
-
[[31m[1;31m"[0m[31mAgraph_t *read(const char *filename)[1;35m\n[0m[31m{[1;35m\n[0m[31m FILE *f;[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m[1;35m\n[0m[31m f = fopen(filename, [1;35m\"[0m[31mr[1;35m\"[0m[31m);[1;35m\n[0m[31m if (!f)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (!gvc)[1;35m\n[0m[31m gv_init();[1;35m\n[0m[31m g = agread(f, NULL);[1;35m\n[0m[31m fclose(f);[1;35m\n[0m[31m return g;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
23
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m FILE *f;[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m[1;35m\n[0m[31m f = fopen(filename, [1;35m\"[0m[31mr[1;35m\"[0m[31m);[1;35m\n[0m[31m if (!f)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (!gvc)[1;35m\n[0m[31m gv_init();[1;35m\n[0m[31m g = agread(f, NULL);[1;35m\n[0m[31m fclose(f);[1;35m\n[0m[31m return g;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
24
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
25
|
-
[[31m[1;31m"[0m[31mAgraph_t *graph(Agraph_t *g, char *name)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!gvc)[1;35m\n[0m[31m gv_init();[1;35m\n[0m[31m return agsubg(g, name, 1);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
26
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!gvc)[1;35m\n[0m[31m gv_init();[1;35m\n[0m[31m return agsubg(g, name, 1);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
27
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
28
|
-
[[31m[1;31m"[0m[31mAgnode_t *node(Agraph_t *g, char *name)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!gvc)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agnode(g, name, 1);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
29
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!gvc)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agnode(g, name, 1);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
30
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
31
|
-
[[31m[1;31m"[0m[31mAgedge_t *edge(Agraph_t* g, Agnode_t *t, Agnode_t *h)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!gvc || !t || !h || !g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m // edges from/to the protonode are not permitted[1;35m\n[0m[31m if (AGTYPE(t) == AGRAPH || AGTYPE(h) == AGRAPH)[1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL;[1;35m\n[0m[31m return agedge(g, t, h, NULL, 1);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
32
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!gvc || !t || !h || !g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m // edges from/to the protonode are not permitted[1;35m\n[0m[31m if (AGTYPE(t) == AGRAPH || AGTYPE(h) == AGRAPH)[1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL;[1;35m\n[0m[31m return agedge(g, t, h, NULL, 1);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
33
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
34
|
-
[[31m[1;31m"[0m[31mAgedge_t *edge(Agnode_t *t, Agnode_t *h)[1;35m\n[0m[31m{[1;35m\n[0m[31m return edge(agraphof(t), t, h);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
35
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m return edge(agraphof(t), t, h);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
36
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
37
|
-
[[31m[1;31m"[0m[31mAgedge_t *edge(char *tname, Agnode_t *h)[1;35m\n[0m[31m{[1;35m\n[0m[31m return edge(node(agraphof(h), tname), h);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
38
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m return edge(node(agraphof(h), tname), h);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
39
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
40
|
-
[[31m[1;31m"[0m[31mAgedge_t *edge(Agnode_t *t, char *hname)[1;35m\n[0m[31m{[1;35m\n[0m[31m return edge(t, node(agraphof(t), hname));[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
41
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m return edge(t, node(agraphof(t), hname));[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
42
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
43
|
-
[[31m[1;31m"[0m[31mAgedge_t *edge(Agraph_t *g, char *tname, char *hname)[1;35m\n[0m[31m{[1;35m\n[0m[31m return edge(g, node(g, tname), node(g, hname));[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
44
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m return edge(g, node(g, tname), node(g, hname));[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
45
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
46
|
-
[[31m[1;31m"[0m[31mstatic char* myagxget(void *obj, Agsym_t *a)[1;35m\n[0m[31m{[1;35m\n[0m[31m int len;[1;35m\n[0m[31m char *val, *hs;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!obj || !a)[1;35m\n[0m[31m return emptystring;[1;35m\n[0m[31m val = agxget(obj, a);[1;35m\n[0m[31m if (!val)[1;35m\n[0m[31m return emptystring;[1;35m\n[0m[31m if (a->name[0] == 'l' && strcmp(a->name, [1;35m\"[0m[31mlabel[1;35m\"[0m[31m) == 0 && aghtmlstr(val)) {[1;35m\n[0m[31m len = strlen(val);[1;35m\n[0m[31m hs = (char*)malloc(len + 3);[1;35m\n[0m[31m hs[0] = '<';[1;35m\n[0m[31m strcpy(hs+1, val);[1;35m\n[0m[31m hs[len+1] = '>';[1;35m\n[0m[31m hs[len+2] = '[1;35m\\[0m[31m0';[1;35m\n[0m[31m return hs;[1;35m\n[0m[31m }[1;35m\n[0m[31m return val;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
47
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m int len;[1;35m\n[0m[31m char *val, *hs;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!obj || !a)[1;35m\n[0m[31m return emptystring;[1;35m\n[0m[31m val = agxget(obj, a);[1;35m\n[0m[31m if (!val)[1;35m\n[0m[31m return emptystring;[1;35m\n[0m[31m if (a->name[0] == 'l' && strcmp(a->name, [1;35m\"[0m[31mlabel[1;35m\"[0m[31m) == 0 && aghtmlstr(val)) {[1;35m\n[0m[31m len = strlen(val);[1;35m\n[0m[31m hs = (char*)malloc(len + 3);[1;35m\n[0m[31m hs[0] = '<';[1;35m\n[0m[31m strcpy(hs+1, val);[1;35m\n[0m[31m hs[len+1] = '>';[1;35m\n[0m[31m hs[len+2] = '[1;35m\\[0m[31m0';[1;35m\n[0m[31m return hs;[1;35m\n[0m[31m }[1;35m\n[0m[31m return val;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
48
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
49
|
-
[[31m[1;31m"[0m[31mchar *getv(Agraph_t *g, Agsym_t *a)[1;35m\n[0m[31m{[1;35m\n[0m[31m return myagxget(g, a);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
50
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m return myagxget(g, a);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
51
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
52
|
-
[[31m[1;31m"[0m[31mchar *getv(Agraph_t *g, char *attr)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agsym_t *a;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g || !attr)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m a = agfindattr(agroot(g), attr);[1;35m\n[0m[31m return myagxget(g, a);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
53
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m Agsym_t *a;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g || !attr)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m a = agfindattr(agroot(g), attr);[1;35m\n[0m[31m return myagxget(g, a);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
54
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
55
|
-
[[31m[1;31m"[0m[31mstatic void myagxset(void *obj, Agsym_t *a, char *val)[1;35m\n[0m[31m{[1;35m\n[0m[31m int len;[1;35m\n[0m[31m char *hs;[1;35m\n[0m[31m[1;35m\n[0m[31m if (a->name[0] == 'l' && val[0] == '<' && strcmp(a->name, [1;35m\"[0m[31mlabel[1;35m\"[0m[31m) == 0) {[1;35m\n[0m[31m len = strlen(val);[1;35m\n[0m[31m if (val[len-1] == '>') {[1;35m\n[0m[31m hs = strdup(val+1);[1;35m\n[0m[31m *(hs+len-2) = '[1;35m\\[0m[31m0';[1;35m\n[0m[31m val = agstrdup_html(agraphof(obj),hs);[1;35m\n[0m[31m free(hs);[1;35m\n[0m[31m }[1;35m\n[0m[31m }[1;35m\n[0m[31m agxset(obj, a, val);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
56
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m int len;[1;35m\n[0m[31m char *hs;[1;35m\n[0m[31m[1;35m\n[0m[31m if (a->name[0] == 'l' && val[0] == '<' && strcmp(a->name, [1;35m\"[0m[31mlabel[1;35m\"[0m[31m) == 0) {[1;35m\n[0m[31m len = strlen(val);[1;35m\n[0m[31m if (val[len-1] == '>') {[1;35m\n[0m[31m hs = strdup(val+1);[1;35m\n[0m[31m *(hs+len-2) = '[1;35m\\[0m[31m0';[1;35m\n[0m[31m val = agstrdup_html(agraphof(obj),hs);[1;35m\n[0m[31m free(hs);[1;35m\n[0m[31m }[1;35m\n[0m[31m }[1;35m\n[0m[31m agxset(obj, a, val);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
57
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
58
|
-
[[31m[1;31m"[0m[31mchar *setv(Agraph_t *g, Agsym_t *a, char *val)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!g || !a || !val)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m myagxset(g, a, val);[1;35m\n[0m[31m return val;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
59
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!g || !a || !val)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m myagxset(g, a, val);[1;35m\n[0m[31m return val;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
60
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
61
|
-
[[31m[1;31m"[0m[31mchar *setv(Agraph_t *g, char *attr, char *val)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agsym_t *a;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g || !attr || !val)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m a = agfindattr(agroot(g), attr);[1;35m\n[0m[31m if (!a)[1;35m\n[0m[31m a = agraphattr(g->root, attr, emptystring);[1;35m\n[0m[31m myagxset(g, a, val);[1;35m\n[0m[31m return val;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
62
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m Agsym_t *a;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g || !attr || !val)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m a = agfindattr(agroot(g), attr);[1;35m\n[0m[31m if (!a)[1;35m\n[0m[31m a = agraphattr(g->root, attr, emptystring);[1;35m\n[0m[31m myagxset(g, a, val);[1;35m\n[0m[31m return val;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
63
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
64
|
-
[[31m[1;31m"[0m[31mchar *getv(Agnode_t *n, Agsym_t *a)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!n || !a)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(n) == AGRAPH) // protonode [1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL; // FIXME ??[1;35m\n[0m[31m return myagxget(n, a);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
65
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!n || !a)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(n) == AGRAPH) // protonode [1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL; // FIXME ??[1;35m\n[0m[31m return myagxget(n, a);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
66
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
67
|
-
[[31m[1;31m"[0m[31mchar *getv(Agnode_t *n, char *attr)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m Agsym_t *a;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!n || !attr)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(n) == AGRAPH) // protonode [1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL; // FIXME ??[1;35m\n[0m[31m g = agroot(agraphof(n));[1;35m\n[0m[31m a = agattr(g, AGNODE, attr, NULL);[1;35m\n[0m[31m return myagxget(n, a);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
68
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m Agsym_t *a;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!n || !attr)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(n) == AGRAPH) // protonode [1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL; // FIXME ??[1;35m\n[0m[31m g = agroot(agraphof(n));[1;35m\n[0m[31m a = agattr(g, AGNODE, attr, NULL);[1;35m\n[0m[31m return myagxget(n, a);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
69
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
70
|
-
[[31m[1;31m"[0m[31mchar *setv(Agnode_t *n, Agsym_t *a, char *val)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!n || !a || !val)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(n) == AGRAPH) // protonode [1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL; // FIXME ??[1;35m\n[0m[31m myagxset(n, a, val);[1;35m\n[0m[31m return val;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
71
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!n || !a || !val)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(n) == AGRAPH) // protonode [1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL; // FIXME ??[1;35m\n[0m[31m myagxset(n, a, val);[1;35m\n[0m[31m return val;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
72
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
73
|
-
[[31m[1;31m"[0m[31mchar *setv(Agnode_t *n, char *attr, char *val)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m Agsym_t *a;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!n || !attr || !val)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(n) == AGRAPH) { // protonode [1;35m\n[0m[31m[1;35m\t[0m[31mg = (Agraph_t*)n;[1;35m\n[0m[31m [1;35m\t[0m[31ma = agattr(g, AGNODE, attr, val); // create default attribute in psuodo protonode[1;35m\n[0m[31m[1;35m\t[0m[31m // FIXME? - deal with html in [1;35m\"[0m[31mlabel[1;35m\"[0m[31m attributes[1;35m\n[0m[31m[1;35m\t[0m[31mreturn val;[1;35m\n[0m[31m }[1;35m\n[0m[31m g = agroot(agraphof(n));[1;35m\n[0m[31m a = agattr(g, AGNODE, attr, NULL);[1;35m\n[0m[31m if (!a)[1;35m\n[0m[31m a = agnodeattr(g, attr, emptystring);[1;35m\n[0m[31m myagxset(n, a, val);[1;35m\n[0m[31m return val;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
74
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m Agsym_t *a;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!n || !attr || !val)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(n) == AGRAPH) { // protonode [1;35m\n[0m[31m[1;35m\t[0m[31mg = (Agraph_t*)n;[1;35m\n[0m[31m [1;35m\t[0m[31ma = agattr(g, AGNODE, attr, val); // create default attribute in psuodo protonode[1;35m\n[0m[31m[1;35m\t[0m[31m // FIXME? - deal with html in [1;35m\"[0m[31mlabel[1;35m\"[0m[31m attributes[1;35m\n[0m[31m[1;35m\t[0m[31mreturn val;[1;35m\n[0m[31m }[1;35m\n[0m[31m g = agroot(agraphof(n));[1;35m\n[0m[31m a = agattr(g, AGNODE, attr, NULL);[1;35m\n[0m[31m if (!a)[1;35m\n[0m[31m a = agnodeattr(g, attr, emptystring);[1;35m\n[0m[31m myagxset(n, a, val);[1;35m\n[0m[31m return val;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
75
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
76
|
-
[[31m[1;31m"[0m[31mchar *getv(Agedge_t *e, Agsym_t *a)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!e || !a)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(e) == AGRAPH) // protoedge [1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL; // FIXME ??[1;35m\n[0m[31m return myagxget(e, a);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
77
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!e || !a)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(e) == AGRAPH) // protoedge [1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL; // FIXME ??[1;35m\n[0m[31m return myagxget(e, a);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
78
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
79
|
-
[[31m[1;31m"[0m[31mchar *getv(Agedge_t *e, char *attr)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m Agsym_t *a;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!e || !attr)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(e) == AGRAPH) // protoedge [1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL; // FIXME ??[1;35m\n[0m[31m g = agraphof(agtail(e));[1;35m\n[0m[31m a = agattr(g, AGEDGE, attr, NULL);[1;35m\n[0m[31m return myagxget(e, a);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
80
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m Agsym_t *a;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!e || !attr)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(e) == AGRAPH) // protoedge [1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL; // FIXME ??[1;35m\n[0m[31m g = agraphof(agtail(e));[1;35m\n[0m[31m a = agattr(g, AGEDGE, attr, NULL);[1;35m\n[0m[31m return myagxget(e, a);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
81
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
82
|
-
[[31m[1;31m"[0m[31mchar *setv(Agedge_t *e, Agsym_t *a, char *val)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!e || !a || !val)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(e) == AGRAPH) // protoedge [1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL; // FIXME ??[1;35m\n[0m[31m myagxset(e, a, val);[1;35m\n[0m[31m return val;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
83
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!e || !a || !val)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(e) == AGRAPH) // protoedge [1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL; // FIXME ??[1;35m\n[0m[31m myagxset(e, a, val);[1;35m\n[0m[31m return val;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
84
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
85
|
-
[[31m[1;31m"[0m[31mchar *setv(Agedge_t *e, char *attr, char *val)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m Agsym_t *a;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!e || !attr || !val)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(e) == AGRAPH) { // protoedge [1;35m\n[0m[31m[1;35m\t[0m[31mg = (Agraph_t*)e;[1;35m\n[0m[31m [1;35m\t[0m[31ma = agattr(g, AGEDGE, attr, val); // create default attribute in pseudo protoedge[1;35m\n[0m[31m[1;35m\t[0m[31m // FIXME? - deal with html in [1;35m\"[0m[31mlabel[1;35m\"[0m[31m attributes[1;35m\n[0m[31m[1;35m\t[0m[31mreturn val;[1;35m\n[0m[31m }[1;35m\n[0m[31m g = agroot(agraphof(agtail(e)));[1;35m\n[0m[31m a = agattr(g, AGEDGE, attr, NULL);[1;35m\n[0m[31m if (!a)[1;35m\n[0m[31m a = agattr(g, AGEDGE, attr, emptystring);[1;35m\n[0m[31m myagxset(e, a, val);[1;35m\n[0m[31m return val;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
86
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m Agsym_t *a;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!e || !attr || !val)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(e) == AGRAPH) { // protoedge [1;35m\n[0m[31m[1;35m\t[0m[31mg = (Agraph_t*)e;[1;35m\n[0m[31m [1;35m\t[0m[31ma = agattr(g, AGEDGE, attr, val); // create default attribute in pseudo protoedge[1;35m\n[0m[31m[1;35m\t[0m[31m // FIXME? - deal with html in [1;35m\"[0m[31mlabel[1;35m\"[0m[31m attributes[1;35m\n[0m[31m[1;35m\t[0m[31mreturn val;[1;35m\n[0m[31m }[1;35m\n[0m[31m g = agroot(agraphof(agtail(e)));[1;35m\n[0m[31m a = agattr(g, AGEDGE, attr, NULL);[1;35m\n[0m[31m if (!a)[1;35m\n[0m[31m a = agattr(g, AGEDGE, attr, emptystring);[1;35m\n[0m[31m myagxset(e, a, val);[1;35m\n[0m[31m return val;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
87
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
88
|
-
[[31m[1;31m"[0m[31mAgraph_t *findsubg(Agraph_t *g, char *name)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!g || !name)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agsubg(g, name, 0);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
89
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!g || !name)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agsubg(g, name, 0);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
90
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
91
|
-
[[31m[1;31m"[0m[31mAgnode_t *findnode(Agraph_t *g, char *name)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!g || !name)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agnode(g, name, 0);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
92
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!g || !name)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agnode(g, name, 0);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
93
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
94
|
-
[[31m[1;31m"[0m[31mAgedge_t *findedge(Agnode_t *t, Agnode_t *h)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!t || !h)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(t) == AGRAPH || AGTYPE(h) == AGRAPH)[1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL;[1;35m\n[0m[31m return agfindedge(agraphof(t), t, h);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
95
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!t || !h)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(t) == AGRAPH || AGTYPE(h) == AGRAPH)[1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL;[1;35m\n[0m[31m return agfindedge(agraphof(t), t, h);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
96
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
97
|
-
[[31m[1;31m"[0m[31mAgsym_t *findattr(Agraph_t *g, char *name)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!g || !name)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfindattr(g, name);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
98
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!g || !name)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfindattr(g, name);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
99
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
100
|
-
[[31m[1;31m"[0m[31mAgsym_t *findattr(Agnode_t *n, char *name)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!n || !name)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfindattr(n, name);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
101
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!n || !name)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfindattr(n, name);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
102
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
103
|
-
[[31m[1;31m"[0m[31mAgsym_t *findattr(Agedge_t *e, char *name)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!e || !name)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfindattr(e, name);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
104
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!e || !name)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfindattr(e, name);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
105
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
106
|
-
[[31m[1;31m"[0m[31mAgnode_t *headof(Agedge_t *e)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(e) == AGRAPH)[1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL;[1;35m\n[0m[31m return aghead(e);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
107
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(e) == AGRAPH)[1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL;[1;35m\n[0m[31m return aghead(e);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
108
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
109
|
-
[[31m[1;31m"[0m[31mAgnode_t *tailof(Agedge_t *e)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(e) == AGRAPH)[1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL;[1;35m\n[0m[31m return agtail(e);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
110
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(e) == AGRAPH)[1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL;[1;35m\n[0m[31m return agtail(e);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
111
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
112
|
-
[[31m[1;31m"[0m[31mAgraph_t *graphof(Agraph_t *g)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!g || g == g->root)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agroot(g);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
113
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!g || g == g->root)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agroot(g);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
114
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
115
|
-
[[31m[1;31m"[0m[31mAgraph_t *graphof(Agedge_t *e)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(e) == AGRAPH)[1;35m\n[0m[31m[1;35m\t[0m[31mreturn (Agraph_t*)e; /* graph of protoedge is itself recast */[1;35m\n[0m[31m return agraphof(agtail(e));[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
116
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(e) == AGRAPH)[1;35m\n[0m[31m[1;35m\t[0m[31mreturn (Agraph_t*)e; /* graph of protoedge is itself recast */[1;35m\n[0m[31m return agraphof(agtail(e));[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
117
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
118
|
-
[[31m[1;31m"[0m[31mAgraph_t *graphof(Agnode_t *n)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(n) == AGRAPH)[1;35m\n[0m[31m[1;35m\t[0m[31mreturn (Agraph_t*)n; /* graph of protonode is itself recast */[1;35m\n[0m[31m return agraphof(n);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
119
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(n) == AGRAPH)[1;35m\n[0m[31m[1;35m\t[0m[31mreturn (Agraph_t*)n; /* graph of protonode is itself recast */[1;35m\n[0m[31m return agraphof(n);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
120
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
121
|
-
[[31m[1;31m"[0m[31mAgraph_t *rootof(Agraph_t *g)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agroot(g);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
122
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agroot(g);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
123
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
124
|
-
[[31m[1;31m"[0m[31mAgnode_t *protonode(Agraph_t *g)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return (Agnode_t *)g; // gross abuse of the type system![1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
125
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return (Agnode_t *)g; // gross abuse of the type system![1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
126
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
127
|
-
[[31m[1;31m"[0m[31mAgedge_t *protoedge(Agraph_t *g)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return (Agedge_t *)g; // gross abuse of the type system![1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
128
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return (Agedge_t *)g; // gross abuse of the type system![1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
129
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
130
|
-
[[31m[1;31m"[0m[31mchar *nameof(Agraph_t *g)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agnameof(g);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
131
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agnameof(g);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
132
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
133
|
-
[[31m[1;31m"[0m[31mchar *nameof(Agnode_t *n)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(n) == AGRAPH)[1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL;[1;35m\n[0m[31m return agnameof(n);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
134
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (AGTYPE(n) == AGRAPH)[1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL;[1;35m\n[0m[31m return agnameof(n);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
135
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
136
|
-
[[31m[1;31m"[0m[31mchar *nameof(Agsym_t *a)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!a)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return a->name;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
137
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!a)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return a->name;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
138
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
139
|
-
[[31m[1;31m"[0m[31mbool ok(Agraph_t *g)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!g) [1;35m\n[0m[31m return false;[1;35m\n[0m[31m return true;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
140
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!g) [1;35m\n[0m[31m return false;[1;35m\n[0m[31m return true;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
141
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
142
|
-
[[31m[1;31m"[0m[31mbool ok(Agnode_t *n)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!n) [1;35m\n[0m[31m return false;[1;35m\n[0m[31m return true;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
143
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!n) [1;35m\n[0m[31m return false;[1;35m\n[0m[31m return true;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
144
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
145
|
-
[[31m[1;31m"[0m[31mbool ok(Agedge_t *e)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!e) [1;35m\n[0m[31m return false;[1;35m\n[0m[31m return true;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
146
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!e) [1;35m\n[0m[31m return false;[1;35m\n[0m[31m return true;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
147
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
148
|
-
[[31m[1;31m"[0m[31mbool ok(Agsym_t *a)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!a) [1;35m\n[0m[31m return false;[1;35m\n[0m[31m return true;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
149
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!a) [1;35m\n[0m[31m return false;[1;35m\n[0m[31m return true;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
150
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
151
|
-
[[31m[1;31m"[0m[31mAgraph_t *firstsubg(Agraph_t *g)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfstsubg(g);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
152
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfstsubg(g);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
153
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
154
|
-
[[31m[1;31m"[0m[31mAgraph_t *nextsubg(Agraph_t *g, Agraph_t *sg)[1;35m\n[0m[31m{[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g || !sg)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agnxtsubg(sg);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
155
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g || !sg)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agnxtsubg(sg);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
156
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
157
|
-
[[31m[1;31m"[0m[31mAgraph_t *firstsupg(Agraph_t *g)[1;35m\n[0m[31m{[1;35m\n[0m[31m return g->parent;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m, [31m[1;31m"[0m[31m[1;35m\n[0m[31m return g->parent;[1;35m\n[0m[31m[1;31m"[0m[31m[0m, [31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
158
|
-
[[31m[1;31m"[0m[31mAgraph_t *nextsupg(Agraph_t *g, Agraph_t *sg)[1;35m\n[0m[31m{[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
159
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
160
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
161
|
-
[[31m[1;31m"[0m[31mAgedge_t *firstout(Agraph_t *g)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agnode_t *n;[1;35m\n[0m[31m Agedge_t *e;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m for (n = agfstnode(g); n; n = agnxtnode(g, n)) {[1;35m\n[0m[31m[1;35m\t[0m[31me = agfstout(g, n);[1;35m\n[0m[31m[1;35m\t[0m[31mif (e) return e;[1;35m\n[0m[31m }[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
162
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m Agnode_t *n;[1;35m\n[0m[31m Agedge_t *e;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m for (n = agfstnode(g); n; n = agnxtnode(g, n)) {[1;35m\n[0m[31m[1;35m\t[0m[31me = agfstout(g, n);[1;35m\n[0m[31m[1;35m\t[0m[31mif (e) return e;[1;35m\n[0m[31m }[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
163
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
164
|
-
[[31m[1;31m"[0m[31mAgedge_t *nextout(Agraph_t *g, Agedge_t *e)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agnode_t *n;[1;35m\n[0m[31m Agedge_t *ne;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g || !e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m ne = agnxtout(g, e);[1;35m\n[0m[31m if (ne)[1;35m\n[0m[31m return (ne);[1;35m\n[0m[31m for (n = agnxtnode(g, agtail(e)); n; n = agnxtnode(g, n)) {[1;35m\n[0m[31m[1;35m\t[0m[31mne = agfstout(g, n);[1;35m\n[0m[31m[1;35m\t[0m[31mif (ne) return ne;[1;35m\n[0m[31m }[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
165
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m Agnode_t *n;[1;35m\n[0m[31m Agedge_t *ne;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g || !e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m ne = agnxtout(g, e);[1;35m\n[0m[31m if (ne)[1;35m\n[0m[31m return (ne);[1;35m\n[0m[31m for (n = agnxtnode(g, agtail(e)); n; n = agnxtnode(g, n)) {[1;35m\n[0m[31m[1;35m\t[0m[31mne = agfstout(g, n);[1;35m\n[0m[31m[1;35m\t[0m[31mif (ne) return ne;[1;35m\n[0m[31m }[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
166
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
167
|
-
[[31m[1;31m"[0m[31mAgedge_t *firstedge(Agraph_t *g)[1;35m\n[0m[31m{[1;35m\n[0m[31m return firstout(g);[1;35m\n[0m[31m} [1;35m\n[0m[31m[1;35m\n[0m[31mAgedge_t *nextedge(Agraph_t *g, Agedge_t *e)[1;35m\n[0m[31m{[1;35m\n[0m[31m return nextout(g, e);[1;35m\n[0m[31m} [1;35m\n[0m[31m[1;35m\n[0m[31mAgedge_t *firstout(Agnode_t *n)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfstout(agraphof(n), n);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
168
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m return firstout(g);[1;35m\n[0m[31m} [1;35m\n[0m[31m[1;35m\n[0m[31mAgedge_t *nextedge(Agraph_t *g, Agedge_t *e)[1;35m\n[0m[31m{[1;35m\n[0m[31m return nextout(g, e);[1;35m\n[0m[31m} [1;35m\n[0m[31m[1;35m\n[0m[31mAgedge_t *firstout(Agnode_t *n)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfstout(agraphof(n), n);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
169
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
170
|
-
[[31m[1;31m"[0m[31mAgedge_t *nextout(Agnode_t *n, Agedge_t *e)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!n || !e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agnxtout(agraphof(n), e);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
171
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!n || !e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agnxtout(agraphof(n), e);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
172
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
173
|
-
[[31m[1;31m"[0m[31mAgnode_t *firsthead(Agnode_t *n)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agedge_t *e;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m e = agfstout(agraphof(n), n);[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return aghead(e);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
174
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m Agedge_t *e;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m e = agfstout(agraphof(n), n);[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return aghead(e);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
175
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
176
|
-
[[31m[1;31m"[0m[31mAgnode_t *nexthead(Agnode_t *n, Agnode_t *h)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agedge_t *e;[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!n || !h)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m g = agraphof(n);[1;35m\n[0m[31m e = agfindedge(g, n, h);[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m do {[1;35m\n[0m[31m e = agnxtout(g, AGMKOUT(e));[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m } while (aghead(e) == h);[1;35m\n[0m[31m return aghead(e);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
177
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m Agedge_t *e;[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!n || !h)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m g = agraphof(n);[1;35m\n[0m[31m e = agfindedge(g, n, h);[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m do {[1;35m\n[0m[31m e = agnxtout(g, AGMKOUT(e));[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m } while (aghead(e) == h);[1;35m\n[0m[31m return aghead(e);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
178
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
179
|
-
[[31m[1;31m"[0m[31mAgedge_t *firstedge(Agnode_t *n)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfstedge(agraphof(n), n);[1;35m\n[0m[31m} [1;35m\n[0m[31m[1;35m\n[0m[31mAgedge_t *nextedge(Agnode_t *n, Agedge_t *e)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!n || !e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agnxtedge(agraphof(n), e, n); [1;35m\n[0m[31m} [1;35m\n[0m[31m[1;35m\n[0m[31mAgedge_t *firstin(Agraph_t *g)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agnode_t *n;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m n = agfstnode(g);[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfstin(g, n);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
180
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfstedge(agraphof(n), n);[1;35m\n[0m[31m} [1;35m\n[0m[31m[1;35m\n[0m[31mAgedge_t *nextedge(Agnode_t *n, Agedge_t *e)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!n || !e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agnxtedge(agraphof(n), e, n); [1;35m\n[0m[31m} [1;35m\n[0m[31m[1;35m\n[0m[31mAgedge_t *firstin(Agraph_t *g)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agnode_t *n;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m n = agfstnode(g);[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfstin(g, n);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
181
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
182
|
-
[[31m[1;31m"[0m[31mAgedge_t *nextin(Agraph_t *g, Agedge_t *e)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agnode_t *n;[1;35m\n[0m[31m Agedge_t *ne;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g || !e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m ne = agnxtin(g, e);[1;35m\n[0m[31m if (ne)[1;35m\n[0m[31m return (ne);[1;35m\n[0m[31m n = agnxtnode(g, aghead(e));[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfstin(g, n);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
183
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m Agnode_t *n;[1;35m\n[0m[31m Agedge_t *ne;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g || !e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m ne = agnxtin(g, e);[1;35m\n[0m[31m if (ne)[1;35m\n[0m[31m return (ne);[1;35m\n[0m[31m n = agnxtnode(g, aghead(e));[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfstin(g, n);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
184
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
185
|
-
[[31m[1;31m"[0m[31mAgedge_t *firstin(Agnode_t *n)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfstin(agraphof(n), n);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
186
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfstin(agraphof(n), n);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
187
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
188
|
-
[[31m[1;31m"[0m[31mAgedge_t *nextin(Agnode_t *n, Agedge_t *e)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!n || !e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agnxtin(agraphof(n), e);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
189
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!n || !e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agnxtin(agraphof(n), e);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
190
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
191
|
-
[[31m[1;31m"[0m[31mAgnode_t *firsttail(Agnode_t *n)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agedge_t *e;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m e = agfstin(agraphof(n), n);[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agtail(e);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
192
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m Agedge_t *e;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m e = agfstin(agraphof(n), n);[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agtail(e);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
193
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
194
|
-
[[31m[1;31m"[0m[31mAgnode_t *nexttail(Agnode_t *n, Agnode_t *t)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agedge_t *e;[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!n || !t)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m g = agraphof(n);[1;35m\n[0m[31m e = agfindedge(g, t, n);[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m do {[1;35m\n[0m[31m e = agnxtin(g, AGMKIN(e));[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m } while (agtail(e) == t);[1;35m\n[0m[31m return agtail(e);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
195
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m Agedge_t *e;[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!n || !t)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m g = agraphof(n);[1;35m\n[0m[31m e = agfindedge(g, t, n);[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m do {[1;35m\n[0m[31m e = agnxtin(g, AGMKIN(e));[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m } while (agtail(e) == t);[1;35m\n[0m[31m return agtail(e);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
196
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
197
|
-
[[31m[1;31m"[0m[31mAgnode_t *firstnode(Agraph_t *g)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfstnode(g);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
198
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agfstnode(g);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
199
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
200
|
-
[[31m[1;31m"[0m[31mAgnode_t *nextnode(Agraph_t *g, Agnode_t *n)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!g || !n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agnxtnode(g, n);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
201
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!g || !n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agnxtnode(g, n);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
202
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
203
|
-
[[31m[1;31m"[0m[31mAgnode_t *firstnode(Agedge_t *e)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agtail(e);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
204
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return agtail(e);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
205
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
206
|
-
[[31m[1;31m"[0m[31mAgnode_t *nextnode(Agedge_t *e, Agnode_t *n)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!e || n != agtail(e))[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return aghead(e);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
207
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!e || n != agtail(e))[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m return aghead(e);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
208
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
209
|
-
[[31m[1;31m"[0m[31mAgsym_t *firstattr(Agraph_t *g)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m g = agroot(g);[1;35m\n[0m[31m return agnxtattr(g,AGRAPH,NULL);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
210
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m g = agroot(g);[1;35m\n[0m[31m return agnxtattr(g,AGRAPH,NULL);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
211
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
212
|
-
[[31m[1;31m"[0m[31mAgsym_t *nextattr(Agraph_t *g, Agsym_t *a)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!g || !a)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m g = agroot(g);[1;35m\n[0m[31m return agnxtattr(g,AGRAPH,a);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
213
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!g || !a)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m g = agroot(g);[1;35m\n[0m[31m return agnxtattr(g,AGRAPH,a);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
214
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
215
|
-
[[31m[1;31m"[0m[31mAgsym_t *firstattr(Agnode_t *n)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m g = agraphof(n);[1;35m\n[0m[31m return agnxtattr(g,AGNODE,NULL);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
216
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m g = agraphof(n);[1;35m\n[0m[31m return agnxtattr(g,AGNODE,NULL);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
217
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
218
|
-
[[31m[1;31m"[0m[31mAgsym_t *nextattr(Agnode_t *n, Agsym_t *a)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!n || !a)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m g = agraphof(n);[1;35m\n[0m[31m return agnxtattr(g,AGNODE,a);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
219
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!n || !a)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m g = agraphof(n);[1;35m\n[0m[31m return agnxtattr(g,AGNODE,a);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
220
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
221
|
-
[[31m[1;31m"[0m[31mAgsym_t *firstattr(Agedge_t *e)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m g = agraphof(agtail(e));[1;35m\n[0m[31m return agnxtattr(g,AGEDGE,NULL);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
222
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m g = agraphof(agtail(e));[1;35m\n[0m[31m return agnxtattr(g,AGEDGE,NULL);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
223
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
224
|
-
[[31m[1;31m"[0m[31mAgsym_t *nextattr(Agedge_t *e, Agsym_t *a)[1;35m\n[0m[31m{[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!e || !a)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m g = agraphof(agtail(e));[1;35m\n[0m[31m return agnxtattr(g,AGEDGE,a);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
225
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m Agraph_t *g;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!e || !a)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m g = agraphof(agtail(e));[1;35m\n[0m[31m return agnxtattr(g,AGEDGE,a);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
226
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
227
|
-
[[31m[1;31m"[0m[31mbool rm(Agraph_t *g)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m#if 0[1;35m\n[0m[31m Agraph_t* sg;[1;35m\n[0m[31m for (sg = agfstsubg (g); sg; sg = agnxtsubg (sg))[1;35m\n[0m[31m[1;35m\t[0m[31mrm(sg);[1;35m\n[0m[31m if (g == agroot(g))[1;35m\n[0m[31m[1;35m\t[0m[31magclose(g);[1;35m\n[0m[31m else[1;35m\n[0m[31m agdelete(agparent(g), g);[1;35m\n[0m[31m#endif[1;35m\n[0m[31m /* The rm function appears to have the semantics of agclose, so[1;35m\n[0m[31m * we should just do that, and let cgraph take care of all the[1;35m\n[0m[31m * details.[1;35m\n[0m[31m */[1;35m\n[0m[31m agclose(g);[1;35m\n[0m[31m return true;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
228
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m#if 0[1;35m\n[0m[31m Agraph_t* sg;[1;35m\n[0m[31m for (sg = agfstsubg (g); sg; sg = agnxtsubg (sg))[1;35m\n[0m[31m[1;35m\t[0m[31mrm(sg);[1;35m\n[0m[31m if (g == agroot(g))[1;35m\n[0m[31m[1;35m\t[0m[31magclose(g);[1;35m\n[0m[31m else[1;35m\n[0m[31m agdelete(agparent(g), g);[1;35m\n[0m[31m#endif[1;35m\n[0m[31m /* The rm function appears to have the semantics of agclose, so[1;35m\n[0m[31m * we should just do that, and let cgraph take care of all the[1;35m\n[0m[31m * details.[1;35m\n[0m[31m */[1;35m\n[0m[31m agclose(g);[1;35m\n[0m[31m return true;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
229
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
230
|
-
[[31m[1;31m"[0m[31mbool rm(Agnode_t *n)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m // removal of the protonode is not permitted[1;35m\n[0m[31m if (agnameof(n)[0] == '[1;35m\\[0m[31m001' && strcmp (agnameof(n), [1;35m\"[0m[31m[1;35m\\[0m[31m001proto[1;35m\"[0m[31m) ==0)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m agdelete(agraphof(n), n);[1;35m\n[0m[31m return true;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
231
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!n)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m // removal of the protonode is not permitted[1;35m\n[0m[31m if (agnameof(n)[0] == '[1;35m\\[0m[31m001' && strcmp (agnameof(n), [1;35m\"[0m[31m[1;35m\\[0m[31m001proto[1;35m\"[0m[31m) ==0)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m agdelete(agraphof(n), n);[1;35m\n[0m[31m return true;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
232
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
233
|
-
[[31m[1;31m"[0m[31mbool rm(Agedge_t *e)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m // removal of the protoedge is not permitted[1;35m\n[0m[31m if ((agnameof(aghead(e))[0] == '[1;35m\\[0m[31m001' && strcmp (agnameof(aghead(e)), [1;35m\"[0m[31m[1;35m\\[0m[31m001proto[1;35m\"[0m[31m) == 0)[1;35m\n[0m[31m || (agnameof(agtail(e))[0] == '[1;35m\\[0m[31m001' && strcmp (agnameof(agtail(e)), [1;35m\"[0m[31m[1;35m\\[0m[31m001proto[1;35m\"[0m[31m) == 0))[1;35m\n[0m[31m return false;[1;35m\n[0m[31m agdelete(agroot(agraphof(aghead(e))), e);[1;35m\n[0m[31m return true;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
234
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!e)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m // removal of the protoedge is not permitted[1;35m\n[0m[31m if ((agnameof(aghead(e))[0] == '[1;35m\\[0m[31m001' && strcmp (agnameof(aghead(e)), [1;35m\"[0m[31m[1;35m\\[0m[31m001proto[1;35m\"[0m[31m) == 0)[1;35m\n[0m[31m || (agnameof(agtail(e))[0] == '[1;35m\\[0m[31m001' && strcmp (agnameof(agtail(e)), [1;35m\"[0m[31m[1;35m\\[0m[31m001proto[1;35m\"[0m[31m) == 0))[1;35m\n[0m[31m return false;[1;35m\n[0m[31m agdelete(agroot(agraphof(aghead(e))), e);[1;35m\n[0m[31m return true;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
235
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
236
|
-
[[31m[1;31m"[0m[31mbool layout(Agraph_t *g, const char *engine)[1;35m\n[0m[31m{[1;35m\n[0m[31m int err;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m err = gvFreeLayout(gvc, g); /* ignore errors */[1;35m\n[0m[31m err = gvLayout(gvc, g, engine);[1;35m\n[0m[31m return (! err);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
237
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m int err;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m err = gvFreeLayout(gvc, g); /* ignore errors */[1;35m\n[0m[31m err = gvLayout(gvc, g, engine);[1;35m\n[0m[31m return (! err);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
238
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
239
|
-
[[31m[1;31m"[0m[31mbool render(Agraph_t *g)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m attach_attrs(g);[1;35m\n[0m[31m return true;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
240
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m attach_attrs(g);[1;35m\n[0m[31m return true;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
241
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
242
|
-
[[31m[1;31m"[0m[31mbool render(Agraph_t *g, const char *format)[1;35m\n[0m[31m{[1;35m\n[0m[31m int err;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m err = gvRender(gvc, g, format, stdout);[1;35m\n[0m[31m return (! err);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
243
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m int err;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m err = gvRender(gvc, g, format, stdout);[1;35m\n[0m[31m return (! err);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
244
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
245
|
-
[[31m[1;31m"[0m[31mbool render(Agraph_t *g, const char *format, FILE *f)[1;35m\n[0m[31m{[1;35m\n[0m[31m int err;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m err = gvRender(gvc, g, format, f);[1;35m\n[0m[31m return (! err);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
246
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m int err;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m err = gvRender(gvc, g, format, f);[1;35m\n[0m[31m return (! err);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
247
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
248
|
-
[[31m[1;31m"[0m[31mbool renderchannel(Agraph_t *g, const char *format, const char *channelname)[1;35m\n[0m[31m{[1;35m\n[0m[31m int err;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m gv_channel_writer_init(gvc);[1;35m\n[0m[31m err = gvRender(gvc, g, format, (FILE*)channelname);[1;35m\n[0m[31m gv_writer_reset (gvc); /* Reset to default */[1;35m\n[0m[31m return (! err);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
249
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m int err;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m gv_channel_writer_init(gvc);[1;35m\n[0m[31m err = gvRender(gvc, g, format, (FILE*)channelname);[1;35m\n[0m[31m gv_writer_reset (gvc); /* Reset to default */[1;35m\n[0m[31m return (! err);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
250
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
251
|
-
[[31m[1;31m"[0m[31mbool render(Agraph_t *g, const char *format, const char *filename)[1;35m\n[0m[31m{[1;35m\n[0m[31m int err;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m err = gvRenderFilename(gvc, g, format, filename);[1;35m\n[0m[31m return (! err);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
252
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m int err;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m err = gvRenderFilename(gvc, g, format, filename);[1;35m\n[0m[31m return (! err);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
253
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
254
|
-
[[31m[1;31m"[0m[31mchar* renderresult(Agraph_t *g, const char *format)[1;35m\n[0m[31m{[1;35m\n[0m[31m BA ba;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (!GD_alg(g))[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m ba.sz = BUFSIZ;[1;35m\n[0m[31m ba.data = (char*)malloc(ba.sz*sizeof(char)); /* must be freed by wrapper code */[1;35m\n[0m[31m ba.len = 0;[1;35m\n[0m[31m gv_string_writer_init(gvc);[1;35m\n[0m[31m (void)gvRender(gvc, g, format, (FILE*)&ba);[1;35m\n[0m[31m gv_writer_reset (gvc); /* Reset to default */[1;35m\n[0m[31m *((int*)GD_alg(g)) = ba.len;[1;35m\n[0m[31m return ba.data;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
255
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m BA ba;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m if (!GD_alg(g))[1;35m\n[0m[31m return NULL;[1;35m\n[0m[31m ba.sz = BUFSIZ;[1;35m\n[0m[31m ba.data = (char*)malloc(ba.sz*sizeof(char)); /* must be freed by wrapper code */[1;35m\n[0m[31m ba.len = 0;[1;35m\n[0m[31m gv_string_writer_init(gvc);[1;35m\n[0m[31m (void)gvRender(gvc, g, format, (FILE*)&ba);[1;35m\n[0m[31m gv_writer_reset (gvc); /* Reset to default */[1;35m\n[0m[31m *((int*)GD_alg(g)) = ba.len;[1;35m\n[0m[31m return ba.data;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
256
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
257
|
-
[[31m[1;31m"[0m[31mvoid renderresult(Agraph_t *g, const char *format, char *outdata)[1;35m\n[0m[31m{[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return;[1;35m\n[0m[31m gv_string_writer_init(gvc);[1;35m\n[0m[31m (void)gvRender(gvc, g, format, (FILE*)outdata);[1;35m\n[0m[31m gv_writer_reset (gvc); /* Reset to default */[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
258
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return;[1;35m\n[0m[31m gv_string_writer_init(gvc);[1;35m\n[0m[31m (void)gvRender(gvc, g, format, (FILE*)outdata);[1;35m\n[0m[31m gv_writer_reset (gvc); /* Reset to default */[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
259
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
260
|
-
[[31m[1;31m"[0m[31mchar* renderdata(Agraph_t *g, const char *format)[1;35m\n[0m[31m{[1;35m\n[0m[31m int err;[1;35m\n[0m[31m char *data;[1;35m\n[0m[31m unsigned int length;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL;[1;35m\n[0m[31m err = gvRenderData(gvc, g, format, &data, &length);[1;35m\n[0m[31m if (err)[1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL;[1;35m\n[0m[31m data = (char*)realloc(data, length + 1);[1;35m\n[0m[31m return data;[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
261
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m int err;[1;35m\n[0m[31m char *data;[1;35m\n[0m[31m unsigned int length;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL;[1;35m\n[0m[31m err = gvRenderData(gvc, g, format, &data, &length);[1;35m\n[0m[31m if (err)[1;35m\n[0m[31m[1;35m\t[0m[31mreturn NULL;[1;35m\n[0m[31m data = (char*)realloc(data, length + 1);[1;35m\n[0m[31m return data;[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
262
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
263
|
-
[[31m[1;31m"[0m[31mbool write(Agraph_t *g, FILE *f)[1;35m\n[0m[31m{[1;35m\n[0m[31m int err;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m err = agwrite(g, f);[1;35m\n[0m[31m return (! err);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
264
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m int err;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m err = agwrite(g, f);[1;35m\n[0m[31m return (! err);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
265
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
266
|
-
[[31m[1;31m"[0m[31mbool write(Agraph_t *g, const char *filename)[1;35m\n[0m[31m{[1;35m\n[0m[31m FILE *f;[1;35m\n[0m[31m int err;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m f = fopen(filename, [1;35m\"[0m[31mw[1;35m\"[0m[31m);[1;35m\n[0m[31m if (!f)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m err = agwrite(g, f);[1;35m\n[0m[31m fclose(f);[1;35m\n[0m[31m return (! err);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
267
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m FILE *f;[1;35m\n[0m[31m int err;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m f = fopen(filename, [1;35m\"[0m[31mw[1;35m\"[0m[31m);[1;35m\n[0m[31m if (!f)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m err = agwrite(g, f);[1;35m\n[0m[31m fclose(f);[1;35m\n[0m[31m return (! err);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
268
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m],
|
269
|
-
[[31m[1;31m"[0m[31mbool tred(Agraph_t *g)[1;35m\n[0m[31m{[1;35m\n[0m[31m int err;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m err = gvToolTred(g);[1;35m\n[0m[31m return (! err);[1;35m\n[0m[31m}[1;31m"[0m[31m[0m,
|
270
|
-
[31m[1;31m"[0m[31m[1;35m\n[0m[31m int err;[1;35m\n[0m[31m[1;35m\n[0m[31m if (!g)[1;35m\n[0m[31m return false;[1;35m\n[0m[31m err = gvToolTred(g);[1;35m\n[0m[31m return (! err);[1;35m\n[0m[31m[1;31m"[0m[31m[0m,
|
271
|
-
[31m[1;31m"[0m[31m}[1;31m"[0m[31m[0m]]
|