home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / fractal / kaos.lha / modellib / kwrite_init < prev    next >
Encoding:
Text File  |  1990-01-26  |  1.1 KB  |  57 lines

  1. #!/bin/csh
  2. # $argv[1]: name of dynamical system class
  3. # $argv[2]: class index
  4. # $argv[3-]: codenames of dynamical systems belonging to the class
  5. #
  6.  
  7. set outdir = $KAOSHOME/modellib
  8. set outfile = $outdir/${argv[1]}_kaos_init.h
  9.  
  10. set argum = 
  11. echo "Write a file $outfile from a set of dynamical systems"
  12.  
  13. cat > $outfile <<END
  14. /*
  15. ----------------------------------------------------------------
  16.     This file is automatically generated by kwrite_init.
  17. -----------------------------------------------------------------
  18. */
  19. /*
  20.     dynamical system class index
  21. */
  22. int ds_class = ${argv[2]};
  23. /*
  24.     vector field and function routine pointers
  25. */
  26. int (*f_p)();
  27. int (*func_p)();
  28. /*
  29.     declaration of dynamical system subroutines
  30. */
  31. struct init_struct { int (*init_p)();};
  32. END
  33.  
  34. foreach argum ($argv[3-])
  35.     cat >> $outfile <<END
  36. int ${argum}_init(),${argum}_f(),${argum}_func();
  37. END
  38. end
  39.  
  40. cat >> $outfile <<END
  41. /*
  42.     list of dynamical systems in the same order as one in panel cycle items
  43. */
  44. struct init_struct init_tbl[MODEL_DIM] = {
  45. END
  46.  
  47. foreach argum ($argv[3-])
  48.     cat >> $outfile <<END
  49.     ${argum}_init,
  50. END
  51. end
  52.  
  53. cat >> $outfile <<END
  54. };
  55. END
  56. echo Done!
  57.