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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c947c88a2f7794cdb7116df8766315e92e2beed8d2911998848ef522d065174
4
- data.tar.gz: e04d20bc854c1f8e39fba70bd70c9da49623b1242a05a667886914bff1658186
3
+ metadata.gz: b3988112277371e7f9cafefa42d88f325db8c58a97ab35d20c2d65fde2c3bacf
4
+ data.tar.gz: b6eb594719ebab68d095d072391ddd9b747f27286cda0e30906083acf3f457ed
5
5
  SHA512:
6
- metadata.gz: 3c79d2adde425d48c119519c791376ac73ab5b30d2de7018b5fc0efc58ae28d1ca7c9c7d1d0adde3532ce9708c67c02054428d0beedf99058717a261412a4f3c
7
- data.tar.gz: 98197ecaf90a52bf701faf8c96005eff4dc142682e2c0a8ae00ea7eea93dadfd3cdc1c1bad5119613eecb343532438935e73d7a272927322af8f77ea20455b7f
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.20.0'
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.672]:001 >>> PWN.help
40
+ pwn[v0.4.675]:001 >>> PWN.help
41
41
  ```
42
42
 
43
43
  [![Installing the pwn Security Automation Framework](https://raw.githubusercontent.com/0dayInc/pwn/master/documentation/pwn_install.png)](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.672]:001 >>> PWN.help
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('-IRANGE', '--ip-range=RANGE', '<Required - nmap supported ip range e.g. 192.168.1.1-20, 192.168.1.0/24, etc>') do |i|
14
- opts[:ip_range] = i
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
- ip_range = opts[:ip_range]
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
- discovery_ports = {
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
- ntp: 123,
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
- xfree86: 6000,
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}/nmap_latest_discovery_results"
104
- latest_tcp_results = "#{nmap_results_root}/nmap_latest_tcp_results"
105
- latest_udp_results = "#{nmap_results_root}/nmap_latest_udp_results"
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 = discovery_ports.values
136
- nmap.ack_discovery = discovery_ports.values
137
- nmap.udp_discovery = discovery_ports.values
138
- nmap.sctp_init_ping = discovery_ports.values
139
- nmap.output_all = latest_discovery_results
140
- nmap.targets = ip_range
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: "#{latest_discovery_results}.xml"
181
+ xml_file: latest_discovery_results
150
182
  ) do |xml|
151
183
  xml.each_host do |host|
152
- f.puts host.ip unless File.read(exclude_file).include?(host.ip)
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
- PWN::Plugins::Tor.switch_exit_node(tor_obj: tor_obj) if with_tor
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 = 3
172
- nmap.host_timeout = '999m'
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
- PWN::Plugins::Tor.switch_exit_node(tor_obj: tor_obj) if with_tor
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 = 3
201
- nmap.host_timeout = '999m'
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.4.672'
4
+ VERSION = '0.4.675'
5
5
  end
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.672
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-04 00:00:00.000000000 Z
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.20.0
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.20.0
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"
@@ -1,271 +0,0 @@
1
- => [["static void gv_init(void) {\n /* list of builtins, enable demand loading */\n gvc = gvContextPlugins(lt_preloaded_symbols, DEMAND_LOADING);\n}",
2
- "\n /* list of builtins, enable demand loading */\n gvc = gvContextPlugins(lt_preloaded_symbols, DEMAND_LOADING);\n",
3
- "}"],
4
- ["Agraph_t *graph(char *name)\n{\n if (!gvc)\n gv_init();\n return agopen(name, Agundirected, 0);\n}",
5
- "\n if (!gvc)\n gv_init();\n return agopen(name, Agundirected, 0);\n",
6
- "}"],
7
- ["Agraph_t *digraph(char *name)\n{\n if (!gvc)\n gv_init();\n return agopen(name, Agdirected, 0);\n}",
8
- "\n if (!gvc)\n gv_init();\n return agopen(name, Agdirected, 0);\n",
9
- "}"],
10
- ["Agraph_t *strictgraph(char *name)\n{\n if (!gvc)\n gv_init();\n return agopen(name, Agstrictundirected, 0);\n}",
11
- "\n if (!gvc)\n gv_init();\n return agopen(name, Agstrictundirected, 0);\n",
12
- "}"],
13
- ["Agraph_t *strictdigraph(char *name)\n{\n if (!gvc)\n gv_init();\n return agopen(name, Agstrictdirected, 0);\n}",
14
- "\n if (!gvc)\n gv_init();\n return agopen(name, Agstrictdirected, 0);\n",
15
- "}"],
16
- ["Agraph_t *readstring(char *string)\n{\n if (!gvc)\n gv_init();\n return agmemread(string);\n}",
17
- "\n if (!gvc)\n gv_init();\n return agmemread(string);\n",
18
- "}"],
19
- ["Agraph_t *read(FILE *f)\n{\n if (!gvc)\n gv_init();\n return agread(f, NULL);\n}",
20
- "\n if (!gvc)\n gv_init();\n return agread(f, NULL);\n",
21
- "}"],
22
- ["Agraph_t *read(const char *filename)\n{\n FILE *f;\n Agraph_t *g;\n\n f = fopen(filename, \"r\");\n if (!f)\n return NULL;\n if (!gvc)\n gv_init();\n g = agread(f, NULL);\n fclose(f);\n return g;\n}",
23
- "\n FILE *f;\n Agraph_t *g;\n\n f = fopen(filename, \"r\");\n if (!f)\n return NULL;\n if (!gvc)\n gv_init();\n g = agread(f, NULL);\n fclose(f);\n return g;\n",
24
- "}"],
25
- ["Agraph_t *graph(Agraph_t *g, char *name)\n{\n if (!gvc)\n gv_init();\n return agsubg(g, name, 1);\n}",
26
- "\n if (!gvc)\n gv_init();\n return agsubg(g, name, 1);\n",
27
- "}"],
28
- ["Agnode_t *node(Agraph_t *g, char *name)\n{\n if (!gvc)\n return NULL;\n return agnode(g, name, 1);\n}",
29
- "\n if (!gvc)\n return NULL;\n return agnode(g, name, 1);\n",
30
- "}"],
31
- ["Agedge_t *edge(Agraph_t* g, Agnode_t *t, Agnode_t *h)\n{\n if (!gvc || !t || !h || !g)\n return NULL;\n // edges from/to the protonode are not permitted\n if (AGTYPE(t) == AGRAPH || AGTYPE(h) == AGRAPH)\n\treturn NULL;\n return agedge(g, t, h, NULL, 1);\n}",
32
- "\n if (!gvc || !t || !h || !g)\n return NULL;\n // edges from/to the protonode are not permitted\n if (AGTYPE(t) == AGRAPH || AGTYPE(h) == AGRAPH)\n\treturn NULL;\n return agedge(g, t, h, NULL, 1);\n",
33
- "}"],
34
- ["Agedge_t *edge(Agnode_t *t, Agnode_t *h)\n{\n return edge(agraphof(t), t, h);\n}",
35
- "\n return edge(agraphof(t), t, h);\n",
36
- "}"],
37
- ["Agedge_t *edge(char *tname, Agnode_t *h)\n{\n return edge(node(agraphof(h), tname), h);\n}",
38
- "\n return edge(node(agraphof(h), tname), h);\n",
39
- "}"],
40
- ["Agedge_t *edge(Agnode_t *t, char *hname)\n{\n return edge(t, node(agraphof(t), hname));\n}",
41
- "\n return edge(t, node(agraphof(t), hname));\n",
42
- "}"],
43
- ["Agedge_t *edge(Agraph_t *g, char *tname, char *hname)\n{\n return edge(g, node(g, tname), node(g, hname));\n}",
44
- "\n return edge(g, node(g, tname), node(g, hname));\n",
45
- "}"],
46
- ["static char* myagxget(void *obj, Agsym_t *a)\n{\n int len;\n char *val, *hs;\n\n if (!obj || !a)\n return emptystring;\n val = agxget(obj, a);\n if (!val)\n return emptystring;\n if (a->name[0] == 'l' && strcmp(a->name, \"label\") == 0 && aghtmlstr(val)) {\n len = strlen(val);\n hs = (char*)malloc(len + 3);\n hs[0] = '<';\n strcpy(hs+1, val);\n hs[len+1] = '>';\n hs[len+2] = '\\0';\n return hs;\n }\n return val;\n}",
47
- "\n int len;\n char *val, *hs;\n\n if (!obj || !a)\n return emptystring;\n val = agxget(obj, a);\n if (!val)\n return emptystring;\n if (a->name[0] == 'l' && strcmp(a->name, \"label\") == 0 && aghtmlstr(val)) {\n len = strlen(val);\n hs = (char*)malloc(len + 3);\n hs[0] = '<';\n strcpy(hs+1, val);\n hs[len+1] = '>';\n hs[len+2] = '\\0';\n return hs;\n }\n return val;\n",
48
- "}"],
49
- ["char *getv(Agraph_t *g, Agsym_t *a)\n{\n return myagxget(g, a);\n}",
50
- "\n return myagxget(g, a);\n",
51
- "}"],
52
- ["char *getv(Agraph_t *g, char *attr)\n{\n Agsym_t *a;\n\n if (!g || !attr)\n return NULL;\n a = agfindattr(agroot(g), attr);\n return myagxget(g, a);\n}",
53
- "\n Agsym_t *a;\n\n if (!g || !attr)\n return NULL;\n a = agfindattr(agroot(g), attr);\n return myagxget(g, a);\n",
54
- "}"],
55
- ["static void myagxset(void *obj, Agsym_t *a, char *val)\n{\n int len;\n char *hs;\n\n if (a->name[0] == 'l' && val[0] == '<' && strcmp(a->name, \"label\") == 0) {\n len = strlen(val);\n if (val[len-1] == '>') {\n hs = strdup(val+1);\n *(hs+len-2) = '\\0';\n val = agstrdup_html(agraphof(obj),hs);\n free(hs);\n }\n }\n agxset(obj, a, val);\n}",
56
- "\n int len;\n char *hs;\n\n if (a->name[0] == 'l' && val[0] == '<' && strcmp(a->name, \"label\") == 0) {\n len = strlen(val);\n if (val[len-1] == '>') {\n hs = strdup(val+1);\n *(hs+len-2) = '\\0';\n val = agstrdup_html(agraphof(obj),hs);\n free(hs);\n }\n }\n agxset(obj, a, val);\n",
57
- "}"],
58
- ["char *setv(Agraph_t *g, Agsym_t *a, char *val)\n{\n if (!g || !a || !val)\n return NULL;\n myagxset(g, a, val);\n return val;\n}",
59
- "\n if (!g || !a || !val)\n return NULL;\n myagxset(g, a, val);\n return val;\n",
60
- "}"],
61
- ["char *setv(Agraph_t *g, char *attr, char *val)\n{\n Agsym_t *a;\n\n if (!g || !attr || !val)\n return NULL;\n a = agfindattr(agroot(g), attr);\n if (!a)\n a = agraphattr(g->root, attr, emptystring);\n myagxset(g, a, val);\n return val;\n}",
62
- "\n Agsym_t *a;\n\n if (!g || !attr || !val)\n return NULL;\n a = agfindattr(agroot(g), attr);\n if (!a)\n a = agraphattr(g->root, attr, emptystring);\n myagxset(g, a, val);\n return val;\n",
63
- "}"],
64
- ["char *getv(Agnode_t *n, Agsym_t *a)\n{\n if (!n || !a)\n return NULL;\n if (AGTYPE(n) == AGRAPH) // protonode \n\treturn NULL; // FIXME ??\n return myagxget(n, a);\n}",
65
- "\n if (!n || !a)\n return NULL;\n if (AGTYPE(n) == AGRAPH) // protonode \n\treturn NULL; // FIXME ??\n return myagxget(n, a);\n",
66
- "}"],
67
- ["char *getv(Agnode_t *n, char *attr)\n{\n Agraph_t *g;\n Agsym_t *a;\n\n if (!n || !attr)\n return NULL;\n if (AGTYPE(n) == AGRAPH) // protonode \n\treturn NULL; // FIXME ??\n g = agroot(agraphof(n));\n a = agattr(g, AGNODE, attr, NULL);\n return myagxget(n, a);\n}",
68
- "\n Agraph_t *g;\n Agsym_t *a;\n\n if (!n || !attr)\n return NULL;\n if (AGTYPE(n) == AGRAPH) // protonode \n\treturn NULL; // FIXME ??\n g = agroot(agraphof(n));\n a = agattr(g, AGNODE, attr, NULL);\n return myagxget(n, a);\n",
69
- "}"],
70
- ["char *setv(Agnode_t *n, Agsym_t *a, char *val)\n{\n if (!n || !a || !val)\n return NULL;\n if (AGTYPE(n) == AGRAPH) // protonode \n\treturn NULL; // FIXME ??\n myagxset(n, a, val);\n return val;\n}",
71
- "\n if (!n || !a || !val)\n return NULL;\n if (AGTYPE(n) == AGRAPH) // protonode \n\treturn NULL; // FIXME ??\n myagxset(n, a, val);\n return val;\n",
72
- "}"],
73
- ["char *setv(Agnode_t *n, char *attr, char *val)\n{\n Agraph_t *g;\n Agsym_t *a;\n\n if (!n || !attr || !val)\n return NULL;\n if (AGTYPE(n) == AGRAPH) { // protonode \n\tg = (Agraph_t*)n;\n \ta = agattr(g, AGNODE, attr, val); // create default attribute in psuodo protonode\n\t // FIXME? - deal with html in \"label\" attributes\n\treturn val;\n }\n g = agroot(agraphof(n));\n a = agattr(g, AGNODE, attr, NULL);\n if (!a)\n a = agnodeattr(g, attr, emptystring);\n myagxset(n, a, val);\n return val;\n}",
74
- "\n Agraph_t *g;\n Agsym_t *a;\n\n if (!n || !attr || !val)\n return NULL;\n if (AGTYPE(n) == AGRAPH) { // protonode \n\tg = (Agraph_t*)n;\n \ta = agattr(g, AGNODE, attr, val); // create default attribute in psuodo protonode\n\t // FIXME? - deal with html in \"label\" attributes\n\treturn val;\n }\n g = agroot(agraphof(n));\n a = agattr(g, AGNODE, attr, NULL);\n if (!a)\n a = agnodeattr(g, attr, emptystring);\n myagxset(n, a, val);\n return val;\n",
75
- "}"],
76
- ["char *getv(Agedge_t *e, Agsym_t *a)\n{\n if (!e || !a)\n return NULL;\n if (AGTYPE(e) == AGRAPH) // protoedge \n\treturn NULL; // FIXME ??\n return myagxget(e, a);\n}",
77
- "\n if (!e || !a)\n return NULL;\n if (AGTYPE(e) == AGRAPH) // protoedge \n\treturn NULL; // FIXME ??\n return myagxget(e, a);\n",
78
- "}"],
79
- ["char *getv(Agedge_t *e, char *attr)\n{\n Agraph_t *g;\n Agsym_t *a;\n\n if (!e || !attr)\n return NULL;\n if (AGTYPE(e) == AGRAPH) // protoedge \n\treturn NULL; // FIXME ??\n g = agraphof(agtail(e));\n a = agattr(g, AGEDGE, attr, NULL);\n return myagxget(e, a);\n}",
80
- "\n Agraph_t *g;\n Agsym_t *a;\n\n if (!e || !attr)\n return NULL;\n if (AGTYPE(e) == AGRAPH) // protoedge \n\treturn NULL; // FIXME ??\n g = agraphof(agtail(e));\n a = agattr(g, AGEDGE, attr, NULL);\n return myagxget(e, a);\n",
81
- "}"],
82
- ["char *setv(Agedge_t *e, Agsym_t *a, char *val)\n{\n if (!e || !a || !val)\n return NULL;\n if (AGTYPE(e) == AGRAPH) // protoedge \n\treturn NULL; // FIXME ??\n myagxset(e, a, val);\n return val;\n}",
83
- "\n if (!e || !a || !val)\n return NULL;\n if (AGTYPE(e) == AGRAPH) // protoedge \n\treturn NULL; // FIXME ??\n myagxset(e, a, val);\n return val;\n",
84
- "}"],
85
- ["char *setv(Agedge_t *e, char *attr, char *val)\n{\n Agraph_t *g;\n Agsym_t *a;\n\n if (!e || !attr || !val)\n return NULL;\n if (AGTYPE(e) == AGRAPH) { // protoedge \n\tg = (Agraph_t*)e;\n \ta = agattr(g, AGEDGE, attr, val); // create default attribute in pseudo protoedge\n\t // FIXME? - deal with html in \"label\" attributes\n\treturn val;\n }\n g = agroot(agraphof(agtail(e)));\n a = agattr(g, AGEDGE, attr, NULL);\n if (!a)\n a = agattr(g, AGEDGE, attr, emptystring);\n myagxset(e, a, val);\n return val;\n}",
86
- "\n Agraph_t *g;\n Agsym_t *a;\n\n if (!e || !attr || !val)\n return NULL;\n if (AGTYPE(e) == AGRAPH) { // protoedge \n\tg = (Agraph_t*)e;\n \ta = agattr(g, AGEDGE, attr, val); // create default attribute in pseudo protoedge\n\t // FIXME? - deal with html in \"label\" attributes\n\treturn val;\n }\n g = agroot(agraphof(agtail(e)));\n a = agattr(g, AGEDGE, attr, NULL);\n if (!a)\n a = agattr(g, AGEDGE, attr, emptystring);\n myagxset(e, a, val);\n return val;\n",
87
- "}"],
88
- ["Agraph_t *findsubg(Agraph_t *g, char *name)\n{\n if (!g || !name)\n return NULL;\n return agsubg(g, name, 0);\n}",
89
- "\n if (!g || !name)\n return NULL;\n return agsubg(g, name, 0);\n",
90
- "}"],
91
- ["Agnode_t *findnode(Agraph_t *g, char *name)\n{\n if (!g || !name)\n return NULL;\n return agnode(g, name, 0);\n}",
92
- "\n if (!g || !name)\n return NULL;\n return agnode(g, name, 0);\n",
93
- "}"],
94
- ["Agedge_t *findedge(Agnode_t *t, Agnode_t *h)\n{\n if (!t || !h)\n return NULL;\n if (AGTYPE(t) == AGRAPH || AGTYPE(h) == AGRAPH)\n\treturn NULL;\n return agfindedge(agraphof(t), t, h);\n}",
95
- "\n if (!t || !h)\n return NULL;\n if (AGTYPE(t) == AGRAPH || AGTYPE(h) == AGRAPH)\n\treturn NULL;\n return agfindedge(agraphof(t), t, h);\n",
96
- "}"],
97
- ["Agsym_t *findattr(Agraph_t *g, char *name)\n{\n if (!g || !name)\n return NULL;\n return agfindattr(g, name);\n}",
98
- "\n if (!g || !name)\n return NULL;\n return agfindattr(g, name);\n",
99
- "}"],
100
- ["Agsym_t *findattr(Agnode_t *n, char *name)\n{\n if (!n || !name)\n return NULL;\n return agfindattr(n, name);\n}",
101
- "\n if (!n || !name)\n return NULL;\n return agfindattr(n, name);\n",
102
- "}"],
103
- ["Agsym_t *findattr(Agedge_t *e, char *name)\n{\n if (!e || !name)\n return NULL;\n return agfindattr(e, name);\n}",
104
- "\n if (!e || !name)\n return NULL;\n return agfindattr(e, name);\n",
105
- "}"],
106
- ["Agnode_t *headof(Agedge_t *e)\n{\n if (!e)\n return NULL;\n if (AGTYPE(e) == AGRAPH)\n\treturn NULL;\n return aghead(e);\n}",
107
- "\n if (!e)\n return NULL;\n if (AGTYPE(e) == AGRAPH)\n\treturn NULL;\n return aghead(e);\n",
108
- "}"],
109
- ["Agnode_t *tailof(Agedge_t *e)\n{\n if (!e)\n return NULL;\n if (AGTYPE(e) == AGRAPH)\n\treturn NULL;\n return agtail(e);\n}",
110
- "\n if (!e)\n return NULL;\n if (AGTYPE(e) == AGRAPH)\n\treturn NULL;\n return agtail(e);\n",
111
- "}"],
112
- ["Agraph_t *graphof(Agraph_t *g)\n{\n if (!g || g == g->root)\n return NULL;\n return agroot(g);\n}",
113
- "\n if (!g || g == g->root)\n return NULL;\n return agroot(g);\n",
114
- "}"],
115
- ["Agraph_t *graphof(Agedge_t *e)\n{\n if (!e)\n return NULL;\n if (AGTYPE(e) == AGRAPH)\n\treturn (Agraph_t*)e; /* graph of protoedge is itself recast */\n return agraphof(agtail(e));\n}",
116
- "\n if (!e)\n return NULL;\n if (AGTYPE(e) == AGRAPH)\n\treturn (Agraph_t*)e; /* graph of protoedge is itself recast */\n return agraphof(agtail(e));\n",
117
- "}"],
118
- ["Agraph_t *graphof(Agnode_t *n)\n{\n if (!n)\n return NULL;\n if (AGTYPE(n) == AGRAPH)\n\treturn (Agraph_t*)n; /* graph of protonode is itself recast */\n return agraphof(n);\n}",
119
- "\n if (!n)\n return NULL;\n if (AGTYPE(n) == AGRAPH)\n\treturn (Agraph_t*)n; /* graph of protonode is itself recast */\n return agraphof(n);\n",
120
- "}"],
121
- ["Agraph_t *rootof(Agraph_t *g)\n{\n if (!g)\n return NULL;\n return agroot(g);\n}",
122
- "\n if (!g)\n return NULL;\n return agroot(g);\n",
123
- "}"],
124
- ["Agnode_t *protonode(Agraph_t *g)\n{\n if (!g)\n return NULL;\n return (Agnode_t *)g; // gross abuse of the type system!\n}",
125
- "\n if (!g)\n return NULL;\n return (Agnode_t *)g; // gross abuse of the type system!\n",
126
- "}"],
127
- ["Agedge_t *protoedge(Agraph_t *g)\n{\n if (!g)\n return NULL;\n return (Agedge_t *)g; // gross abuse of the type system!\n}",
128
- "\n if (!g)\n return NULL;\n return (Agedge_t *)g; // gross abuse of the type system!\n",
129
- "}"],
130
- ["char *nameof(Agraph_t *g)\n{\n if (!g)\n return NULL;\n return agnameof(g);\n}",
131
- "\n if (!g)\n return NULL;\n return agnameof(g);\n",
132
- "}"],
133
- ["char *nameof(Agnode_t *n)\n{\n if (!n)\n return NULL;\n if (AGTYPE(n) == AGRAPH)\n\treturn NULL;\n return agnameof(n);\n}",
134
- "\n if (!n)\n return NULL;\n if (AGTYPE(n) == AGRAPH)\n\treturn NULL;\n return agnameof(n);\n",
135
- "}"],
136
- ["char *nameof(Agsym_t *a)\n{\n if (!a)\n return NULL;\n return a->name;\n}",
137
- "\n if (!a)\n return NULL;\n return a->name;\n",
138
- "}"],
139
- ["bool ok(Agraph_t *g)\n{\n if (!g) \n return false;\n return true;\n}",
140
- "\n if (!g) \n return false;\n return true;\n",
141
- "}"],
142
- ["bool ok(Agnode_t *n)\n{\n if (!n) \n return false;\n return true;\n}",
143
- "\n if (!n) \n return false;\n return true;\n",
144
- "}"],
145
- ["bool ok(Agedge_t *e)\n{\n if (!e) \n return false;\n return true;\n}",
146
- "\n if (!e) \n return false;\n return true;\n",
147
- "}"],
148
- ["bool ok(Agsym_t *a)\n{\n if (!a) \n return false;\n return true;\n}",
149
- "\n if (!a) \n return false;\n return true;\n",
150
- "}"],
151
- ["Agraph_t *firstsubg(Agraph_t *g)\n{\n if (!g)\n return NULL;\n return agfstsubg(g);\n}",
152
- "\n if (!g)\n return NULL;\n return agfstsubg(g);\n",
153
- "}"],
154
- ["Agraph_t *nextsubg(Agraph_t *g, Agraph_t *sg)\n{\n\n if (!g || !sg)\n return NULL;\n return agnxtsubg(sg);\n}",
155
- "\n\n if (!g || !sg)\n return NULL;\n return agnxtsubg(sg);\n",
156
- "}"],
157
- ["Agraph_t *firstsupg(Agraph_t *g)\n{\n return g->parent;\n}", "\n return g->parent;\n", "}"],
158
- ["Agraph_t *nextsupg(Agraph_t *g, Agraph_t *sg)\n{\n return NULL;\n}",
159
- "\n return NULL;\n",
160
- "}"],
161
- ["Agedge_t *firstout(Agraph_t *g)\n{\n Agnode_t *n;\n Agedge_t *e;\n\n if (!g)\n return NULL;\n for (n = agfstnode(g); n; n = agnxtnode(g, n)) {\n\te = agfstout(g, n);\n\tif (e) return e;\n }\n return NULL;\n}",
162
- "\n Agnode_t *n;\n Agedge_t *e;\n\n if (!g)\n return NULL;\n for (n = agfstnode(g); n; n = agnxtnode(g, n)) {\n\te = agfstout(g, n);\n\tif (e) return e;\n }\n return NULL;\n",
163
- "}"],
164
- ["Agedge_t *nextout(Agraph_t *g, Agedge_t *e)\n{\n Agnode_t *n;\n Agedge_t *ne;\n\n if (!g || !e)\n return NULL;\n ne = agnxtout(g, e);\n if (ne)\n return (ne);\n for (n = agnxtnode(g, agtail(e)); n; n = agnxtnode(g, n)) {\n\tne = agfstout(g, n);\n\tif (ne) return ne;\n }\n return NULL;\n}",
165
- "\n Agnode_t *n;\n Agedge_t *ne;\n\n if (!g || !e)\n return NULL;\n ne = agnxtout(g, e);\n if (ne)\n return (ne);\n for (n = agnxtnode(g, agtail(e)); n; n = agnxtnode(g, n)) {\n\tne = agfstout(g, n);\n\tif (ne) return ne;\n }\n return NULL;\n",
166
- "}"],
167
- ["Agedge_t *firstedge(Agraph_t *g)\n{\n return firstout(g);\n} \n\nAgedge_t *nextedge(Agraph_t *g, Agedge_t *e)\n{\n return nextout(g, e);\n} \n\nAgedge_t *firstout(Agnode_t *n)\n{\n if (!n)\n return NULL;\n return agfstout(agraphof(n), n);\n}",
168
- "\n return firstout(g);\n} \n\nAgedge_t *nextedge(Agraph_t *g, Agedge_t *e)\n{\n return nextout(g, e);\n} \n\nAgedge_t *firstout(Agnode_t *n)\n{\n if (!n)\n return NULL;\n return agfstout(agraphof(n), n);\n",
169
- "}"],
170
- ["Agedge_t *nextout(Agnode_t *n, Agedge_t *e)\n{\n if (!n || !e)\n return NULL;\n return agnxtout(agraphof(n), e);\n}",
171
- "\n if (!n || !e)\n return NULL;\n return agnxtout(agraphof(n), e);\n",
172
- "}"],
173
- ["Agnode_t *firsthead(Agnode_t *n)\n{\n Agedge_t *e;\n\n if (!n)\n return NULL;\n e = agfstout(agraphof(n), n);\n if (!e)\n return NULL;\n return aghead(e);\n}",
174
- "\n Agedge_t *e;\n\n if (!n)\n return NULL;\n e = agfstout(agraphof(n), n);\n if (!e)\n return NULL;\n return aghead(e);\n",
175
- "}"],
176
- ["Agnode_t *nexthead(Agnode_t *n, Agnode_t *h)\n{\n Agedge_t *e;\n Agraph_t *g;\n\n if (!n || !h)\n return NULL;\n g = agraphof(n);\n e = agfindedge(g, n, h);\n if (!e)\n return NULL;\n do {\n e = agnxtout(g, AGMKOUT(e));\n if (!e)\n return NULL;\n } while (aghead(e) == h);\n return aghead(e);\n}",
177
- "\n Agedge_t *e;\n Agraph_t *g;\n\n if (!n || !h)\n return NULL;\n g = agraphof(n);\n e = agfindedge(g, n, h);\n if (!e)\n return NULL;\n do {\n e = agnxtout(g, AGMKOUT(e));\n if (!e)\n return NULL;\n } while (aghead(e) == h);\n return aghead(e);\n",
178
- "}"],
179
- ["Agedge_t *firstedge(Agnode_t *n)\n{\n if (!n)\n return NULL;\n return agfstedge(agraphof(n), n);\n} \n\nAgedge_t *nextedge(Agnode_t *n, Agedge_t *e)\n{\n if (!n || !e)\n return NULL;\n return agnxtedge(agraphof(n), e, n); \n} \n\nAgedge_t *firstin(Agraph_t *g)\n{\n Agnode_t *n;\n\n if (!g)\n return NULL;\n n = agfstnode(g);\n if (!n)\n return NULL;\n return agfstin(g, n);\n}",
180
- "\n if (!n)\n return NULL;\n return agfstedge(agraphof(n), n);\n} \n\nAgedge_t *nextedge(Agnode_t *n, Agedge_t *e)\n{\n if (!n || !e)\n return NULL;\n return agnxtedge(agraphof(n), e, n); \n} \n\nAgedge_t *firstin(Agraph_t *g)\n{\n Agnode_t *n;\n\n if (!g)\n return NULL;\n n = agfstnode(g);\n if (!n)\n return NULL;\n return agfstin(g, n);\n",
181
- "}"],
182
- ["Agedge_t *nextin(Agraph_t *g, Agedge_t *e)\n{\n Agnode_t *n;\n Agedge_t *ne;\n\n if (!g || !e)\n return NULL;\n ne = agnxtin(g, e);\n if (ne)\n return (ne);\n n = agnxtnode(g, aghead(e));\n if (!n)\n return NULL;\n return agfstin(g, n);\n}",
183
- "\n Agnode_t *n;\n Agedge_t *ne;\n\n if (!g || !e)\n return NULL;\n ne = agnxtin(g, e);\n if (ne)\n return (ne);\n n = agnxtnode(g, aghead(e));\n if (!n)\n return NULL;\n return agfstin(g, n);\n",
184
- "}"],
185
- ["Agedge_t *firstin(Agnode_t *n)\n{\n if (!n)\n return NULL;\n return agfstin(agraphof(n), n);\n}",
186
- "\n if (!n)\n return NULL;\n return agfstin(agraphof(n), n);\n",
187
- "}"],
188
- ["Agedge_t *nextin(Agnode_t *n, Agedge_t *e)\n{\n if (!n || !e)\n return NULL;\n return agnxtin(agraphof(n), e);\n}",
189
- "\n if (!n || !e)\n return NULL;\n return agnxtin(agraphof(n), e);\n",
190
- "}"],
191
- ["Agnode_t *firsttail(Agnode_t *n)\n{\n Agedge_t *e;\n\n if (!n)\n return NULL;\n e = agfstin(agraphof(n), n);\n if (!e)\n return NULL;\n return agtail(e);\n}",
192
- "\n Agedge_t *e;\n\n if (!n)\n return NULL;\n e = agfstin(agraphof(n), n);\n if (!e)\n return NULL;\n return agtail(e);\n",
193
- "}"],
194
- ["Agnode_t *nexttail(Agnode_t *n, Agnode_t *t)\n{\n Agedge_t *e;\n Agraph_t *g;\n\n if (!n || !t)\n return NULL;\n g = agraphof(n);\n e = agfindedge(g, t, n);\n if (!e)\n return NULL;\n do {\n e = agnxtin(g, AGMKIN(e));\n if (!e)\n return NULL;\n } while (agtail(e) == t);\n return agtail(e);\n}",
195
- "\n Agedge_t *e;\n Agraph_t *g;\n\n if (!n || !t)\n return NULL;\n g = agraphof(n);\n e = agfindedge(g, t, n);\n if (!e)\n return NULL;\n do {\n e = agnxtin(g, AGMKIN(e));\n if (!e)\n return NULL;\n } while (agtail(e) == t);\n return agtail(e);\n",
196
- "}"],
197
- ["Agnode_t *firstnode(Agraph_t *g)\n{\n if (!g)\n return NULL;\n return agfstnode(g);\n}",
198
- "\n if (!g)\n return NULL;\n return agfstnode(g);\n",
199
- "}"],
200
- ["Agnode_t *nextnode(Agraph_t *g, Agnode_t *n)\n{\n if (!g || !n)\n return NULL;\n return agnxtnode(g, n);\n}",
201
- "\n if (!g || !n)\n return NULL;\n return agnxtnode(g, n);\n",
202
- "}"],
203
- ["Agnode_t *firstnode(Agedge_t *e)\n{\n if (!e)\n return NULL;\n return agtail(e);\n}",
204
- "\n if (!e)\n return NULL;\n return agtail(e);\n",
205
- "}"],
206
- ["Agnode_t *nextnode(Agedge_t *e, Agnode_t *n)\n{\n if (!e || n != agtail(e))\n return NULL;\n return aghead(e);\n}",
207
- "\n if (!e || n != agtail(e))\n return NULL;\n return aghead(e);\n",
208
- "}"],
209
- ["Agsym_t *firstattr(Agraph_t *g)\n{\n if (!g)\n return NULL;\n g = agroot(g);\n return agnxtattr(g,AGRAPH,NULL);\n}",
210
- "\n if (!g)\n return NULL;\n g = agroot(g);\n return agnxtattr(g,AGRAPH,NULL);\n",
211
- "}"],
212
- ["Agsym_t *nextattr(Agraph_t *g, Agsym_t *a)\n{\n if (!g || !a)\n return NULL;\n g = agroot(g);\n return agnxtattr(g,AGRAPH,a);\n}",
213
- "\n if (!g || !a)\n return NULL;\n g = agroot(g);\n return agnxtattr(g,AGRAPH,a);\n",
214
- "}"],
215
- ["Agsym_t *firstattr(Agnode_t *n)\n{\n Agraph_t *g;\n\n if (!n)\n return NULL;\n g = agraphof(n);\n return agnxtattr(g,AGNODE,NULL);\n}",
216
- "\n Agraph_t *g;\n\n if (!n)\n return NULL;\n g = agraphof(n);\n return agnxtattr(g,AGNODE,NULL);\n",
217
- "}"],
218
- ["Agsym_t *nextattr(Agnode_t *n, Agsym_t *a)\n{\n Agraph_t *g;\n\n if (!n || !a)\n return NULL;\n g = agraphof(n);\n return agnxtattr(g,AGNODE,a);\n}",
219
- "\n Agraph_t *g;\n\n if (!n || !a)\n return NULL;\n g = agraphof(n);\n return agnxtattr(g,AGNODE,a);\n",
220
- "}"],
221
- ["Agsym_t *firstattr(Agedge_t *e)\n{\n Agraph_t *g;\n\n if (!e)\n return NULL;\n g = agraphof(agtail(e));\n return agnxtattr(g,AGEDGE,NULL);\n}",
222
- "\n Agraph_t *g;\n\n if (!e)\n return NULL;\n g = agraphof(agtail(e));\n return agnxtattr(g,AGEDGE,NULL);\n",
223
- "}"],
224
- ["Agsym_t *nextattr(Agedge_t *e, Agsym_t *a)\n{\n Agraph_t *g;\n\n if (!e || !a)\n return NULL;\n g = agraphof(agtail(e));\n return agnxtattr(g,AGEDGE,a);\n}",
225
- "\n Agraph_t *g;\n\n if (!e || !a)\n return NULL;\n g = agraphof(agtail(e));\n return agnxtattr(g,AGEDGE,a);\n",
226
- "}"],
227
- ["bool rm(Agraph_t *g)\n{\n if (!g)\n return false;\n#if 0\n Agraph_t* sg;\n for (sg = agfstsubg (g); sg; sg = agnxtsubg (sg))\n\trm(sg);\n if (g == agroot(g))\n\tagclose(g);\n else\n agdelete(agparent(g), g);\n#endif\n /* The rm function appears to have the semantics of agclose, so\n * we should just do that, and let cgraph take care of all the\n * details.\n */\n agclose(g);\n return true;\n}",
228
- "\n if (!g)\n return false;\n#if 0\n Agraph_t* sg;\n for (sg = agfstsubg (g); sg; sg = agnxtsubg (sg))\n\trm(sg);\n if (g == agroot(g))\n\tagclose(g);\n else\n agdelete(agparent(g), g);\n#endif\n /* The rm function appears to have the semantics of agclose, so\n * we should just do that, and let cgraph take care of all the\n * details.\n */\n agclose(g);\n return true;\n",
229
- "}"],
230
- ["bool rm(Agnode_t *n)\n{\n if (!n)\n return false;\n // removal of the protonode is not permitted\n if (agnameof(n)[0] == '\\001' && strcmp (agnameof(n), \"\\001proto\") ==0)\n return false;\n agdelete(agraphof(n), n);\n return true;\n}",
231
- "\n if (!n)\n return false;\n // removal of the protonode is not permitted\n if (agnameof(n)[0] == '\\001' && strcmp (agnameof(n), \"\\001proto\") ==0)\n return false;\n agdelete(agraphof(n), n);\n return true;\n",
232
- "}"],
233
- ["bool rm(Agedge_t *e)\n{\n if (!e)\n return false;\n // removal of the protoedge is not permitted\n if ((agnameof(aghead(e))[0] == '\\001' && strcmp (agnameof(aghead(e)), \"\\001proto\") == 0)\n || (agnameof(agtail(e))[0] == '\\001' && strcmp (agnameof(agtail(e)), \"\\001proto\") == 0))\n return false;\n agdelete(agroot(agraphof(aghead(e))), e);\n return true;\n}",
234
- "\n if (!e)\n return false;\n // removal of the protoedge is not permitted\n if ((agnameof(aghead(e))[0] == '\\001' && strcmp (agnameof(aghead(e)), \"\\001proto\") == 0)\n || (agnameof(agtail(e))[0] == '\\001' && strcmp (agnameof(agtail(e)), \"\\001proto\") == 0))\n return false;\n agdelete(agroot(agraphof(aghead(e))), e);\n return true;\n",
235
- "}"],
236
- ["bool layout(Agraph_t *g, const char *engine)\n{\n int err;\n\n if (!g)\n return false;\n err = gvFreeLayout(gvc, g); /* ignore errors */\n err = gvLayout(gvc, g, engine);\n return (! err);\n}",
237
- "\n int err;\n\n if (!g)\n return false;\n err = gvFreeLayout(gvc, g); /* ignore errors */\n err = gvLayout(gvc, g, engine);\n return (! err);\n",
238
- "}"],
239
- ["bool render(Agraph_t *g)\n{\n if (!g)\n return false;\n attach_attrs(g);\n return true;\n}",
240
- "\n if (!g)\n return false;\n attach_attrs(g);\n return true;\n",
241
- "}"],
242
- ["bool render(Agraph_t *g, const char *format)\n{\n int err;\n\n if (!g)\n return false;\n err = gvRender(gvc, g, format, stdout);\n return (! err);\n}",
243
- "\n int err;\n\n if (!g)\n return false;\n err = gvRender(gvc, g, format, stdout);\n return (! err);\n",
244
- "}"],
245
- ["bool render(Agraph_t *g, const char *format, FILE *f)\n{\n int err;\n\n if (!g)\n return false;\n err = gvRender(gvc, g, format, f);\n return (! err);\n}",
246
- "\n int err;\n\n if (!g)\n return false;\n err = gvRender(gvc, g, format, f);\n return (! err);\n",
247
- "}"],
248
- ["bool renderchannel(Agraph_t *g, const char *format, const char *channelname)\n{\n int err;\n\n if (!g)\n return false;\n gv_channel_writer_init(gvc);\n err = gvRender(gvc, g, format, (FILE*)channelname);\n gv_writer_reset (gvc); /* Reset to default */\n return (! err);\n}",
249
- "\n int err;\n\n if (!g)\n return false;\n gv_channel_writer_init(gvc);\n err = gvRender(gvc, g, format, (FILE*)channelname);\n gv_writer_reset (gvc); /* Reset to default */\n return (! err);\n",
250
- "}"],
251
- ["bool render(Agraph_t *g, const char *format, const char *filename)\n{\n int err;\n\n if (!g)\n return false;\n err = gvRenderFilename(gvc, g, format, filename);\n return (! err);\n}",
252
- "\n int err;\n\n if (!g)\n return false;\n err = gvRenderFilename(gvc, g, format, filename);\n return (! err);\n",
253
- "}"],
254
- ["char* renderresult(Agraph_t *g, const char *format)\n{\n BA ba;\n\n if (!g)\n return NULL;\n if (!GD_alg(g))\n return NULL;\n ba.sz = BUFSIZ;\n ba.data = (char*)malloc(ba.sz*sizeof(char)); /* must be freed by wrapper code */\n ba.len = 0;\n gv_string_writer_init(gvc);\n (void)gvRender(gvc, g, format, (FILE*)&ba);\n gv_writer_reset (gvc); /* Reset to default */\n *((int*)GD_alg(g)) = ba.len;\n return ba.data;\n}",
255
- "\n BA ba;\n\n if (!g)\n return NULL;\n if (!GD_alg(g))\n return NULL;\n ba.sz = BUFSIZ;\n ba.data = (char*)malloc(ba.sz*sizeof(char)); /* must be freed by wrapper code */\n ba.len = 0;\n gv_string_writer_init(gvc);\n (void)gvRender(gvc, g, format, (FILE*)&ba);\n gv_writer_reset (gvc); /* Reset to default */\n *((int*)GD_alg(g)) = ba.len;\n return ba.data;\n",
256
- "}"],
257
- ["void renderresult(Agraph_t *g, const char *format, char *outdata)\n{\n if (!g)\n return;\n gv_string_writer_init(gvc);\n (void)gvRender(gvc, g, format, (FILE*)outdata);\n gv_writer_reset (gvc); /* Reset to default */\n}",
258
- "\n if (!g)\n return;\n gv_string_writer_init(gvc);\n (void)gvRender(gvc, g, format, (FILE*)outdata);\n gv_writer_reset (gvc); /* Reset to default */\n",
259
- "}"],
260
- ["char* renderdata(Agraph_t *g, const char *format)\n{\n int err;\n char *data;\n unsigned int length;\n\n if (!g)\n\treturn NULL;\n err = gvRenderData(gvc, g, format, &data, &length);\n if (err)\n\treturn NULL;\n data = (char*)realloc(data, length + 1);\n return data;\n}",
261
- "\n int err;\n char *data;\n unsigned int length;\n\n if (!g)\n\treturn NULL;\n err = gvRenderData(gvc, g, format, &data, &length);\n if (err)\n\treturn NULL;\n data = (char*)realloc(data, length + 1);\n return data;\n",
262
- "}"],
263
- ["bool write(Agraph_t *g, FILE *f)\n{\n int err;\n\n if (!g)\n return false;\n err = agwrite(g, f);\n return (! err);\n}",
264
- "\n int err;\n\n if (!g)\n return false;\n err = agwrite(g, f);\n return (! err);\n",
265
- "}"],
266
- ["bool write(Agraph_t *g, const char *filename)\n{\n FILE *f;\n int err;\n\n if (!g)\n return false;\n f = fopen(filename, \"w\");\n if (!f)\n return false;\n err = agwrite(g, f);\n fclose(f);\n return (! err);\n}",
267
- "\n FILE *f;\n int err;\n\n if (!g)\n return false;\n f = fopen(filename, \"w\");\n if (!f)\n return false;\n err = agwrite(g, f);\n fclose(f);\n return (! err);\n",
268
- "}"],
269
- ["bool tred(Agraph_t *g)\n{\n int err;\n\n if (!g)\n return false;\n err = gvToolTred(g);\n return (! err);\n}",
270
- "\n int err;\n\n if (!g)\n return false;\n err = gvToolTred(g);\n return (! err);\n",
271
- "}"]]