Debian Codegraph @

src/gen/lib/cgraph/graph__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.cdt.dtsize__c.dtsize_;
50 import static gen.lib.cgraph.attr__c.agraphattr_init;
51 import static gen.lib.cgraph.edge__c.agsubrep;
52 import static gen.lib.cgraph.id__c.agmapnametoid;
53 import static gen.lib.cgraph.id__c.agregister;
54 import static gen.lib.cgraph.node__c.agfstnode;
55 import static gen.lib.cgraph.node__c.agnxtnode;
56 import static gen.lib.cgraph.obj__c.agmethod_init;
57 import static gen.lib.cgraph.obj__c.agroot;
58 import static gen.lib.cgraph.subg__c.agparent;
59 import static gen.lib.cgraph.utils__c.agdtopen;
60 import static smetana.core.JUtils.EQ;
61 import static smetana.core.JUtils.sizeof;
62 import static smetana.core.JUtilsDebug.ENTERING;
63 import static smetana.core.JUtilsDebug.LEAVING;
64 import static smetana.core.Macro.AGID;
65 import static smetana.core.Macro.AGRAPH;
66 import static smetana.core.Macro.AGSEQ;
67 import static smetana.core.Macro.AGTYPE;
68 import static smetana.core.Macro.ASINT;
69 import static smetana.core.Macro.N;
70 import static smetana.core.Macro.NOT;
71 import static smetana.core.Macro.UNSUPPORTED;
72 import h.ST_Agclos_s;
73 import h.ST_Agdesc_s;
74 import h.ST_Agdisc_s;
75 import h.ST_Agmemdisc_s;
76 import h.ST_Agnode_s;
77 import h.ST_Agraph_s;
78 import h.ST_Agsubnode_s;
79 import h.ST_dt_s;
80 import h.ST_dtdisc_s;
81 import h.ST_dtlink_s;
82 import smetana.core.ACCESS;
83 import smetana.core.CString;
84 import smetana.core.STARSTAR;
85 import smetana.core.Z;
86 import smetana.core.__ptr__;
87
88 public class graph__c {
89 //1 9k44uhd5foylaeoekf3llonjq
90 // extern Dtmethod_t* Dtset
91
92
93 //1 1ahfywsmzcpcig2oxm7pt9ihj
94 // extern Dtmethod_t* Dtbag
95
96
97 //1 anhghfj3k7dmkudy2n7rvt31v
98 // extern Dtmethod_t* Dtoset
99
100
101 //1 5l6oj1ux946zjwvir94ykejbc
102 // extern Dtmethod_t* Dtobag
103
104
105 //1 2wtf222ak6cui8cfjnw6w377z
106 // extern Dtmethod_t* Dtlist
107
108
109 //1 d1s1s6ibtcsmst88e3057u9r7
110 // extern Dtmethod_t* Dtstack
111
112
113 //1 axa7mflo824p6fspjn1rdk0mt
114 // extern Dtmethod_t* Dtqueue
115
116
117 //1 ega812utobm4xx9oa9w9ayij6
118 // extern Dtmethod_t* Dtdeque
119
120
121 //1 cyfr996ur43045jv1tjbelzmj
122 // extern Dtmethod_t* Dtorder
123
124
125 //1 wlofoiftbjgrrabzb2brkycg
126 // extern Dtmethod_t* Dttree
127
128
129 //1 12bds94t7voj7ulwpcvgf6agr
130 // extern Dtmethod_t* Dthash
131
132
133 //1 9lqknzty480cy7zsubmabkk8h
134 // extern Dtmethod_t _Dttree
135
136
137 //1 bvn6zkbcp8vjdhkccqo1xrkrb
138 // extern Dtmethod_t _Dthash
139
140
141 //1 9lidhtd6nsmmv3e7vjv9e10gw
142 // extern Dtmethod_t _Dtlist
143
144
145 //1 34ujfamjxo7xn89u90oh2k6f8
146 // extern Dtmethod_t _Dtqueue
147
148
149 //1 3jy4aceckzkdv950h89p4wjc8
150 // extern Dtmethod_t _Dtstack
151
152
153 //1 8dfqgf3u1v830qzcjqh9o8ha7
154 // extern Agmemdisc_t AgMemDisc
155
156
157 //1 18k2oh2t6llfsdc5x0wlcnby8
158 // extern Agiddisc_t AgIdDisc
159
160
161 //1 a4r7hi80gdxtsv4hdoqpyiivn
162 // extern Agiodisc_t AgIoDisc
163
164
165 //1 bnzt5syjb7mgeru19114vd6xx
166 // extern Agdisc_t AgDefaultDisc
167
168
169 //1 35y2gbegsdjilegaribes00mg
170 // extern Agdesc_t Agdirected, Agstrictdirected, Agundirected, Agstrictundirected
171
172
173 //1 c2rygslq6bcuka3awmvy2b3ow
174 // typedef Agsubnode_t Agnoderef_t
175
176
177 //1 xam6yv0dcsx57dtg44igpbzn
178 // typedef Dtlink_t Agedgeref_t
179
180
181 //1 ix101dcoysqmkv8bgsxsq8u1
182 // Agraph_t *Ag_G_global
183
184
185 //1 871mxtg9l6ffpxdl9kniwusf7
186 // extern char *AgDataRecName
187
188
189 //1 c0o2kmml0tn6hftuwo0u4shwd
190 // extern Dtdisc_t Ag_subnode_id_disc
191
192
193 //1 8k15pyu256unm2kpd9zf5pf7k
194 // extern Dtdisc_t Ag_subnode_seq_disc
195
196
197 //1 e3d820y06gpeusn6atgmj8bzd
198 // extern Dtdisc_t Ag_mainedge_id_disc
199
200
201 //1 cbr0772spix9h1aw7h5v7dv9j
202 // extern Dtdisc_t Ag_subedge_id_disc
203
204
205 //1 akd0c3v0j7m2npxcb9acit1fa
206 // extern Dtdisc_t Ag_mainedge_seq_disc
207
208
209 //1 12d8la07351ww7vwfzucjst8m
210 // extern Dtdisc_t Ag_subedge_seq_disc
211
212
213 //1 29eokk7v88e62g8o6lizmo967
214 // extern Dtdisc_t Ag_subgraph_id_disc
215
216
217 //1 4xd9cbgy6hk5g6nhjcbpzkx14
218 // extern Agcbdisc_t AgAttrdisc
219
220
221 //1 ewderv8bx65jlxf61iw8en77s
222 // const char AgraphVersion[] =
223
224
225
226
227 //3 bb2bu9iyqx0u6xx44l282vmch
228 // static Agclos_t *agclos(Agdisc_t * proto)
229 public static ST_Agclos_s agclos(ST_Agdisc_s proto) {
230 ENTERING("bb2bu9iyqx0u6xx44l282vmch","agclos");
231 try {
232 ST_Agmemdisc_s memdisc;
233 __ptr__ memclosure;
234 ST_Agclos_s rv;
235 /* establish an allocation arena */
236 memdisc = (ST_Agmemdisc_s) ((proto != null && proto.mem != null) ? proto.mem : Z.z().AgMemDisc);
237 memclosure = (__ptr__) memdisc.open.exe(proto);
238 rv = (ST_Agclos_s) memdisc.alloc.exe(memclosure, sizeof(ST_Agclos_s.class));
239 rv.disc.setPtr("mem", memdisc);
240 rv.state.setPtr("mem", memclosure);
241 rv.disc.setPtr("id", ((proto != null && proto.id != null) ? proto.id : Z.z().AgIdDisc));
242 // Translation bug in next line: should be AgIoDisc and not AgIdDisc
243 // rv.disc.setPtr("io", ((proto != null && proto.getPtr("io") != null) ? proto.getPtr("io") : Z.z().AgIoDisc));
244 rv.callbacks_enabled = (N(0));
245 return rv;
246 } finally {
247 LEAVING("bb2bu9iyqx0u6xx44l282vmch","agclos");
248 }
249 }
250
251
252
253
254 //3 d5yqn56yii8cdoahswt4n6bug
255 // Agraph_t *agopen(char *name, Agdesc_t desc, Agdisc_t * arg_disc)
256 public static ST_Agraph_s agopen(CString name, final ST_Agdesc_s desc, ST_Agdisc_s arg_disc) {
257 // WARNING!! STRUCT
258 return agopen_w_(name, (ST_Agdesc_s) desc.copy(), arg_disc);
259 }
260 private static ST_Agraph_s agopen_w_(CString name, final ST_Agdesc_s desc, ST_Agdisc_s arg_disc) {
261 ENTERING("d5yqn56yii8cdoahswt4n6bug","agopen");
262 try {
263 ST_Agraph_s g;
264 ST_Agclos_s clos;
265 int gid[] = new int[1];
266 clos = agclos(arg_disc);
267 g = (ST_Agraph_s) clos.disc.mem.alloc.exe(clos.state.mem, sizeof(ST_Agraph_s.class));
268 AGTYPE(g, AGRAPH);
269 g.setPtr("clos", clos);
270 g.setStruct("desc", desc);
271 ((ST_Agdesc_s)g.desc).maingraph = ASINT((N(0)));
272 g.setPtr("root", g);
273 g.clos.state.setPtr("id", (__ptr__) g.clos.disc.id.open.exe(g, arg_disc));
274 if (agmapnametoid(g, AGRAPH, name, gid, (N(0)))!=0)
275 AGID(g, gid[0]);
276 // /* else AGID(g) = 0 because we have no alternatives */
277 g = agopen1(g);
278 agregister(g, AGRAPH, g);
279 return g;
280 } finally {
281 LEAVING("d5yqn56yii8cdoahswt4n6bug","agopen");
282 }
283 }
284
285
286
287
288 //3 8jyhwfdfm0a877qfz8cjlb8rk
289 // Agraph_t *agopen1(Agraph_t * g)
290 public static ST_Agraph_s agopen1(ST_Agraph_s g) {
291 ENTERING("8jyhwfdfm0a877qfz8cjlb8rk","agopen1");
292 try {
293 ST_Agraph_s par;
294 g.setPtr("n_seq", agdtopen(g, Z.z().Ag_subnode_seq_disc, Z.z().Dttree));
295 g.setPtr("n_id", agdtopen(g, Z.z().Ag_subnode_id_disc, Z.z().Dttree));
296 g.setPtr("e_seq", agdtopen(g, EQ(g, agroot(g))? Z.z().Ag_mainedge_seq_disc : Z.z().Ag_subedge_seq_disc, Z.z().Dttree));
297 g.setPtr("e_id", agdtopen(g, EQ(g, agroot(g))? Z.z().Ag_mainedge_id_disc : Z.z().Ag_subedge_id_disc, Z.z().Dttree));
298 g.setPtr("g_dict", agdtopen(g, Z.z().Ag_subgraph_id_disc, Z.z().Dttree));
299 par = agparent(g);
300 if (par!=null) {
301 AGSEQ(g, agnextseq(par, AGRAPH));
302 par.g_dict.searchf.exe(par.g_dict,g,0000001);
303 } /* else AGSEQ=0 */
304 if (N(par) || ((ST_Agdesc_s)par.desc).has_attrs!=0)
305 agraphattr_init(g);
306 agmethod_init(g, g);
307 return g;
308 } finally {
309 LEAVING("8jyhwfdfm0a877qfz8cjlb8rk","agopen1");
310 }
311 }
312
313
314
315
316 //3 dmhavsadfjootm2o8lnwizndm
317 // int agclose(Agraph_t * g)
318 public static Object agclose(Object... arg) {
319 UNSUPPORTED("afwvyph6n53ckvxm8d8h7mfb8"); // int agclose(Agraph_t * g)
320 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
321 UNSUPPORTED("bf3nmka0aaoswb2zwm0qee15o"); // Agraph_t *subg, *next_subg, *par;
322 UNSUPPORTED("7qo66ph77ke8gsbowf6kwqjff"); // Agnode_t *n, *next_n;
323 UNSUPPORTED("d7yov7q4cj5xaglc5czdcnix5"); // par = agparent(g);
324 UNSUPPORTED("1u7cs2kb7x42iwswgskdrpk5m"); // if ((par == ((Agraph_t*)0)) && (((g)->clos->disc.mem)->close)) {
325 UNSUPPORTED("6yjypc20njwrfp5bsnjhiiabf"); // /* free entire heap */
326 UNSUPPORTED("cmba0hmq318rx9h0jefkyen70"); // agmethod_delete(g, g); /* invoke user callbacks */
327 UNSUPPORTED("dbiair9ce3vkfb8s9l08pfx6w"); // agfreeid(g, AGRAPH, AGID(g));
328 UNSUPPORTED("2bdjy9rtybb0v767umxcnz6rs"); // ((g)->clos->disc.mem)->close(((g)->clos->state.mem)); /* whoosh */
329 UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
330 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
331 UNSUPPORTED("2hk83bjq106e9rdcpxqbv9nnl"); // for (subg = agfstsubg(g); subg; subg = next_subg) {
332 UNSUPPORTED("608ihpc2s8xb39yo654s19zxd"); // next_subg = agnxtsubg(subg);
333 UNSUPPORTED("3noc43t4fqi4gollim1ygyuqh"); // agclose(subg);
334 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
335 UNSUPPORTED("6r3mocyf2tlkysyu64nxw0u9h"); // for (n = agfstnode(g); n; n = next_n) {
336 UNSUPPORTED("3d2h3vjjw6x8w1joyvc3qlruy"); // next_n = agnxtnode(g, n);
337 UNSUPPORTED("3xjgsp211uvaug1aa3mvpdlnc"); // agdelnode(g, n);
338 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
339 UNSUPPORTED("1ia10h9dh09qjfarfdjx452gf"); // aginternalmapclose(g);
340 UNSUPPORTED("ddezjv0si4sjtexy5kqfwqg9n"); // agmethod_delete(g, g);
341 UNSUPPORTED("5i0sddp616zsw63jk38od62l4"); // ;
342 UNSUPPORTED("5d72jwytwy7gvtmqynj5ndpyr"); // if (agdtclose(g, g->n_id)) return -1;
343 UNSUPPORTED("5i0sddp616zsw63jk38od62l4"); // ;
344 UNSUPPORTED("324yaisi4aejlbofpo08bx36u"); // if (agdtclose(g, g->n_seq)) return -1;
345 UNSUPPORTED("5i0sddp616zsw63jk38od62l4"); // ;
346 UNSUPPORTED("34xteu7bflgwy03788khpb2gb"); // if (agdtclose(g, g->e_id)) return -1;
347 UNSUPPORTED("5i0sddp616zsw63jk38od62l4"); // ;
348 UNSUPPORTED("6bwledkxe6algose4ob82o61"); // if (agdtclose(g, g->e_seq)) return -1;
349 UNSUPPORTED("5i0sddp616zsw63jk38od62l4"); // ;
350 UNSUPPORTED("d7yg3wo8tmofx0anjr742k191"); // if (agdtclose(g, g->g_dict)) return -1;
351 UNSUPPORTED("l0tanhlxt2jokflxnd061z3y"); // if (g->desc.has_attrs)
352 UNSUPPORTED("9jhznqh28rajdovcc58834278"); // if (agraphattr_delete(g)) return -1;
353 UNSUPPORTED("a5y6rvdlz9o09pphxz38sbtna"); // agrecclose((Agobj_t *) g);
354 UNSUPPORTED("crfg36z5yetflihtijtubwo8y"); // agfreeid(g, AGRAPH, AGID(g));
355 UNSUPPORTED("et9lswrohfsxngrn2xcefry4q"); // if (par) {
356 UNSUPPORTED("dzboxj0ijphtqrm463tpbvkhx"); // agdelsubg(par, g);
357 UNSUPPORTED("e7v29f5dzfhzrj9v4shzbcywi"); // agfree(par, g);
358 UNSUPPORTED("c07up7zvrnu2vhzy6d7zcu94g"); // } else {
359 UNSUPPORTED("5y8tww8901b1ro7bgu6r58vgr"); // Agmemdisc_t *memdisc;
360 UNSUPPORTED("6ozvxgrg2q3sua4w4cnwun2hd"); // void *memclos, *clos;
361 UNSUPPORTED("9i0i3wyt8alu21zy4mtvxxhj7"); // while (g->clos->cb)
362 UNSUPPORTED("1y6k38rbnyl26lquznq5kass6"); // agpopdisc(g, g->clos->cb->f);
363 UNSUPPORTED("8qcjv2uq7ztij51cy8b5r7yqr"); // ((g)->clos->disc.id)->close(((g)->clos->state.id));
364 UNSUPPORTED("px95fp6paiia8ts33pk4tph1"); // if (agstrclose(g)) return -1;
365 UNSUPPORTED("2kp9gdc0xn3li7ibgz4x4lnmz"); // memdisc = ((g)->clos->disc.mem);
366 UNSUPPORTED("8lo1wjoiak85adsa9fwxo62zl"); // memclos = ((g)->clos->state.mem);
367 UNSUPPORTED("8n6pjmho9f28hof6v2v1lruyo"); // clos = g->clos;
368 UNSUPPORTED("ets9jwr303m5yl6eqowve1loh"); // (memdisc->free) (memclos, g);
369 UNSUPPORTED("d0v33cnucd6c13avcqkwy4wzc"); // (memdisc->free) (memclos, clos);
370 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
371 UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
372 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
373
374 throw new UnsupportedOperationException();
375 }
376
377
378
379
380 //3 axmdmml95l55vlp1vqmh0v5sn
381 // unsigned long agnextseq(Agraph_t * g, int objtype)
382 public static int agnextseq(ST_Agraph_s g, int objtype) {
383 ENTERING("axmdmml95l55vlp1vqmh0v5sn","agnextseq");
384 try {
385 int tmp = g.clos.seq[objtype];
386 tmp++;
387 g.clos.seq[objtype]=tmp;
388 return tmp;
389 } finally {
390 LEAVING("axmdmml95l55vlp1vqmh0v5sn","agnextseq");
391 }
392 }
393
394
395
396
397 //3 688euygrkbl10cveflgwalo2n
398 // int agnnodes(Agraph_t * g)
399 public static int agnnodes(ST_Agraph_s g) {
400 ENTERING("688euygrkbl10cveflgwalo2n","agnnodes");
401 try {
402 return dtsize_((ST_dt_s)g.n_id);
403 } finally {
404 LEAVING("688euygrkbl10cveflgwalo2n","agnnodes");
405 }
406 }
407
408
409
410
411 //3 8zjne7uv8rfpmbv5t96zhnr4u
412 // int agnedges(Agraph_t * g)
413 public static int agnedges(ST_Agraph_s g) {
414 ENTERING("8zjne7uv8rfpmbv5t96zhnr4u","agnedges");
415 try {
416 ST_Agnode_s n;
417 int rv = 0;
418 for (n = agfstnode(g); n!=null; n = agnxtnode(g, n))
419 rv += agdegree(g, n, (false), (N(0))); /* must use OUT to get self-arcs */
420 return rv;
421 } finally {
422 LEAVING("8zjne7uv8rfpmbv5t96zhnr4u","agnedges");
423 }
424 }
425
426
427
428
429 //3 e1ndua2eo29tb0z93wrmamm3g
430 // int agnsubg(Agraph_t * g)
431 public static Object agnsubg(Object... arg) {
432 UNSUPPORTED("5auwvgl2zekzvzu6p5413tqd0"); // int agnsubg(Agraph_t * g)
433 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
434 UNSUPPORTED("18u3kziious357fry7i0r4kg2"); // return dtsize(g->g_dict);
435 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
436
437 throw new UnsupportedOperationException();
438 }
439
440
441
442
443 //3 blvn1w3v0icnucu5m5xvbrba1
444 // int agisdirected(Agraph_t * g)
445 public static boolean agisdirected(ST_Agraph_s g) {
446 ENTERING("blvn1w3v0icnucu5m5xvbrba1","agisdirected");
447 try {
448 return ((ST_Agdesc_s)g.desc).directed!=0;
449 } finally {
450 LEAVING("blvn1w3v0icnucu5m5xvbrba1","agisdirected");
451 }
452 }
453
454
455
456
457 //3 8thgds4eioot64flko26m8ns0
458 // int agisundirected(Agraph_t * g)
459 public static boolean agisundirected(ST_Agraph_s g) {
460 ENTERING("8thgds4eioot64flko26m8ns0","agisundirected");
461 try {
462 return (NOT(agisdirected(g)));
463 } finally {
464 LEAVING("8thgds4eioot64flko26m8ns0","agisundirected");
465 }
466 }
467
468
469
470
471 //3 9qgdebmdfrcfjm394bg59a7y5
472 // int agisstrict(Agraph_t * g)
473 public static boolean agisstrict(ST_Agraph_s g) {
474 ENTERING("9qgdebmdfrcfjm394bg59a7y5","agisstrict");
475 try {
476 return ((ST_Agdesc_s)g.desc).strict!=0;
477 } finally {
478 LEAVING("9qgdebmdfrcfjm394bg59a7y5","agisstrict");
479 }
480 }
481
482
483
484
485 //3 4zw0onm78e3x5anx7snfpe40m
486 // int agissimple(Agraph_t * g)
487 public static Object agissimple(Object... arg) {
488 UNSUPPORTED("5khld3f380yzb9kztjfa00b7t"); // int agissimple(Agraph_t * g)
489 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
490 UNSUPPORTED("9u553zzb7in07zdd55sdea2an"); // return (g->desc.strict && g->desc.no_loop);
491 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
492
493 throw new UnsupportedOperationException();
494 }
495
496
497
498
499 //3 abaldeo2ie6zi60cazxp7rv47
500 // static int cnt(Dict_t * d, Dtlink_t ** set)
501 public static int cnt(ST_dt_s d, STARSTAR<ST_dtlink_s> set) {
502 ENTERING("abaldeo2ie6zi60cazxp7rv47","cnt");
503 try {
504 int rv;
505 dtrestore(d, set.getMe());
506 rv = dtsize_(d);
507 set.setMe(dtextract(d));
508 return rv;
509 } finally {
510 LEAVING("abaldeo2ie6zi60cazxp7rv47","cnt");
511 }
512 }
513
514
515
516
517 //3 crupee5rve7q7m335ngnqsb39
518 // int agcountuniqedges(Agraph_t * g, Agnode_t * n, int want_in, int want_out)
519 public static Object agcountuniqedges(Object... arg) {
520 UNSUPPORTED("47c9iab9p596xa2xrkcgmepw0"); // int agcountuniqedges(Agraph_t * g, Agnode_t * n, int want_in, int want_out)
521 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
522 UNSUPPORTED("36vshotvjkc5iodgg7nq6qa2r"); // Agedge_t *e;
523 UNSUPPORTED("2llbfi4jrmre7cyhu90pgcm72"); // Agsubnode_t *sn;
524 UNSUPPORTED("en7ch189nkys76f42mlo1s5zz"); // int rv = 0;
525 UNSUPPORTED("b0wzl2qtz6anq1dhlxtmvwvgn"); // sn = agsubrep(g, n);
526 UNSUPPORTED("e0cr7vhmu27121z5m8qtchlwn"); // if (want_out) rv = cnt(g->e_seq,&(sn->out_seq));
527 UNSUPPORTED("4gu3qg6aqwexl6ysrfrqko4z8"); // if (want_in) {
528 UNSUPPORTED("3r5t38hbcwvc5hpus6062r7ic"); // if (!want_out) rv += cnt(g->e_seq,&(sn->in_seq)); /* cheap */
529 UNSUPPORTED("6p5yaaxfj7183iw2v0uuruh56"); // else { /* less cheap */
530 UNSUPPORTED("7jxxmlwkqih7nv6yrum6qhfe0"); // for (e = agfstin(g, n); e; e = agnxtin(g, e))
531 UNSUPPORTED("73lyxs2pp1e0s95qdz9vgc5iy"); // if (e->node != n) rv++; /* don't double count loops */
532 UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
533 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
534 UNSUPPORTED("v7vqc9l7ge2bfdwnw11z7rzi"); // return rv;
535 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
536
537 throw new UnsupportedOperationException();
538 }
539
540
541
542
543 //3 2bz40qf0qo7pd6er1ut25gthp
544 // int agdegree(Agraph_t * g, Agnode_t * n, int want_in, int want_out)
545 public static int agdegree(ST_Agraph_s g, ST_Agnode_s n, boolean want_in, boolean want_out) {
546 ENTERING("2bz40qf0qo7pd6er1ut25gthp","agdegree");
547 try {
548 ST_Agsubnode_s sn;
549 int rv = 0;
550 sn = agsubrep(g, n);
551 final ST_Agsubnode_s sn1 = sn;
552 if (sn!=null) {
553 if (want_out) rv += cnt((ST_dt_s)g.e_seq,
554 STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
555 public ST_dtlink_s get() {
556 return (ST_dtlink_s) sn1.out_seq;
557 }
558 public void set(ST_dtlink_s obj) {
559 sn1.setPtr("out_seq", obj);
560 }})
561 );
562 if (want_in) rv += cnt((ST_dt_s)g.e_seq,
563 STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
564 public ST_dtlink_s get() {
565 return (ST_dtlink_s) sn1.in_seq;
566 }
567 public void set(ST_dtlink_s obj) {
568 sn1.setPtr("in_seq", obj);
569 }})
570 );
571 }
572 return rv;
573 } finally {
574 LEAVING("2bz40qf0qo7pd6er1ut25gthp","agdegree");
575 }
576 }
577
578
579
580
581 //3 dhbtfzzp8n5yygqmhmluo9bxl
582 // int agraphidcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc)
583 public static int agraphidcmpf(ST_dt_s d, ST_Agraph_s arg0, ST_Agraph_s arg1, ST_dtdisc_s disc) {
584 ENTERING("dhbtfzzp8n5yygqmhmluo9bxl","agraphidcmpf");
585 try {
586 int v;
587 ST_Agraph_s sg0, sg1;
588 sg0 = (ST_Agraph_s) arg0;
589 sg1 = (ST_Agraph_s) arg1;
590 v = (AGID(sg0) - AGID(sg1));
591 return ((v==0)?0:(v<0?-1:1));
592 } finally {
593 LEAVING("dhbtfzzp8n5yygqmhmluo9bxl","agraphidcmpf");
594 }
595 }
596
597
598
599
600 //3 llkcwaxuse8jc2ri7r9n6t0c
601 // int agraphseqcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc)
602 public static Object agraphseqcmpf(Object... arg) {
603 UNSUPPORTED("97lu4ei4gjam66ku5pz8dn7il"); // int agraphseqcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc)
604 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
605 UNSUPPORTED("ccl2joincnprtk47hwmpz1o7n"); // long v;
606 UNSUPPORTED("73bfha5x7xhgp9p6wxa9jap6j"); // Agraph_t *sg0, *sg1;
607 UNSUPPORTED("e8rx1ahgpoym3u3v0jgarn58y"); // sg0 = (Agraph_t *) arg0;
608 UNSUPPORTED("bc6x70wml3jh4l4ana92njtid"); // sg1 = (Agraph_t *) arg1;
609 UNSUPPORTED("4afy6g5l0jng6m6l3abdyuk80"); // v = (AGSEQ(sg0) - AGSEQ(sg1));
610 UNSUPPORTED("2tgj1svqq4v5mqo7525nw7icj"); // return ((v==0)?0:(v<0?-1:1));
611 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
612
613 throw new UnsupportedOperationException();
614 }
615
616
617 //1 cqgilvgau98cgaulohsii8vx4
618 // Dtdisc_t Ag_subgraph_id_disc =
619 /*static final public __struct__<_dtdisc_s> Ag_subgraph_id_disc = JUtils.from(_dtdisc_s.class);
620 static {
621 Ag_subgraph_id_disc.setInt("key", 0);
622 Ag_subgraph_id_disc.setInt("size", 0);
623 Ag_subgraph_id_disc.setInt("link", OFFSET.create(Agraph_s.class, "link").toInt()); // link is the third field in Agraph_t
624 Ag_subgraph_id_disc.setPtr("makef", null);
625 Ag_subgraph_id_disc.setPtr("freef", null);
626 Ag_subgraph_id_disc.setPtr("comparf", function(graph__c.class, "agraphidcmpf"));
627 Ag_subgraph_id_disc.setPtr("hashf", null);
628 Ag_subgraph_id_disc.setPtr("memoryf", function(utils__c.class, "agdictobjmem"));
629 Ag_subgraph_id_disc.setPtr("eventf", null);
630 }*/
631
632 //1 98aldesvg4i0qxoidbuanebv7
633 // Agdesc_t Agdirected =
634 /*static final public __struct__<Agdesc_s> Agdirected = JUtils.from(Agdesc_s.class);
635 static {
636 Agdirected.setInt("directed", 1);
637 Agdirected.setInt("strict", 0);
638 Agdirected.setInt("no_loop", 0);
639 Agdirected.setInt("maingraph", 1);
640 }*/
641
642 //1 4fbe4dfrxvwi5l1l4rb30s9o8
643 // Agdesc_t Agstrictdirected =
644
645
646 //1 5rysra3mrm6tscdrjbg5rhyuu
647 // Agdesc_t Agundirected =
648
649
650 //1 2x0008zd99c6pdbwdqnv7yjcz
651 // Agdesc_t Agstrictundirected =
652
653
654 //1 biws2qqe0e0xqmwdmfuvdopo3
655 // Agdisc_t AgDefaultDisc =
656
657
658
659
660 //3 4rhqd5bl4tiypdakk2hhpsj7s
661 // void scndump(Agraph_t *g, char *file)
662 public static Object scndump(Object... arg) {
663 UNSUPPORTED("7e937yycgb0eiorckxpq4qqwo"); // void scndump(Agraph_t *g, char *file)
664 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
665 UNSUPPORTED("38goe38ctv7d6jktnwysyagy8"); // FILE * f = fopen(file,"w");
666 UNSUPPORTED("7luati80gyuf0ex40qi3bjkkp"); // if (f) {agwrite(g,f); fclose(f);}
667 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
668
669 throw new UnsupportedOperationException();
670 }
671
672
673 }