Debian Codegraph @

src/gen/lib/cgraph/apply__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.subg__c.agfstsubg;
48 import static gen.lib.cgraph.subg__c.agnxtsubg;
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.AGINEDGE;
53 import static smetana.core.Macro.AGNODE;
54 import static smetana.core.Macro.AGOUTEDGE;
55 import static smetana.core.Macro.AGRAPH;
56 import static smetana.core.Macro.AGTYPE;
57 import static smetana.core.Macro.N;
58 import static smetana.core.Macro.UNSUPPORTED;
59 import h.ST_Agobj_s;
60 import h.ST_Agraph_s;
61 import smetana.core.CFunction;
62 import smetana.core.__ptr__;
63
64 public class apply__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
198
199 //3 dups4iqoegzha9tq6pupoim08
200 // static Agobj_t *subnode_search(Agraph_t * sub, Agobj_t * n)
201 public static Object subnode_search(Object... arg) {
202 UNSUPPORTED("pxacbw8fd49n7yuf74ww3m4o"); // static Agobj_t *subnode_search(Agraph_t * sub, Agobj_t * n)
203 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
204 UNSUPPORTED("5h609thtbczs8d02vo4tkt5av"); // if (agraphof(n) == sub)
205 UNSUPPORTED("bp96fem54xcxrw16cmnlpell9"); // return n;
206 UNSUPPORTED("bdb4i0co0gl0r87nhwlfqsbah"); // return (Agobj_t *) agsubnode(sub, (Agnode_t *) n, (0));
207 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
208
209 throw new UnsupportedOperationException();
210 }
211
212
213
214
215 //3 1qi7zit7howdl3n270k4whbgh
216 // static Agobj_t *subedge_search(Agraph_t * sub, Agobj_t * e)
217 public static Object subedge_search(Object... arg) {
218 UNSUPPORTED("4hoc59s32d3n083o2rhe085zx"); // static Agobj_t *subedge_search(Agraph_t * sub, Agobj_t * e)
219 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
220 UNSUPPORTED("3y411cm763tnv8mvrigf8pg8y"); // if (agraphof(e) == sub)
221 UNSUPPORTED("8ihpc010r3nccyfagedpc4nlv"); // return e;
222 UNSUPPORTED("bha9r1zngfg6nmzgqmku0ji52"); // return (Agobj_t *) agsubedge(sub, (Agedge_t *) e, (0));
223 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
224
225 throw new UnsupportedOperationException();
226 }
227
228
229
230
231 //3 95y4aknoddh42lieikrb72vxw
232 // static Agobj_t *subgraph_search(Agraph_t * sub, Agobj_t * g)
233 public static ST_Agobj_s subgraph_search(ST_Agraph_s sub, ST_Agobj_s g) {
234 ENTERING("95y4aknoddh42lieikrb72vxw","subgraph_search");
235 try {
236 return (ST_Agobj_s) sub.castTo_ST_Agobj_s();
237 } finally {
238 LEAVING("95y4aknoddh42lieikrb72vxw","subgraph_search");
239 }
240 }
241
242
243
244
245 //3 8s9l15wqucf1glmbeb6fmya8e
246 // static void rec_apply(Agraph_t * g, Agobj_t * obj, agobjfn_t fn, void *arg, agobjsearchfn_t objsearch, int preorder)
247 public static void rec_apply(ST_Agraph_s g, ST_Agobj_s obj, CFunction fn, __ptr__ arg, CFunction objsearch, boolean preorder) {
248 ENTERING("8s9l15wqucf1glmbeb6fmya8e","rec_apply");
249 try {
250 ST_Agraph_s sub;
251 ST_Agobj_s subobj;
252 if (preorder)
253 fn.exe(g, obj, arg);
254 for (sub = agfstsubg(g); sub!=null; sub = agnxtsubg(sub)) {
255 if ((subobj = (ST_Agobj_s) objsearch.exe(sub, obj))!=null)
256 rec_apply(sub, subobj, fn, arg, objsearch, preorder);
257 }
258 if (N(preorder))
259 fn.exe(g, obj, arg);
260 } finally {
261 LEAVING("8s9l15wqucf1glmbeb6fmya8e","rec_apply");
262 }
263 }
264
265
266
267
268 //3 9hqql178zpl8iudlf6sgnv7aj
269 // int agapply(Agraph_t * g, Agobj_t * obj, agobjfn_t fn, void *arg, int preorder)
270 public static int agapply(ST_Agraph_s g, ST_Agobj_s obj, CFunction fn, __ptr__ arg, boolean preorder) {
271 ENTERING("9hqql178zpl8iudlf6sgnv7aj","agapply");
272 try {
273 ST_Agobj_s subobj;
274 CFunction objsearch=null;
275 switch (AGTYPE(obj)) {
276 case AGRAPH:
277 objsearch = function(apply__c.class, "subgraph_search");
278 break;
279 case AGNODE:
280 UNSUPPORTED("arkoj4niyfqe213zut6szzeji"); // objsearch = subnode_search;
281 break;
282 case AGOUTEDGE:
283 case AGINEDGE:
284 UNSUPPORTED("3h8kzrrsobdp839772gupdrbf"); // objsearch = subedge_search;
285 break;
286 default:
287 UNSUPPORTED("2pc67byzirrkhe1cmdoguh6i1"); // agerr(AGERR, "agapply: unknown object type %d\n", AGTYPE(obj));
288 UNSUPPORTED("8d9xfgejx5vgd6shva5wk5k06"); // return -1;
289 break;
290 }
291 if ((subobj = (ST_Agobj_s) objsearch.exe(g, obj))!=null) {
292 rec_apply(g, subobj, fn, arg, objsearch, preorder);
293 return 0;
294 } else
295 UNSUPPORTED("8d9xfgejx5vgd6shva5wk5k06"); // return -1;
296 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
297
298 throw new UnsupportedOperationException();
299 } finally {
300 LEAVING("9hqql178zpl8iudlf6sgnv7aj","agapply");
301 }
302 }
303
304
305 }