Debian Codegraph @

src/gen/lib/cgraph/id__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.cgraph.imap__c.aginternalmapinsert;
48 import static gen.lib.cgraph.imap__c.aginternalmaplookup;
49 import static gen.lib.cgraph.imap__c.aginternalmapprint;
50 import static gen.lib.cgraph.obj__c.agraphof;
51 import static gen.lib.cgraph.refstr__c.agstrbind;
52 import static gen.lib.cgraph.refstr__c.agstrdup;
53 import static smetana.core.JUtilsDebug.ENTERING;
54 import static smetana.core.JUtilsDebug.LEAVING;
55 import static smetana.core.Macro.AGEDGE;
56 import static smetana.core.Macro.AGID;
57 import static smetana.core.Macro.AGTYPE;
58 import static smetana.core.Macro.ASINT;
59 import static smetana.core.Macro.N;
60 import static smetana.core.Macro.UNSUPPORTED;
61 import h.ST_Agdisc_s;
62 import h.ST_Agobj_s;
63 import h.ST_Agraph_s;
64 import smetana.core.CString;
65 import smetana.core.Memory;
66 import smetana.core.Z;
67 import smetana.core.__ptr__;
68
69 public class id__c {
70 //1 9k44uhd5foylaeoekf3llonjq
71 // extern Dtmethod_t* Dtset
72
73
74 //1 1ahfywsmzcpcig2oxm7pt9ihj
75 // extern Dtmethod_t* Dtbag
76
77
78 //1 anhghfj3k7dmkudy2n7rvt31v
79 // extern Dtmethod_t* Dtoset
80
81
82 //1 5l6oj1ux946zjwvir94ykejbc
83 // extern Dtmethod_t* Dtobag
84
85
86 //1 2wtf222ak6cui8cfjnw6w377z
87 // extern Dtmethod_t* Dtlist
88
89
90 //1 d1s1s6ibtcsmst88e3057u9r7
91 // extern Dtmethod_t* Dtstack
92
93
94 //1 axa7mflo824p6fspjn1rdk0mt
95 // extern Dtmethod_t* Dtqueue
96
97
98 //1 ega812utobm4xx9oa9w9ayij6
99 // extern Dtmethod_t* Dtdeque
100
101
102 //1 cyfr996ur43045jv1tjbelzmj
103 // extern Dtmethod_t* Dtorder
104
105
106 //1 wlofoiftbjgrrabzb2brkycg
107 // extern Dtmethod_t* Dttree
108
109
110 //1 12bds94t7voj7ulwpcvgf6agr
111 // extern Dtmethod_t* Dthash
112
113
114 //1 9lqknzty480cy7zsubmabkk8h
115 // extern Dtmethod_t _Dttree
116
117
118 //1 bvn6zkbcp8vjdhkccqo1xrkrb
119 // extern Dtmethod_t _Dthash
120
121
122 //1 9lidhtd6nsmmv3e7vjv9e10gw
123 // extern Dtmethod_t _Dtlist
124
125
126 //1 34ujfamjxo7xn89u90oh2k6f8
127 // extern Dtmethod_t _Dtqueue
128
129
130 //1 3jy4aceckzkdv950h89p4wjc8
131 // extern Dtmethod_t _Dtstack
132
133
134 //1 8dfqgf3u1v830qzcjqh9o8ha7
135 // extern Agmemdisc_t AgMemDisc
136
137
138 //1 18k2oh2t6llfsdc5x0wlcnby8
139 // extern Agiddisc_t AgIdDisc
140
141
142 //1 a4r7hi80gdxtsv4hdoqpyiivn
143 // extern Agiodisc_t AgIoDisc
144
145
146 //1 bnzt5syjb7mgeru19114vd6xx
147 // extern Agdisc_t AgDefaultDisc
148
149
150 //1 35y2gbegsdjilegaribes00mg
151 // extern Agdesc_t Agdirected, Agstrictdirected, Agundirected, Agstrictundirected
152
153
154 //1 c2rygslq6bcuka3awmvy2b3ow
155 // typedef Agsubnode_t Agnoderef_t
156
157
158 //1 xam6yv0dcsx57dtg44igpbzn
159 // typedef Dtlink_t Agedgeref_t
160
161
162 //1 6ayavpu39aihwyojkx093pcy3
163 // extern Agraph_t *Ag_G_global
164
165
166 //1 871mxtg9l6ffpxdl9kniwusf7
167 // extern char *AgDataRecName
168
169
170 //1 c0o2kmml0tn6hftuwo0u4shwd
171 // extern Dtdisc_t Ag_subnode_id_disc
172
173
174 //1 8k15pyu256unm2kpd9zf5pf7k
175 // extern Dtdisc_t Ag_subnode_seq_disc
176
177
178 //1 e3d820y06gpeusn6atgmj8bzd
179 // extern Dtdisc_t Ag_mainedge_id_disc
180
181
182 //1 cbr0772spix9h1aw7h5v7dv9j
183 // extern Dtdisc_t Ag_subedge_id_disc
184
185
186 //1 akd0c3v0j7m2npxcb9acit1fa
187 // extern Dtdisc_t Ag_mainedge_seq_disc
188
189
190 //1 12d8la07351ww7vwfzucjst8m
191 // extern Dtdisc_t Ag_subedge_seq_disc
192
193
194 //1 29eokk7v88e62g8o6lizmo967
195 // extern Dtdisc_t Ag_subgraph_id_disc
196
197
198 //1 4xd9cbgy6hk5g6nhjcbpzkx14
199 // extern Agcbdisc_t AgAttrdisc
200
201
202
203
204 //3 a0a2zxsu8n019hzm1rwf1jc7f
205 // static void *idopen(Agraph_t * g, Agdisc_t* disc)
206 public static Object idopen(ST_Agraph_s g, ST_Agdisc_s disc) {
207 ENTERING("a0a2zxsu8n019hzm1rwf1jc7f","idopen");
208 try {
209 return g;
210 } finally {
211 LEAVING("a0a2zxsu8n019hzm1rwf1jc7f","idopen");
212 }
213 }
214
215
216
217
218 //3 lsl0c1gejls1wv04ga6xy2cf
219 // static long idmap(void *state, int objtype, char *str, unsigned long *id, int createflag)
220 //static int ctr = 1;
221 public static int idmap(Object state, int objtype, CString str, int id[], boolean createflag) {
222 ENTERING("lsl0c1gejls1wv04ga6xy2cf","idmap");
223 try {
224 CString s;
225 if (str!=null) {
226 ST_Agraph_s g;
227 g = (ST_Agraph_s) state;
228 if (createflag)
229 s = agstrdup(g, str);
230 else
231 s = agstrbind(g, str);
232 id[0] = Memory.identityHashCode(s);
233 } else {
234 id[0] = Z.z().ctr;
235 Z.z().ctr += 2;
236 }
237 return ASINT(N(0));
238 } finally {
239 LEAVING("lsl0c1gejls1wv04ga6xy2cf","idmap");
240 }
241 }
242
243
244
245
246 //3 8ynmf2fueegi7vjejal3ri1ax
247 // static long idalloc(void *state, int objtype, unsigned long request)
248 public static Object idalloc(Object... arg) {
249 UNSUPPORTED("1z2o91qjhxg0zcs8vgzyl9bf1"); // static long idalloc(void *state, int objtype, unsigned long request)
250 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
251 UNSUPPORTED("2s0qc9g3dasd7eqa3rhtlxrae"); // (void) state;
252 UNSUPPORTED("x0ltcg0hfp8jlgbjde43bdwj"); // (void) objtype;
253 UNSUPPORTED("6xs9bwnce34njm5w424uwon6d"); // (void) request;
254 UNSUPPORTED("297p5iu8oro94tdg9v29bbgiw"); // return (0);
255 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
256
257 throw new UnsupportedOperationException();
258 }
259
260
261
262
263 //3 5fsdlq8w38bfd7gtwz1z8arad
264 // static void idfree(void *state, int objtype, unsigned long id)
265 public static Object idfree(Object... arg) {
266 UNSUPPORTED("adq5fviqjzpkxrjt37qxo1ywh"); // static void idfree(void *state, int objtype, unsigned long id)
267 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
268 UNSUPPORTED("x0ltcg0hfp8jlgbjde43bdwj"); // (void) objtype;
269 UNSUPPORTED("e3dd233viwus8xrkad68a1qhr"); // if (id % 2 == 0)
270 UNSUPPORTED("69x6bjndheh46syz632mlu192"); // agstrfree((Agraph_t *) state, (char *) id);
271 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
272
273 throw new UnsupportedOperationException();
274 }
275
276
277
278
279 //3 8143j507ej7uqqjzw5i32xej5
280 // static char *idprint(void *state, int objtype, unsigned long id)
281 public static CString idprint(__ptr__ state, int objtype, int id) {
282 ENTERING("8143j507ej7uqqjzw5i32xej5","idprint");
283 try {
284 if (id % 2 == 0)
285 return (CString) Memory.fromIdentityHashCode(id);
286 else
287 return null;
288 } finally {
289 LEAVING("8143j507ej7uqqjzw5i32xej5","idprint");
290 }
291 }
292
293
294
295
296 //3 44seyu1scoubb1wsuhwlghwyz
297 // static void idclose(void *state)
298 public static Object idclose(Object... arg) {
299 UNSUPPORTED("18oh21h7t6fg06ozg64u87nyu"); // static void idclose(void *state)
300 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
301 UNSUPPORTED("2s0qc9g3dasd7eqa3rhtlxrae"); // (void) state;
302 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
303
304 throw new UnsupportedOperationException();
305 }
306
307
308
309
310 //3 5bjqo0ihl0x25vaspoiehmwzk
311 // static void idregister(void *state, int objtype, void *obj)
312 public static void idregister(Object state, int objtype, Object obj) {
313 ENTERING("5bjqo0ihl0x25vaspoiehmwzk","idregister");
314 try {
315
316 } finally {
317 LEAVING("5bjqo0ihl0x25vaspoiehmwzk","idregister");
318 }
319 }
320
321
322 //1 cxrk51474ugltvklkcvp3v2ly
323 // Agiddisc_t AgIdDisc =
324 /*public final static __struct__<Agiddisc_s> AgIdDisc = JUtils.from(Agiddisc_s.class);
325 static {
326 AgIdDisc.setPtr("open", function(id__c.class, "idopen"));
327 AgIdDisc.setPtr("map", function(id__c.class, "idmap"));
328 AgIdDisc.setPtr("alloc", function(id__c.class, "idalloc"));
329 AgIdDisc.setPtr("free", function(id__c.class, "idfree"));
330 AgIdDisc.setPtr("print", function(id__c.class, "idprint"));
331 AgIdDisc.setPtr("close", function(id__c.class, "idclose"));
332 AgIdDisc.setPtr("idregister", function(id__c.class, "idregister"));
333 }*/
334
335
336
337 //3 aq30wwcj4ugatsgx0zdtdmeed
338 // int agmapnametoid(Agraph_t * g, int objtype, char *str, unsigned long *result, int createflag)
339 public static int agmapnametoid(ST_Agraph_s g, int objtype, CString str, int result[], boolean createflag) {
340 ENTERING("aq30wwcj4ugatsgx0zdtdmeed","agmapnametoid");
341 try {
342 int rv;
343 if (str!=null && (str.charAt(0) != '%')) {
344 rv = (Integer) g.clos.disc.id.map.exe(g.clos.state.id, objtype, str, result, createflag);
345 if (rv!=0)
346 return rv;
347 }
348 /* either an internal ID, or disc. can't map strings */
349 if (str!=null) {
350 rv = aginternalmaplookup(g, objtype, str, result);
351 if (rv!=0)
352 return rv;
353 } else
354 rv = 0;
355 if (createflag) {
356 /* get a new anonymous ID, and store in the internal map */
357 rv = (Integer) g.clos.disc.id.map.exe(g.clos.state.id, objtype, null, result,
358 createflag);
359 if (rv!=0 && str!=null)
360 aginternalmapinsert(g, objtype, str, result[0]);
361 }
362 return rv;
363 } finally {
364 LEAVING("aq30wwcj4ugatsgx0zdtdmeed","agmapnametoid");
365 }
366 }
367
368
369
370
371 //3 dwufsd296z6lfmtm7fp4e3tk7
372 // int agallocid(Agraph_t * g, int objtype, unsigned long request)
373 public static Object agallocid(Object... arg) {
374 UNSUPPORTED("5i7l75ugdm5j5c4xtqqk9atdd"); // int agallocid(Agraph_t * g, int objtype, unsigned long request)
375 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
376 UNSUPPORTED("dlf21dkccrftu3zc0t5amuwu4"); // return ((g)->clos->disc.id)->alloc(((g)->clos->state.id), objtype, request);
377 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
378
379 throw new UnsupportedOperationException();
380 }
381
382
383
384
385 //3 cfub4osftc8djs88cq592feu3
386 // void agfreeid(Agraph_t * g, int objtype, unsigned long id)
387 public static Object agfreeid(Object... arg) {
388 UNSUPPORTED("4hpxv4j7rcvj3lrbvu2e0hus4"); // void agfreeid(Agraph_t * g, int objtype, unsigned long id)
389 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
390 UNSUPPORTED("3s1vo79t7lt6fm1bimxdpbqj"); // (void) aginternalmapdelete(g, objtype, id);
391 UNSUPPORTED("dm45ri059viqxsb08rmvo60y1"); // (((g)->clos->disc.id)->free) (((g)->clos->state.id), objtype, id);
392 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
393
394 throw new UnsupportedOperationException();
395 }
396
397
398
399
400 //3 cctsybrl54fy799aynfej4iiy
401 // char *agnameof(void *obj)
402 // private static char buf[32];
403 public static CString agnameof(__ptr__ obj) {
404 ENTERING("cctsybrl54fy799aynfej4iiy","agnameof");
405 try {
406 ST_Agraph_s g;
407 CString rv;
408 /* perform internal lookup first */
409 g = agraphof(obj);
410 if ((rv = aginternalmapprint(g, AGTYPE(obj), AGID(obj)))!=null)
411 return rv;
412 if (g.clos.disc.id.print!=null) {
413 if ((rv =
414 (CString) g.clos.disc.id.print.exe(g.clos.state.id,
415 AGTYPE(obj),
416 AGID(obj)))!=null)
417 return rv;
418 }
419 if (AGTYPE(obj) != AGEDGE) {
420 rv = new CString("%"+((ST_Agobj_s)obj.castTo(ST_Agobj_s.class)).tag.id);
421 }
422 else
423 rv = null;
424 return rv;
425 } finally {
426 LEAVING("cctsybrl54fy799aynfej4iiy","agnameof");
427 }
428 }
429
430
431
432
433 //3 emt63ldde99jnwe2vvjal9kt9
434 // void agregister(Agraph_t * g, int objtype, void *obj)
435 public static void agregister(ST_Agraph_s g, int objtype, Object obj) {
436 ENTERING("emt63ldde99jnwe2vvjal9kt9","agregister");
437 try {
438 g.clos.disc.id.idregister.exe(g.clos.state.id, objtype, obj);
439 } finally {
440 LEAVING("emt63ldde99jnwe2vvjal9kt9","agregister");
441 }
442 }
443
444
445 }