home *** CD-ROM | disk | FTP | other *** search
/ Dream 45 / Amiga_Dream_45.iso / Amiga / Magazine / Dossier-LaTeX / AmiWeb2C.lha / source / web2c-6.1 / web2c / lib / convert.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-23  |  1KB  |  44 lines

  1. /*
  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.  
  11. Parse Arg PASCALFILE CFILE THIRDARG .
  12.  
  13. If "" = PASCALFILE Then
  14.   Exit 1
  15. If "" = CFILE Then
  16.   Exit 1
  17.  
  18. BASEFILE = Left(PASCALFILE,Pos('.',PASCALFILE)-1)
  19.  
  20. /*
  21.  * We use andycpascal.h instead of andyconfig.h because getopt.c and
  22.  * perhaps other straight C routines don't need or want the Pascal
  23.  * definitions of `chr' and the like.
  24.  */
  25.  
  26. If "" = THIRDARG Then Do
  27.   HFILE = "andycpascal.h"
  28.   DEFNFILE = ""
  29. End; Else Do
  30.   HFILE = THIRDARG || ".h"
  31.   DEFNFILE = THIRDARG || ".defines"
  32. End
  33.  
  34. Pragma('Directory','.')
  35.  
  36. Address Command
  37.  
  38. "type ../lib/common.defines" DEFNFILE PASCALFILE "> temp_1"
  39. "../web2c/web2c -h" || HFILE "-c" || BASEFILE "< temp_1 > temp_2"
  40. "../web2c/fixwrites" BASEFILE "< temp_2 >" CFILE
  41. "delete temp_1 temp_2 quiet"
  42.  
  43. Exit 0
  44.