home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 2
/
goldfish_vol2_cd1.bin
/
files
/
comm
/
misc
/
elcheapofax
/
rcs
/
all2fax.rexx,v
< prev
next >
Wrap
Text File
|
1993-12-21
|
4KB
|
213 lines
head 1.3;
access;
symbols
OCT93:1.3;
locks;
comment @# @;
1.3
date 93.07.01.00.44.20; author Rhialto; state Exp;
branches;
next 1.2;
1.2
date 93.06.11.16.33.37; author Rhialto; state Exp;
branches;
next 1.1;
1.1
date 93.06.11.14.53.53; author Rhialto; state Exp;
branches;
next ;
desc
@Driver to interpret fax scripts
@
1.3
log
@Open correct input file name.
@
text
@/*
* All2fax.rexx
* $Id: all2fax.rexx,v 1.2 1993/06/11 16:33:37 Rhialto Exp $
*
* Copyright (C) 1993 by Olaf 'Rhialto' Seibert. All rights reserved.
*/
append = "" /* set for each non-first filepart */
invert = ""
raw = "-r" /* unset for last filepart */
verbose = ""
fontname = "courier.font"
fontsize = 30
outfile = "all.fax"
xoffset = 50
yoffset = 50 /* set to 0 for each non-first filepart */
infiles = 0
call doargs(arg(1))
do fi = 1 to infiles
ifp = ""
if open(ifp, infile.fi, "read") = 0 then do
say "Can't open input file" infile.fi
exit 20
end
call opentempfile
do forever
line = readln(ifp)
if eof(ifp) then leave
if left(line, 1) = "." then do
cmd = word(line, 1)
tail = delword(line, 1, 1)
select
when left(line, 2) = ".." then do
writeln(tfp, substr(line, 2)
dotfp = 1
end
when cmd = ".args" then do
call processtempfile
call doargs(tail)
end
when cmd = ".doit" then do
call doargs(tail)
call processtempfile
end
when cmd = ".iff" then do
call processtempfile
call doifffile(tail)
end
when cmd = ".raw" then do
call processtempfile
call dorawfile(tail)
end
when cmd = ".rexx" then do
say "REXX:" tail
interpret tail
end
when cmd = ".shell" then do
say "SHELL:" tail
address command tail
end
when cmd = "." then nop
otherwise do
say "Unknown directive:" line
end
end
end; else do
writeln(tfp, line)
say line
dotfp = 1
end
end
/* Last filepart */
if fi = infiles then raw = ""
call processtempfile
call closetempfile
call deletetempfile
end
doargs: /* (arguments) */
args = arg(1)
words = words(args)
do wi = 1 to words
w = word(args, wi)
select
when w = "-a" then append = w
when w = "--a" then append = ""
when w = "-i" then invert = w
when w = "--i" then invert = ""
when w = "-r" then raw = w
when w = "--r" then raw = ""
when w = "-v" then verbose = w
when w = "--v" then verbose = ""
when w = "-f" then do; wi=wi+1; fontname = word(args, wi); end
when w = "-s" then do; wi=wi+1; fontsize = word(args, wi); end
when w = "-o" then do; wi=wi+1; outfile = word(args, wi); end
when w = "-x" then do; wi=wi+1; xoffset = word(args, wi); end
when w = "-y" then do; wi=wi+1; yoffset = word(args, wi); end
otherwise do
infiles = infiles + 1
infile.infiles = w
end
end
end
return
opentempfile:
tfpname = "t:all2fax.tmp"
dotfp = 0
if open(tfp, tfpname, "write") = 0 then do
say "Can't open temporary file" tfpname
exit 20
end
return
closetempfile:
if close(tfp) = 0 then do
say "Can't close temporary file" tfpname
exit 20
end
return
deletetempfile:
address command "delete" tfpname
return
processtempfile:
if dotfp = 0 then return
call closetempfile
cmd = "asc2fax" append invert raw verbose,
"-f" fontname "-s" fontsize "-o" outfile "-x" xoffset "-y" yoffset,
tfpname
say cmd
address command cmd
call opentempfile
/* >= Second file part */
append = "-a"
yoffset = 0
return
doifffile: /* (arguments) */
cmd = "iff2fax" append invert raw verbose,
"-o" outfile "-x" xoffset "-y" yoffset,
arg(1)
say cmd
address command cmd
return
dorawfile: /* (arguments) */
cmd = "append" verbose "-o" outfile arg(1)
say cmd
address command cmd
return
@
1.2
log
@First real RCS checkin
@
text
@d3 1
a3 1
* $Id$
d22 2
a23 2
if open(ifp, infile.infiles, "read") = 0 then do
say "Can't open input file" infile.infiles
@
1.1
log
@Initial revision
@
text
@d3 1
@