Debian Codegraph @

src/gen/lib/cgraph/edge__c.java

raw symbols SCIP
1 /* ========================================================================
2 * PlantUML : a free UML diagram generator
3 * ========================================================================
4 *
5 * Project Info: http://plantuml.com
6 *
7 * If you like this project or if you find it useful, you can support us at:
8 *
9 * http://plantuml.com/patreon (only 1$ per month!)
10 * http://plantuml.com/paypal
11 *
12 * This file is part of Smetana.
13 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
14 *
15 * (C) Copyright 2009-2020, Arnaud Roques
16 *
17 * This translation is distributed under the same Licence as the original C program:
18 *
19 *************************************************************************
20 * Copyright (c) 2011 AT&T Intellectual Property
21 * All rights reserved. This program and the accompanying materials
22 * are made available under the terms of the Eclipse Public License v1.0
23 * which accompanies this distribution, and is available at
24 * http://www.eclipse.org/legal/epl-v10.html
25 *
26 * Contributors: See CVS logs. Details at http://www.graphviz.org/
27 *************************************************************************
28 *
29 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
30 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
31 *
32 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
33 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
34 *
35 * You may obtain a copy of the License at
36 *
37 * http://www.eclipse.org/legal/epl-v10.html
38 *
39 * Unless required by applicable law or agreed to in writing, software
40 * distributed under the License is distributed on an "AS IS" BASIS,
41 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
42 * See the License for the specific language governing permissions and
43 * limitations under the License.
44 *
45 */
46 package gen.lib.cgraph;
47 import static gen.lib.cdt.dtextract__c.dtextract;
48 import static gen.lib.cdt.dtrestore__c.dtrestore;
49 import static gen.lib.cgraph.attr__c.AgDataRecName;
50 import static gen.lib.cgraph.attr__c.agedgeattr_init;
51 import static gen.lib.cgraph.graph__c.agisstrict;
52 import static gen.lib.cgraph.graph__c.agisundirected;
53 import static gen.lib.cgraph.graph__c.agnextseq;
54 import static gen.lib.cgraph.id__c.agmapnametoid;
55 import static gen.lib.cgraph.id__c.agregister;
56 import static gen.lib.cgraph.mem__c.agalloc;
57 import static gen.lib.cgraph.node__c.agsubnode;
58 import static gen.lib.cgraph.obj__c.agmethod_init;
59 import static gen.lib.cgraph.obj__c.agroot;
60 import static gen.lib.cgraph.rec__c.agbindrec;
61 import static gen.lib.cgraph.subg__c.agparent;
62 import static smetana.core.JUtils.EQ;
63 import static smetana.core.JUtils.NEQ;
64 import static smetana.core.JUtils.sizeof;
65 import static smetana.core.JUtilsDebug.ENTERING;
66 import static smetana.core.JUtilsDebug.LEAVING;
67 import static smetana.core.Macro.AGEDGE;
68 import static smetana.core.Macro.AGHEAD;
69 import static smetana.core.Macro.AGID;
70 import static smetana.core.Macro.AGINEDGE;
71 import static smetana.core.Macro.AGMKIN;
72 import static smetana.core.Macro.AGMKOUT;
73 import static smetana.core.Macro.AGOPP;
74 import static smetana.core.Macro.AGOUTEDGE;
75 import static smetana.core.Macro.AGSEQ;
76 import static smetana.core.Macro.AGTAG;
77 import static smetana.core.Macro.AGTAIL;
78 import static smetana.core.Macro.AGTYPE;
79 import static smetana.core.Macro.N;
80 import static smetana.core.Macro.NOT;
81 import static smetana.core.Macro.UNSUPPORTED;
82 import h.ST_Agattr_s;
83 import h.ST_Agdesc_s;
84 import h.ST_Agedge_s;
85 import h.ST_Agedgepair_s;
86 import h.ST_Agnode_s;
87 import h.ST_Agraph_s;
88 import h.ST_Agsubnode_s;
89 import h.ST_Agtag_s;
90 import h.ST_dt_s;
91 import h.ST_dtdisc_s;
92 import h.ST_dtlink_s;
93 import smetana.core.ACCESS;
94 import smetana.core.CString;
95 import smetana.core.STARSTAR;
96 import smetana.core.Z;
97 import smetana.core.__ptr__;
98
99 public class edge__c {
100 //1 9k44uhd5foylaeoekf3llonjq
101 // extern Dtmethod_t* Dtset
102
103
104 //1 1ahfywsmzcpcig2oxm7pt9ihj
105 // extern Dtmethod_t* Dtbag
106
107
108 //1 anhghfj3k7dmkudy2n7rvt31v
109 // extern Dtmethod_t* Dtoset
110
111
112 //1 5l6oj1ux946zjwvir94ykejbc
113 // extern Dtmethod_t* Dtobag
114
115
116 //1 2wtf222ak6cui8cfjnw6w377z
117 // extern Dtmethod_t* Dtlist
118
119
120 //1 d1s1s6ibtcsmst88e3057u9r7
121 // extern Dtmethod_t* Dtstack
122
123
124 //1 axa7mflo824p6fspjn1rdk0mt
125 // extern Dtmethod_t* Dtqueue
126
127
128 //1 ega812utobm4xx9oa9w9ayij6
129 // extern Dtmethod_t* Dtdeque
130
131
132 //1 cyfr996ur43045jv1tjbelzmj
133 // extern Dtmethod_t* Dtorder
134
135
136 //1 wlofoiftbjgrrabzb2brkycg
137 // extern Dtmethod_t* Dttree
138
139
140 //1 12bds94t7voj7ulwpcvgf6agr
141 // extern Dtmethod_t* Dthash
142
143
144 //1 9lqknzty480cy7zsubmabkk8h
145 // extern Dtmethod_t _Dttree
146
147
148 //1 bvn6zkbcp8vjdhkccqo1xrkrb
149 // extern Dtmethod_t _Dthash
150
151
152 //1 9lidhtd6nsmmv3e7vjv9e10gw
153 // extern Dtmethod_t _Dtlist
154
155
156 //1 34ujfamjxo7xn89u90oh2k6f8
157 // extern Dtmethod_t _Dtqueue
158
159
160 //1 3jy4aceckzkdv950h89p4wjc8
161 // extern Dtmethod_t _Dtstack
162
163
164 //1 8dfqgf3u1v830qzcjqh9o8ha7
165 // extern Agmemdisc_t AgMemDisc
166
167
168 //1 18k2oh2t6llfsdc5x0wlcnby8
169 // extern Agiddisc_t AgIdDisc
170
171
172 //1 a4r7hi80gdxtsv4hdoqpyiivn
173 // extern Agiodisc_t AgIoDisc
174
175
176 //1 bnzt5syjb7mgeru19114vd6xx
177 // extern Agdisc_t AgDefaultDisc
178
179
180 //1 35y2gbegsdjilegaribes00mg
181 // extern Agdesc_t Agdirected, Agstrictdirected, Agundirected, Agstrictundirected
182
183
184 //1 c2rygslq6bcuka3awmvy2b3ow
185 // typedef Agsubnode_t Agnoderef_t
186
187
188 //1 xam6yv0dcsx57dtg44igpbzn
189 // typedef Dtlink_t Agedgeref_t
190
191
192 //1 6ayavpu39aihwyojkx093pcy3
193 // extern Agraph_t *Ag_G_global
194
195
196 //1 871mxtg9l6ffpxdl9kniwusf7
197 // extern char *AgDataRecName
198
199
200 //1 c0o2kmml0tn6hftuwo0u4shwd
201 // extern Dtdisc_t Ag_subnode_id_disc
202
203
204 //1 8k15pyu256unm2kpd9zf5pf7k
205 // extern Dtdisc_t Ag_subnode_seq_disc
206
207
208 //1 e3d820y06gpeusn6atgmj8bzd
209 // extern Dtdisc_t Ag_mainedge_id_disc
210
211
212 //1 cbr0772spix9h1aw7h5v7dv9j
213 // extern Dtdisc_t Ag_subedge_id_disc
214
215
216 //1 akd0c3v0j7m2npxcb9acit1fa
217 // extern Dtdisc_t Ag_mainedge_seq_disc
218
219
220 //1 12d8la07351ww7vwfzucjst8m
221 // extern Dtdisc_t Ag_subedge_seq_disc
222
223
224 //1 29eokk7v88e62g8o6lizmo967
225 // extern Dtdisc_t Ag_subgraph_id_disc
226
227
228 //1 4xd9cbgy6hk5g6nhjcbpzkx14
229 // extern Agcbdisc_t AgAttrdisc
230
231
232 //1 cee3kc2m61ml4f8le5ueoyrjb
233 // static Agtag_t Tag
234 //private final static __struct__<Agtag_s> Tag = JUtils.from(Agtag_s.class);
235
236
237
238 //3 9vamtktowqtk4955i546z9obw
239 // Agedge_t *agfstout(Agraph_t * g, Agnode_t * n)
240 public static ST_Agedge_s agfstout(ST_Agraph_s g, ST_Agnode_s n) {
241 ENTERING("9vamtktowqtk4955i546z9obw","agfstout");
242 try {
243 ST_Agsubnode_s sn;
244 ST_Agedge_s e = null;
245 sn = agsubrep(g, n);
246 if (sn!=null) {
247 dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.out_seq);
248 e = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,null,0000200);
249 sn.out_seq = dtextract((ST_dt_s)g.e_seq);
250 }
251 return e;
252 } finally {
253 LEAVING("9vamtktowqtk4955i546z9obw","agfstout");
254 }
255 }
256
257
258
259
260 //3 1qh7mgqwomkdqvczauv4ex1lu
261 // Agedge_t *agnxtout(Agraph_t * g, Agedge_t * e)
262 public static ST_Agedge_s agnxtout(ST_Agraph_s g, ST_Agedge_s e) {
263 ENTERING("1qh7mgqwomkdqvczauv4ex1lu","agnxtout");
264 try {
265 ST_Agnode_s n;
266 ST_Agsubnode_s sn;
267 ST_Agedge_s f = null;
268 n = AGTAIL(e);
269 sn = agsubrep(g, n);
270 if (sn!=null) {
271 dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.out_seq);
272 f = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,e,0000010);
273 sn.out_seq = dtextract((ST_dt_s)g.e_seq);
274 }
275 return f;
276 } finally {
277 LEAVING("1qh7mgqwomkdqvczauv4ex1lu","agnxtout");
278 }
279 }
280
281
282
283
284 //3 c60qt3ycq0xweabgtqt16xe93
285 // Agedge_t *agfstin(Agraph_t * g, Agnode_t * n)
286 public static ST_Agedge_s agfstin(ST_Agraph_s g, ST_Agnode_s n) {
287 ENTERING("c60qt3ycq0xweabgtqt16xe93","agfstin");
288 try {
289 ST_Agsubnode_s sn;
290 ST_Agedge_s e = null;
291 sn = agsubrep(g, n);
292 if (sn!=null) {
293 dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.in_seq);
294 e = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,null,0000200);
295 sn.setPtr("in_seq", dtextract((ST_dt_s)g.e_seq));
296 }
297 return e;
298 } finally {
299 LEAVING("c60qt3ycq0xweabgtqt16xe93","agfstin");
300 }
301 }
302
303
304
305
306 //3 f2af4x97mqn16npd6alsw7avs
307 // Agedge_t *agnxtin(Agraph_t * g, Agedge_t * e)
308 public static ST_Agedge_s agnxtin(ST_Agraph_s g, ST_Agedge_s e) {
309 ENTERING("f2af4x97mqn16npd6alsw7avs","agnxtin");
310 try {
311 ST_Agnode_s n;
312 ST_Agsubnode_s sn;
313 ST_Agedge_s f = null;
314 n = AGHEAD(e);
315 sn = agsubrep(g, n);
316 if (sn!=null) {
317 dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.in_seq);
318 f = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,e,0000010);
319 sn.setPtr("in_seq", dtextract((ST_dt_s)g.e_seq));
320 }
321 return f;
322 } finally {
323 LEAVING("f2af4x97mqn16npd6alsw7avs","agnxtin");
324 }
325 }
326
327
328
329
330 //3 6nwyo5bklramr0d093aa1h25o
331 // Agedge_t *agfstedge(Agraph_t * g, Agnode_t * n)
332 public static ST_Agedge_s agfstedge(ST_Agraph_s g, ST_Agnode_s n) {
333 ENTERING("6nwyo5bklramr0d093aa1h25o","agfstedge");
334 try {
335 ST_Agedge_s rv;
336 rv = agfstout(g, n);
337 if (rv == null)
338 rv = agfstin(g, n);
339 return rv;
340 } finally {
341 LEAVING("6nwyo5bklramr0d093aa1h25o","agfstedge");
342 }
343 }
344
345
346
347
348 //3 8zy2u6gsi2xzv2ffv8o4v4uvf
349 // Agedge_t *agnxtedge(Agraph_t * g, Agedge_t * e, Agnode_t * n)
350 public static ST_Agedge_s agnxtedge(ST_Agraph_s g, ST_Agedge_s e, ST_Agnode_s n) {
351 ENTERING("8zy2u6gsi2xzv2ffv8o4v4uvf","agnxtedge");
352 try {
353 ST_Agedge_s rv;
354 if (AGTYPE(e) == AGOUTEDGE) {
355 rv = agnxtout(g, e);
356 if (rv == null) {
357 do {
358 rv = N(rv) ? agfstin(g, n) : agnxtin(g,rv);
359 } while (rv!=null && EQ(rv.node, n));
360 }
361 } else {
362 do {
363 rv = agnxtin(g, e); /* so that we only see each edge once, */
364 e = rv;
365 } while (rv!=null && EQ(rv.node, n)); /* ignore loops as in-edges */
366 }
367 return rv;
368 } finally {
369 LEAVING("8zy2u6gsi2xzv2ffv8o4v4uvf","agnxtedge");
370 }
371 }
372
373
374
375
376 //3 c175o6j61jqmfnl4o1g1h1mie
377 // static Agedge_t *agfindedge_by_key(Agraph_t * g, Agnode_t * t, Agnode_t * h, Agtag_t key)
378 public static ST_Agedge_s agfindedge_by_key(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h, final ST_Agtag_s key) {
379 // WARNING!! STRUCT
380 return agfindedge_by_key_w_(g, t, h, (ST_Agtag_s) key.copy());
381 }
382 private static ST_Agedge_s agfindedge_by_key_w_(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h, final ST_Agtag_s key) {
383 ENTERING("c175o6j61jqmfnl4o1g1h1mie","agfindedge_by_key");
384 try {
385 ST_Agedge_s e;
386 final ST_Agedge_s template = new ST_Agedge_s();
387 ST_Agsubnode_s sn;
388 if ((t == null) || (h == null))
389 return null;
390 template.base.setStruct("tag", key);
391 template.setPtr("node", t); /* guess that fan-in < fan-out */
392 sn = agsubrep(g, h);
393 if (N(sn)) e = null;
394 else {
395 dtrestore((ST_dt_s)g.e_id, (ST_dtlink_s)sn.in_id);
396 e = ((ST_Agedge_s)g.e_id.searchf.exe(g.e_id,template,0000004));
397 sn.setPtr("in_id", dtextract((ST_dt_s)g.e_id));
398 }
399 return e;
400 } finally {
401 LEAVING("c175o6j61jqmfnl4o1g1h1mie","agfindedge_by_key");
402 }
403 }
404
405
406
407
408 //3 7ph1egysh0yp1kxmrerg5v40e
409 // static Agedge_t *agfindedge_by_id(Agraph_t * g, Agnode_t * t, Agnode_t * h, unsigned long id)
410 public static Object agfindedge_by_id(Object... arg) {
411 UNSUPPORTED("ec9zslg8lac601i0b25y7zwto"); // static Agedge_t *agfindedge_by_id(Agraph_t * g, Agnode_t * t, Agnode_t * h,
412 UNSUPPORTED("3aq1nzyk7buuizn5in1tizrxw"); // unsigned long id)
413 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
414 UNSUPPORTED("e1mtghvcaueacf53mmdm4tfy0"); // Agtag_t tag;
415 UNSUPPORTED("9sao87j2usq1a87o75iju8s5b"); // tag = Tag;
416 UNSUPPORTED("8ftb0g8ykm4jkjpro0pcai75y"); // tag.objtype = AGEDGE;
417 UNSUPPORTED("4dwsgoqnwiy82putqjt97dagp"); // tag.id = id;
418 UNSUPPORTED("57t26f9vd4vltjvoz5m7lo5lf"); // return agfindedge_by_key(g, t, h, tag);
419 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
420
421 throw new UnsupportedOperationException();
422 }
423
424
425
426
427 //3 b32ssm6ex1pdz1b3nt4fwlhul
428 // Agsubnode_t *agsubrep(Agraph_t * g, Agnode_t * n)
429 public static ST_Agsubnode_s agsubrep(ST_Agraph_s g, ST_Agnode_s n) {
430 ENTERING("b32ssm6ex1pdz1b3nt4fwlhul","agsubrep");
431 try {
432 ST_Agsubnode_s sn;
433 final ST_Agsubnode_s template = new ST_Agsubnode_s();
434 if (EQ(g, n.root)) sn = (ST_Agsubnode_s) n.mainsub;
435 else {
436 template.setPtr("node", n);
437 sn = (ST_Agsubnode_s) g.n_id.searchf.exe(g.n_id, template, 0000004);
438 }
439 return sn;
440 } finally {
441 LEAVING("b32ssm6ex1pdz1b3nt4fwlhul","agsubrep");
442 }
443 }
444
445
446
447
448 //3 6u0niow33w9gva780waluva4n
449 // static void ins(Dict_t * d, Dtlink_t ** set, Agedge_t * e)
450 public static void ins(ST_dt_s d, STARSTAR<ST_dtlink_s> set, ST_Agedge_s e) {
451 ENTERING("6u0niow33w9gva780waluva4n","ins");
452 try {
453 dtrestore(d, set.getMe());
454 d.searchf.exe(d,e,0000001);
455 set.setMe(dtextract(d));
456 } finally {
457 LEAVING("6u0niow33w9gva780waluva4n","ins");
458 }
459 }
460
461
462
463
464 //3 2h2dtr49b6fcn440sc4xrseg3
465 // static void del(Dict_t * d, Dtlink_t ** set, Agedge_t * e)
466 public static Object del(Object... arg) {
467 UNSUPPORTED("5lvsvkq5t8c8pj03debt0mwal"); // static void del(Dict_t * d, Dtlink_t ** set, Agedge_t * e)
468 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
469 UNSUPPORTED("atawgqln44t2lhf2j4q1dsw80"); // void *x;
470 UNSUPPORTED("c1wraxzkcgmquqsiuypvr56tj"); // dtrestore(d, *set);
471 UNSUPPORTED("9e6qtst4eze5ps8ukq79d6zf8"); // x = (*(((Dt_t*)(d))->searchf))((d),(void*)(e),0000002);
472 UNSUPPORTED("5i0sddp616zsw63jk38od62l4"); // ;
473 UNSUPPORTED("dgfo5c0o8ftxxwmcq8kxe7ht8"); // *set = dtextract(d);
474 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
475
476 throw new UnsupportedOperationException();
477 }
478
479
480
481
482 //3 8kizmg7gziussfgx8zs3qvkfw
483 // static void installedge(Agraph_t * g, Agedge_t * e)
484 public static void installedge(ST_Agraph_s g, ST_Agedge_s e) {
485 ENTERING("8kizmg7gziussfgx8zs3qvkfw","installedge");
486 try {
487 ST_Agnode_s t, h;
488 ST_Agedge_s out, in;
489 ST_Agsubnode_s sn;
490 out = AGMKOUT(e);
491 in = AGMKIN(e);
492 t = agtail(e);
493 h = aghead(e);
494 while (g!=null) {
495 if (agfindedge_by_key(g, t, h, AGTAG(e))!=null) break;
496 sn = agsubrep(g, t); final ST_Agsubnode_s sn1 = sn;
497 ins((ST_dt_s)g.e_seq,
498 STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
499 public ST_dtlink_s get() {
500 return (ST_dtlink_s) sn1.out_seq;
501 }
502 public void set(ST_dtlink_s obj) {
503 sn1.setPtr("out_seq", obj);
504 }})
505 , (ST_Agedge_s)out);
506 ins((ST_dt_s)g.e_id,
507 STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
508 public ST_dtlink_s get() {
509 return (ST_dtlink_s) sn1.out_id;
510 }
511 public void set(ST_dtlink_s obj) {
512 sn1.setPtr("out_id", obj);
513 }})
514 , (ST_Agedge_s)out);
515 sn = agsubrep(g, h); final ST_Agsubnode_s sn2 = sn;
516 ins((ST_dt_s)g.e_seq,
517 STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
518 public ST_dtlink_s get() {
519 return (ST_dtlink_s) sn2.in_seq;
520 }
521 public void set(ST_dtlink_s obj) {
522 sn2.setPtr("in_seq", obj);
523 }})
524 , (ST_Agedge_s)in);
525 ins((ST_dt_s)g.e_id,
526 STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
527 public ST_dtlink_s get() {
528 return (ST_dtlink_s) sn2.in_id;
529 }
530 public void set(ST_dtlink_s obj) {
531 sn2.setPtr("in_id", obj);
532 }})
533 , (ST_Agedge_s)in);
534 g = agparent(g);
535 }
536 } finally {
537 LEAVING("8kizmg7gziussfgx8zs3qvkfw","installedge");
538 }
539 }
540
541
542
543
544 //3 2vtt6zb0n3oru23okvw4pxasg
545 // static void subedge(Agraph_t * g, Agedge_t * e)
546 public static Object subedge(Object... arg) {
547 UNSUPPORTED("1qslen16fp6w3yse2y311vtsf"); // static void subedge(Agraph_t * g, Agedge_t * e)
548 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
549 UNSUPPORTED("3rvuc9rdxdwmvq3dtwv2hqwjo"); // installedge(g, e);
550 UNSUPPORTED("4d70e4y79ekvafnx88hgwdrna"); // /* might an init method call be needed here? */
551 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
552
553 throw new UnsupportedOperationException();
554 }
555
556
557
558
559 //3 4rzjui6oo0k009o64bxwgjmvq
560 // static Agedge_t *newedge(Agraph_t * g, Agnode_t * t, Agnode_t * h, unsigned long id)
561 public static ST_Agedge_s newedge(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h, int id) {
562 ENTERING("4rzjui6oo0k009o64bxwgjmvq","newedge");
563 try {
564 ST_Agedgepair_s e2;
565 ST_Agedge_s in, out;
566 int seq;
567 agsubnode(g,t,(N(0)));
568 agsubnode(g,h,(N(0)));
569 e2 = (ST_Agedgepair_s) agalloc(g, sizeof(ST_Agedgepair_s.class));
570 in = (ST_Agedge_s) e2.in;
571 out = (ST_Agedge_s) e2.out;
572 seq = agnextseq(g, AGEDGE);
573 AGTYPE(in, AGINEDGE);
574 AGTYPE(out, AGOUTEDGE);
575 AGID(out, id);
576 AGID(in, id);
577 AGSEQ(in, seq);
578 AGSEQ(out, seq);
579 in.setPtr("node", t);
580 out.setPtr("node", h);
581 installedge(g, out);
582 if (((ST_Agdesc_s)g.desc).has_attrs!=0) {
583 agbindrec(out, AgDataRecName, sizeof(ST_Agattr_s.class), false);
584 agedgeattr_init(g, out);
585 }
586 agmethod_init(g, out);
587 return out;
588 } finally {
589 LEAVING("4rzjui6oo0k009o64bxwgjmvq","newedge");
590 }
591 }
592
593
594
595
596 //3 1ufxhg5xnmll1pe5339477823
597 // static int ok_to_make_edge(Agraph_t * g, Agnode_t * t, Agnode_t * h)
598 public static boolean ok_to_make_edge(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h) {
599 ENTERING("1ufxhg5xnmll1pe5339477823","ok_to_make_edge");
600 try {
601 final ST_Agtag_s key = new ST_Agtag_s();
602 /* protect against self, multi-edges in strict graphs */
603 if (agisstrict(g)) {
604 if (g.desc.no_loop!=0 && (EQ(t, h))) /* simple graphs */
605 return false;
606 key.___(Z.z().Tag);
607 key.setInt("objtype", 0); /* wild card */
608 if (agfindedge_by_key(g, t, h, key)!=null)
609 return false;
610 }
611 return (N(0));
612 } finally {
613 LEAVING("1ufxhg5xnmll1pe5339477823","ok_to_make_edge");
614 }
615 }
616
617
618
619
620 //3 75ua3fc3lvhnwftacueslv8e5
621 // Agedge_t *agidedge(Agraph_t * g, Agnode_t * t, Agnode_t * h, unsigned long id, int cflag)
622 public static Object agidedge(Object... arg) {
623 UNSUPPORTED("5pslnv27wv1h507npa2zxh90y"); // Agedge_t *agidedge(Agraph_t * g, Agnode_t * t, Agnode_t * h,
624 UNSUPPORTED("e28xnrj58aci1fn3kunzmqxbv"); // unsigned long id, int cflag)
625 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
626 UNSUPPORTED("2hs0004nnparj6tt7elslt4zj"); // Agraph_t *root;
627 UNSUPPORTED("36vshotvjkc5iodgg7nq6qa2r"); // Agedge_t *e;
628 UNSUPPORTED("1v1wyp9m83obk7jvlhzzmbwqb"); // e = agfindedge_by_id(g, t, h, id);
629 UNSUPPORTED("1gxwr1hr3zd8rrmnl1zq34xju"); // if ((e == ((Agedge_t*)0)) && agisundirected(g))
630 UNSUPPORTED("7jnnbxt6l29uby71ap2ioa94q"); // e = agfindedge_by_id(g, h, t, id);
631 UNSUPPORTED("2m5yl6487z3nh60gz8x9otg16"); // if ((e == ((Agedge_t*)0)) && cflag && ok_to_make_edge(g, t, h)) {
632 UNSUPPORTED("7zol2448bccu90sqoxkvnbuif"); // root = agroot(g);
633 UNSUPPORTED("e9viv3tnfxask57of0bhahbev"); // if ((g != root) && ((e = agfindedge_by_id(root, t, h, id)))) {
634 UNSUPPORTED("7u9o1s6uopqwva82fgnfbgr03"); // subedge(g, e); /* old */
635 UNSUPPORTED("7yhr8hn3r6wohafwxrt85b2j2"); // } else {
636 UNSUPPORTED("3nwzv8q6jwjadczk10hhrt14f"); // if (agallocid(g, AGEDGE, id)) {
637 UNSUPPORTED("2zklsds1y3vegvq9xgmx9ayyn"); // e = newedge(g, t, h, id); /* new */
638 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
639 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
640 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
641 UNSUPPORTED("2bswif6w6ot01ynlvkimntfly"); // return e;
642 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
643
644 throw new UnsupportedOperationException();
645 }
646
647
648
649
650 //3 4361pvzr3ozft2ov0fgx6t8bo
651 // Agedge_t *agedge(Agraph_t * g, Agnode_t * t, Agnode_t * h, char *name, int cflag)
652 public static ST_Agedge_s agedge(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h, CString name, boolean cflag) {
653 ENTERING("4361pvzr3ozft2ov0fgx6t8bo","agedge");
654 try {
655 ST_Agedge_s e;
656 int id[] = new int[1];
657 int have_id;
658 have_id = agmapnametoid(g, AGEDGE, name, id, false);
659 if (have_id!=0 || ((name == null) && ((NOT(cflag)) || agisstrict(g)))) {
660 /* probe for pre-existing edge */
661 final ST_Agtag_s key = new ST_Agtag_s();
662 key.___(Z.z().Tag);
663 if (have_id!=0) {
664 key.id = id[0];
665 key.objtype = AGEDGE;
666 } else {
667 key.id = 0;
668 key.objtype = 0;
669 }
670 /* might already exist locally */
671 e = agfindedge_by_key(g, t, h, key);
672 if ((e == null && agisundirected(g)))
673 e = agfindedge_by_key(g, h, t, key);
674 if (e!=null)
675 return e;
676 if (cflag) {
677 e = agfindedge_by_key(agroot(g), t, h, key);
678 if ((e == null) && agisundirected(g))
679 e = agfindedge_by_key(agroot(g), h, t, key);
680 if (e!=null) {
681 subedge(g,e);
682 return e;
683 }
684 }
685 }
686 if (cflag && ok_to_make_edge(g, t, h)
687 && (agmapnametoid(g, AGEDGE, name, id, (N(0))))!=0) { /* reserve id */
688 e = newedge(g, t, h, id[0]);
689 agregister(g, AGEDGE, e); /* register new object in external namespace */
690 }
691 else
692 e = null;
693 return e;
694 } finally {
695 LEAVING("4361pvzr3ozft2ov0fgx6t8bo","agedge");
696 }
697 }
698
699
700
701
702 //3 bbzly9og4lr1fza64fjk04djp
703 // void agdeledgeimage(Agraph_t * g, Agedge_t * e, void *ignored)
704 public static Object agdeledgeimage(Object... arg) {
705 UNSUPPORTED("7gzvhvwj0z152fzg3h94s4wa3"); // void agdeledgeimage(Agraph_t * g, Agedge_t * e, void *ignored)
706 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
707 UNSUPPORTED("50fokbemxzgivcd3b6k3miqqn"); // Agedge_t *in, *out;
708 UNSUPPORTED("4ybt6tm56tubmbuve8lp6rxhh"); // Agnode_t *t, *h;
709 UNSUPPORTED("2llbfi4jrmre7cyhu90pgcm72"); // Agsubnode_t *sn;
710 UNSUPPORTED("4pgl4pn1cad2whf242bntmjre"); // (void) ignored;
711 UNSUPPORTED("65tqa3if9hwq2yshaaiw31i7p"); // if (AGTYPE(e) == AGINEDGE) {
712 UNSUPPORTED("7awcpvsw7kw84dndmnqoe7jml"); // in = e;
713 UNSUPPORTED("d4vc8t57wygctu4vl9tau8a6a"); // out = AGIN2OUT(e);
714 UNSUPPORTED("c07up7zvrnu2vhzy6d7zcu94g"); // } else {
715 UNSUPPORTED("54k8hnomk4mrwatjixro9a1yr"); // out = e;
716 UNSUPPORTED("7qnm0e5czl4a8gcj7f5vo98h"); // in = AGOUT2IN(e);
717 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
718 UNSUPPORTED("uc5fexr8h438pt7usvlh0ul3"); // t = in->node;
719 UNSUPPORTED("9a1uo5zmwfnuphv9st2w2b7hh"); // h = out->node;
720 UNSUPPORTED("dpshsqc8cs6ucoq4t0hnuxws6"); // sn = agsubrep(g, t);
721 UNSUPPORTED("a1kpx292l61dmu7eqdcm7fd51"); // del(g->e_seq, &sn->out_seq, out);
722 UNSUPPORTED("3xx2m5a0qzz8zcz61qn8mw44q"); // del(g->e_id, &sn->out_id, out);
723 UNSUPPORTED("e1vy7p3xj8dfi23jli55il082"); // sn = agsubrep(g, h);
724 UNSUPPORTED("dtt5k4axitnc0rvaop78flltt"); // del(g->e_seq, &sn->in_seq, in);
725 UNSUPPORTED("3w1dtrerdp5ojxgix55ysgcd3"); // del(g->e_id, &sn->in_id, in);
726 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
727
728 throw new UnsupportedOperationException();
729 }
730
731
732
733
734 //3 5l2v1bqchqfkinhpae4ip3yvz
735 // int agdeledge(Agraph_t * g, Agedge_t * e)
736 public static Object agdeledge(Object... arg) {
737 UNSUPPORTED("a87xum130tyatez3ic2nbxnna"); // int agdeledge(Agraph_t * g, Agedge_t * e)
738 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
739 UNSUPPORTED("9tj8yk1m099w6420vq9obwqv6"); // e = AGMKOUT(e);
740 UNSUPPORTED("58hfnwh2g7pubdk6wexuvksuo"); // if (agfindedge_by_key(g, agtail(e), aghead(e), AGTAG(e)) == ((Agedge_t*)0))
741 UNSUPPORTED("8d9xfgejx5vgd6shva5wk5k06"); // return -1;
742 UNSUPPORTED("ackx3cor82a94trjk4owh3083"); // if (g == agroot(g)) {
743 UNSUPPORTED("5247bml3o0pwzg9fc9q1xhhnc"); // if (g->desc.has_attrs)
744 UNSUPPORTED("4lf7sorcdbqef4eadxah45x08"); // agedgeattr_delete(e);
745 UNSUPPORTED("dpp3uqwrwe9geok1zmxonosd3"); // agmethod_delete(g, e);
746 UNSUPPORTED("6kvbonl2aylsja52uh6deu14c"); // agrecclose((Agobj_t *) e);
747 UNSUPPORTED("dnmywe26u2d1rmgozlfonjw94"); // agfreeid(g, AGEDGE, AGID(e));
748 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
749 UNSUPPORTED("6ox33bv05arfuz70cp795jqlg"); // if (agapply (g, (Agobj_t *) e, (agobjfn_t) agdeledgeimage, ((Agedge_t*)0), (0)) == 0) {
750 UNSUPPORTED("6tlwlx478gb1clm2fykihi2zk"); // if (g == agroot(g))
751 UNSUPPORTED("ebin71xd0muor7ysk74hizhw3"); // agfree(g, e);
752 UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
753 UNSUPPORTED("2lkbqgh2h6urnppaik3zo7ywi"); // } else
754 UNSUPPORTED("8d9xfgejx5vgd6shva5wk5k06"); // return -1;
755 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
756
757 throw new UnsupportedOperationException();
758 }
759
760
761
762
763 //3 30v8z3tlda81fbqbkzx6m9fkn
764 // Agedge_t *agsubedge(Agraph_t * g, Agedge_t * e, int cflag)
765 public static ST_Agedge_s agsubedge(ST_Agraph_s g, ST_Agedge_s e, boolean cflag) {
766 ENTERING("30v8z3tlda81fbqbkzx6m9fkn","agsubedge");
767 try {
768 ST_Agnode_s t, h;
769 ST_Agedge_s rv;
770 rv = null;
771 t = agsubnode(g, AGTAIL(e), cflag);
772 h = agsubnode(g, AGHEAD(e), cflag);
773 if (t!=null && h!=null) {
774 rv = agfindedge_by_key(g, t, h, AGTAG(e));
775 if (cflag && (rv == null)) {
776 installedge(g, e);
777 rv = e;
778 }
779 if (rv!=null && (AGTYPE(rv) != AGTYPE(e)))
780 rv = AGOPP(rv);
781 }
782 return rv;
783 } finally {
784 LEAVING("30v8z3tlda81fbqbkzx6m9fkn","agsubedge");
785 }
786 }
787
788
789
790
791 //3 avk47eh26r45qk2dtoipwiqvz
792 // int agedgeidcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc)
793 public static int agedgeidcmpf(ST_dt_s d, ST_Agedge_s arg_e0, ST_Agedge_s arg_e1, ST_dtdisc_s disc) {
794 ENTERING("avk47eh26r45qk2dtoipwiqvz","agedgeidcmpf");
795 try {
796 int v;
797 ST_Agedge_s e0, e1;
798 e0 = (ST_Agedge_s) arg_e0;
799 e1 = (ST_Agedge_s) arg_e1;
800 v = AGID(e0.node) - AGID(e1.node);
801 if (v == 0) { /* same node */
802 if ((AGTYPE(e0) == 0) || (AGTYPE(e1) == 0))
803 v = 0;
804 else
805 v = AGID(e0) - AGID(e1);
806 }
807 return ((v==0)?0:(v<0?-1:1));
808 } finally {
809 LEAVING("avk47eh26r45qk2dtoipwiqvz","agedgeidcmpf");
810 }
811 }
812
813
814
815
816 //3 b6jhzc16xvrknu4e7jp6zx0ue
817 // int agedgeseqcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc)
818 public static int agedgeseqcmpf(ST_dt_s d, ST_Agedge_s arg_e0, ST_Agedge_s arg_e1, ST_dtdisc_s disc) {
819 ENTERING("b6jhzc16xvrknu4e7jp6zx0ue","agedgeseqcmpf");
820 try {
821 int v;
822 ST_Agedge_s e0, e1;
823 e0 = (ST_Agedge_s) arg_e0;
824 e1 = (ST_Agedge_s) arg_e1;
825 if (NEQ(e0.node, e1.node)) v = AGSEQ(e0.node) - AGSEQ(e1.node);
826 else v = (AGSEQ(e0) - AGSEQ(e1));
827 return ((v==0)?0:(v<0?-1:1));
828 } finally {
829 LEAVING("b6jhzc16xvrknu4e7jp6zx0ue","agedgeseqcmpf");
830 }
831 }
832
833
834 //1 d058zqckpiqls71p4vkuxe87o
835 // Dtdisc_t Ag_mainedge_seq_disc =
836 /*static final public __struct__<_dtdisc_s> Ag_mainedge_seq_disc = JUtils.from(_dtdisc_s.class);
837 static {
838 Ag_mainedge_seq_disc.setInt("key", 0);
839 Ag_mainedge_seq_disc.setInt("size", 0);
840 Ag_mainedge_seq_disc.setInt("link", OFFSET.create(Agedge_s.class, "seq_link").toInt()); // seq_link is the third field in Agedge_t
841 Ag_mainedge_seq_disc.setPtr("makef", null);
842 Ag_mainedge_seq_disc.setPtr("freef", null);
843 Ag_mainedge_seq_disc.setPtr("comparf", function(edge__c.class, "agedgeseqcmpf"));
844 Ag_mainedge_seq_disc.setPtr("hashf", null);
845 Ag_mainedge_seq_disc.setPtr("memoryf", function(utils__c.class, "agdictobjmem"));
846 Ag_mainedge_seq_disc.setPtr("eventf", null);
847 }*/
848
849 //1 7n5e8w5zjp9b4oeecyvyl96il
850 // Dtdisc_t Ag_subedge_seq_disc =
851 /*static public final __struct__<_dtdisc_s> Ag_subedge_seq_disc = JUtils.from(_dtdisc_s.class);
852 static {
853 Ag_subedge_seq_disc.setInt("key", 0);
854 Ag_subedge_seq_disc.setInt("size", 0);
855 Ag_subedge_seq_disc.setInt("link", -1);
856 Ag_subedge_seq_disc.setPtr("makef", null);
857 Ag_subedge_seq_disc.setPtr("freef", null);
858 Ag_subedge_seq_disc.setPtr("comparf", function(edge__c.class, "agedgeseqcmpf"));
859 Ag_subedge_seq_disc.setPtr("hashf", null);
860 Ag_subedge_seq_disc.setPtr("memoryf", function(utils__c.class, "agdictobjmem"));
861 Ag_subedge_seq_disc.setPtr("eventf", null);
862 }*/
863
864
865 //1 7grv8f2wvpg0db2pn1g7r5abv
866 // Dtdisc_t Ag_mainedge_id_disc =
867 /*static final public __struct__<_dtdisc_s> Ag_mainedge_id_disc = JUtils.from(_dtdisc_s.class);
868 static {
869 Ag_mainedge_id_disc.setInt("key", 0);
870 Ag_mainedge_id_disc.setInt("size", 0);
871 Ag_mainedge_id_disc.setInt("link", OFFSET.create(Agedge_s.class, "id_link").toInt()); // id_link is the second field in Agedge_t
872 Ag_mainedge_id_disc.setPtr("makef", null);
873 Ag_mainedge_id_disc.setPtr("freef", null);
874 Ag_mainedge_id_disc.setPtr("comparf", function(edge__c.class, "agedgeidcmpf"));
875 Ag_mainedge_id_disc.setPtr("hashf", null);
876 Ag_mainedge_id_disc.setPtr("memoryf", function(utils__c.class, "agdictobjmem"));
877 Ag_mainedge_id_disc.setPtr("eventf", null);
878 }*/
879
880 //1 9u0ic8u2hrwlmlqalv37s053f
881 // Dtdisc_t Ag_subedge_id_disc =
882 /*static public final __struct__<_dtdisc_s> Ag_subedge_id_disc = JUtils.from(_dtdisc_s.class);
883 static {
884 Ag_subedge_id_disc.setInt("key", 0);
885 Ag_subedge_id_disc.setInt("size", 0);
886 Ag_subedge_id_disc.setInt("link", -1);
887 Ag_subedge_id_disc.setPtr("makef", null);
888 Ag_subedge_id_disc.setPtr("freef", null);
889 Ag_subedge_id_disc.setPtr("comparf", function(edge__c.class, "agedgeidcmpf"));
890 Ag_subedge_id_disc.setPtr("hashf", null);
891 Ag_subedge_id_disc.setPtr("memoryf", function(utils__c.class, "agdictobjmem"));
892 Ag_subedge_id_disc.setPtr("eventf", null);
893 }*/
894
895
896
897 //3 ceexs6t1q4jxwz6h0g8fszxp4
898 // Agnode_t *agtail(Agedge_t * e)
899 public static ST_Agnode_s agtail(ST_Agedge_s e) {
900 ENTERING("ceexs6t1q4jxwz6h0g8fszxp4","agtail");
901 try {
902 return AGTAIL(e);
903 } finally {
904 LEAVING("ceexs6t1q4jxwz6h0g8fszxp4","agtail");
905 }
906 }
907
908
909
910
911 //3 3tj9gj3dvrpox6grrdd3rftd8
912 // Agnode_t *aghead(Agedge_t * e)
913 public static ST_Agnode_s aghead(__ptr__ e) {
914 ENTERING("3tj9gj3dvrpox6grrdd3rftd8","aghead");
915 try {
916 return AGHEAD((ST_Agedge_s) e);
917 } finally {
918 LEAVING("3tj9gj3dvrpox6grrdd3rftd8","aghead");
919 }
920 }
921
922
923
924
925 //3 15e6s5bh5hey2u79yoebir59w
926 // Agedge_t *agopp(Agedge_t * e)
927 public static ST_Agedge_s agopp(__ptr__ e) {
928 ENTERING("15e6s5bh5hey2u79yoebir59w","agopp");
929 try {
930 return AGOPP((ST_Agedge_s) e);
931 } finally {
932 LEAVING("15e6s5bh5hey2u79yoebir59w","agopp");
933 }
934 }
935
936
937 }