Debian Codegraph @

src/gen/lib/cdt/dtview__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.dtrestore__c.dtrestore;
48 import static smetana.core.JUtils.EQ;
49 import static smetana.core.JUtils.NEQ;
50 import static smetana.core.JUtils.function;
51 import static smetana.core.JUtils.strcmp;
52 import static smetana.core.JUtilsDebug.ENTERING;
53 import static smetana.core.JUtilsDebug.LEAVING;
54 import static smetana.core.Macro.N;
55 import static smetana.core.Macro.UNSUPPORTED;
56 import static smetana.core.Macro.UNSUPPORTED_INT;
57 import h.Dtcompar_f;
58 import h.ST_dt_s;
59 import smetana.core.CFunction;
60 import smetana.core.CString;
61 import smetana.core.__ptr__;
62
63 public class dtview__c {
64 //1 9k44uhd5foylaeoekf3llonjq
65 // extern Dtmethod_t* Dtset
66
67
68 //1 1ahfywsmzcpcig2oxm7pt9ihj
69 // extern Dtmethod_t* Dtbag
70
71
72 //1 anhghfj3k7dmkudy2n7rvt31v
73 // extern Dtmethod_t* Dtoset
74
75
76 //1 5l6oj1ux946zjwvir94ykejbc
77 // extern Dtmethod_t* Dtobag
78
79
80 //1 2wtf222ak6cui8cfjnw6w377z
81 // extern Dtmethod_t* Dtlist
82
83
84 //1 d1s1s6ibtcsmst88e3057u9r7
85 // extern Dtmethod_t* Dtstack
86
87
88 //1 axa7mflo824p6fspjn1rdk0mt
89 // extern Dtmethod_t* Dtqueue
90
91
92 //1 ega812utobm4xx9oa9w9ayij6
93 // extern Dtmethod_t* Dtdeque
94
95
96 //1 cyfr996ur43045jv1tjbelzmj
97 // extern Dtmethod_t* Dtorder
98
99
100 //1 wlofoiftbjgrrabzb2brkycg
101 // extern Dtmethod_t* Dttree
102
103
104 //1 12bds94t7voj7ulwpcvgf6agr
105 // extern Dtmethod_t* Dthash
106
107
108 //1 9lqknzty480cy7zsubmabkk8h
109 // extern Dtmethod_t _Dttree
110
111
112 //1 bvn6zkbcp8vjdhkccqo1xrkrb
113 // extern Dtmethod_t _Dthash
114
115
116 //1 9lidhtd6nsmmv3e7vjv9e10gw
117 // extern Dtmethod_t _Dtlist
118
119
120 //1 34ujfamjxo7xn89u90oh2k6f8
121 // extern Dtmethod_t _Dtqueue
122
123
124 //1 3jy4aceckzkdv950h89p4wjc8
125 // extern Dtmethod_t _Dtstack
126
127
128
129
130 //3 6spidg45w8teb64726drdswaa
131 // static void* dtvsearch(Dt_t* dt, register void* obj, register int type)
132 public static __ptr__ dtvsearch(ST_dt_s dt, __ptr__ obj, int type) {
133 ENTERING("6spidg45w8teb64726drdswaa","dtvsearch");
134 try {
135 ST_dt_s d, p;
136 __ptr__ o=null, n, ok, nk;
137 int cmp, lk, sz, ky;
138 Dtcompar_f cmpf;
139 /* these operations only happen at the top level */
140 if ((type&(0000001|0000002|0000100|0000040))!=0)
141 return (__ptr__) dt.meth.searchf.exe(dt, obj, type);
142 if(((type&(0001000|0000004))!=0) || /* order sets first/last done below */
143 (((type&(0000200|0000400))!=0) && N(dt.meth.type&(0000010|0000004)) ) )
144 { for(d = dt; d!=null; d = (ST_dt_s) d.view)
145 if((o = (__ptr__) d.meth.searchf.exe(d,obj,type))!=null )
146 break;
147 dt.setPtr("walk", d);
148 return o;
149 }
150 if((dt.meth.type & (0000010|0000004) )!=0)
151 { if(N(type & (0000200|0000400|0000010|0000020)) )
152 return null;
153 n = nk = null; p = null;
154 for(d = dt; d!=null; d = (ST_dt_s) d.view)
155 { if(N(o = (__ptr__) d.meth.searchf.exe(d, obj, type) ))
156 continue;
157 ky = d.disc.key;
158 sz = d.disc.size;
159 lk = d.disc.link;
160 cmpf = (Dtcompar_f) d.disc.comparf;
161 ok = (__ptr__) (sz < 0 ? ((__ptr__)o).addVirtualBytes(ky) : ((__ptr__)o).addVirtualBytes(ky));
162 if(n!=null) /* get the right one among all dictionaries */
163 { cmp = (cmpf!=null ? (Integer)((CFunction)cmpf).exe(d,ok,nk,d.disc) : (sz <= 0 ? strcmp((CString)ok,(CString)nk) : UNSUPPORTED_INT("memcmp(ok,nk,sz)")) );
164 if(((type & (0000010|0000200))!=0 && cmp < 0) ||
165 ((type & (0000020|0000400))!=0 && cmp > 0) )
166 UNSUPPORTED("5o3u9aaanyd9yh74sjfkkofmo"); // goto a_dj;
167 }
168 else /* looks good for now */
169 { a_dj: p = d;
170 n = o;
171 nk = ok;
172 }
173 }
174 dt.setPtr("walk", p);
175 return n;
176 }
177 /* non-ordered methods */
178 UNSUPPORTED("36qdhpbcwst6tc1gvwcyvg91u"); // if(!(type & (0000010|0000020)) )
179 UNSUPPORTED("5p6q7ip4om6y4nrsjz07ua456"); // return ((void*)0);
180 UNSUPPORTED("bx84jj9durkqzcrq4l9h1b0za"); // if(!dt->walk || obj != (dt->walk->disc->link < 0 ? ((Dthold_t*)(dt->walk->data->here))->obj : (void*)((char*)(dt->walk->data->here) - dt->walk->disc->link) ) )
181 UNSUPPORTED("eh58afn12udc5q8yzr25advls"); // { for(d = dt; d; d = d->view)
182 UNSUPPORTED("de5yx4s0nsbgshd9seabcy2g9"); // if((o = (*(d->meth->searchf))(d, obj, 0000004)) )
183 UNSUPPORTED("1dhrv6aj5eq8ntuvb7qbs8aot"); // break;
184 UNSUPPORTED("66mzv36wy2mflr2u2a5pwa2vg"); // dt->walk = d;
185 UNSUPPORTED("d4pllgr7b2ohssrhtxxtd1fbb"); // if(!(obj = o) )
186 UNSUPPORTED("aihzmr4oo3tuh6kkxwtn9tlbd"); // return ((void*)0);
187 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
188 UNSUPPORTED("6he3c07r1xjfepuku37yav920"); // for(d = dt->walk, obj = (*d->meth->searchf)(d, obj, type);; )
189 UNSUPPORTED("d7hiatjof3gfyx3ab27oq4d74"); // { while(obj) /* keep moving until finding an uncovered object */
190 UNSUPPORTED("44tdztkynd140cqbaafbbxvqn"); // { for(p = dt; ; p = p->view)
191 UNSUPPORTED("72t51pabtpfsnn4qrcjvd6gkb"); // { if(p == d) /* adjacent object is uncovered */
192 UNSUPPORTED("4an2jpd7xs9lm1jlfrbualsrv"); // return obj;
193 UNSUPPORTED("bndt77eukkw8dnhl8sce4ts3d"); // if((*(p->meth->searchf))(p, obj, 0000004) )
194 UNSUPPORTED("6ioth986rfbv208dp59shjy15"); // break;
195 UNSUPPORTED("3to5h0rvqxdeqs38mhv47mm3o"); // }
196 UNSUPPORTED("5bx9ax8tembk4pweu41m5yw43"); // obj = (*d->meth->searchf)(d, obj, type);
197 UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
198 UNSUPPORTED("3diupilxwbi5nroolxiy7e8b0"); // if(!(d = dt->walk = d->view) ) /* move on to next dictionary */
199 UNSUPPORTED("aihzmr4oo3tuh6kkxwtn9tlbd"); // return ((void*)0);
200 UNSUPPORTED("esje2igec9cwwteta36lbrdvc"); // else if(type&0000010)
201 UNSUPPORTED("aeh2pn8gp2xj4lehv52n4hp6b"); // obj = (*(d->meth->searchf))(d,((void*)0),0000200);
202 UNSUPPORTED("1lfqka4p8e7w15b16wquy0vjx"); // else obj = (*(d->meth->searchf))(d,((void*)0),0000400);
203 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
204 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
205
206 throw new UnsupportedOperationException();
207 } finally {
208 LEAVING("6spidg45w8teb64726drdswaa","dtvsearch");
209 }
210 }
211
212
213
214
215 //3 dfryioch2xz35w8nq6lxbk5kh
216 // Dt_t* dtview(register Dt_t* dt, register Dt_t* view)
217 public static ST_dt_s dtview(ST_dt_s dt, ST_dt_s view) {
218 ENTERING("dfryioch2xz35w8nq6lxbk5kh","dtview");
219 try {
220 ST_dt_s d;
221 if ((dt.data.type&010000)!=0) dtrestore(dt,null);
222 if(view!=null)
223 { if ((view.data.type&010000)!=0) dtrestore(view,null);
224 if(NEQ(view.meth, dt.meth)) /* must use the same method */
225 UNSUPPORTED("return null;");
226 }
227 /* make sure there won't be a cycle */
228 for(d = view; d!=null; d = (ST_dt_s)d.view)
229 if(EQ(d, dt))
230 return null;
231 /* no more viewing lower dictionary */
232 if((d = (ST_dt_s)dt.view)!=null )
233 d.setInt("nview", d.nview-1);
234 dt.setPtr("walk", null);
235 dt.setPtr("view", null);
236 if(N(view))
237 { dt.setPtr("searchf", dt.meth.searchf);
238 return d;
239 }
240 /* ok */
241 dt.setPtr("view", view);
242 dt.setPtr("searchf", function(dtview__c.class, "dtvsearch"));
243 view.setInt("nview", view.nview+1 );
244 return view;
245 } finally {
246 LEAVING("dfryioch2xz35w8nq6lxbk5kh","dtview");
247 }
248 }
249
250
251 }