Subversion Repositories wimsdev

Rev

Rev 18065 | Rev 18118 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. #! /bin/sh
  2.  
  3. tablist="prep color obj"
  4. prepstruct="
  5.         char *name;
  6.         int typ;
  7. "
  8. colorstruct="
  9.         char *name;
  10.         char *def;
  11. "
  12. objstruct="
  13.         char *name;
  14.         int required_parms,color_pos,fill_tag,subst;
  15.         void (*routine) (objparm *pm);
  16. "
  17. export prepstruct colorstruct objstruct
  18.  
  19. header="
  20.         /* This file is automatically generated! Do not edit it. */
  21. #include \"flydraw.h\"
  22. "
  23.  
  24. names=`cat <<@
  25. brush   t_color "-1,-1,-255"
  26. brushed t_color "-1,-1,-255"
  27. style   t_color "-1,-255,-1"
  28. styled  t_color "-1,-255,-1"
  29. tile    t_color "-255,-1,-1"
  30. tiled   t_color "-255,-1,-1"
  31.  
  32. color   t_prep  p_color
  33. colour  t_prep  p_color
  34. colors  t_prep  p_color
  35. colours t_prep  p_color
  36.  
  37. tiny    t_prep  p_font
  38. small   t_prep  p_font
  39. medium  t_prep  p_font
  40. large   t_prep  p_font
  41. huge    t_prep  p_font
  42. giant   t_prep  p_font
  43.  
  44. affine          t_obj   6,0,0,0,        obj_affine
  45. arrow           t_obj   5,1,0,1,        obj_arrow
  46. arrow2          t_obj   5,1,0,1,        obj_arrow2
  47. arrows          t_obj   5,-1,0,1,       obj_arrows
  48. arrows2         t_obj   5,-1,0,1,       obj_arrows2
  49. darrow          t_obj   5,1,-1,1,       obj_arrow
  50. darrow2         t_obj   5,1,-1,1,       obj_arrow2
  51. darrows         t_obj   5,-1,-1,1,      obj_arrows
  52. darrows2        t_obj   5,-1,-1,1,      obj_arrows2
  53. dasharrow       t_obj   5,1,-1,1,       obj_arrow
  54. dasharrow2      t_obj   5,1,-1,1,       obj_arrow2
  55. dashedarrow     t_obj   5,1,-1,1,       obj_arrow
  56. dashedarrow2    t_obj   5,1,-1,1,       obj_arrow2
  57. arc             t_obj   6,1,0,3, obj_arc
  58. angle t_obj 5,1,0,3, obj_angle
  59. ball            t_obj   3,1,1,0,        obj_circle
  60. circle          t_obj   3,1,0,3,        obj_circle
  61. circles         t_obj   3,-1,0,4,       obj_circles
  62. comment         t_obj   0,0,0,0,        obj_comment
  63. copy            t_obj   6,0,0,0,        obj_copy
  64. copyresized     t_obj   8,0,0,0,        obj_copyresize
  65. crosshair       t_obj   2,1,0,1,        obj_crosshair
  66. crosshairs      t_obj   2,-1,0,1,       obj_crosshairs
  67. crosshairsize   t_obj   1,0,0,0,        obj_crosshairsize
  68. curve   t_obj   0,-1,0,1,       obj_plot
  69. dashhalfline    t_obj   4,1,-1,3,       obj_halfline
  70. dashedline      t_obj   4,1,0,1,        obj_dline
  71. dashedlines     t_obj   4,-1,0,1,       obj_dlines
  72. dashline        t_obj   4,1,0,1,        obj_dline
  73. dashlines       t_obj   4,-1,0,1,       obj_dlines
  74. dashsegment     t_obj   4,1,0,1,        obj_dline
  75. demiline        t_obj   4,1,0,3,        obj_halfline
  76. diafill         t_obj   4,1,1,0,        obj_diafill
  77. diamondfill     t_obj   4,1,1,0,        obj_diafill
  78. disk            t_obj   3,1,1,0,        obj_circle
  79. diskfill        t_obj   4,1,1,0,        obj_dotfill
  80. dline           t_obj   4,1,0,1,        obj_dline
  81. dlines          t_obj   4,-1,0,1,       obj_dlines
  82. dhline          t_obj   2,1,-1,1,       obj_hline
  83. dpolyline       t_obj   4,-1,0,1,       obj_dlines
  84. dotfill         t_obj   4,1,1,0,        obj_dotfill
  85. dplot           t_obj   0,-1,0,1,       obj_dplot
  86. dsegment        t_obj   4,1,0,1,        obj_dline
  87. dvline          t_obj   2,1,-1,1,       obj_vline
  88. ellipse         t_obj   4,1,0,3,        obj_ellipse
  89. ellipses        t_obj   4,-1,0,3,       obj_ellipses
  90. existing        t_obj   0,0,0,0,        obj_existing
  91. fcircle         t_obj   3,1,1,0,        obj_circle
  92. fellipse        t_obj   4,1,1,0,        obj_ellipse
  93. fill            t_obj   2,1,1,0,        obj_fill
  94. filledcircle    t_obj   3,1,1,0,        obj_circle
  95. filledellipse   t_obj   4,1,1,0,        obj_ellipse
  96. filledpoly      t_obj   4,-1,1,0,       obj_poly
  97. filledpolygon   t_obj   4,-1,1,0,       obj_poly
  98. filledrect      t_obj   4,1,1,0,        obj_rect
  99. filledrectangle t_obj   4,1,1,0,        obj_rect
  100. filledsquare    t_obj   3,1,1,0,        obj_square
  101. filledtriangle  t_obj   6,1,1,0,        obj_triangle
  102. fillcircle      t_obj   3,1,1,0,        obj_circle
  103. fillellipse     t_obj   4,1,1,0,        obj_ellipse
  104. fillpoly        t_obj   4,-1,1,0,       obj_poly
  105. fillpolygon     t_obj   4,-1,1,0,       obj_poly
  106. fillrect        t_obj   4,1,1,0,        obj_rect
  107. fillrectangle   t_obj   4,1,1,0,        obj_rect
  108. fillsquare      t_obj   3,1,1,0,        obj_square
  109. filltriangle    t_obj   6,1,1,0,        obj_triangle
  110. filltoborder    t_obj   2,2,1,0,        obj_fillb
  111. flood           t_obj   2,1,1,0,        obj_fill
  112. floodfill       t_obj   2,1,1,0,        obj_fill
  113. fpoly           t_obj   4,-1,1,0,       obj_poly
  114. fpolygon        t_obj   4,-1,1,0,       obj_poly
  115. frect           t_obj   4,1,1,0,        obj_rect
  116. frectangle      t_obj   4,1,1,0,        obj_rect
  117. fsquare         t_obj   3,1,1,0,        obj_square
  118. ftriangle       t_obj   6,1,1,0,        obj_triangle
  119. gridfill        t_obj   4,1,1,0,        obj_gridfill
  120. halfline        t_obj   4,1,0,3,        obj_halfline
  121. hatchfill       t_obj   4,1,1,0,        obj_hatchfill
  122. hline           t_obj   2,1,0,3,        obj_hline
  123. hdline          t_obj   2,1,-1,1,       obj_hline
  124. insert          t_obj   6,0,0,0,        obj_copy
  125. interlace       t_obj   0,0,0,0,        obj_interlace
  126. killaffine      t_obj   0,0,0,0,        obj_killaffine
  127. killbrush       t_obj   0,0,0,0,        obj_killbrush
  128. killlinear      t_obj   0,0,0,0,        obj_killlinear
  129. killrotate      t_obj   0,0,0,0,        obj_killlinear
  130. killrotation    t_obj   0,0,0,0,        obj_killlinear
  131. killstyle       t_obj   0,0,0,0,        obj_killstyle
  132. killtile        t_obj   0,0,0,0,        obj_killtile
  133. killtranslate   t_obj   0,0,0,0,        obj_killtranslation
  134. killtranslation t_obj   0,0,0,0,        obj_killtranslation
  135. lattice         t_obj   8,1,0,1,        obj_lattice
  136. line            t_obj   4,1,0,3,        obj_line
  137. linear          t_obj   4,0,0,0,        obj_linear
  138. lines           t_obj   4,-1,0,3,       obj_lines
  139. rays            t_obj   4,-1,0,3,       obj_rays
  140. linewidth       t_obj   1,0,0,0,        obj_linewidth
  141. new             t_obj   0,0,0,0,        obj_new
  142. output          t_obj   0,0,0,0,        obj_output
  143. parallel        t_obj   7,1,0,3,        obj_parallel
  144. pixels          t_obj   2,-1,-1,0,      obj_points
  145. point           t_obj   2,1,0,1,        obj_point
  146. pointfill       t_obj   4,1,1,0,        obj_dotfill
  147. points          t_obj   2,-1,0,1,       obj_points
  148. poly            t_obj   4,-1,0,3,       obj_poly
  149. polygon         t_obj   4,-1,0,3,       obj_poly
  150. polyline        t_obj   4,-1,0,3,       obj_lines
  151. brokenline              t_obj   4,-1,0,3,       obj_lines
  152. print           t_obj   2,-1,0,0,       obj_string
  153. range           t_obj   4,0,0,0,        obj_range
  154. rangex          t_obj   2,0,0,0,        obj_xrange
  155. rangey          t_obj   2,0,0,0,        obj_yrange
  156. ranget          t_obj   2,0,0,0,        obj_trange
  157. rect            t_obj   4,1,0,3,        obj_rect
  158. rectangle       t_obj   4,1,0,3,        obj_rect
  159. rotate          t_obj   1,0,0,0,        obj_rotation
  160. rotation        t_obj   1,0,0,0,        obj_rotation
  161. seg             t_obj   4,1,0,3,        obj_line
  162. segment         t_obj   4,1,0,3,        obj_line
  163. segments                t_obj   4,-1,0,3,       obj_segments
  164. setbrush        t_obj   0,0,0,0,        obj_setbrush
  165. setpixel        t_obj   2,1,-1,0,       obj_point
  166. setstyle        t_obj   0,0,0,0,        obj_setstyle
  167. settile         t_obj   0,0,-1,0,       obj_setbrush
  168. size            t_obj   2,0,0,0,        obj_size
  169. square          t_obj   3,1,0,3,        obj_square
  170. string          t_obj   2,-1,0,0,       obj_string
  171. stringup        t_obj   2,-1,-1,0,      obj_string
  172. text            t_obj   2,-1,0,0,       obj_string
  173. textup          t_obj   2,-1,-1,0,      obj_string
  174. translate       t_obj   2,0,0,0,        obj_translation
  175. translation     t_obj   2,0,0,0,        obj_translation
  176. transparent     t_obj   0,-1,0,0,       obj_transp
  177. triangle        t_obj   6,1,0,3,        obj_triangle
  178. vline           t_obj   2,1,0,3,        obj_vline
  179. vdline          t_obj   2,1,-1,1,       obj_vline
  180. write           t_obj   2,-1,0,0,       obj_string
  181. writeup         t_obj   2,-1,-1,0,      obj_string
  182. xrange          t_obj   2,0,0,0,        obj_xrange
  183. yrange          t_obj   2,0,0,0,        obj_yrange
  184. trange          t_obj   2,0,0,0,        obj_trange
  185. tstep           t_obj   1,0,0,0,        obj_tstep
  186. tsteps          t_obj   1,0,0,0,        obj_tstep
  187. plotstep        t_obj   1,0,0,0,        obj_tstep
  188. plotsteps       t_obj   1,0,0,0,        obj_tstep
  189. plot            t_obj   0,-1,0,1,       obj_plot
  190. plotjump        t_obj   1,0,0,0,        obj_plotjump
  191. levelcurve      t_obj   0,-1,0,1,       obj_levelcurve
  192. levelstep       t_obj   1,0,0,0,        obj_levelstep
  193. animstep        t_obj   1,0,0,0,        obj_animstep
  194. wims_linecount  t_obj   1,0,0,0,        obj_linecount
  195. wims_end        t_obj   0,0,0,0,        obj_end
  196. setmatrix       t_obj   5,0,0,0,        obj_setmatrix
  197. resetmatrix     t_obj   1,0,0,0,        obj_resetmatrix
  198. setvector       t_obj   3,0,0,0,        obj_setvector
  199. resetvector     t_obj   1,0,0,0,        obj_resetvector
  200. settransform    t_obj   7,0,0,0,        obj_settransform
  201. resettransform  t_obj   1,0,0,0,        obj_resettransform
  202. setparallelogram        t_obj   6,0,0,0,        obj_setparallelogram
  203. resetparallelogram      t_obj   0,0,0,0,        obj_resetparallelogram
  204. multicopy       t_obj   0,0,0,0,        obj_multicopy
  205. vimgfile        t_obj   0,0,0,0,        obj_vimgfile
  206. vimg            t_obj   1,0,0,0,        obj_vimg
  207. tikzfile                t_obj   0,0,0,0,        obj_tikzfile
  208. @
  209. `
  210. namecolor=`awk 'NF==2 {print $1"        t_color \""$2"\""}' colors`
  211. namelist=`sort -k 1,1 <<@ | uniq
  212. $namecolor
  213. $names
  214. @
  215. `
  216.  
  217. o_list=`echo "$namelist" | grep t_obj | awk '{print substr($4,5)}' | sort | uniq`
  218.  
  219. cd `dirname $0`
  220. echo "$header" >nametab.c
  221. for o in $o_list
  222. do
  223.  echo "void obj_$o(objparm *pm);" >>nametab.c
  224. done
  225.  
  226. tab=tab
  227. no=_no
  228. for t in $tablist
  229. do
  230.  eval def='$'$t'struct'
  231.  list=`echo "$namelist" | grep t_$t`
  232.  ll=`echo "$list" | awk '
  233.         NF>1 {print "{\""$1"\", "$3" "$4" "$5"},"}
  234.         '`
  235.  echo "$list" | awk '
  236.         BEGIN {a=0};
  237.         NF>1 {print "\""$1"\",  ",$2",  "a; a=a+1;};
  238. '>.nametab.$t
  239.  echo "struct $t$tab $t$tab[]={
  240. $ll
  241. };
  242.  
  243. int $t$no=(sizeof($t$tab)/sizeof($t$tab[0]));
  244. " >>nametab.c
  245. done
  246.  
  247. list=`cat .nametab.* | sort -k 1,1 | awk '{print "{"$0"},"}'`
  248. cat <<@ >>nametab.c
  249. struct nametab nametab[]={
  250. $list
  251. };
  252.  
  253. int nametab_no=(sizeof(nametab)/sizeof(nametab[0]));
  254.  
  255. @
  256.  
  257. rm -f .nametab.* >/dev/null 2>&1
  258.