Subversion Repositories wimsdev

Rev

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