Subversion Repositories wimsdev

Rev

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