dp.h 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315
  1. /*
  2. * Copyright 2021
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. *
  17. * SPDX-License-Identifier: GPL-3.0+
  18. * License-Filename: LICENSE
  19. */
  20. /*
  21. * the dp*.c dp*.h files are about DotParsing */
  22. #ifndef DP_H
  23. #define DP_H 1
  24. #undef __BEGIN_DECLS
  25. #undef __END_DECLS
  26. #ifdef __cplusplus
  27. #define __BEGIN_DECLS extern "C" {
  28. #define __END_DECLS }
  29. #else
  30. #define __BEGIN_DECLS /* empty */
  31. #define __END_DECLS /* empty */
  32. #endif
  33. __BEGIN_DECLS
  34. /* types of subgraphs */
  35. #define DP_SG_ROOT 0 /* root graph type */
  36. #define DP_SG_CO 1 /* compound subgraph {} */
  37. #define DP_SG_NM 2 /* named subgrph */
  38. #define DP_SG_CL 3 /* cluster subgraph */
  39. #define DP_SG_NN 4 /* no name subgraph */
  40. /* spline modes */
  41. #define DP_SPLINE_NONE 1
  42. #define DP_SPLINE_LINE 2
  43. #define DP_SPLINE_POLY 3
  44. #define DP_SPLINE_CURVED 4
  45. #define DP_SPLINE_ORTHO 5
  46. #define DP_SPLINE_SPLINE 6
  47. #define DP_SPLINE_COMP 7
  48. /* ratio modes */
  49. #define DP_RATIO_FILL 1
  50. #define DP_RATIO_COM 2
  51. #define DP_RATIO_EXP 3
  52. #define DP_RATIO_AUTO 4
  53. /* graph rankdir */
  54. #define DP_RANKDIR_TB 1
  55. #define DP_RANKDIR_LR 2
  56. #define DP_RANKDIR_BT 3
  57. #define DP_RANKDIR_RL 4
  58. /* graph rank added rank=none */
  59. #define DP_RANK_SAME 1
  60. #define DP_RANK_MIN 2
  61. #define DP_RANK_SRC 3
  62. #define DP_RANK_MAX 4
  63. #define DP_RANK_SINK 5
  64. #define DP_RANK_NONE 6
  65. /* graph output order modes, 0 means undefined */
  66. #define DP_OO_BF 1 /* breadthfirst */
  67. #define DP_OO_NF 2 /* nodesfirst */
  68. #define DP_OO_EF 3 /* edgesfirst */
  69. /* edge arrow directions */
  70. #define DP_DIR_NONE 1
  71. #define DP_DIR_BOTH 2
  72. #define DP_DIR_BACK 3
  73. #define DP_DIR_FORWARD 4
  74. /* edge arrow basic types */
  75. #define DP_EA_BOX 1 /* "box" */
  76. #define DP_EA_CROW 2 /* "crow" */
  77. #define DP_EA_CURVE 3 /* "curve" */
  78. #define DP_EA_ICURVE 4 /* "icurve" */
  79. #define DP_EA_DIAMOND 5 /* "diamond" */
  80. #define DP_EA_DOT 6 /* "dot" */
  81. #define DP_EA_INV 7 /* "inv" */
  82. #define DP_EA_NONE 8 /* "none" */
  83. #define DP_EA_NORMAL 9 /* "normal" */
  84. #define DP_EA_TEE 10 /* "tee" */
  85. #define DP_EA_VEE 11 /* "vee" */
  86. #define DP_EA_UNKNOWN 0;
  87. /* labelloc, t,b,c, default c for node, b for graph */
  88. #define DP_LLT 1 /* top */
  89. #define DP_LLB 2 /* bottom */
  90. #define DP_LLC 3 /* center */
  91. /* states during parse */
  92. #define DP_TGRAPH 1
  93. #define DP_TNODE 2
  94. #define DP_TEDGE 3
  95. #define DP_TGRAPHDEF 4
  96. #define DP_TNODEDEF 5
  97. #define DP_TEDGEDEF 6
  98. #define DP_SGRAPH 7
  99. /* node shapes */
  100. #define DPSHAPE_ASSEMBLY 1 /* "assembly" */
  101. #define DPSHAPE_BOX 2 /* "box" */
  102. #define DPSHAPE_BOX3D 3 /* "box3d" */
  103. #define DPSHAPE_CDS 4 /* "cds" */
  104. #define DPSHAPE_CIRCLE 5 /* "circle" */
  105. #define DPSHAPE_COMPONENT 6 /* "component" */
  106. #define DPSHAPE_CYLINDER 7 /* "cylinder" */
  107. #define DPSHAPE_DIAMOND 8 /* "diamond" */
  108. #define DPSHAPE_DOUBLECIRCLE 9 /* "doublecircle" */
  109. #define DPSHAPE_DOUBLEOCTAGON 10 /* "doubleoctagon" */
  110. #define DPSHAPE_EGG 11 /* "egg" */
  111. #define DPSHAPE_ELLIPSE 12 /* "ellipse" */
  112. #define DPSHAPE_FIVEPOVERHANG 13 /* "fivepoverhang" */
  113. #define DPSHAPE_FOLDER 14 /* "folder" */
  114. #define DPSHAPE_HEXAGON 15 /* "hexagon" */
  115. #define DPSHAPE_HOUSE 16 /* "house" */
  116. #define DPSHAPE_INSULATOR 17 /* "insulator" */
  117. #define DPSHAPE_INVHOUSE 18 /* "invhouse" */
  118. #define DPSHAPE_INVTRAPEZIUM 19 /* "invtrapezium" */
  119. #define DPSHAPE_INVTRIANGLE 20 /* "invtriangle" */
  120. #define DPSHAPE_LARROW 21 /* "larrow" */
  121. #define DPSHAPE_LPROMOTOR 22 /* "lpromoter" */
  122. #define DPSHAPE_MCIRCLE 23 /* "Mcircle" */
  123. #define DPSHAPE_MDIAMOND 24 /* "Mdiamond" */
  124. #define DPSHAPE_MSQUARE 25 /* "Msquare" */
  125. #define DPSHAPE_NONE 26 /* "none" */
  126. #define DPSHAPE_NOTE 27 /* "note" */
  127. #define DPSHAPE_NOVERHANG 28 /* "noverhang" */
  128. #define DPSHAPE_OCTAGON 29 /* "octagon" */
  129. #define DPSHAPE_OVAL 30 /* "oval" */
  130. #define DPSHAPE_PARALLELOGRAM 31 /* "parallelogram" */
  131. #define DPSHAPE_PENTAGON 32 /* "pentagon" */
  132. #define DPSHAPE_PLAIN 33 /* "plain" */
  133. #define DPSHAPE_PLAINTEXT 34 /* "plaintext" */
  134. #define DPSHAPE_POINT 35 /* "point" */
  135. #define DPSHAPE_POLYGON 36 /* "polygon" */
  136. #define DPSHAPE_PRIMERSITE 37 /* "primersite" */
  137. #define DPSHAPE_PROMOTER 38 /* "promoter" */
  138. #define DPSHAPE_PROTEASESITE 39 /* "proteasesite" */
  139. #define DPSHAPE_PROTEINSTAB 40 /* "proteinstab" */
  140. #define DPSHAPE_RARROW 41 /* "rarrow" */
  141. #define DPSHAPE_RECT 42 /* "rect" */
  142. #define DPSHAPE_RECTANGLE 43 /* "rectangle" */
  143. #define DPSHAPE_RESTRICTIONSITE 44 /* "restrictionsite" */
  144. #define DPSHAPE_RIBOSITE 45 /* "ribosite" */
  145. #define DPSHAPE_RNASTAB 46 /* "rnastab" */
  146. #define DPSHAPE_RPROMOTER 47 /* "rpromoter" */
  147. #define DPSHAPE_SEPTAGON 48 /* "septagon" */
  148. #define DPSHAPE_SIGNATURE 49 /* "signature" */
  149. #define DPSHAPE_SQUARE 50 /* "square" */
  150. #define DPSHAPE_STAR 51 /* "star" */
  151. #define DPSHAPE_TAB 52 /* "tab" */
  152. #define DPSHAPE_TERMINATOR 53 /* "terminator" */
  153. #define DPSHAPE_THREEPOVERHANG 54 /* "threepoverhang" */
  154. #define DPSHAPE_TRAPEZIUM 55 /* "trapezium" */
  155. #define DPSHAPE_TRIANGLE 56 /* "triangle" */
  156. #define DPSHAPE_TRIPLEOCTAGON 57 /* "tripleoctagon" */
  157. #define DPSHAPE_UNDERLINE 58 /* "underline" */
  158. #define DPSHAPE_UTR 59 /* "utr" */
  159. #define DPSHAPE_RECORD 60 /* "record" special shape */
  160. #define DPSHAPE_MRECORD 61 /* "record" special shape */
  161. /* values for align html setting */
  162. #define DP_ALIGNC 1 /* center */
  163. #define DP_ALIGNL 2 /* left */
  164. #define DP_ALIGNR 3 /* right */
  165. #define DP_ALIGNT 4 /* text */
  166. /* values for valign html setting */
  167. #define DP_VALIGNM 1 /* middle */
  168. #define DP_VALIGNB 2 /* bottom */
  169. #define DP_VALIGNT 3 /* top */
  170. /* values for html img scale */
  171. #define DP_IMGF 1 /* "false" */
  172. #define DP_IMGT 2 /* "true" */
  173. #define DP_IMGW 3 /* "width" */
  174. #define DP_IMGH 4 /* "height" */
  175. #define DP_IMGB 5 /* "both" */
  176. /* numbers for <tags> in html strings */
  177. #define T_TD 1 /* <td> */
  178. #define T_TABLE 2 /* <table> */
  179. #define T_FONT 3 /* <font> */
  180. #define T_IMG 4 /* <img> */
  181. #define T_BR 5 /* <br> */
  182. /* true/false for fixedsize in html strings */
  183. #define DP_TRUE 1 /* true */
  184. #define DP_FALSE 0 /* false */
  185. struct dpgraph;
  186. struct dpnode;
  187. struct dpepoint;
  188. struct dpnlink;
  189. struct dpeplink;
  190. struct dpglink;
  191. struct dptmpe;
  192. struct dptelink;
  193. struct dpedge;
  194. struct dpelink;
  195. struct dppart;
  196. struct dpnum;
  197. struct dpbool;
  198. struct dpcolor;
  199. struct dpstyle;
  200. struct dpdir;
  201. struct dppoint;
  202. struct dprect;
  203. struct dpmargin;
  204. struct dpoo;
  205. struct dprank;
  206. struct dprankdir;
  207. struct dpranksep;
  208. struct dpratio;
  209. struct dpsplines;
  210. struct hlpart;
  211. /* */
  212. struct dpgraph {
  213. int nr; /* uniq graph number */
  214. int type; /* type of subgraph */
  215. struct dpgraph *rootedon; /* graph is rooted on */
  216. char tag; /* tag */
  217. char *etype; /* -- or -> */
  218. char *graphname; /* "" or name */
  219. int cluster; /* set if graphname start with cluster */
  220. int nnodes; /* number of nodes */
  221. int nnedges; /* number of edges */
  222. int nngraph; /* number of graphs */
  223. splay_tree gattr; /* graph[] attributes */
  224. splay_tree nattr; /* node[] attributes */
  225. splay_tree eattr; /* edge[] attributes */
  226. struct dpnode *defnode; /* node with defaults */
  227. struct dpedge *defedge; /* edge with defaults */
  228. struct dpeplink *dpeplist; /* edge points list */
  229. struct dpeplink *dpeplistend; /* edge points list */
  230. struct dpnlink *dpnodes; /* node in this graph */
  231. struct dpnlink *dpnodesend; /* node in this graph */
  232. struct dpelink *dpedges; /* edges starting in this graph */
  233. struct dpelink *dpedgesend; /* edges starting in this graph */
  234. struct dpglink *dpsubg; /* subgraphs */
  235. struct dpglink *dpsubgend; /* subgraphs */
  236. int enest; /* nesting counter */
  237. int yylineno; /* line number where graph starts */
  238. int color;
  239. int bgcolor; /* rgb background color */
  240. int fontcolor;
  241. int fcolor;
  242. int pencolor;
  243. int csnum; /* color scheme number or 0 */
  244. double penwidth; /* */
  245. char *bb; /* bb string */
  246. double bbx0; /* bb number */
  247. double bby0; /* bb number */
  248. double bbx1; /* bb number */
  249. double bby1; /* bb number */
  250. char *url; /* url */
  251. char *charset; /* charset */
  252. int clrank; /* clusterrank none,local,global */
  253. char *comment; /* device data */
  254. double dpi; /* svg dpi */
  255. char *fontname; /* fontname */
  256. char *fontpath; /* fontpath */
  257. double fontsize; /* fontsize 14, min 1. */
  258. char *id; /* imagemap id */
  259. char *label; /* label */
  260. char *labelj; /* label justify for cluster is l,r or other c center */
  261. int labelloc; /* label location t,b,c */
  262. char *layers; /* layers */
  263. char *layerls; /* layerlistsep chars */
  264. char *layersep; /* layersep chars */
  265. char *layersel; /* layerselect */
  266. char *layout; /* layout */
  267. double lheight; /* lheight */
  268. double lwidth; /* lwidth */
  269. char *lp; /* lp */
  270. double lpx; /* lp */
  271. double lpy; /* lp */
  272. int lpflag; /* lp */
  273. char *margin; /* margin */
  274. double marginx; /* margin */
  275. double marginy; /* margin */
  276. double mclimit; /* mclimit layout stop factor */
  277. double nodesep; /* nodesep */
  278. double nslimit; /* nslimit */
  279. double nslimit1; /* nslimit1 */
  280. char *ordering; /* ordering */
  281. char *orientation; /* landscape orientation */
  282. int oorder; /* outputorder mode */
  283. double pack; /* pack number or bool */
  284. char *packmode; /* scc packing */
  285. char *pad; /* padding around drawing */
  286. double peripheries; /* cluster peripheries */
  287. double quantum; /* round factor */
  288. int rank; /* rank type or 0 */
  289. int rankdir; /* rankdir type or 0 */
  290. double ranksep; /* ranksep number */
  291. double ratio; /* ratio */
  292. int ratiomode; /* ratio */
  293. double rotate; /* rotate in degrees int */
  294. double ssize; /* searchsize */
  295. double sboxes; /* showboxes */
  296. double sizex; /* size */
  297. double sizey; /* size */
  298. int sizeflag; /* size */
  299. double sortv; /* sortv */
  300. int splines; /* splines type */
  301. char *viewport; /* viewport numbes as string */
  302. struct {
  303. unsigned int bgcolorset:1; /* set if background color bgcolor specified */
  304. unsigned int penwidthset:1;
  305. unsigned int csnumset:1;
  306. unsigned int colorset:1;
  307. unsigned int fontcolorset:1;
  308. unsigned int fcolorset:1; /* fill color */
  309. unsigned int pencolorset:1;
  310. unsigned int bbset:1; /* set if bb specified */
  311. unsigned int center:1; /* center drawing */
  312. unsigned int centerset:1; /* set if center specified */
  313. unsigned int urlset:1; /* set if url specified */
  314. unsigned int charsset:1; /* set if charset specified */
  315. unsigned int clrankset:1; /* set if clusterrank specified none,local,global */
  316. unsigned int commset:1; /* set if comment specified */
  317. unsigned int compound:1; /* compound bool */
  318. unsigned int compset:1; /* set if compound specified */
  319. unsigned int concentrate:1; /* concentrate */
  320. unsigned int concenset:1; /* set if concentrate specified */
  321. unsigned int dpiset:1; /* set if dpi specified */
  322. unsigned int fontnameset:1; /* set if fontname specified */
  323. unsigned int fontpathset:1; /* set if fontpath specified */
  324. unsigned int fontsizeset:1; /* set if fontsize specified */
  325. unsigned int idset:1; /* set if id specified */
  326. unsigned int labelset:1; /* set if label specified */
  327. unsigned int labeljset:1; /* set if labeljustify specified */
  328. unsigned int labellset:1; /* set if labelloc specified */
  329. unsigned int landscape:1; /* landscape drawing mode bool */
  330. unsigned int landscset:1; /* set if landscape specified */
  331. unsigned int layersset:1; /* set if layers specified */
  332. unsigned int layerlsset:1; /* set if layerlistsep specified */
  333. unsigned int layersepset:1; /* set if layersep specified */
  334. unsigned int layerselset:1; /* set if layerselect specified */
  335. } bitflags0;
  336. struct {
  337. unsigned int layoutset:1; /* set if layout specified */
  338. unsigned int lhset:1; /* set if lheight specified */
  339. unsigned int lwset:1; /* set if lwidth specified */
  340. unsigned int lpset:1; /* set if lp specified */
  341. unsigned int marginset:1; /* set if margin specified */
  342. unsigned int mcset:1; /* set if mclimit specified */
  343. unsigned int newrank:1; /* newrank algo */
  344. unsigned int nrankset:1; /* set if newrank specified */
  345. unsigned int nsepset:1; /* set if nodesep specified */
  346. unsigned int nojustify:1; /* nojustify bool */
  347. unsigned int nojustset:1; /* set if nojustify specified */
  348. unsigned int nsset:1; /* set if nslimit specified */
  349. unsigned int ns1set:1; /* set if nslimit1 specified */
  350. unsigned int orderset:1; /* set if ordering specified */
  351. unsigned int oriset:1; /* set if orientation specified */
  352. unsigned int ooset:1; /* set if outputorder specified */
  353. unsigned int packset:1; /* set if pack specified */
  354. unsigned int packmset:1; /* set if packmode specified */
  355. unsigned int padset:1; /* set if pad specified */
  356. unsigned int periset:1; /* set if peripheries specified */
  357. unsigned int quanset:1; /* set if quantum specified */
  358. unsigned int rankset:1; /* set if rank specified */
  359. unsigned int rankdset:1; /* set if rankdir specified */
  360. unsigned int ranksset:1; /* set if ranksep specified */
  361. unsigned int rankseq:1; /* equally in ranksep value */
  362. unsigned int ratioset:1; /* set if ratio specified */
  363. unsigned int remincross:1; /* run mincross again 1/0 */
  364. unsigned int remset:1; /* set if remincross specified */
  365. unsigned int rotset:1; /* set if rotate specified */
  366. unsigned int ssizeset:1; /* set if searchsize specified */
  367. unsigned int sboxesset:1; /* set if showboxes specified */
  368. unsigned int sizeset:1; /* set if size specified */
  369. } bitflags1;
  370. struct {
  371. unsigned int sortvset:1; /* set if sortv specified */
  372. unsigned int splinesset:1; /* set if splines specified */
  373. unsigned int dashed:1; /* style */
  374. unsigned int dashedset:1; /* style */
  375. unsigned int dotted:1; /* style */
  376. unsigned int dottedset:1; /* style */
  377. unsigned int solid:1; /* style */
  378. unsigned int solidset:1; /* style */
  379. unsigned int bold:1; /* style */
  380. unsigned int boldset:1; /* style */
  381. unsigned int filled:1; /* style */
  382. unsigned int filledset:1; /* style */
  383. unsigned int striped:1; /* style */
  384. unsigned int stripedset:1; /* style */
  385. unsigned int rounded:1; /* style */
  386. unsigned int roundedset:1; /* style */
  387. unsigned int styleset:1; /* set if style specified */
  388. unsigned int vpset:1; /* viewport */
  389. unsigned int bit18:1;
  390. unsigned int bit19:1;
  391. unsigned int bit20:1;
  392. unsigned int bit21:1;
  393. unsigned int bit22:1;
  394. unsigned int bit23:1;
  395. unsigned int bit24:1;
  396. unsigned int bit25:1;
  397. unsigned int bit26:1;
  398. unsigned int bit27:1;
  399. unsigned int bit28:1;
  400. unsigned int bit29:1;
  401. unsigned int bit30:1;
  402. unsigned int bit31:1;
  403. } bitflags2;
  404. struct {
  405. unsigned int bit0:1;
  406. unsigned int bit1:1;
  407. unsigned int bit2:1;
  408. unsigned int bit3:1;
  409. unsigned int bit4:1;
  410. unsigned int bit5:1;
  411. unsigned int bit6:1;
  412. unsigned int bit7:1;
  413. unsigned int bit8:1;
  414. unsigned int bit9:1;
  415. unsigned int bit10:1;
  416. unsigned int bit11:1;
  417. unsigned int bit12:1;
  418. unsigned int bit13:1;
  419. unsigned int bit14:1;
  420. unsigned int bit15:1;
  421. unsigned int bit16:1;
  422. unsigned int bit17:1;
  423. unsigned int bit18:1;
  424. unsigned int bit19:1;
  425. unsigned int bit20:1;
  426. unsigned int bit21:1;
  427. unsigned int bit22:1;
  428. unsigned int bit23:1;
  429. unsigned int bit24:1;
  430. unsigned int bit25:1;
  431. unsigned int bit26:1;
  432. unsigned int bit27:1;
  433. unsigned int bit28:1;
  434. unsigned int bit29:1;
  435. unsigned int bit30:1;
  436. unsigned int bit31:1;
  437. } bitflags3;
  438. };
  439. struct dpnode {
  440. int nr; /* uniq node number */
  441. char *name; /* uniq node name */
  442. char *label; /* label text of node */
  443. char htmllabel; /* set if html label */
  444. struct hlpart *hlinfo; /* parts of html label */
  445. struct dppart *labelinfo; /* parts of record-label */
  446. int yylineno; /* line where defined in input */
  447. struct dpgraph *root; /* graph where node is defined */
  448. int csnum; /* colorscheme number or 0 */
  449. int color; /* parsed color, rgb */
  450. int fcolor; /* parsed fillcolor, background fill color rgb */
  451. int fontcolor; /* parsed fontcolor */
  452. int shape; /* node shape number DPSHAPE_ */
  453. double penwidth; /* border line thickness */
  454. double sides; /* nr. of sides for shape polygon */
  455. double width; /* specified node width */
  456. double height; /* specified node height */
  457. char *group; /* specified group */
  458. char *comment; /* device dep. comment */
  459. double distortion; /* shape polygon distortion, default 0, min -100 */
  460. char *fontname; /* name of font */
  461. double fontsize; /* size of font, 14, min 1 */
  462. char *id; /* imagemap id */
  463. char *image; /* image for node */
  464. int labelloc; /* label location */
  465. char *layer; /* layer string */
  466. char *margin; /* margin string */
  467. double marginx; /* margin */
  468. double marginy; /* margin */
  469. double orientation; /* rotate polygon nodes, 0.0..360.0 */
  470. double peripheries; /* int for polygonal shapes */
  471. char *pos; /* pos of node %f,%f as string */
  472. char *rects; /* rect %f,%f,%f,%f as string */
  473. double samplepoints; /* sample points for shape */
  474. char *shapefile; /* external node shape */
  475. double showboxes; /* postscript showboxes, (int) 0,1,2 */
  476. double skew; /* polygon skew factor */
  477. double sortv; /* (int) packing */
  478. char *vertices; /* coords polygon */
  479. char *url; /* url of node */
  480. int indegree; /* number of incoming edges */
  481. int outdegree; /* number of outgoing edges */
  482. struct {
  483. unsigned int defbynode:1; /* set if defined by node statement */
  484. unsigned int csnumset:1; /* set if colorscheme is defined */
  485. unsigned int fcolorset:1; /* set if fillcolor specified */
  486. unsigned int shapeset:1; /* set if node shape specified */
  487. unsigned int labelset:1; /* set if label specified */
  488. unsigned int radialset:1; /* set at style=radial */
  489. unsigned int colorset:1; /* set if color specified bordercolor */
  490. unsigned int fontcolorset:1; /* set if font color set */
  491. unsigned int penwidthset:1; /* set if border thickness set with penwidth */
  492. unsigned int sidesset:1; /* set if sides specified */
  493. unsigned int widthset:1; /* set if width specified */
  494. unsigned int fixsize:1; /* set if fixedsize=true */
  495. unsigned int fixsizeset:1; /* set if fixedsize is set */
  496. unsigned int heightset:1; /* set if height specified */
  497. unsigned int groupset:1; /* set if group specified */
  498. unsigned int comset:1; /* set if comment is specified */
  499. unsigned int distortionset:1; /* set if distortion shape polygon is set */
  500. unsigned int fontnameset:1; /* set if font name specified */
  501. unsigned int fontsizeset:1; /* set if size of font specified */
  502. unsigned int idset:1; /* set if imagemap id set */
  503. unsigned int imgset:1; /* set if image specified */
  504. unsigned int iscale:1; /* bool imagescale */
  505. unsigned int iscaleset:1; /* set if imagescale specified */
  506. unsigned int labellset:1; /* set if label loc specified */
  507. unsigned int layerset:1; /* set if layer specified */
  508. unsigned int marginset:1; /* set if margin specified */
  509. unsigned int nojust:1; /* nojustify bool */
  510. unsigned int nojustset:1; /* set if nojustify specified */
  511. unsigned int oriset:1; /* set if orientation specified */
  512. unsigned int periset:1; /* set if peripheries specified */
  513. unsigned int pin:1; /* true if fixed node pos */
  514. unsigned int pinset:1; /* set if pin specified */
  515. } bitflags0;
  516. struct {
  517. unsigned int posset:1; /* pos of node %f,%f as string */
  518. unsigned int rectsset:1; /* rect %f,%f,%f,%f as string set */
  519. unsigned int regular:1; /* regular polygon bool */
  520. unsigned int reguset:1; /* set if regular specified */
  521. unsigned int spset:1; /* set if samplepoints specified */
  522. unsigned int shapefset:1; /* set if shapefile specified */
  523. unsigned int showbset:1; /* set if showboxes specified */
  524. unsigned int skewset:1; /* set if skew specified */
  525. unsigned int sortvset:1; /* set if sortv specified */
  526. unsigned int vertset:1; /* set if vertices specified */
  527. unsigned int urlset:1; /* set if url specified */
  528. unsigned int dashed:1; /* style dashed */
  529. unsigned int dashedset:1; /* set if style dashed specified */
  530. unsigned int dotted:1; /* style dotted */
  531. unsigned int dottedset:1; /* set if style style dotted specified */
  532. unsigned int solid:1; /* style solid */
  533. unsigned int solidset:1; /* set if style solid specified */
  534. unsigned int invis:1; /* style invis */
  535. unsigned int invisset:1; /* set if style invis specified */
  536. unsigned int bold:1; /* style bold */
  537. unsigned int boldset:1; /* set if style bold specified */
  538. unsigned int filled:1; /* style filled */
  539. unsigned int filledset:1; /* set if style filled specified */
  540. unsigned int striped:1; /* style striped */
  541. unsigned int stripedset:1; /* set if style striped specified */
  542. unsigned int wedged:1; /* style wedged */
  543. unsigned int wedgedset:1; /* set if style wedged specified */
  544. unsigned int dia:1; /* style diagonals */
  545. unsigned int diaset:1; /* set if style diagonals specified */
  546. unsigned int rounded:1; /* style rounded */
  547. unsigned int roundedset:1; /* set if style rounded specified */
  548. unsigned int radial:1; /* style radial */
  549. } bitflags1;
  550. };
  551. /*edge */
  552. struct dpedge {
  553. int nr; /* uniq number */
  554. struct dpgraph *rootedon; /* edge is rooted on */
  555. struct dpnode *fn; /* from node */
  556. char *fport;
  557. char *fcompass;
  558. struct dpnode *tn; /* to node */
  559. char *tport;
  560. char *tcompass;
  561. int yylineno; /* input line nr of edge */
  562. char *label; /* optional edge label */
  563. char style; /* optional edge style, solid, dotted */
  564. int ecolor; /* edge line color */
  565. double penwidth; /* edge line thickness */
  566. int csnum; /* color scheme number */
  567. char *url; /* url */
  568. char *ahstring; /* raw arrowhead string */
  569. char *atstring; /* raw arrowtail string */
  570. int ahnum; /* arrowhead encoding */
  571. int atnum; /* arrowtail encoding */
  572. double asize; /* arrowsize mult factor, 1.0 */
  573. char *comment; /* output data */
  574. int dir; /* arrow dir */
  575. char *etarg; /* svg only edge target */
  576. char *ett; /* tooltip for url */
  577. int fontcolor; /* font color edge label */
  578. char *fontname; /* font name */
  579. double fontsize; /* fontsize is 14, min 1 */
  580. char *hurl; /* headurl */
  581. char *hlp; /* %f,%f point of head label as string */
  582. double hlpx; /* point x for head_lp */
  583. double hlpy; /* point y for head_lp */
  584. int hlpflag; /* '!' flag for head_lp */
  585. char *hlabel; /* head label */
  586. char *hport; /* head port compass point as string */
  587. char *htarg; /* headtarget, svg map */
  588. char *htt; /* headtooltip svg cmap */
  589. char *id; /* svg id */
  590. char *lurl; /* label url */
  591. double la; /* labelangle */
  592. double ldist; /* labeldistance */
  593. int lfontcolor; /* labelfontcolor */
  594. char *lfontname; /* labelfontname */
  595. double lfontsize; /* labelfontsize is 14, min 1 */
  596. char *ltarg; /* labeltarget */
  597. char *ltt; /* labeltooltip svg cmap */
  598. char *layer; /* layer control string */
  599. double len; /* len neato */
  600. char *lhead; /* lhead */
  601. char *ltail; /* ltail */
  602. char *lp; /* %f,%f point of label as string */
  603. double lpx; /* point x for lp */
  604. double lpy; /* point y for lp */
  605. int lpflag; /* '!' flag for lp */
  606. double minlen; /* minlen */
  607. char *pos; /* pos string */
  608. char *sameh; /* samehead */
  609. char *samet; /* sametail */
  610. char *turl; /* label url */
  611. char *tlp; /* %f,%f point of tail label as string */
  612. double tlpx; /* point x for tail_lp */
  613. double tlpy; /* point y for tail_lp */
  614. int tlpflag; /* '!' flag for tail_lp */
  615. char *tlabel; /* tail label */
  616. char *tlport; /* tail port */
  617. char *ttarg; /* tail target */
  618. char *ttt; /* tail tooltip */
  619. char *target; /* target */
  620. char *tt; /* tooltip */
  621. double weight; /* edge weight */
  622. char *xlabel; /* x-label */
  623. char *xlp; /* %f,%f point of x label as string */
  624. double xlpx; /* point x for xlp */
  625. double xlpy; /* point y for xlp */
  626. int xlpflag; /* '!' flag for xlp */
  627. struct {
  628. unsigned int labelset:1; /* set if label specified */
  629. unsigned int styleset:1; /* set if style specified */
  630. unsigned int ecolorset:1; /* set if color specified */
  631. unsigned int penwidthset:1; /* set if penwidth specified */
  632. unsigned int csnumset:1; /* set if colorscheme specified */
  633. unsigned int urlset:1; /* set if url specified */
  634. unsigned int ahset:1; /* set if arrowhead specified */
  635. unsigned int asizeset:1; /* set if arrowsize mult factor set */
  636. unsigned int atset:1; /* set if arrowtail specified */
  637. unsigned int comset:1; /* set if comment specified */
  638. unsigned int constraint:1; /* bool constraint */
  639. unsigned int constrset:1; /* set if constraint specified */
  640. unsigned int decorset:1; /* set if decorate set */
  641. unsigned int decorate:1; /* decorate bool */
  642. unsigned int dirset:1; /* set if dir specified */
  643. unsigned int etargset:1; /* set if edgetarget specified */
  644. unsigned int ettset:1; /* set if edgetooltip specified */
  645. unsigned int focolorset:1; /* set if fontcolor specified */
  646. unsigned int fontnameset:1; /* set if fontname specified */
  647. unsigned int fontsizeset:1; /* set if fontsize specified */
  648. unsigned int hurlset:1; /* set if headurl specified */
  649. unsigned int hlpset:1; /* set if head_lp specified */
  650. unsigned int headclip:1; /* head clip booleam */
  651. unsigned int hcset:1; /* set if headclip bool specified */
  652. unsigned int hlset:1; /* set if headlabel spacified */
  653. unsigned int hportset:1; /* set if headport specified */
  654. unsigned int htargset:1; /* set if headtarget specified svg map */
  655. unsigned int httset:1; /* set if headtooltip specified svg cmap */
  656. unsigned int idset:1; /* set if id specified */
  657. unsigned int lurlset:1; /* set if labelurl specified */
  658. unsigned int laset:1; /* set if labelangle specified */
  659. unsigned int ldistset:1; /* set if labeldistance specified */
  660. } bitflags0;
  661. struct {
  662. unsigned int lfloat:1; /* labelfloat */
  663. unsigned int lfloatset:1; /* set if labelfloat specified */
  664. unsigned int lfocolorset:1; /* set if labelfontcolor specified */
  665. unsigned int lfontnameset:1; /* set if labelfontname specified */
  666. unsigned int lfontsizeset:1; /* set if labelfontsize specified */
  667. unsigned int ltargset:1; /* set if labeltarget specified */
  668. unsigned int lttset:1; /* set if labeltooltip specified */
  669. unsigned int layerset:1; /* set if layer string specified */
  670. unsigned int lenset:1; /* set if len specified neato */
  671. unsigned int lheadset:1; /* set if lhead specified */
  672. unsigned int ltailset:1; /* set if ltail specified */
  673. unsigned int lpset:1; /* set if lp specified */
  674. unsigned int minlenset:1; /* set if minlen specified */
  675. unsigned int nojust:1; /* nojustify bool */
  676. unsigned int nojustset:1; /* set if nojustify specified */
  677. unsigned int posset:1; /* set if pos specified */
  678. unsigned int samehset:1; /* set if samehead specified */
  679. unsigned int sametset:1; /* set if sametail specified */
  680. unsigned int dashed:1; /* style */
  681. unsigned int dashedset:1; /* style */
  682. unsigned int dotted:1; /* style */
  683. unsigned int dottedset:1; /* style */
  684. unsigned int solid:1; /* style */
  685. unsigned int solidset:1; /* style */
  686. unsigned int invis:1; /* style */
  687. unsigned int invisset:1; /* style */
  688. unsigned int bold:1; /* style */
  689. unsigned int boldset:1; /* style */
  690. unsigned int tapered:1; /* style */
  691. unsigned int taperedset:1; /* style */
  692. unsigned int turlset:1; /* set if tailurl specified */
  693. unsigned int tlpset:1; /* set if tail_lp specified */
  694. } bitflags1;
  695. struct {
  696. unsigned int tailc:1; /* tailclip bool */
  697. unsigned int tailcset:1; /* set if tailclip specified */
  698. unsigned int tlabelset:1; /* set if taillabel specified */
  699. unsigned int tportset:1; /* set if tailport specified */
  700. unsigned int ttargset:1; /* set if tailtarget specified */
  701. unsigned int tttset:1; /* set if tailtooltip specified */
  702. unsigned int targetset:1; /* set if target specified */
  703. unsigned int ttset:1; /* set if tooltip specified */
  704. unsigned int weightset:1; /* set if weight specified */
  705. unsigned int xlabelset:1; /* set if xlabel specified */
  706. unsigned int xlpset:1; /* set if xlp specified */
  707. unsigned int bit11:1;
  708. unsigned int bit12:1;
  709. unsigned int bit13:1;
  710. unsigned int bit14:1;
  711. unsigned int bit15:1;
  712. unsigned int bit16:1;
  713. unsigned int bit17:1;
  714. unsigned int bit18:1;
  715. unsigned int bit19:1;
  716. unsigned int bit20:1;
  717. unsigned int bit21:1;
  718. unsigned int bit22:1;
  719. unsigned int bit23:1;
  720. unsigned int bit24:1;
  721. unsigned int bit25:1;
  722. unsigned int bit26:1;
  723. unsigned int bit27:1;
  724. unsigned int bit28:1;
  725. unsigned int bit29:1;
  726. unsigned int bit30:1;
  727. unsigned int bit31:1;
  728. } bitflags2;
  729. struct {
  730. unsigned int bit0:1;
  731. unsigned int bit1:1;
  732. unsigned int bit2:1;
  733. unsigned int bit3:1;
  734. unsigned int bit4:1;
  735. unsigned int bit5:1;
  736. unsigned int bit6:1;
  737. unsigned int bit7:1;
  738. unsigned int bit8:1;
  739. unsigned int bit9:1;
  740. unsigned int bit10:1;
  741. unsigned int bit11:1;
  742. unsigned int bit12:1;
  743. unsigned int bit13:1;
  744. unsigned int bit14:1;
  745. unsigned int bit15:1;
  746. unsigned int bit16:1;
  747. unsigned int bit17:1;
  748. unsigned int bit18:1;
  749. unsigned int bit19:1;
  750. unsigned int bit20:1;
  751. unsigned int bit21:1;
  752. unsigned int bit22:1;
  753. unsigned int bit23:1;
  754. unsigned int bit24:1;
  755. unsigned int bit25:1;
  756. unsigned int bit26:1;
  757. unsigned int bit27:1;
  758. unsigned int bit28:1;
  759. unsigned int bit29:1;
  760. unsigned int bit30:1;
  761. unsigned int bit31:1;
  762. } bitflags3;
  763. };
  764. /* edge point */
  765. struct dpepoint {
  766. char *port; /* port or compass */
  767. char *compass;
  768. int type; /* node or graph */
  769. struct dpgraph *root; /* where node is rooted */
  770. struct dpnode *n;
  771. };
  772. /* node linked list */
  773. struct dpnlink {
  774. struct dpnode *n;
  775. struct dpnlink *next;
  776. };
  777. /* edge point list */
  778. struct dpeplink {
  779. struct dpepoint *ep;
  780. struct dpeplink *next;
  781. };
  782. /* subgraph list */
  783. struct dpglink {
  784. struct dpgraph *sg;
  785. struct dpglink *next;
  786. };
  787. /* tmp edge */
  788. struct dptmpe {
  789. struct dpnode *fn;
  790. char *fport;
  791. char *fcompass;
  792. struct dpnode *tn;
  793. char *tport;
  794. char *tcompass;
  795. };
  796. struct dptelink {
  797. struct dptmpe *e;
  798. struct dptelink *next;
  799. };
  800. struct dpelink {
  801. struct dpedge *e;
  802. struct dpelink *next;
  803. };
  804. /* part of record label */
  805. struct dppart {
  806. int dir; /* direction, 0=hor, 1=vertical */
  807. int ndpparts; /* how many subparts */
  808. struct dppart **parts; /* sub parts */
  809. char *id; /* port id */
  810. char *lp; /* label text */
  811. int hd; /* has-data */
  812. };
  813. /* parsed number */
  814. struct dpnum {
  815. double number;
  816. int pe; /* set at parse error */
  817. int es; /* set at "" string */
  818. };
  819. /* parsed int number */
  820. struct dpinum {
  821. int number;
  822. int pe; /* set at parse error */
  823. int es; /* set at "" string */
  824. };
  825. /* parsed boolean */
  826. struct dpbool {
  827. int number; /* 0/1 number */
  828. int pe; /* set at parse error */
  829. int es; /* set at "" string */
  830. };
  831. /* parsed color */
  832. struct dpcolor {
  833. int color; /* argb color */
  834. int pe; /* set at parse error */
  835. int es; /* set at "" string */
  836. int islist; /* set if color is a list of colors */
  837. };
  838. /* parsed style */
  839. struct dpstyle {
  840. int pe; /* parse error */
  841. int pe_slw; /* parse error setlinewidth number */
  842. int pe_unk; /* parse error unknown token */
  843. int pe_exp; /* parse error expected number at setlinewidth */
  844. int es; /* empty string */
  845. int slwset; /* set if setlinewidth N */
  846. double slw; /* setlinewidth number */
  847. int dashed; /* "dashed" parsed N+E */
  848. int dotted; /* "dotted" parsed N+E */
  849. int solid; /* "solid" parsed N+E */
  850. int invis; /* "invis" parsed N+E */
  851. int bold; /* "bold" parsed N+E */
  852. int tapered; /* "tapered" parsed E */
  853. int filled; /* "filled" parsed N+c */
  854. int striped; /* "striped" parsed N+c */
  855. int wedged; /* "wedged" parsed N */
  856. int diagonals; /* "diagonals" parsed N */
  857. int rounded; /* "rounded" parsed N+C */
  858. int radial; /* "radial" parsed N+C+G */
  859. char *unknown; /* unknown token */
  860. };
  861. /* edge arrow */
  862. struct dparrow {
  863. int pe;
  864. int es;
  865. char *name;
  866. int type; /* type is basic type or 0 */
  867. };
  868. /* edge dir */
  869. struct dpdir {
  870. int pe;
  871. int es;
  872. int type;
  873. };
  874. /* 1 point with optional '!' flag */
  875. struct dppoint {
  876. int pe;
  877. double x;
  878. double y;
  879. int flag;
  880. };
  881. /* rect */
  882. struct dprect {
  883. int pe;
  884. int es;
  885. double x0;
  886. double y0;
  887. double x1;
  888. double y1;
  889. };
  890. /* margin */
  891. struct dpmargin {
  892. int pe;
  893. int es;
  894. double x;
  895. double y;
  896. };
  897. /* output order */
  898. struct dpoo {
  899. int pe;
  900. int es;
  901. int mode;
  902. };
  903. /* rank */
  904. struct dprank {
  905. int pe;
  906. int es;
  907. int mode;
  908. };
  909. /* rankdir */
  910. struct dprankdir {
  911. int pe;
  912. int es;
  913. int mode;
  914. };
  915. /* ranksep */
  916. struct dpranksep {
  917. int pe;
  918. int es;
  919. double number;
  920. int eq;
  921. };
  922. /* ratio */
  923. struct dpratio {
  924. int pe;
  925. int es;
  926. double number;
  927. int mode;
  928. };
  929. /* splines args */
  930. struct dpsplines {
  931. int pe;
  932. int mode;
  933. };
  934. /* for <table>
  935. * int align="center|left|right"
  936. * int bgcolor="colorname"
  937. * int border="int-value"
  938. * int cellborder="int-value"
  939. * int cellpadding="int-value"
  940. * int cellspacing="int-value"
  941. * int color="colorname"
  942. * (char *) columns="string" only "*" allowed
  943. * int fixedsize="true|false"
  944. * int gradientangle="int-value"
  945. * int height="int-value"
  946. * (char *) href="string"
  947. * (char *) id="string"
  948. * (char *) port="string"
  949. * (char *) rows="string" only "*" allowed
  950. * (char *) sides="string"
  951. * (char *) style="string"
  952. * (char *) target="string"
  953. * (char *) title="string"
  954. * int valign="middle|bottom|top"
  955. * int width="int-value"
  956. */
  957. struct tabledata {
  958. struct tlist *tl; /* list of sub table items */
  959. struct tlist *tlend; /* end list of sub table items */
  960. struct tabledata *table; /* rooted on this table or 0 */
  961. struct trlist *tr; /* tr items */
  962. struct trlist *trend; /* end tr items */
  963. int align; /* ="center|left|right" */
  964. int bgcolor; /* ="colorname" background color */
  965. int border; /* ="int-value" */
  966. int cellborder; /* ="int-value" */
  967. int cellpadding; /* ="int-value" */
  968. int cellspacing; /* ="int-value" */
  969. int color; /* ="colorname" fontcolor */
  970. char *columns; /* ="string" only "*" allowed */
  971. int fixedsize; /* ="true|false" */
  972. int gradientangle; /* ="int-value" */
  973. int height; /* ="int-value" */
  974. char *href; /* ="string" */
  975. char *id; /* ="string" */
  976. char *port; /* ="string" */
  977. char *rows; /* ="string" only "*" allowed */
  978. char *sides; /* ="string" */
  979. char *style; /* ="string" */
  980. int stylerounded; /* style options */
  981. int styleradial; /* style options */
  982. int styleinvis; /* style options */
  983. int styledotted; /* style options */
  984. int styledashed; /* style options */
  985. char *target; /* ="string" */
  986. char *title; /* ="string" */
  987. int valign; /* ="middle|bottom|top" */
  988. int width; /* ="int-value" */
  989. struct gml_titem *alt; /* ptr to copy */
  990. };
  991. /* for <td>
  992. * int align="center|left|right|text"
  993. * int balign="center|left|right"
  994. * int bgcolor="colorname"
  995. * int border="int-value"
  996. * int cellpadding="int-value"
  997. * int cellspacing="int-value"
  998. * int color="colorname"
  999. * int colspan="int-value"
  1000. * int fixedsize="true|false"
  1001. * int gradientangle="int-value"
  1002. * int height="int-value"
  1003. * (char *) href="string"
  1004. * (char *) id="string"
  1005. * (char *) port="string"
  1006. * int rowspan="int-value"
  1007. * (char *) sides="string"
  1008. * (char *) style="string"
  1009. * (char *) target="string"
  1010. * (char *) title="string"
  1011. * int valign="middle|bottom|top"
  1012. * int width="int-value"
  1013. */
  1014. struct tddata {
  1015. struct tabledata *table; /* rooted on this table or 0 */
  1016. struct ilist *il; /* text items in td or 0 */
  1017. struct ilist *ilend; /* end text items */
  1018. int align; /* ="center|left|right|text" */
  1019. int balign; /* ="center|left|right" */
  1020. int bgcolor; /* ="colorname" */
  1021. int border; /* ="int-value" */
  1022. int cellpadding; /* ="int-value" */
  1023. int cellspacing; /* ="int-value" */
  1024. int color; /* ="colorname" */
  1025. int colspan; /* ="int-value" */
  1026. int fixedsize; /* ="true|false" */
  1027. int gradientangle; /* ="int-value" */
  1028. int height; /* ="int-value" */
  1029. char *href; /* ="string" */
  1030. char *id; /* ="string" */
  1031. char *port; /* ="string" */
  1032. int rowspan; /* ="int-value" */
  1033. char *sides; /* ="string" */
  1034. char *style; /* ="string" */
  1035. int stylerounded; /* style options */
  1036. int styleradial; /* style options */
  1037. int styleinvis; /* style options */
  1038. int styledotted; /* style options */
  1039. int styledashed; /* style options */
  1040. char *target; /* ="string" */
  1041. char *title; /* ="string" */
  1042. int valign; /* ="middle|bottom|top" */
  1043. int width; /* ="int-value" */
  1044. int istab; /* set if <td> is a <table> */
  1045. };
  1046. /* for <img>
  1047. * int scale="false|true|width|height|both"
  1048. * (char *) src="imagename"
  1049. */
  1050. struct imgdata {
  1051. int scale; /* ="false|true|width|height|both" */
  1052. char *src; /* ="imagename" */
  1053. };
  1054. /* for <br>
  1055. * int align="center|left|right"
  1056. */
  1057. struct brdata {
  1058. int align; /* ="center|left|right" */
  1059. };
  1060. /* for <font>
  1061. * int color="colorname"
  1062. * (char *) face="fontname"
  1063. * int point-size="int-number"
  1064. */
  1065. struct fontdata {
  1066. int color; /* ="colorname" */
  1067. char *face; /* ="fontname" */
  1068. int pointsize; /* ="int-number" */
  1069. };
  1070. struct fontldata {
  1071. struct fontdata *fd;
  1072. struct fontldata *next;
  1073. };
  1074. /* one item of text:
  1075. * bgcolor is default white 0x00ffffff
  1076. * then set by optional node fillcolor
  1077. * then set by optional <table> bgcolor
  1078. * then set by optional <td> bgcolor
  1079. */
  1080. struct item {
  1081. char *text; /* text to display */
  1082. char *atext; /* modified text to display */
  1083. char *fontname; /* optional font name */
  1084. int fontsize; /* optional pointsize */
  1085. int fontcolor; /* optional color of text */
  1086. int ncolor; /* optional background color from <td> or <table> */
  1087. struct tabledata *table; /* optional <table> if <td> is a table */
  1088. struct {
  1089. unsigned int at:1; /* set if str has a '&' */
  1090. unsigned int br:1; /* set if str is a <br/> token */
  1091. unsigned int img:1; /* set if str is a <img> */
  1092. unsigned int i:1; /* set if str is <i> italic */
  1093. unsigned int u:1; /* set if str is <u> underline */
  1094. unsigned int o:1; /* set if str is <o> overline */
  1095. unsigned int s:1; /* set if str is <s> strike-through */
  1096. unsigned int sub:1; /* set if str is <sub> subscript */
  1097. unsigned int sup:1; /* set if str is <sup> superscript */
  1098. unsigned int hr:1; /* set if str is a <hr> token */
  1099. unsigned int vr:1; /* set if str is a <vr> token */
  1100. unsigned int b:1; /* set if str is <b> bold */
  1101. unsigned int table:1; /* set if a <table> not a string */
  1102. unsigned int bit13:1;
  1103. unsigned int bit14:1;
  1104. unsigned int bit15:1;
  1105. unsigned int bit16:1;
  1106. unsigned int bit17:1;
  1107. unsigned int bit18:1;
  1108. unsigned int bit19:1;
  1109. unsigned int bit20:1;
  1110. unsigned int bit21:1;
  1111. unsigned int bit22:1;
  1112. unsigned int bit23:1;
  1113. unsigned int bit24:1;
  1114. unsigned int bit25:1;
  1115. unsigned int bit26:1;
  1116. unsigned int bit27:1;
  1117. unsigned int bit28:1;
  1118. unsigned int bit29:1;
  1119. unsigned int bit30:1;
  1120. unsigned int bit31:1;
  1121. } bitflags;
  1122. };
  1123. struct tableldata {
  1124. struct tabledata *tabdata;
  1125. struct tableldata *next;
  1126. };
  1127. /* <td> */
  1128. struct tdldata {
  1129. struct tddata *tdd;
  1130. struct tdldata *next;
  1131. };
  1132. /* tr data */
  1133. struct trdata {
  1134. struct tabledata *table; /* rooted on this table or 0 */
  1135. struct tdldata *td; /* td items in tr */
  1136. struct tdldata *tdend;
  1137. int hastab; /* set if <tr> has <td> elements with a <table> */
  1138. struct trdata *next;
  1139. };
  1140. /* list with tr items in html string */
  1141. struct trlist {
  1142. struct trdata *tritem;
  1143. struct trlist *next;
  1144. };
  1145. /* list with text items in html string */
  1146. struct ilist {
  1147. struct item *items;
  1148. struct ilist *next;
  1149. };
  1150. /* list with table elements in html string */
  1151. struct tlist {
  1152. struct tableldata *titem;
  1153. struct tlist *next;
  1154. };
  1155. /* html label info is
  1156. * item list with parts of html label
  1157. * or table list with parts of html label
  1158. * but not both at once.
  1159. */
  1160. struct hlpart {
  1161. int mode; /* 0=items, 1=tables */
  1162. struct ilist *il; /* list of text items */
  1163. struct ilist *ilend;
  1164. struct tlist *tl; /* list of table items */
  1165. struct tlist *tlend;
  1166. };
  1167. /* static buffer for parser error messages */
  1168. extern char dp_errmsg[256];
  1169. /* all nodes */
  1170. extern struct dpnlink *dp_anodes;
  1171. /* all edges */
  1172. extern struct dpelink *dp_aedges;
  1173. /* root graphs */
  1174. extern struct dpgraph *dp_groot;
  1175. /* the current graph */
  1176. extern struct dpgraph *dp_curgraph;
  1177. extern struct dpnode *dp_curnode;
  1178. extern struct dpedge *dp_curedge;
  1179. /* data type during parse */
  1180. extern int dp_cclass;
  1181. /* routines */
  1182. extern int dp_chkerr(void);
  1183. extern void dp_sg(char *etype, char *gname);
  1184. extern void dp_eg(void);
  1185. extern char *dp_ccat(char *a, char *b);
  1186. extern void dp_atype_graph(void);
  1187. extern void dp_atype_sgraph(void);
  1188. extern void dp_atype_node(void);
  1189. extern void dp_atype_edge(void);
  1190. extern void dp_atype_graphdef(void);
  1191. extern void dp_atype_nodedef(void);
  1192. extern void dp_atype_edgedef(void);
  1193. extern void dp_aset(char *l, char *r, int ishtml);
  1194. extern void dp_mknode0(char *name);
  1195. extern void dp_cke(char *edgedir);
  1196. extern struct dpepoint *dp_mknid(char *name, char *port, char *compass);
  1197. extern void dp_ende(void);
  1198. extern void dp_newe(void);
  1199. extern void dp_starte1(struct dpepoint *ep);
  1200. extern void dp_starte2(struct dpepoint *ep);
  1201. extern void dp_ine(struct dpepoint *ep);
  1202. extern void dp_namedsubg(char *sgname, int type);
  1203. extern struct dpepoint *dp_endss(void);
  1204. extern void dp_clrep(void);
  1205. extern void dp_clearall(void);
  1206. extern void dp_clrheade(void);
  1207. extern void dp_nsubg(struct dpgraph *sg, char *gname, int type);
  1208. __END_DECLS
  1209. #endif
  1210. /* end */