Debian Codegraph @

src/gen/lib/cdt/dtdisc__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.cdt;
47 import static gen.lib.cdt.dtflatten__c.dtflatten;
48 import static gen.lib.cdt.dtrestore__c.dtrestore;
49 import static smetana.core.JUtils.function;
50 import static smetana.core.JUtilsDebug.ENTERING;
51 import static smetana.core.JUtilsDebug.LEAVING;
52 import static smetana.core.Macro.N;
53 import static smetana.core.Macro.UNSUPPORTED;
54 import h.Dtsearch_f;
55 import h.ST_dt_s;
56 import h.ST_dtdisc_s;
57 import h.ST_dtlink_s;
58 import smetana.core.CString;
59 import smetana.core.Memory;
60 import smetana.core.size_t;
61
62 public class dtdisc__c {
63 //1 9k44uhd5foylaeoekf3llonjq
64 // extern Dtmethod_t* Dtset
65
66
67 //1 1ahfywsmzcpcig2oxm7pt9ihj
68 // extern Dtmethod_t* Dtbag
69
70
71 //1 anhghfj3k7dmkudy2n7rvt31v
72 // extern Dtmethod_t* Dtoset
73
74
75 //1 5l6oj1ux946zjwvir94ykejbc
76 // extern Dtmethod_t* Dtobag
77
78
79 //1 2wtf222ak6cui8cfjnw6w377z
80 // extern Dtmethod_t* Dtlist
81
82
83 //1 d1s1s6ibtcsmst88e3057u9r7
84 // extern Dtmethod_t* Dtstack
85
86
87 //1 axa7mflo824p6fspjn1rdk0mt
88 // extern Dtmethod_t* Dtqueue
89
90
91 //1 ega812utobm4xx9oa9w9ayij6
92 // extern Dtmethod_t* Dtdeque
93
94
95 //1 cyfr996ur43045jv1tjbelzmj
96 // extern Dtmethod_t* Dtorder
97
98
99 //1 wlofoiftbjgrrabzb2brkycg
100 // extern Dtmethod_t* Dttree
101
102
103 //1 12bds94t7voj7ulwpcvgf6agr
104 // extern Dtmethod_t* Dthash
105
106
107 //1 9lqknzty480cy7zsubmabkk8h
108 // extern Dtmethod_t _Dttree
109
110
111 //1 bvn6zkbcp8vjdhkccqo1xrkrb
112 // extern Dtmethod_t _Dthash
113
114
115 //1 9lidhtd6nsmmv3e7vjv9e10gw
116 // extern Dtmethod_t _Dtlist
117
118
119 //1 34ujfamjxo7xn89u90oh2k6f8
120 // extern Dtmethod_t _Dtqueue
121
122
123 //1 3jy4aceckzkdv950h89p4wjc8
124 // extern Dtmethod_t _Dtstack
125
126
127
128
129 //3 507t9jcy6v9twvl30rs9i2nwi
130 // static void* dtmemory(Dt_t* dt,void* addr,size_t size,Dtdisc_t* disc)
131 public static Object dtmemory(ST_dt_s dt, Object addr, size_t size, ST_dtdisc_s disc) {
132 ENTERING("507t9jcy6v9twvl30rs9i2nwi","dtmemory");
133 try {
134 if(addr!=null) {
135 if(size == null) {
136 Memory.free(addr);
137 return null;
138 }
139 UNSUPPORTED("9ed8imo9cbvwtwe92qmavoqko"); // else return realloc(addr,size);
140 }
141 else return size.isStrictPositive() ? size.malloc() : null;
142 throw new UnsupportedOperationException();
143 } finally {
144 LEAVING("507t9jcy6v9twvl30rs9i2nwi","dtmemory");
145 }
146 }
147
148
149
150
151 //3 axpvuswclmi9bx3qtlh4quyah
152 // Dtdisc_t* dtdisc(Dt_t* dt, Dtdisc_t* disc, int type)
153 public static ST_dtdisc_s dtdisc(ST_dt_s dt, ST_dtdisc_s disc, int type) {
154 ENTERING("axpvuswclmi9bx3qtlh4quyah","dtdisc");
155 try {
156 Dtsearch_f searchf;
157 ST_dtlink_s r, t;
158 CString k;
159 ST_dtdisc_s old;
160 if(N(old = (ST_dtdisc_s) dt.disc) ) /* initialization call from dtopen() */
161 { dt.setPtr("disc", disc);
162 if(N(dt.setPtr("memoryf", disc.memoryf )))
163 dt.setPtr("memoryf", function(dtdisc__c.class, "dtmemory"));
164 return disc;
165 }
166 if(N(disc)) /* only want to know current discipline */
167 return old;
168 searchf = (Dtsearch_f) dt.meth.searchf;
169 if((dt.data.type&010000)!=0) dtrestore(dt,null);
170 if(old.eventf!=null && ((Integer)old.eventf.exe(dt,3, disc,old)) < 0)
171 return null;
172 dt.setPtr("disc", disc);
173 if(N(dt.setPtr("memoryf", disc.memoryf)))
174 dt.setPtr("memoryf", function(dtdisc__c.class, "dtmemory"));
175 if((dt.data.type&(0000040|0000100|0000020))!=0)
176 UNSUPPORTED("e2tzh95k1lvjl6wbtpwizam8q"); // goto done;
177 else if((dt.data.type&0000002)!=0) {
178 UNSUPPORTED("3q5nyguq8mgdfwmm0yrzq2br8"); // if(type&0000002)
179 UNSUPPORTED("93q6zqzlgfz2qd0yl6koyw99c"); // goto done;
180 UNSUPPORTED("6d1rfacssm8768oz9fu5o66t8"); // else goto dt_renew;
181 }
182 else if((dt.data.type&(0000001|0000002))!=0) {
183 UNSUPPORTED("8xmm1djjds55s86jodixkp72u"); // if((type&0000002) && (type&0000001))
184 UNSUPPORTED("93q6zqzlgfz2qd0yl6koyw99c"); // goto done;
185 UNSUPPORTED("6d1rfacssm8768oz9fu5o66t8"); // else goto dt_renew;
186 }
187 else /*if(dt->data->type&(DT_OSET|DT_OBAG))*/ {
188 if((type&0000001)!=0)
189 UNSUPPORTED("93q6zqzlgfz2qd0yl6koyw99c"); // goto done;
190 // dt_renew:
191 r = dtflatten(dt);
192 UNSUPPORTED("1rry7yjzos90pgbf3li2qpa18"); // dt->data->type &= ~010000;
193 UNSUPPORTED("6vkn7padspfbtju9g5b65b34w"); // dt->data->here = ((Dtlink_t*)0);
194 UNSUPPORTED("2jfi30wa60xp7iqlk9yyf4k5j"); // dt->data->size = 0;
195 UNSUPPORTED("1i3oayy7gy36lar9kfhuq6rur"); // if(dt->data->type&(0000001|0000002))
196 UNSUPPORTED("ay51d19gimt3gpqjact2t0ypm"); // { register Dtlink_t **s, **ends;
197 UNSUPPORTED("5p6g054kk7snvpwuxudelseir"); // ends = (s = dt->data->hh._htab) + dt->data->ntab;
198 UNSUPPORTED("3zu1r6orkvmsvbjbzqqx9wedr"); // while(s < ends)
199 UNSUPPORTED("9wq8eycc78fg8sqi6bjce4q7f"); // *s++ = ((Dtlink_t*)0);
200 UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
201 UNSUPPORTED("3rfhc462a0qx53yecw933hkk8"); // /* reinsert them */
202 UNSUPPORTED("ctmfjzioo5q7mzsmb6rf9mxoy"); // while(r)
203 UNSUPPORTED("9qxb0eqp3ujnnuum1bggqarjh"); // { t = r->right;
204 UNSUPPORTED("ddltpk94i08fyy6x03ozyc7s1"); // if(!(type&0000002)) /* new hash value */
205 UNSUPPORTED("8mj2vd7idro90tjnvl6b9trnc"); // { k = (char*)(disc->link < 0 ? ((Dthold_t*)(r))->obj : (void*)((char*)(r) - disc->link) );
206 UNSUPPORTED("1dvo2602az1wcigxx20czskv9"); // k = (void*)(disc->size < 0 ? *((char**)((char*)((void*)k)+disc->key)) : ((char*)((void*)k)+disc->key));
207 UNSUPPORTED("269t5qi8m2ujfjvmbqvyjvr1s"); // r->hl._hash = (disc->hashf ? (*disc->hashf)(dt,k,disc) : dtstrhash(0,k,disc->size) );
208 UNSUPPORTED("3to5h0rvqxdeqs38mhv47mm3o"); // }
209 UNSUPPORTED("2e2tx3ch32oxo5y01bflgbf2h"); // (void)(*searchf)(dt,(void*)r,0000040);
210 UNSUPPORTED("8tob14cb9u9q0mnud0wovaioi"); // r = t;
211 UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
212 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
213 UNSUPPORTED("cerydbb7i6l7c4pgeygvwoqk2"); // done:
214 UNSUPPORTED("bi0p581nen18ypj0ey48s6ete"); // return old;
215 }
216
217 throw new UnsupportedOperationException();
218 } finally {
219 LEAVING("axpvuswclmi9bx3qtlh4quyah","dtdisc");
220 }
221 }
222
223
224 }