Debian Codegraph @

src/gen/lib/cgraph/refstr__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.mem__c.agalloc;
48 import static gen.lib.cgraph.utils__c.agdtdelete;
49 import static gen.lib.cgraph.utils__c.agdtopen;
50 import static smetana.core.JUtils.EQ;
51 import static smetana.core.JUtils.sizeof;
52 import static smetana.core.JUtilsDebug.ENTERING;
53 import static smetana.core.JUtilsDebug.LEAVING;
54 import static smetana.core.Macro.UNSUPPORTED;
55 import h.ST_Agraph_s;
56 import h.ST_dt_s;
57 import h.ST_refstr_t;
58 import smetana.core.ACCESS;
59 import smetana.core.CString;
60 import smetana.core.STARSTAR;
61 import smetana.core.Z;
62 import smetana.core.size_t;
63
64 public class refstr__c {
65 //1 9k44uhd5foylaeoekf3llonjq
66 // extern Dtmethod_t* Dtset
67
68
69 //1 1ahfywsmzcpcig2oxm7pt9ihj
70 // extern Dtmethod_t* Dtbag
71
72
73 //1 anhghfj3k7dmkudy2n7rvt31v
74 // extern Dtmethod_t* Dtoset
75
76
77 //1 5l6oj1ux946zjwvir94ykejbc
78 // extern Dtmethod_t* Dtobag
79
80
81 //1 2wtf222ak6cui8cfjnw6w377z
82 // extern Dtmethod_t* Dtlist
83
84
85 //1 d1s1s6ibtcsmst88e3057u9r7
86 // extern Dtmethod_t* Dtstack
87
88
89 //1 axa7mflo824p6fspjn1rdk0mt
90 // extern Dtmethod_t* Dtqueue
91
92
93 //1 ega812utobm4xx9oa9w9ayij6
94 // extern Dtmethod_t* Dtdeque
95
96
97 //1 cyfr996ur43045jv1tjbelzmj
98 // extern Dtmethod_t* Dtorder
99
100
101 //1 wlofoiftbjgrrabzb2brkycg
102 // extern Dtmethod_t* Dttree
103
104
105 //1 12bds94t7voj7ulwpcvgf6agr
106 // extern Dtmethod_t* Dthash
107
108
109 //1 9lqknzty480cy7zsubmabkk8h
110 // extern Dtmethod_t _Dttree
111
112
113 //1 bvn6zkbcp8vjdhkccqo1xrkrb
114 // extern Dtmethod_t _Dthash
115
116
117 //1 9lidhtd6nsmmv3e7vjv9e10gw
118 // extern Dtmethod_t _Dtlist
119
120
121 //1 34ujfamjxo7xn89u90oh2k6f8
122 // extern Dtmethod_t _Dtqueue
123
124
125 //1 3jy4aceckzkdv950h89p4wjc8
126 // extern Dtmethod_t _Dtstack
127
128
129 //1 8dfqgf3u1v830qzcjqh9o8ha7
130 // extern Agmemdisc_t AgMemDisc
131
132
133 //1 18k2oh2t6llfsdc5x0wlcnby8
134 // extern Agiddisc_t AgIdDisc
135
136
137 //1 a4r7hi80gdxtsv4hdoqpyiivn
138 // extern Agiodisc_t AgIoDisc
139
140
141 //1 bnzt5syjb7mgeru19114vd6xx
142 // extern Agdisc_t AgDefaultDisc
143
144
145 //1 35y2gbegsdjilegaribes00mg
146 // extern Agdesc_t Agdirected, Agstrictdirected, Agundirected, Agstrictundirected
147
148
149 //1 c2rygslq6bcuka3awmvy2b3ow
150 // typedef Agsubnode_t Agnoderef_t
151
152
153 //1 xam6yv0dcsx57dtg44igpbzn
154 // typedef Dtlink_t Agedgeref_t
155
156
157 //1 6ayavpu39aihwyojkx093pcy3
158 // extern Agraph_t *Ag_G_global
159
160
161 //1 871mxtg9l6ffpxdl9kniwusf7
162 // extern char *AgDataRecName
163
164
165 //1 c0o2kmml0tn6hftuwo0u4shwd
166 // extern Dtdisc_t Ag_subnode_id_disc
167
168
169 //1 8k15pyu256unm2kpd9zf5pf7k
170 // extern Dtdisc_t Ag_subnode_seq_disc
171
172
173 //1 e3d820y06gpeusn6atgmj8bzd
174 // extern Dtdisc_t Ag_mainedge_id_disc
175
176
177 //1 cbr0772spix9h1aw7h5v7dv9j
178 // extern Dtdisc_t Ag_subedge_id_disc
179
180
181 //1 akd0c3v0j7m2npxcb9acit1fa
182 // extern Dtdisc_t Ag_mainedge_seq_disc
183
184
185 //1 12d8la07351ww7vwfzucjst8m
186 // extern Dtdisc_t Ag_subedge_seq_disc
187
188
189 //1 29eokk7v88e62g8o6lizmo967
190 // extern Dtdisc_t Ag_subgraph_id_disc
191
192
193 //1 4xd9cbgy6hk5g6nhjcbpzkx14
194 // extern Agcbdisc_t AgAttrdisc
195
196
197 //1 8bj6ivnd4go7wt4pvzqgk8mlr
198 // static unsigned long HTML_BIT
199 //static public int HTML_BIT;
200
201 //1 dqn77l82bfu071bv703e77jmg
202 // static unsigned long CNT_BITS
203 //static public int CNT_BITS;
204
205 //1 boyxdmkhstn4i64pqf6sv1mi7
206 // static Dtdisc_t Refstrdisc =
207 /*static public final __struct__<_dtdisc_s> Refstrdisc = JUtils.from(_dtdisc_s.class);
208 static {
209 Refstrdisc.setInt("key", OFFSET.create(refstr_t.class, "s").toInt()); // *s is the third field in refstr_t
210 Refstrdisc.setInt("size", -1);
211 Refstrdisc.setInt("link", 0);
212 Refstrdisc.setPtr("makef", null);
213 Refstrdisc.setPtr("freef", function(utils__c.class, "agdictobjfree"));
214 Refstrdisc.setPtr("comparf", null);
215 Refstrdisc.setPtr("hashf", null);
216 Refstrdisc.setPtr("memoryf", function(utils__c.class, "agdictobjmem"));
217 Refstrdisc.setPtr("eventf", null);
218 }*/
219
220 //1 2e0tdcdyjc9zq54xt1nzgwvn3
221 // static Dict_t *Refdict_default
222 //static public _dt_s Refdict_default;
223
224
225
226 //3 f1nwss2xoaub1hyord232ugoj
227 // static Dict_t *refdict(Agraph_t * g)
228 public static ST_dt_s refdict(final ST_Agraph_s g) {
229 ENTERING("f1nwss2xoaub1hyord232ugoj","refdict");
230 try {
231 STARSTAR<ST_dt_s> dictref;
232 if (g != null)
233 dictref = STARSTAR.amp(new ACCESS<ST_dt_s>() {
234 public ST_dt_s get() {
235 return (ST_dt_s) g.clos.strdict;
236 }
237 public void set(ST_dt_s obj) {
238 g.clos.setPtr("strdict", obj);
239 }
240 });
241 else
242 dictref = STARSTAR.amp(new ACCESS<ST_dt_s>() {
243 public ST_dt_s get() {
244 return Z.z().Refdict_default;
245 }
246 public void set(ST_dt_s obj) {
247 Z.z().Refdict_default = obj;
248 }
249 });
250 if (dictref.getMe() == null) {
251 dictref.setMe(agdtopen(g, Z.z().Refstrdisc, Z.z().Dttree));
252 }
253 Z.z().HTML_BIT = 1 << 31;
254 Z.z().CNT_BITS = ~Z.z().HTML_BIT;
255 return dictref.getMe();
256 } finally {
257 LEAVING("f1nwss2xoaub1hyord232ugoj","refdict");
258 }
259 }
260
261
262
263
264 //3 9aajykl8nuymg60zukycquawa
265 // int agstrclose(Agraph_t * g)
266 public static Object agstrclose(Object... arg) {
267 UNSUPPORTED("c2l353zz5jt7jlmbhjbbt3m7v"); // int agstrclose(Agraph_t * g)
268 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
269 UNSUPPORTED("208rcf0f70q2wxwsa6po42oqq"); // return agdtclose(g, refdict(g));
270 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
271
272 throw new UnsupportedOperationException();
273 }
274
275
276
277
278 //3 9ts4wqhw2xafdv3tlcilneewq
279 // static refstr_t *refsymbind(Dict_t * strdict, char *s)
280 public static ST_refstr_t refsymbind(ST_dt_s strdict, CString s) {
281 ENTERING("9ts4wqhw2xafdv3tlcilneewq","refsymbind");
282 try {
283 final ST_refstr_t key = new ST_refstr_t();
284 ST_refstr_t r;
285 // key.setPtr("s", s.duplicate());
286 key.setString(s);
287 r = (ST_refstr_t) strdict.searchf.exe(strdict, key, 0000004);
288 return r;
289 } finally {
290 LEAVING("9ts4wqhw2xafdv3tlcilneewq","refsymbind");
291 }
292 }
293
294
295
296
297 //3 1scntgo71z7c2v15zapiyw59w
298 // static char *refstrbind(Dict_t * strdict, char *s)
299 public static CString refstrbind(ST_dt_s strdict, CString s) {
300 ENTERING("1scntgo71z7c2v15zapiyw59w","refstrbind");
301 try {
302 ST_refstr_t r;
303 r = refsymbind(strdict, s);
304 if (r!=null)
305 return r.s;
306 else
307 return null;
308 } finally {
309 LEAVING("1scntgo71z7c2v15zapiyw59w","refstrbind");
310 }
311 }
312
313
314
315
316 //3 bb8aqjshw3ecae2lsmhigd0mc
317 // char *agstrbind(Agraph_t * g, char *s)
318 public static CString agstrbind(ST_Agraph_s g, CString s) {
319 ENTERING("bb8aqjshw3ecae2lsmhigd0mc","agstrbind");
320 try {
321 return refstrbind(refdict(g), s);
322 } finally {
323 LEAVING("bb8aqjshw3ecae2lsmhigd0mc","agstrbind");
324 }
325 }
326
327
328
329
330 //3 86oznromwhn9qeym0k7pih73q
331 // char *agstrdup(Agraph_t * g, char *s)
332 public static CString agstrdup(ST_Agraph_s g, CString s) {
333 ENTERING("86oznromwhn9qeym0k7pih73q","agstrdup");
334 try {
335 ST_refstr_t r;
336 ST_dt_s strdict;
337 size_t sz;
338 if (s == null)
339 return null;
340 strdict = refdict(g);
341 r = (ST_refstr_t) refsymbind(strdict, s);
342 if (r!=null)
343 r.refcnt++;
344 else {
345 sz = sizeof(ST_refstr_t.class).plus(s.length());
346 if (g!=null)
347 r = (ST_refstr_t) agalloc(g, sz);
348 else
349 r = new ST_refstr_t();
350 r.refcnt = 1;
351 r.setString(s.duplicate());
352 // strcpy(r->store, s);
353 // r->s = r->store;
354 strdict.searchf.exe(strdict,r,0000001);
355 }
356 return r.s;
357 } finally {
358 LEAVING("86oznromwhn9qeym0k7pih73q","agstrdup");
359 }
360 }
361
362
363
364
365 //3 1ovgpnv6r8ru6iz51ic91zzal
366 // char *agstrdup_html(Agraph_t * g, char *s)
367 public static Object agstrdup_html(Object... arg) {
368 UNSUPPORTED("6679vrn0j0vkzernsn2rlottw"); // char *agstrdup_html(Agraph_t * g, char *s)
369 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
370 UNSUPPORTED("1uvxutp09oluiacpgn0f76bgu"); // refstr_t *r;
371 UNSUPPORTED("czgqod5ni1s5av81qa3n0ghgr"); // Dict_t *strdict;
372 UNSUPPORTED("55x2wgzchv0157f4g74693oaq"); // size_t sz;
373 UNSUPPORTED("a5abfeqtsa4i5x739edpwuxin"); // if (s == ((char *)0))
374 UNSUPPORTED("xp8okoaicybpovkenntpd857"); // return ((char *)0);
375 UNSUPPORTED("bo3fdoot7ldevx250qweitj6z"); // strdict = refdict(g);
376 UNSUPPORTED("12vt0u4w3q0jht9f9vsaybntn"); // r = refsymbind(strdict, s);
377 UNSUPPORTED("67y4tszu7dmeves31gr9ydmpi"); // if (r)
378 UNSUPPORTED("5gybhadmtbc77f5wf9adyemj7"); // r->refcnt++;
379 UNSUPPORTED("1nyzbeonram6636b1w955bypn"); // else {
380 UNSUPPORTED("9llv1u64vbj6q8loctnrowtm5"); // sz = sizeof(refstr_t) + strlen(s);
381 UNSUPPORTED("7tmc6a514rv2k24wg5o8qpvyp"); // if (g)
382 UNSUPPORTED("asjj8bj1b02f70rfr41ayipxy"); // r = (refstr_t *) agalloc(g, sz);
383 UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else
384 UNSUPPORTED("bp5rr6mkh94826cbgdwglvpk9"); // r = (refstr_t *) malloc(sz);
385 UNSUPPORTED("6sl9ejza97inawt8uprd120h6"); // r->refcnt = 1 | HTML_BIT;
386 UNSUPPORTED("dadamob0ot3fpofdm1ey34srj"); // strcpy(r->store, s);
387 UNSUPPORTED("1cyhds1lm0ee8rtp7k7h5cqfw"); // r->s = r->store;
388 UNSUPPORTED("b2zaf5uj8gofpyc40hl0ziymh"); // (*(((Dt_t*)(strdict))->searchf))((strdict),(void*)(r),0000001);
389 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
390 UNSUPPORTED("lxjgfic7zk869xczsgazw3sx"); // return r->s;
391 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
392
393 throw new UnsupportedOperationException();
394 }
395
396
397
398
399 //3 enhn1ajfo86a19dgm4b8lduz7
400 // int agstrfree(Agraph_t * g, char *s)
401 public static int agstrfree(ST_Agraph_s g, CString s) {
402 ENTERING("enhn1ajfo86a19dgm4b8lduz7","agstrfree");
403 try {
404 ST_refstr_t r;
405 ST_dt_s strdict;
406 if (s == null)
407 return -1;
408 strdict = refdict(g);
409 r = (ST_refstr_t) refsymbind(strdict, s);
410 if (r!=null && (EQ(r.s, s))) {
411 r.refcnt--;
412 if ((r.refcnt!=0 && Z.z().CNT_BITS!=0) == false) {
413 agdtdelete(g, strdict, r);
414 /*
415 if (g) agfree(g,r);
416 else free(r);
417 */
418 }
419 }
420 if (r == null)
421 return -1;
422 return 0;
423 } finally {
424 LEAVING("enhn1ajfo86a19dgm4b8lduz7","agstrfree");
425 }
426 }
427
428
429
430
431 //3 3em4wzjnpajd5d3igb90l3rml
432 // int aghtmlstr(char *s)
433 public static int aghtmlstr(CString s) {
434 ENTERING("3em4wzjnpajd5d3igb90l3rml","aghtmlstr");
435 try {
436 ST_refstr_t key;
437 if (s == null)
438 return 0;
439 key = (ST_refstr_t) s.getParent();
440 return (key.refcnt & Z.z().HTML_BIT);
441 } finally {
442 LEAVING("3em4wzjnpajd5d3igb90l3rml","aghtmlstr");
443 }
444 }
445
446
447
448
449 //3 ap2ebebypq6vmwle0hicv6tmj
450 // void agmarkhtmlstr(char *s)
451 public static Object agmarkhtmlstr(Object... arg) {
452 UNSUPPORTED("8oc24oz62ej815sjwuwuj9bmt"); // void agmarkhtmlstr(char *s)
453 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
454 UNSUPPORTED("164ww6fcxh6v2wmxj0v8aqviy"); // refstr_t *key;
455 UNSUPPORTED("8quozj18vjguewxdpv9w14yjn"); // if (s == NULL)
456 UNSUPPORTED("a7fgam0j0jm7bar0mblsv3no4"); // return;
457 UNSUPPORTED("9cmt4vbkm95fqftevdqyfvslr"); // key = (refstr_t *) (s - ((int)(&(((refstr_t*)0)->store[0]))));
458 UNSUPPORTED("68mcf5kr6xw538zkdk8b50aeb"); // key->refcnt |= HTML_BIT;
459 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
460
461 throw new UnsupportedOperationException();
462 }
463
464
465 }