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 >
Wrap
OS/2 REXX Batch file
|
1995-03-23
|
1KB
|
44 lines
/*
* Convert WEB programs not needing special treatment to C.
*
* $1 is the Pascal file to be converted.
* $2 is the C file to be created.
* $3, if present, is extended with .h, and #included in the C file, and
* extended with .defines, and prepended along with the common
* definitions.
*/
Parse Arg PASCALFILE CFILE THIRDARG .
If "" = PASCALFILE Then
Exit 1
If "" = CFILE Then
Exit 1
BASEFILE = Left(PASCALFILE,Pos('.',PASCALFILE)-1)
/*
* We use andycpascal.h instead of andyconfig.h because getopt.c and
* perhaps other straight C routines don't need or want the Pascal
* definitions of `chr' and the like.
*/
If "" = THIRDARG Then Do
HFILE = "andycpascal.h"
DEFNFILE = ""
End; Else Do
HFILE = THIRDARG || ".h"
DEFNFILE = THIRDARG || ".defines"
End
Pragma('Directory','.')
Address Command
"type ../lib/common.defines" DEFNFILE PASCALFILE "> temp_1"
"../web2c/web2c -h" || HFILE "-c" || BASEFILE "< temp_1 > temp_2"
"../web2c/fixwrites" BASEFILE "< temp_2 >" CFILE
"delete temp_1 temp_2 quiet"
Exit 0