home *** CD-ROM | disk | FTP | other *** search
- /*
- * Test of rexxflow.library
- * Origional Name: FidoInOut.Rexx by Russell McOrmond
- *
- * Modified to convert 4d style .?LO and .?UT files by
- * James McOrmond 1:224/140.0
- *
- * Can be converted to use regular ?lo/?ut files.
- *
- * January ?/92 - Converted from FidoInOut.Rexx to Jflow.rexx
- * * - (didn't log the modifications)
- * April 21/92 - fixed logical error in generating filenames
- * April 22/92 - cleaned up output for faster execution
- * May 16/92 - more cleaning
- */
-
- options results
-
- DTF_IFSENT = 128
- DTF_DELETE = 64
- DTF_TRUNCATE = 32
- DTF_REQUEUE = 16
-
- DT_TRUNCATE = DTF_IFSENT+DTF_TRUNCATE+DTF_REQUEUE
- DT_FILEATTACH = DTF_IFSENT+DTF_REQUEUE
- DT_DELETE = DTF_IFSENT+DTF_DELETE+DTF_REQUEUE
- DT_SHOW_DELETE = DT_DELETE
- DT_NOTHING = DT_FILEATTACH
- DT_EXTRA_DELETE = DT_DELETE
- DT_REQUEST = DTF_REQUEUE+DTF_DELETE
- DT_MAILBUNDLE = DT_TRUNCATE
-
- DTPRI_CRASH = 50
- DTPRI_HOLD = -50
-
-
- DTPRI_DIRECT= 30 /* This one I added; your scheduler
- * can/could be updated to send
- * Direct files during ZMH.
- * If not, 30 should be assumed
- * "Normal" as if it came from a .FLO
- */
- nl='0a'X
- cr='0d'X
- TRUE = 1
- FALSE = 0
-
- magicnum = 11111111
-
- flows = GetOutbound() /* Make sure your Outbound is set */
- if (flows="")then call SetOutbound("outbound:flows")
- flows = upper(GetOutbound())
-
- outbound = "OUTBOUND:"
-
- say "JFlow 0.7 - 4dstyle outbound -> Flow.Library Converter"
- say "Updated May 16, 1992. By James McOrmond"
-
- /* This should list all of the needed
- * files: Flow,Direct,Crash & Hold.
- */
-
- Address Command 'list >t:outlist out:#?.#?.#?.#?.?lo quick nohead'
- Address Command 'list >>t:outlist out:#?.#?.#?.#?.?ut quick nohead'
-
- if open('in',"Mail:MAGICNUM",'R') then do
- magicnum=readln('in')
- close('in')
- end
-
- myaddress.domain = "Fidonet" /* Put YOUR address here */
- myaddress.zone = 1
- myaddress.net = 224
- myaddress.node = 140
- myaddress.point = 0
- call SetDefaultAddress(myaddress)
-
- x=Open('cfgfile',"t:outlist",'R')
- if x=0 then do
- say "Error opening outlist"
- Exit 1
- end
-
-
- i=0
-
- do forever
-
- Line=Upper(strip(space(ReadLn('cfgfile'),1),'B'))
-
- if EOF('cfgfile') then Leave
-
- /* say "Found" Line */
-
- i=i+1
- whichnode.i.domain = "Fidonet"
- whichnode.i.pri = "0"
- node.i = Line /* If you want to use regular flo
- * files, you parse the list
- * differently on this next line
- */
- parse var Line whichnode.i.zone"."whichnode.i.net"."whichnode.i.node"."whichnode.i.point"."junk
-
- /* This takes care of special
- * files; Crash, Hold, Direct.
- * All others are sent like a
- * .FLO or .OUT.
- */
- if Left(junk,1)="C" then whichnode.i.pri = DTPRI_CRASH
- if Left(junk,1)="H" then whichnode.i.pri = DTPRI_HOLD
- if Left(junk,1)="D" then whichnode.i.pri = DTPRI_DIRECT
-
- end
- x=Close('cfgfile')
- if i = 0 then do
- say "No Files found to convert"
- exit
- end
-
- whichnode.numnodes = i
-
- call pragma('D',"mail:")
-
- do anode = 1 until anode = whichnode.numnodes
- say " "
- say "ReFlow" node.anode
-
- jnode = left(node.anode,length(node.anode)-3)
-
- /* say "node ="node */
-
- outname = OUTBOUND||jnode||Left(right(node.anode,3),1)||"UT"
- floname = OUTBOUND||jnode||Left(right(node.anode,3),1)||"LO"
-
- /* Yes i know one
- * these will give
- * NODE.ANODE back,
- * but this way, I
- * don't have to
- * worry about which
- * was which.
- */
- /* say "outname = "outname */
- /* say "floname = "floname */
-
- work_detail = FindDetail(whichnode.anode)
-
- call ScanDetail(work_detail, huge_list)
-
- additout = EXISTS(outname)
-
- if huge_list.numnodes > 0 then do
- do i = 1 until i = huge_list.numnodes
- drop flags
- if upper(huge_list.i.filename) ~= outname then do
- detailnode=AddWorkName(work_detail,huge_list.i.filename,huge_list.i.asname,huge_list.i.flags)
- ChangeDetailPri(work_detail,detailnode,huge_list.i.pri)
- end
- end
- end
-
- if EXISTS(floname) then do
- x=Open('flofile',floname,'R')
- if x=0 then do
- say "Error opening" floname
- Exit 1
- end
-
- do forever
-
- Line=upper(ReadLn('flofile'))
-
- if EOF('flofile') then Leave
-
- flags= DT_NOTHING
- if (LEFT(Line,1) = "#") then do
- flags = DT_TRUNCATE
- Line=DELSTR(Line,1,1)
- end
- if (LEFT(Line,1) = "^") then do
- flags = DT_DELETE
- Line=DELSTR(Line,1,1)
- end
- if (LEFT(Line,1) = "-") then do
- flags = DT_DELETE
- Line=DELSTR(Line,1,1)
- end
- addit = TRUE
-
- if huge_list.numnodes > 0 then do
- do i = 1 until i = huge_list.numnodes
- if upper(huge_list.i.filename) = Line then do
- addit = FALSE
- end
- end
- end
- /* I'm also checking to see if the file exists here
- * incase its been deleted already.
- */
- if EXISTS(Line) = FALSE then do
- Say "File No Longer Exists"
- addit = FALSE
- end
-
- if (addit = TRUE) & (Line ~= outname) then do
- say "Adding: " Line
- cmprs = left(right(line,3),2)
- asfile = Right(d2x(whichnode.anode.net),4,"0") ,
- ||Right(d2x(whichnode.anode.node),4,"0") ,
- ||Right(Line,4)
- if ((cmprs ~= MO) & (cmprs ~= TU) & (cmprs ~= WE) & (cmprs ~= TH) ,
- & (cmprs ~= FR) & (cmprs ~= SA) & (cmprs ~= SU)) then asfile = ""
-
- if asfile ~= "" then do
- detailnode=AddWorkName(work_detail,Line, upper(asfile), flags)
- end
- else detailnode=AddWork(work_detail,Line,flags)
-
- say whichnode.anode.pri
- ChangeDetailPri(work_detail,detailnode,whichnode.anode.pri)
- end
- end
- x=Close('flofile')
- end
-
- if (whichnode.anode.net ~= 114) & (whichnode.anode.net ~= 487) then do
- address command "delete "floname
- end
- else say "Not Deleting Flo"
-
- if additout = TRUE then do
- magicnum= magicnum+1
- if ((magicnum > 99999999) | (Magicnum < 11111111)) then magicnum = 11111111 + randu() * 99999
- /* say "Adding It - MagicNum" magicnum */
- detailnode=AddWorkName(work_detail,outname,magicnum||".PKT", DT_DELETE)
- ChangeDetailPri(work_detail,detailnode,whichnode.anode.pri)
- end
- call freeDetail(work_detail)
- call DumpOutbound(flows)
- end
-
- if ~open('out',"Mail:MAGICNUM",'W') then do
- say "Can't open numberfile"
- end
- else do
- writeln('out',magicnum)
- close('out')
- /* Say "Wrote out Magicnum:"magicnum */
- end
-
- /* We're Outta here! */