| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
package gen.lib.cgraph; |
| 47 |
import static gen.lib.cdt.dtsize__c.dtsize_; |
| 48 |
import static gen.lib.cdt.dtview__c.dtview; |
| 49 |
import static gen.lib.cgraph.apply__c.agapply; |
| 50 |
import static gen.lib.cgraph.edge__c.agfstout; |
| 51 |
import static gen.lib.cgraph.edge__c.agnxtout; |
| 52 |
import static gen.lib.cgraph.graph__c.agopen; |
| 53 |
import static gen.lib.cgraph.mem__c.agalloc; |
| 54 |
import static gen.lib.cgraph.node__c.agfstnode; |
| 55 |
import static gen.lib.cgraph.node__c.agnxtnode; |
| 56 |
import static gen.lib.cgraph.obj__c.agmethod_upd; |
| 57 |
import static gen.lib.cgraph.obj__c.agraphof; |
| 58 |
import static gen.lib.cgraph.obj__c.agroot; |
| 59 |
import static gen.lib.cgraph.rec__c.agbindrec; |
| 60 |
import static gen.lib.cgraph.rec__c.aggetrec; |
| 61 |
import static gen.lib.cgraph.refstr__c.agstrdup; |
| 62 |
import static gen.lib.cgraph.refstr__c.agstrfree; |
| 63 |
import static gen.lib.cgraph.subg__c.agparent; |
| 64 |
import static gen.lib.cgraph.utils__c.agdtopen; |
| 65 |
import static smetana.core.JUtils.NEQ; |
| 66 |
import static smetana.core.JUtils.function; |
| 67 |
import static smetana.core.JUtils.sizeof; |
| 68 |
import static smetana.core.JUtilsDebug.ENTERING; |
| 69 |
import static smetana.core.JUtilsDebug.LEAVING; |
| 70 |
import static smetana.core.Macro.AGEDGE; |
| 71 |
import static smetana.core.Macro.AGINEDGE; |
| 72 |
import static smetana.core.Macro.AGNODE; |
| 73 |
import static smetana.core.Macro.AGOUTEDGE; |
| 74 |
import static smetana.core.Macro.AGRAPH; |
| 75 |
import static smetana.core.Macro.AGTYPE; |
| 76 |
import static smetana.core.Macro.N; |
| 77 |
import static smetana.core.Macro.UNSUPPORTED; |
| 78 |
import h.ST_Agattr_s; |
| 79 |
import h.ST_Agdatadict_s; |
| 80 |
import h.ST_Agdesc_s; |
| 81 |
import h.ST_Agedge_s; |
| 82 |
import h.ST_Agnode_s; |
| 83 |
import h.ST_Agobj_s; |
| 84 |
import h.ST_Agraph_s; |
| 85 |
import h.ST_Agrec_s; |
| 86 |
import h.ST_Agsym_s; |
| 87 |
import h.ST_Agtag_s; |
| 88 |
import h.ST_dt_s; |
| 89 |
import h.ST_dtdisc_s; |
| 90 |
|
| 91 |
import java.util.ArrayList; |
| 92 |
|
| 93 |
import smetana.core.CString; |
| 94 |
import smetana.core.Memory; |
| 95 |
import smetana.core.Z; |
| 96 |
import smetana.core.__ptr__; |
| 97 |
|
| 98 |
public class attr__c { |
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
|
| 245 |
|
| 246 |
public final static CString DataDictName = new CString("_AG_datadict"); |
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
|
| 252 |
|
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
public static ST_Agdatadict_s agdatadict(ST_Agraph_s g, boolean cflag) { |
| 269 |
ENTERING("4bm10isw1qq1eqcse8afbxee3","agdatadict"); |
| 270 |
try { |
| 271 |
ST_Agdatadict_s rv; |
| 272 |
rv = (ST_Agdatadict_s) aggetrec(g, DataDictName, false).castTo(ST_Agdatadict_s.class); |
| 273 |
if (rv!=null || N(cflag)) |
| 274 |
return rv; |
| 275 |
init_all_attrs(g); |
| 276 |
rv = (ST_Agdatadict_s) aggetrec(g, DataDictName, false).castTo(ST_Agdatadict_s.class); |
| 277 |
return rv; |
| 278 |
} finally { |
| 279 |
LEAVING("4bm10isw1qq1eqcse8afbxee3","agdatadict"); |
| 280 |
} |
| 281 |
} |
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
public static ST_dt_s agdictof(ST_Agraph_s g, int kind) { |
| 289 |
ENTERING("2b2cg0am9e1lwc0nqikl2wczb","agdictof"); |
| 290 |
try { |
| 291 |
ST_Agdatadict_s dd; |
| 292 |
ST_dt_s dict; |
| 293 |
dd = agdatadict(g, false); |
| 294 |
if (dd!=null) |
| 295 |
switch (kind) { |
| 296 |
case AGRAPH: |
| 297 |
dict = (ST_dt_s) dd.dict_g; |
| 298 |
break; |
| 299 |
case AGNODE: |
| 300 |
dict = (ST_dt_s) dd.dict_n; |
| 301 |
break; |
| 302 |
case AGINEDGE: |
| 303 |
case AGOUTEDGE: |
| 304 |
dict = (ST_dt_s) dd.dict_e; |
| 305 |
break; |
| 306 |
default: |
| 307 |
System.err.println("agdictof: unknown kind "+ kind); |
| 308 |
dict = null; |
| 309 |
throw new UnsupportedOperationException(); |
| 310 |
} else |
| 311 |
dict = null; |
| 312 |
return dict; |
| 313 |
} finally { |
| 314 |
LEAVING("2b2cg0am9e1lwc0nqikl2wczb","agdictof"); |
| 315 |
} |
| 316 |
} |
| 317 |
|
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
|
| 322 |
|
| 323 |
public static ST_Agsym_s agnewsym(ST_Agraph_s g, CString name, CString value, int id, int kind) { |
| 324 |
ENTERING("dbhw2q2jfsz9qwawchy0hxj4i","agnewsym"); |
| 325 |
try { |
| 326 |
ST_Agsym_s sym; |
| 327 |
sym = (ST_Agsym_s) agalloc(g, sizeof(ST_Agsym_s.class)); |
| 328 |
sym.setInt("kind", kind); |
| 329 |
sym.setPtr("name", agstrdup(g, name)); |
| 330 |
sym.setPtr("defval", agstrdup(g, value)); |
| 331 |
sym.setInt("id", id); |
| 332 |
return sym; |
| 333 |
} finally { |
| 334 |
LEAVING("dbhw2q2jfsz9qwawchy0hxj4i","agnewsym"); |
| 335 |
} |
| 336 |
} |
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
|
| 343 |
public static Object agcopydict(Object... arg) { |
| 344 |
UNSUPPORTED("5x2q9spbx7y0k6l59z6oy8cuc"); |
| 345 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 346 |
UNSUPPORTED("1y11aotql5lts9njnreyq9t6r"); |
| 347 |
UNSUPPORTED("5i0sddp616zsw63jk38od62l4"); |
| 348 |
UNSUPPORTED("5wsq1ipnwwy8yumrluztmye7f"); |
| 349 |
UNSUPPORTED("aqq7o7hh4nwqvvtcdqetmidkg"); |
| 350 |
UNSUPPORTED("2astc0oxlvew45mitrflnx0ar"); |
| 351 |
UNSUPPORTED("36os9hvg0e59rrhe68di2b5r3"); |
| 352 |
UNSUPPORTED("77sre49xpjwlyjqhek659u3tq"); |
| 353 |
UNSUPPORTED("3rc58hrkem2xey59d9ptss1sx"); |
| 354 |
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); |
| 355 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 356 |
|
| 357 |
throw new UnsupportedOperationException(); |
| 358 |
} |
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
|
| 364 |
|
| 365 |
public static ST_Agdatadict_s agmakedatadict(ST_Agraph_s g) { |
| 366 |
ENTERING("alb1d5x6huba3q44ms1wt0rr5","agmakedatadict"); |
| 367 |
try { |
| 368 |
ST_Agraph_s par; |
| 369 |
ST_Agdatadict_s parent_dd, dd; |
| 370 |
dd = (ST_Agdatadict_s) agbindrec(g, DataDictName, sizeof(ST_Agdatadict_s.class), |
| 371 |
false).castTo(ST_Agdatadict_s.class); |
| 372 |
dd.setPtr("dict.n", agdtopen(g, Z.z().AgDataDictDisc, Z.z().Dttree)); |
| 373 |
dd.setPtr("dict.e", agdtopen(g, Z.z().AgDataDictDisc,Z.z(). Dttree)); |
| 374 |
dd.setPtr("dict.g", agdtopen(g, Z.z().AgDataDictDisc, Z.z().Dttree)); |
| 375 |
if ((par = agparent(g))!=null) { |
| 376 |
parent_dd = agdatadict(par, false); |
| 377 |
dtview((ST_dt_s)dd.dict_n, (ST_dt_s)parent_dd.dict_n); |
| 378 |
dtview((ST_dt_s)dd.dict_e, (ST_dt_s)parent_dd.dict_e); |
| 379 |
dtview((ST_dt_s)dd.dict_g, (ST_dt_s)parent_dd.dict_g); |
| 380 |
} else { |
| 381 |
if (Z.z().ProtoGraph!=null && NEQ(g, Z.z().ProtoGraph)) { |
| 382 |
|
| 383 |
|
| 384 |
parent_dd = agdatadict(Z.z().ProtoGraph, false); |
| 385 |
agcopydict(parent_dd.dict_n, dd.dict_n, g, AGNODE); |
| 386 |
agcopydict(parent_dd.dict_e, dd.dict_e, g, AGEDGE); |
| 387 |
agcopydict(parent_dd.dict_g, dd.dict_g, g, AGRAPH); |
| 388 |
} |
| 389 |
} |
| 390 |
return dd; |
| 391 |
} finally { |
| 392 |
LEAVING("alb1d5x6huba3q44ms1wt0rr5","agmakedatadict"); |
| 393 |
} |
| 394 |
} |
| 395 |
|
| 396 |
|
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
public static ST_Agsym_s agdictsym(ST_dt_s dict, CString name) { |
| 402 |
ENTERING("50wfzq5wy8wc7vuyvs3mrx5ct","agdictsym"); |
| 403 |
try { |
| 404 |
ST_Agsym_s key = (ST_Agsym_s) Memory.malloc(ST_Agsym_s.class); |
| 405 |
key.setPtr("name", name); |
| 406 |
return (ST_Agsym_s) dict.searchf.exe((dict),key,0000004); |
| 407 |
} finally { |
| 408 |
LEAVING("50wfzq5wy8wc7vuyvs3mrx5ct","agdictsym"); |
| 409 |
} |
| 410 |
} |
| 411 |
|
| 412 |
|
| 413 |
|
| 414 |
|
| 415 |
|
| 416 |
|
| 417 |
public static ST_Agsym_s aglocaldictsym(ST_dt_s dict, CString name) { |
| 418 |
ENTERING("4wy4ggu70d7harhix8xnh5w4l","aglocaldictsym"); |
| 419 |
try { |
| 420 |
ST_Agsym_s rv; |
| 421 |
ST_dt_s view; |
| 422 |
view = dtview(dict, null); |
| 423 |
rv = agdictsym(dict, name); |
| 424 |
dtview(dict, view); |
| 425 |
return rv; |
| 426 |
} finally { |
| 427 |
LEAVING("4wy4ggu70d7harhix8xnh5w4l","aglocaldictsym"); |
| 428 |
} |
| 429 |
} |
| 430 |
|
| 431 |
|
| 432 |
|
| 433 |
|
| 434 |
|
| 435 |
|
| 436 |
public static ST_Agsym_s agattrsym(__ptr__ obj, CString name) { |
| 437 |
ENTERING("8hy9sl3zmwobwm960jz466ufe","agattrsym"); |
| 438 |
try { |
| 439 |
ST_Agattr_s data; |
| 440 |
ST_Agsym_s rv; |
| 441 |
CString arg = name; |
| 442 |
data = agattrrec(obj.castTo(ST_Agobj_s.class)); |
| 443 |
if (data!=null) |
| 444 |
rv = agdictsym((ST_dt_s)data.dict, arg); |
| 445 |
else |
| 446 |
rv = null; |
| 447 |
return rv; |
| 448 |
} finally { |
| 449 |
LEAVING("8hy9sl3zmwobwm960jz466ufe","agattrsym"); |
| 450 |
} |
| 451 |
} |
| 452 |
|
| 453 |
|
| 454 |
|
| 455 |
|
| 456 |
public final static CString AgDataRecName = new CString("_AG_strdata"); |
| 457 |
|
| 458 |
|
| 459 |
|
| 460 |
|
| 461 |
|
| 462 |
public static int topdictsize(ST_Agobj_s obj) { |
| 463 |
ENTERING("6az8xu0sgu1d6abu0xfpd89hi","topdictsize"); |
| 464 |
try { |
| 465 |
ST_dt_s d; |
| 466 |
d = agdictof(agroot(agraphof(obj)), AGTYPE(obj)); |
| 467 |
return d!=null ? dtsize_(d) : 0; |
| 468 |
} finally { |
| 469 |
LEAVING("6az8xu0sgu1d6abu0xfpd89hi","topdictsize"); |
| 470 |
} |
| 471 |
} |
| 472 |
|
| 473 |
|
| 474 |
|
| 475 |
|
| 476 |
|
| 477 |
|
| 478 |
public static ST_Agrec_s agmakeattrs(ST_Agraph_s context, __ptr__ obj) { |
| 479 |
ENTERING("3wjrlyjdlz8k9nfxenxsfiqmj","agmakeattrs"); |
| 480 |
try { |
| 481 |
int sz; |
| 482 |
ST_Agattr_s rec; |
| 483 |
ST_Agsym_s sym; |
| 484 |
ST_dt_s datadict; |
| 485 |
rec = (ST_Agattr_s) agbindrec(obj, AgDataRecName, sizeof(ST_Agattr_s.class), false).castTo(ST_Agattr_s.class); |
| 486 |
datadict = agdictof(context, AGTYPE(obj)); |
| 487 |
|
| 488 |
|
| 489 |
if (rec.dict == null) { |
| 490 |
rec.dict = agdictof(agroot(context), AGTYPE(obj)); |
| 491 |
|
| 492 |
sz = topdictsize((ST_Agobj_s) obj.castTo(ST_Agobj_s.class)); |
| 493 |
if (sz < 4) |
| 494 |
sz = 4; |
| 495 |
rec.str = new ArrayList<CString>(); for (int i=0; i<sz; i++) rec.str.add(null); |
| 496 |
|
| 497 |
for (sym = (ST_Agsym_s) ((__ptr__)datadict.searchf.exe(datadict,null,0000200)); sym!=null; |
| 498 |
sym = (ST_Agsym_s) ((__ptr__)datadict.searchf.exe(datadict,sym,0000010))) |
| 499 |
rec.str.set(sym.id, agstrdup(agraphof(obj), sym.defval)); |
| 500 |
} else { |
| 501 |
} |
| 502 |
return (ST_Agrec_s) rec.castTo(ST_Agrec_s.class); |
| 503 |
} finally { |
| 504 |
LEAVING("3wjrlyjdlz8k9nfxenxsfiqmj","agmakeattrs"); |
| 505 |
} |
| 506 |
} |
| 507 |
|
| 508 |
|
| 509 |
|
| 510 |
|
| 511 |
|
| 512 |
|
| 513 |
public static Object freeattr(Object... arg) { |
| 514 |
UNSUPPORTED("b7w7ts75503jg2pb69wdgviy6"); |
| 515 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 516 |
UNSUPPORTED("22kc1nt4b0bllq26fmw8ytgp2"); |
| 517 |
UNSUPPORTED("1dbyk58q3r4fyfxxo7ovemkpu"); |
| 518 |
UNSUPPORTED("8pfuk9ua4x9bh68zk1kzwc5t9"); |
| 519 |
UNSUPPORTED("65sc7rva5ncw0awo92jglve6w"); |
| 520 |
UNSUPPORTED("cl9683xent4h3vyf21r0ct6a1"); |
| 521 |
UNSUPPORTED("4so817anjuwmq6rj2hjrk4wlx"); |
| 522 |
UNSUPPORTED("5t1oinkxblld9xyoaz469i6dz"); |
| 523 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 524 |
|
| 525 |
throw new UnsupportedOperationException(); |
| 526 |
} |
| 527 |
|
| 528 |
|
| 529 |
|
| 530 |
|
| 531 |
|
| 532 |
|
| 533 |
public static void freesym(ST_dt_s d, Object obj, ST_dtdisc_s disc) { |
| 534 |
ENTERING("6b3c2syvj23lbf7kz0aal8vmc","freesym"); |
| 535 |
try { |
| 536 |
UNSUPPORTED("bf9av4xbx61835st3og3wfqr8"); |
| 537 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 538 |
UNSUPPORTED("av59ae8c4mws46sf5dumz1k0s"); |
| 539 |
UNSUPPORTED("6z29omss9ay00bqf6xael7t6t"); |
| 540 |
UNSUPPORTED("3wnut6i7v07q7n0fa538dyp7a"); |
| 541 |
UNSUPPORTED("8l8wg6vltx6d7vc9dzqb6n3wi"); |
| 542 |
UNSUPPORTED("aka2fcwk9snppcvd59dzewx38"); |
| 543 |
UNSUPPORTED("89enhovojps3wt6zo6s4xqlu7"); |
| 544 |
UNSUPPORTED("2ttw1xr5hp7fxq8w5bofu7cg9"); |
| 545 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 546 |
|
| 547 |
throw new UnsupportedOperationException(); |
| 548 |
} finally { |
| 549 |
LEAVING("6b3c2syvj23lbf7kz0aal8vmc","freesym"); |
| 550 |
} |
| 551 |
} |
| 552 |
|
| 553 |
|
| 554 |
|
| 555 |
|
| 556 |
|
| 557 |
|
| 558 |
public static ST_Agattr_s agattrrec(__ptr__ obj) { |
| 559 |
ENTERING("13sfx74lme08ur04vkrqta25j","agattrrec"); |
| 560 |
try { |
| 561 |
return (ST_Agattr_s) aggetrec(obj, AgDataRecName, false).castTo(ST_Agattr_s.class); |
| 562 |
} finally { |
| 563 |
LEAVING("13sfx74lme08ur04vkrqta25j","agattrrec"); |
| 564 |
} |
| 565 |
} |
| 566 |
|
| 567 |
|
| 568 |
|
| 569 |
|
| 570 |
|
| 571 |
|
| 572 |
public static void addattr(ST_Agraph_s g, ST_Agobj_s obj, ST_Agsym_s sym) { |
| 573 |
ENTERING("2io7b26wq70e7kwdlzsh6bw7f","addattr"); |
| 574 |
try { |
| 575 |
ST_Agattr_s attr; |
| 576 |
attr = (ST_Agattr_s) agattrrec(obj); |
| 577 |
|
| 578 |
if (sym.id >= 4) |
| 579 |
|
| 580 |
|
| 581 |
|
| 582 |
|
| 583 |
attr.str.add(null); |
| 584 |
attr.str.set(sym.id, agstrdup(g, sym.defval)); |
| 585 |
|
| 586 |
} finally { |
| 587 |
LEAVING("2io7b26wq70e7kwdlzsh6bw7f","addattr"); |
| 588 |
} |
| 589 |
} |
| 590 |
|
| 591 |
|
| 592 |
|
| 593 |
|
| 594 |
|
| 595 |
|
| 596 |
public static ST_Agsym_s setattr(ST_Agraph_s g, int kind, CString name, CString value) { |
| 597 |
ENTERING("a3qr8ug1rkxp6ocieyp41ly3o","setattr"); |
| 598 |
try { |
| 599 |
ST_Agdatadict_s dd; |
| 600 |
ST_dt_s ldict, rdict; |
| 601 |
ST_Agsym_s lsym, psym, rsym, rv; |
| 602 |
ST_Agraph_s root; |
| 603 |
ST_Agnode_s n; |
| 604 |
ST_Agedge_s e; |
| 605 |
|
| 606 |
root = agroot(g); |
| 607 |
dd = agdatadict(g, (N(0))); |
| 608 |
ldict = agdictof(g, kind); |
| 609 |
lsym = aglocaldictsym(ldict, name); |
| 610 |
if (lsym!=null) { |
| 611 |
agstrfree(g, lsym.defval); |
| 612 |
lsym.setPtr("defval", agstrdup(g, value)); |
| 613 |
rv = lsym; |
| 614 |
} else { |
| 615 |
psym = agdictsym(ldict, name); |
| 616 |
if (psym!=null) { |
| 617 |
lsym = agnewsym(g, name, value, psym.id, kind); |
| 618 |
ldict.searchf.exe(ldict,lsym,0000001); |
| 619 |
rv = lsym; |
| 620 |
} else { |
| 621 |
rdict = agdictof(root, kind); |
| 622 |
rsym = agnewsym(g, name, value, dtsize_(rdict), kind); |
| 623 |
rdict.searchf.exe(rdict,rsym,0000001); |
| 624 |
switch (kind) { |
| 625 |
case AGRAPH: |
| 626 |
agapply(root, (ST_Agobj_s) root.castTo(ST_Agobj_s.class), function(attr__c.class, "addattr"), |
| 627 |
rsym, (N(0))); |
| 628 |
break; |
| 629 |
case AGNODE: |
| 630 |
for (n = agfstnode(root); n!=null; n = agnxtnode(root, n)) |
| 631 |
addattr(g, (ST_Agobj_s) n.castTo(ST_Agobj_s.class), rsym); |
| 632 |
break; |
| 633 |
case AGINEDGE: |
| 634 |
case AGOUTEDGE: |
| 635 |
for (n = agfstnode(root); n!=null; n = agnxtnode(root, n)) |
| 636 |
for (e = agfstout(root, n); e!=null; e = agnxtout(root, e)) |
| 637 |
addattr(g, (ST_Agobj_s) e.castTo(ST_Agobj_s.class), rsym); |
| 638 |
break; |
| 639 |
} |
| 640 |
rv = rsym; |
| 641 |
} |
| 642 |
} |
| 643 |
if (rv!=null && (kind == 0)) |
| 644 |
agxset(g, rv, value); |
| 645 |
agmethod_upd(g, g, rv); |
| 646 |
return rv; |
| 647 |
} finally { |
| 648 |
LEAVING("a3qr8ug1rkxp6ocieyp41ly3o","setattr"); |
| 649 |
} |
| 650 |
} |
| 651 |
|
| 652 |
|
| 653 |
|
| 654 |
|
| 655 |
|
| 656 |
|
| 657 |
public static ST_Agsym_s getattr(ST_Agraph_s g, int kind, CString name) { |
| 658 |
ENTERING("8f80aahwb8cqc2t9592v47ttd","getattr"); |
| 659 |
try { |
| 660 |
ST_Agsym_s rv = null; |
| 661 |
ST_dt_s dict; |
| 662 |
dict = agdictof(g, kind); |
| 663 |
if (dict!=null) |
| 664 |
rv = agdictsym(dict, name); |
| 665 |
return rv; |
| 666 |
} finally { |
| 667 |
LEAVING("8f80aahwb8cqc2t9592v47ttd","getattr"); |
| 668 |
} |
| 669 |
} |
| 670 |
|
| 671 |
|
| 672 |
|
| 673 |
|
| 674 |
|
| 675 |
|
| 676 |
public static ST_Agsym_s agattr(ST_Agraph_s g, int kind, CString name, CString value) { |
| 677 |
ENTERING("blr3drm2hxuzwd6gpeeb84yyg","agattr"); |
| 678 |
try { |
| 679 |
ST_Agsym_s rv; |
| 680 |
if (g == null) { |
| 681 |
if (Z.z().ProtoGraph == null) |
| 682 |
Z.z().ProtoGraph = agopen(null, (ST_Agdesc_s) Z.z().ProtoDesc.copy(), null); |
| 683 |
g = Z.z().ProtoGraph; |
| 684 |
} |
| 685 |
if (value!=null) |
| 686 |
rv = setattr(g, kind, name, value); |
| 687 |
else |
| 688 |
rv = getattr(g, kind, name); |
| 689 |
return rv; |
| 690 |
} finally { |
| 691 |
LEAVING("blr3drm2hxuzwd6gpeeb84yyg","agattr"); |
| 692 |
} |
| 693 |
} |
| 694 |
|
| 695 |
|
| 696 |
|
| 697 |
|
| 698 |
|
| 699 |
|
| 700 |
public static Object agnxtattr(Object... arg) { |
| 701 |
UNSUPPORTED("1nquny99ik5rdqpdzl1efzzw5"); |
| 702 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 703 |
UNSUPPORTED("l4y6zpshfefue2m18wlswfkp"); |
| 704 |
UNSUPPORTED("ekzntpxwtsedcg8uzmlsfbb5h"); |
| 705 |
UNSUPPORTED("786h6jfmnfzp39fkdwa7fzz71"); |
| 706 |
UNSUPPORTED("4ftgdafqwlor792t6qye23xle"); |
| 707 |
UNSUPPORTED("ealluogofs9ig6hmoveplut40"); |
| 708 |
UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); |
| 709 |
UNSUPPORTED("8yv728l38cvhrasbkgvce3bsb"); |
| 710 |
UNSUPPORTED("2lkbqgh2h6urnppaik3zo7ywi"); |
| 711 |
UNSUPPORTED("40zoypg37zonwb7nuewxdti29"); |
| 712 |
UNSUPPORTED("v7vqc9l7ge2bfdwnw11z7rzi"); |
| 713 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 714 |
|
| 715 |
throw new UnsupportedOperationException(); |
| 716 |
} |
| 717 |
|
| 718 |
|
| 719 |
|
| 720 |
|
| 721 |
|
| 722 |
|
| 723 |
public static void agraphattr_init(ST_Agraph_s g) { |
| 724 |
ENTERING("ex2qtmuwz0o2e5svkujdbux78","agraphattr_init"); |
| 725 |
try { |
| 726 |
|
| 727 |
|
| 728 |
ST_Agraph_s context; |
| 729 |
((ST_Agdesc_s)g.desc).has_attrs = 1; |
| 730 |
agmakedatadict(g); |
| 731 |
if (N(context = agparent(g))) |
| 732 |
context = g; |
| 733 |
agmakeattrs(context, g); |
| 734 |
} finally { |
| 735 |
LEAVING("ex2qtmuwz0o2e5svkujdbux78","agraphattr_init"); |
| 736 |
} |
| 737 |
} |
| 738 |
|
| 739 |
|
| 740 |
|
| 741 |
|
| 742 |
|
| 743 |
|
| 744 |
public static Object agraphattr_delete(Object... arg) { |
| 745 |
UNSUPPORTED("4chc6o30l6nehselkvpo4xtao"); |
| 746 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 747 |
UNSUPPORTED("eq0gq1d7pmvj94j5nxbexze8p"); |
| 748 |
UNSUPPORTED("4e7iq4f4pk0x2v3zvdc2tdbd1"); |
| 749 |
UNSUPPORTED("6qvjz1ziwr3nwocahqvfzw14t"); |
| 750 |
UNSUPPORTED("4t3qv06n62hquaihi33zqc8bi"); |
| 751 |
UNSUPPORTED("31flnlx452d07y9bjvvk0nygk"); |
| 752 |
UNSUPPORTED("ag6tzein6gkpxcarnafbxws91"); |
| 753 |
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); |
| 754 |
UNSUPPORTED("4p9dsuje96h48qnpgn0m02aij"); |
| 755 |
UNSUPPORTED("6ubrug572yhktadcj02muyr5e"); |
| 756 |
UNSUPPORTED("3msb0eqyxef8ye31vjnzxbkh6"); |
| 757 |
UNSUPPORTED("597gu9wfswglr8tbdrbqpr27p"); |
| 758 |
UNSUPPORTED("dhn07bfi40opq2qmakfkosz77"); |
| 759 |
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); |
| 760 |
UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); |
| 761 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 762 |
|
| 763 |
throw new UnsupportedOperationException(); |
| 764 |
} |
| 765 |
|
| 766 |
|
| 767 |
|
| 768 |
|
| 769 |
|
| 770 |
|
| 771 |
public static void agnodeattr_init(ST_Agraph_s g, ST_Agnode_s n) { |
| 772 |
ENTERING("2pp4ot3pqy71jpfvu3g398y4y","agnodeattr_init"); |
| 773 |
try { |
| 774 |
ST_Agattr_s data; |
| 775 |
data = (ST_Agattr_s) agattrrec(n); |
| 776 |
if ((N(data)) || (N(data.dict))) |
| 777 |
agmakeattrs(g, n); |
| 778 |
} finally { |
| 779 |
LEAVING("2pp4ot3pqy71jpfvu3g398y4y","agnodeattr_init"); |
| 780 |
} |
| 781 |
} |
| 782 |
|
| 783 |
|
| 784 |
|
| 785 |
|
| 786 |
|
| 787 |
|
| 788 |
public static Object agnodeattr_delete(Object... arg) { |
| 789 |
UNSUPPORTED("72jlvkhc0kqxzf6infgwjj96n"); |
| 790 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 791 |
UNSUPPORTED("cxk0x5bmjhvgv8b1uv960lx4"); |
| 792 |
UNSUPPORTED("96w8m9uhl8904g83fqzl5a0fl"); |
| 793 |
UNSUPPORTED("34er8hi05mpmz6cld4lt2pzyd"); |
| 794 |
UNSUPPORTED("3vr5ktefaene3xr7wprole0q4"); |
| 795 |
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); |
| 796 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 797 |
|
| 798 |
throw new UnsupportedOperationException(); |
| 799 |
} |
| 800 |
|
| 801 |
|
| 802 |
|
| 803 |
|
| 804 |
|
| 805 |
|
| 806 |
public static void agedgeattr_init(ST_Agraph_s g, ST_Agedge_s e) { |
| 807 |
ENTERING("ckfzmnxfi0jiiayxmq38giw0r","agedgeattr_init"); |
| 808 |
try { |
| 809 |
ST_Agattr_s data; |
| 810 |
data = agattrrec(e); |
| 811 |
if ((N(data)) || (N(data.dict))) |
| 812 |
agmakeattrs(g, e); |
| 813 |
} finally { |
| 814 |
LEAVING("ckfzmnxfi0jiiayxmq38giw0r","agedgeattr_init"); |
| 815 |
} |
| 816 |
} |
| 817 |
|
| 818 |
|
| 819 |
|
| 820 |
|
| 821 |
|
| 822 |
|
| 823 |
public static Object agedgeattr_delete(Object... arg) { |
| 824 |
UNSUPPORTED("97nvxy8b8p4rmo31kk1qkusns"); |
| 825 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 826 |
UNSUPPORTED("cxk0x5bmjhvgv8b1uv960lx4"); |
| 827 |
UNSUPPORTED("5n6u4cfiymhx4a88tj9vpz5z8"); |
| 828 |
UNSUPPORTED("1ct1lua1igkf5stpj1vcd2z0h"); |
| 829 |
UNSUPPORTED("67nly1q6jgpe4ozoidte7zl4v"); |
| 830 |
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); |
| 831 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 832 |
|
| 833 |
throw new UnsupportedOperationException(); |
| 834 |
} |
| 835 |
|
| 836 |
|
| 837 |
|
| 838 |
|
| 839 |
|
| 840 |
|
| 841 |
public static CString agget(__ptr__ obj, CString name) { |
| 842 |
ENTERING("eydjyhexv5jr6vi7uhk0cgphv","agget"); |
| 843 |
try { |
| 844 |
ST_Agsym_s sym; |
| 845 |
ST_Agattr_s data; |
| 846 |
CString rv = null; |
| 847 |
sym = agattrsym(obj, name); |
| 848 |
if (sym == null) |
| 849 |
rv = null; |
| 850 |
else { |
| 851 |
data = agattrrec(obj.castTo(ST_Agobj_s.class)); |
| 852 |
rv = data.str.get(sym.id); |
| 853 |
} |
| 854 |
return rv; |
| 855 |
} finally { |
| 856 |
LEAVING("eydjyhexv5jr6vi7uhk0cgphv","agget"); |
| 857 |
} |
| 858 |
} |
| 859 |
|
| 860 |
|
| 861 |
|
| 862 |
|
| 863 |
|
| 864 |
|
| 865 |
public static CString agxget(__ptr__ obj, ST_Agsym_s sym) { |
| 866 |
ENTERING("9h5oymhfkp6k34zl0fonn10k9","agxget"); |
| 867 |
try { |
| 868 |
ST_Agattr_s data; |
| 869 |
CString rv; |
| 870 |
data = agattrrec(obj.castTo(ST_Agobj_s.class)); |
| 871 |
|
| 872 |
rv = data.str.get(sym.id); |
| 873 |
return rv; |
| 874 |
} finally { |
| 875 |
LEAVING("9h5oymhfkp6k34zl0fonn10k9","agxget"); |
| 876 |
} |
| 877 |
} |
| 878 |
|
| 879 |
|
| 880 |
|
| 881 |
|
| 882 |
|
| 883 |
|
| 884 |
public static Object agset(Object... arg) { |
| 885 |
UNSUPPORTED("dw46ysqbvbb1syq3h2su8khpt"); |
| 886 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 887 |
UNSUPPORTED("av59ae8c4mws46sf5dumz1k0s"); |
| 888 |
UNSUPPORTED("ecz4e03zumggc8tfymqvirexq"); |
| 889 |
UNSUPPORTED("a5zpawq5lfz2h4k7xzaf5qtcl"); |
| 890 |
UNSUPPORTED("4htetkykqre1tnc0i1ksxdqmx"); |
| 891 |
UNSUPPORTED("71xur63dbv1df4fp5xw1bru2i"); |
| 892 |
UNSUPPORTED("div10atae09n36x269sl208r1"); |
| 893 |
UNSUPPORTED("932tqrc73k3hieetx14jtfgk0"); |
| 894 |
UNSUPPORTED("v7vqc9l7ge2bfdwnw11z7rzi"); |
| 895 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 896 |
|
| 897 |
throw new UnsupportedOperationException(); |
| 898 |
} |
| 899 |
|
| 900 |
|
| 901 |
|
| 902 |
|
| 903 |
|
| 904 |
|
| 905 |
public static int agxset(__ptr__ obj, ST_Agsym_s sym, CString value) { |
| 906 |
ENTERING("4q8xvstvl6fbijhucfd1endxc","agxset"); |
| 907 |
try { |
| 908 |
ST_Agraph_s g; |
| 909 |
ST_Agobj_s hdr; |
| 910 |
ST_Agattr_s data; |
| 911 |
ST_Agsym_s lsym; |
| 912 |
g = agraphof(obj); |
| 913 |
hdr = (ST_Agobj_s) obj.castTo(ST_Agobj_s.class); |
| 914 |
data = agattrrec(hdr); |
| 915 |
|
| 916 |
agstrfree(g, data.str.get(sym.id)); |
| 917 |
data.str.set(sym.id, agstrdup(g, value)); |
| 918 |
if (((ST_Agtag_s)hdr.tag).objtype == AGRAPH) { |
| 919 |
|
| 920 |
ST_dt_s dict; |
| 921 |
dict = (ST_dt_s) agdatadict(g, false).dict_g; |
| 922 |
if ((lsym = aglocaldictsym(dict, sym.name))!=null) { |
| 923 |
agstrfree(g, lsym.defval); |
| 924 |
lsym.setPtr("defval", agstrdup(g, value)); |
| 925 |
} else { |
| 926 |
lsym = agnewsym(g, sym.name, value, sym.id, AGTYPE(hdr)); |
| 927 |
dict.searchf.exe(dict, lsym, 0000001); |
| 928 |
} |
| 929 |
} |
| 930 |
agmethod_upd(g, obj, sym); |
| 931 |
return 0; |
| 932 |
} finally { |
| 933 |
LEAVING("4q8xvstvl6fbijhucfd1endxc","agxset"); |
| 934 |
} |
| 935 |
} |
| 936 |
|
| 937 |
|
| 938 |
|
| 939 |
|
| 940 |
|
| 941 |
|
| 942 |
public static int agsafeset(__ptr__ obj, CString name, CString value, CString def) { |
| 943 |
ENTERING("9b7vn95cin8o7mb2f21exh1qr","agsafeset"); |
| 944 |
try { |
| 945 |
ST_Agsym_s a; |
| 946 |
a = agattr(agraphof(obj), AGTYPE(obj), name, null); |
| 947 |
if (N(a)) |
| 948 |
a = agattr(agraphof(obj), AGTYPE(obj), name, def); |
| 949 |
return agxset(obj, a, value); |
| 950 |
} finally { |
| 951 |
LEAVING("9b7vn95cin8o7mb2f21exh1qr","agsafeset"); |
| 952 |
} |
| 953 |
} |
| 954 |
|
| 955 |
|
| 956 |
|
| 957 |
|
| 958 |
|
| 959 |
|
| 960 |
public static Object init_all_attrs(Object... arg) { |
| 961 |
UNSUPPORTED("bir8xur87cl8inhyrgimkboqq"); |
| 962 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 963 |
UNSUPPORTED("2hs0004nnparj6tt7elslt4zj"); |
| 964 |
UNSUPPORTED("2jcii9cclu1dijzqekzc175pe"); |
| 965 |
UNSUPPORTED("36vshotvjkc5iodgg7nq6qa2r"); |
| 966 |
UNSUPPORTED("bnybowlbrgjx7x160vaxt6eok"); |
| 967 |
UNSUPPORTED("et7b6czk7vef12o9ct0zlil6b"); |
| 968 |
UNSUPPORTED("a1lzdxitcghqk0l63zsudijhj"); |
| 969 |
UNSUPPORTED("8uyptmsbxy8cnb2yc5e1zjy93"); |
| 970 |
UNSUPPORTED("149yfxxc7rsqn6goirepjpcf2"); |
| 971 |
UNSUPPORTED("1qcg6rx46tkna823mgf1786us"); |
| 972 |
UNSUPPORTED("555dsk5o3bvij5uz01q0cs74w"); |
| 973 |
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); |
| 974 |
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); |
| 975 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 976 |
|
| 977 |
throw new UnsupportedOperationException(); |
| 978 |
} |
| 979 |
|
| 980 |
|
| 981 |
|
| 982 |
|
| 983 |
|
| 984 |
|
| 985 |
public static Object agcopyattr(Object... arg) { |
| 986 |
UNSUPPORTED("9hxxxad2s159e1mpaqdq32p1j"); |
| 987 |
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); |
| 988 |
UNSUPPORTED("1dbyk58q3r4fyfxxo7ovemkpu"); |
| 989 |
UNSUPPORTED("av59ae8c4mws46sf5dumz1k0s"); |
| 990 |
UNSUPPORTED("e0it3jbt5zhk1nsy4jog99dpu"); |
| 991 |
UNSUPPORTED("6bpbm2s85uk2e5o6cm49boc4w"); |
| 992 |
UNSUPPORTED("85pgv5dfzc1lewmaoiherq9nf"); |
| 993 |
UNSUPPORTED("4lyqrf8bj8y0fbafzxuae0xqa"); |
| 994 |
UNSUPPORTED("enr7x1oa4c50ne66ts6hvz0dx"); |
| 995 |
UNSUPPORTED("6qj4ytcakj7t70xil9hxyy5c9"); |
| 996 |
UNSUPPORTED("eleqpc2p2r3hvma6tipoy7tr"); |
| 997 |
UNSUPPORTED("5btwvtgpjz0hx5y9ouikwsrc4"); |
| 998 |
UNSUPPORTED("886wv340pnju68k6aejj7o3x0"); |
| 999 |
UNSUPPORTED("cino0o0155s1h3gsr2l2uz7z"); |
| 1000 |
UNSUPPORTED("daq5urcl5ihipluxk5sf4ccdx"); |
| 1001 |
UNSUPPORTED("btmwubugs9vkexo4yb7a5nqel"); |
| 1002 |
UNSUPPORTED("aao8dsiq1evom55a3f4w4rha3"); |
| 1003 |
UNSUPPORTED("a078bakz1z0utl11856f4vk7w"); |
| 1004 |
UNSUPPORTED("cpxrqzz637g381bs344b2sj0u"); |
| 1005 |
UNSUPPORTED("d41ayxc51x2hyvj9eo15qmgun"); |
| 1006 |
UNSUPPORTED("3kp67yo7cfslm3l0o4e5cdnd8"); |
| 1007 |
UNSUPPORTED("62wb43w2xc6ex6hootjubbx22"); |
| 1008 |
UNSUPPORTED("ez0g3o1tj7ommhxsolcr2gsr"); |
| 1009 |
UNSUPPORTED("do57srwwkvwu30y5dd2pr6tkp"); |
| 1010 |
UNSUPPORTED("9nzu0ckgyrqklwagcbye9wtx9"); |
| 1011 |
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); |
| 1012 |
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); |
| 1013 |
UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); |
| 1014 |
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); |
| 1015 |
|
| 1016 |
throw new UnsupportedOperationException(); |
| 1017 |
} |
| 1018 |
|
| 1019 |
|
| 1020 |
} |