home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / tex / texsrc1 / Src / lib / convert < prev    next >
Text File  |  1993-05-05  |  798b  |  36 lines

  1. |#!/bin/sh
  2. |# Convert WEB programs not needing special treatment to C.
  3. |# 
  4. |# $1 is the Pascal file to be converted.
  5. |# $2 is the C file to be created.
  6. |# $3, if present, is extended with .h, and #included in the C file, and
  7. |# extended with .defines, and prepended along with the common
  8. |# definitions.
  9.  
  10. |pascalfile=$1
  11. |basefile=`basename $1 .p`
  12. |cfile=$2
  13. |hfile=config.h
  14. |defnfile=
  15.  
  16. |if test $# -eq 3
  17. |then
  18. |  hfile=$3.h
  19. |  defnfile=$3.defines
  20. |fi
  21.  
  22. |cat ../lib/common.defines $defnfile $pascalfile \
  23. |       | ../web2c/web2c -h$hfile -c$basefile \
  24. |       | ../web2c/fixwrites $basefile > $cfile
  25.  
  26. |RISC OS:
  27. echo Concatenating...
  28. fcat ^.lib.common_def ^.lib.riscos_def %0.p >temp
  29. echo web2c...
  30. web2c -hh.config -c%0 <temp >temp2
  31. echo fixwrites...
  32. fixwrites %0 <temp2 >%1
  33. remove temp
  34. remove temp2
  35.  
  36.