*=== PLW-MAIN 1 ===*
EQUATE AM TO CHAR(254)
EQUATE VM TO CHAR(253)
EQUATE SVM TO CHAR(252)
EQUATE SEPAR.CHAR TO CHAR(249)
EQUATE ESC TO CHAR(27)
EQUATE CR TO CHAR(13)
EQUATE FF TO CHAR(12)
EQUATE LF TO CHAR(10)
EQUATE BS TO CHAR(8)
EQUATE BELL TO CHAR(7)
EQUATE NUL TO CHAR(0)
EQUATE YES TO 1
EQUATE NO TO 0
DAYS = 'Sun' : VM : 'Mon' : VM : 'Tue' : VM : 'Wed' : VM : 'Thu' : VM : 'Fri' : VM : 'Sat'
*
*========================================*
*
*
*
*
*
*
*
*
*
*=== PLW-MAIN 11 ===*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*#DEFINE 1
*
*=== INCL..1.0 26 ===*
*
*
*
*
*
*
*
*
*
*
*
*
*#DEFINE QMLINUX
*========================================*
*#DEFINE IP1
*
*### #IF APPRO|ADDS|SEQ32|P6432
*### #DEFINE TELNET
*### #END
*
*$PC OFF
EQUATE VER TO '2.0.0 (build 177)'
EQUATE CW$STR TO '(C) Copyright 1990-2003 Modular Software Corporation.'
EQUATE SHORT.VER TO '2.0.0.177'
*
*### #IF R83
*### EQUATE SYS.TYPE            TO 'R83'
*### EQUATE SYS.T               TO 'R83'
*### EQUATE MAX.ITEM.LEN        TO 32000
*### EQUATE MAX.ID.LEN          TO 50
*### EQUATE BIG.STR             TO 32000
*### #END
*
*### #IF UPBOARD
*### EQUATE SYS.TYPE            TO 'UpBoard'
*### EQUATE SYS.T               TO 'UPBOARD'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 50
*### EQUATE BIG.STR             TO 99999999
*### #END
*
*### #IF PICK64
*### EQUATE SYS.TYPE            TO 'Pick64'
*### EQUATE SYS.T               TO 'PICK64'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 50
*### EQUATE BIG.STR             TO 99999999
*### #END
*### #IF P6432
*### EQUATE SYS.TYPE            TO 'Pick64 32-bit'
*### EQUATE SYS.TP              TO 'P32'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 100
*### EQUATE BIG.STR             TO 99999999
*### #END
*### #IF SEQ
*### EQUATE SYS.TYPE           TO 'SEQUOIApro'
*### EQUATE SYS.T               TO 'SEQ'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 100
*### EQUATE BIG.STR             TO 99999999
*### #END
*### #IF SEQ32
*### EQUATE SYS.TYPE            TO 'SEQUOIApro32'
*### EQUATE SYS.T               TO 'SEQ32'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 50
*### EQUATE BIG.STR             TO 99999999
*### #END
*
*### #IF GA
*### EQUATE SYS.TYPE            TO 'GA'
*### EQUATE SYS.T               TO 'GA'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 50
*### EQUATE BIG.STR             TO 99999999
*### #END
*
*### #IF AP
*### EQUATE SYS.TYPE            TO 'AP/Native'
*### EQUATE SYS.T               TO 'AP'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 100
*### EQUATE BIG.STR             TO 99999999
*### #END
*### #IF APPRO
*### EQUATE SYS.TYPE            TO 'AP/Pro'
*### EQUATE SYS.T               TO 'APPRO'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 100
*### EQUATE BIG.STR             TO 99999999
*### #END
*
*### #IF ADDS3
*### EQUATE SYS.TYPE            TO 'PC/OS'
*### EQUATE SYS.T               TO 'ADDS3'
*### #DEFINE ADDS
*### #END
*### #IF ADDS4
*### EQUATE SYS.TYPE            TO 'Mentor PRO'
*### EQUATE SYS.T               TO 'ADDS4'
*### #DEFINE ADDS
*### #END
*### #IF ADDS
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 50
*### EQUATE BIG.STR             TO 99999999
*### #END
*
*### #IF MVBASE
*### EQUATE SYS.TYPE            TO 'mv*Base'
*### EQUATE SYS.T               TO 'MVBASE'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 100
*### EQUATE BIG.STR             TO 99999999
*### #DEFINE NT
*### #END
*
*### #IF D3NT
*### EQUATE SYS.TYPE            TO 'D3/NT'
*### EQUATE SYS.T               TO 'D3NT'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 100
*### EQUATE BIG.STR             TO 99999999
*### #DEFINE D3
*### #DEFINE NT
*### #END
*### #IF D3LINUX
*### EQUATE SYS.TYPE            TO 'D3/LINUX'
*### EQUATE SYS.T               TO 'D3LINUX'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 100
*### EQUATE BIG.STR             TO 99999999
*### #DEFINE D3
*### #DEFINE UNIX
*### #DEFINE D3UNIX
*### #END
*### #IF EZOPEN
*### EQUATE SYS.TYPE            TO 'EZ-Open'
*### EQUATE SYS.T               TO 'EZOPEN'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 100
*### EQUATE BIG.STR             TO 99999999
*### #DEFINE D3
*### #DEFINE UNIX
*### #DEFINE D3UNIX
*### #END
*
*### #IF UVLINUX
*### EQUATE SYS.TYPE            TO 'UV/LINUX'
*### EQUATE SYS.T               TO 'UVLINUX'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 100
*### EQUATE BIG.STR             TO 99999999
*### #DEFINE UV
*### #DEFINE UNIX
*### #DEFINE UVUNIX
*### #END
*
*### #IF UDLINUX
*### EQUATE SYS.TYPE            TO 'UD/LINUX'
*### EQUATE SYS.T               TO 'UDLINUX'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 100
*### EQUATE BIG.STR             TO 99999999
*### #DEFINE UD
*### #DEFINE UNIX
*### #DEFINE UDUNIX
*### #END
*
*### #IF UNLINUX
*### EQUATE SYS.TYPE            TO 'UN/LINUX'
*### EQUATE SYS.T               TO 'UNLINUX'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 100
*### EQUATE BIG.STR             TO 99999999
*### #DEFINE UN
*### #DEFINE UNIX
*### #DEFINE UNUNIX
*### #END
*
*### #IF UVNT
*### EQUATE SYS.TYPE            TO 'UV/NT'
*### EQUATE SYS.T               TO 'UVNT'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 100
*### EQUATE BIG.STR             TO 99999999
*### #DEFINE UV
*### #END
*
*### #IF UDNT
*### EQUATE SYS.TYPE            TO 'UD/NT'
*### EQUATE SYS.T               TO 'UDNT'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 100
*### EQUATE BIG.STR             TO 99999999
*### #DEFINE UD
*### #DEFINE NT
*### #END
*
*### #IF JB-NT
*### EQUATE SYS.TYPE            TO 'JBASE/NT'
*### EQUATE SYS.T               TO 'JBASENT'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 100
*### EQUATE BIG.STR             TO 99999999
*### #DEFINE JBASE
*### #DEFINE JB
*### #DEFINE NT
*### #END
*### #IF JB-LINUX
*### EQUATE SYS.TYPE            TO 'JBASE/LINUX'
*### EQUATE SYS.T               TO 'JBASELX'
*### EQUATE MAX.ITEM.LEN        TO 1000000
*### EQUATE MAX.ID.LEN          TO 100
*### EQUATE BIG.STR             TO 99999999
*### #DEFINE JBASE
*### #DEFINE JB
*### #DEFINE LINUX
*### #DEFINE UNIX
*### #END
*
*#IF QMLINUX
*#DEFINE QM
*#DEFINE LINUX
*#DEFINE UNIX
*#END
*### #IF QMWIN
*### #DEFINE QM
*### #END
*
*#IF QM
EQUATE SYS.TYPE            TO 'QM'
EQUATE SYS.T               TO 'QM'
EQUATE MAX.ITEM.LEN        TO 1000000
EQUATE MAX.ID.LEN          TO 64
EQUATE BIG.STR             TO 99999999
*
deffun CALLFN(str)
*
$catalog local
*#END
*
*### #IF APPRO|ADDS4|SEQ32|P6432
*### #DEFINE TELNET
*### #END
*
*$PC ON
*========================================*
*
*=== PLW-MAIN 13 ===*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*$PC OFF
*
COMMON USER.COMMON(500)
*
*
COMMON CONFIG.ARRAY(50)
*
*
*
COMMON ARRAY$BTREE(40)
EQUATE DEF$BTREE     TO ARRAY$BTREE(36)
EQUATE C0$BTREE      TO ARRAY$BTREE(37)
EQUATE C1$BTREE      TO ARRAY$BTREE(38)
EQUATE C2$BTREE      TO ARRAY$BTREE(39)
EQUATE KEY$BTREE     TO ARRAY$BTREE(40)
*
COMMON PORT.NO
COMMON ACCT.NAME
COMMON CRLF
COMMON PR.EOL
COMMON SENT
COMMON RESOURCE.LIST
COMMON ERR
COMMON RES
COMMON NUL80
COMMON NUL.MAXREAD
COMMON HEX.MAXREAD
COMMON NULDIR
COMMON HEX.MAXDIR
*
*$PC ON
*========================================*
*=== PLW-MAIN 14 ===*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*$PC OFF
*
*
*#IFN UPBOARD
EQUATE SEG                    TO CONFIG.ARRAY(1)
*#END
EQUATE CONFIG                 TO CONFIG.ARRAY(5)
EQUATE CALL.DRIVER.EP         TO CONFIG.ARRAY(7)
EQUATE LICENSE.SIZE           TO CONFIG.ARRAY(8)
*
*#IFN PICK64|SEQ|SEQ32|P6432|AP|APPRO
*#IFN UPBOARD
EQUATE PEEK.MD                TO CONFIG.ARRAY(11)
EQUATE POKE.MD                TO CONFIG.ARRAY(12)
EQUATE POKE.D.MD              TO CONFIG.ARRAY(13)
EQUATE LOCK.FRM.MD            TO CONFIG.ARRAY(14)
*#END
EQUATE GET.MD                 TO CONFIG.ARRAY(15)
*#IFN UPBOARD
EQUATE NAT.GET.MD             TO CONFIG.ARRAY(16)
EQUATE NAT.PUT.MD             TO CONFIG.ARRAY(17)
*#END
EQUATE CALL.DRIVER.MD         TO CONFIG.ARRAY(18)
EQUATE RQM.MD                 TO CONFIG.ARRAY(19)
*
*### #IF GA|ADDS
*### EQUATE GET.BUFFER.MD          TO CONFIG.ARRAY(20)
*### #END
*### #IF MVBASE
*### EQUATE CALL.FAST.MD           TO CONFIG.ARRAY(21)
*### #END
EQUATE PRINT.MD               TO CONFIG.ARRAY(22)
EQUATE GET.FRM.MD             TO CONFIG.ARRAY(23)
EQUATE BIN.TO.PICK.MD         TO CONFIG.ARRAY(24)
*### #IF R83|GA|ADDS
*### EQUATE GET2.MD                TO CONFIG.ARRAY(25)
*### #END
*### #IF GA
*### EQUATE TP.RD.MD               TO CONFIG.ARRAY(26)
*### EQUATE TP.WT.MD               TO CONFIG.ARRAY(27)
*### #END
*
EQUATE KD.C.MD                TO CONFIG.ARRAY(30)
EQUATE KD.CLEAR.MD            TO CONFIG.ARRAY(31)
*
EQUATE BCB.ALLOC.MD           TO CONFIG.ARRAY(32)
EQUATE BCB.DEALLOC.MD         TO CONFIG.ARRAY(33)
*
EQUATE BCB.SEND.MD            TO CONFIG.ARRAY(35)
EQUATE BCB.SEND.WS.MD         TO CONFIG.ARRAY(36)
*
EQUATE BCB.GET.CMD.MD         TO CONFIG.ARRAY(37)
EQUATE BCB.GET.DATA.MD        TO CONFIG.ARRAY(38)
EQUATE BCB.GET.DATA.WS.MD     TO CONFIG.ARRAY(39)
EQUATE BCB.WRITE.DATA.MD      TO CONFIG.ARRAY(40)
EQUATE BCB.WRITE.DATA.WS.MD   TO CONFIG.ARRAY(41)
*
EQUATE BCB.OPEN.FILE.MD       TO CONFIG.ARRAY(42)
EQUATE BCB.READ.ITEM.MD       TO CONFIG.ARRAY(43)
EQUATE BCB.READ.ITEM.FLG.MD   TO CONFIG.ARRAY(44)
*
EQUATE BCB.GET.MD             TO CONFIG.ARRAY(45)
EQUATE BCB.PRINT.MD           TO CONFIG.ARRAY(46)
*
EQUATE DLL.HANDLE             TO CONFIG.ARRAY(50)
*#END
*### #IF PICK64|P6432
*### EQUATE CALL.DRIVER.MD         TO 'U53;1'
*### EQUATE GET.MD                 TO 'U53;2'
*### EQUATE RQM.MD                 TO 'U53;3'
*### EQUATE BCB.ALLOC.MD           TO 'U53;4'
*### EQUATE BCB.DEALLOC.MD         TO 'U53;5'
*### EQUATE BCB.SEND.MD            TO 'U53;6'
*### EQUATE BCB.SEND.WS.MD         TO 'U53;7'
*### EQUATE BCB.GET.CMD.MD         TO 'U53;8'
*### EQUATE BCB.GET.DATA.MD        TO 'U53;9'
*### EQUATE BCB.GET.DATA.WS.MD     TO 'U53;10'
*### EQUATE BCB.WRITE.DATA.MD      TO 'U53;11'
*### EQUATE BCB.WRITE.DATA.WS.MD   TO 'U53;12'
*### EQUATE BCB.OPEN.FILE.MD       TO 'U53;13'
*### EQUATE BCB.READ.ITEM.MD       TO 'U53;14'
*### EQUATE BCB.READ.ITEM.FLG.MD   TO 'U53;15'
*### EQUATE BCB.GET.MD             TO 'U53;16'
*### EQUATE BCB.PRINT.MD           TO 'U53;17'
*### EQUATE PRINT.MD               TO 'U53;18'
*### EQUATE GET.FRM.MD             TO 'U53;19'
*### EQUATE VIR.PEEK.MD            TO 'U53;20'
*### EQUATE VIR.POKE.MD            TO 'U53;21'
*### EQUATE PEEK.MD                TO 'U53;22'
*### EQUATE POKE.MD                TO 'U53;23'
*### EQUATE GET.GDTR.MD            TO 'U53;24'
*### EQUATE FIND.BYTE.MD           TO 'U53;25'
*### EQUATE FARCALL.MD             TO 'U53;26'
*### EQUATE LOCK.FRAME.MD          TO 'U53;27'
*### EQUATE INIT.MD                TO 'U53;28'
*### EQUATE GET2.MD                TO 'U53;29'
*### EQUATE P64.MEM.MD             TO 'U37'
*### EQUATE P64.PEEK.MD            TO 'U38'
*### EQUATE FRM.SIZE               TO 2048
*### #END
*### #IF SEQ|SEQ32
*### EQUATE CALL.DRIVER.MD         TO 'U56;1'
*### EQUATE GET.MD                 TO 'U56;2'
*### EQUATE RQM.MD                 TO 'U56;3'
*### EQUATE BCB.ALLOC.MD           TO 'U56;4'
*### EQUATE BCB.DEALLOC.MD         TO 'U56;5'
*### EQUATE BCB.SEND.MD            TO 'U56;6'
*### EQUATE BCB.SEND.WS.MD         TO 'U56;7'
*### EQUATE BCB.GET.CMD.MD         TO 'U56;8'
*### EQUATE BCB.GET.DATA.MD        TO 'U56;9'
*### EQUATE BCB.GET.DATA.WS.MD     TO 'U56;10'
*### EQUATE BCB.WRITE.DATA.MD      TO 'U56;11'
*### EQUATE BCB.WRITE.DATA.WS.MD   TO 'U56;12'
*### EQUATE BCB.OPEN.FILE.MD       TO 'U56;13'
*### EQUATE BCB.READ.ITEM.MD       TO 'U56;14'
*### EQUATE BCB.READ.ITEM.FLG.MD   TO 'U56;15'
*### EQUATE BCB.GET.MD             TO 'U56;16'
*### EQUATE BCB.PRINT.MD           TO 'U56;17'
*### EQUATE PRINT.MD               TO 'U56;18'
*### EQUATE GET.FRM.MD             TO 'U56;19'
*### EQUATE VIR.PEEK.MD            TO 'U56;20'
*### EQUATE VIR.POKE.MD            TO 'U56;21'
*### EQUATE PEEK.MD                TO 'U56;22'
*### EQUATE POKE.MD                TO 'U56;23'
*### EQUATE GET.GDTR.MD            TO 'U56;24'
*### EQUATE FIND.BYTE.MD           TO 'U56;25'
*### EQUATE FARCALL.MD             TO 'U56;26'
*### EQUATE LOCK.FRAME.MD          TO 'U56;27'
*### EQUATE INIT.MD                TO 'U56;28'
*### EQUATE GET2.MD                TO 'U56;29'
*### EQUATE P64.MEM.MD             TO 'U4B'
*### EQUATE P64.PEEK.MD            TO 'U4C'
*### EQUATE FRM.SIZE               TO 4096
*### #END
*### #IF AP|APPRO
*### EQUATE CALL.DRIVER.MD         TO 'U$piclan.user.exits;1'
*### EQUATE GET.MD                 TO 'U$piclan.user.exits;2'
*### EQUATE RQM.MD                 TO 'U$piclan.user.exits;3'
*### EQUATE BCB.ALLOC.MD           TO 'U$piclan.user.exits;4'
*### EQUATE BCB.DEALLOC.MD         TO 'U$piclan.user.exits;5'
*### EQUATE BCB.SEND.MD            TO 'U$piclan.user.exits;6'
*### EQUATE BCB.SEND.WS.MD         TO 'U$piclan.user.exits;7'
*### EQUATE BCB.GET.CMD.MD         TO 'U$piclan.user.exits;8'
*### EQUATE BCB.GET.DATA.MD        TO 'U$piclan.user.exits;9'
*### EQUATE BCB.GET.DATA.WS.MD     TO 'U$piclan.user.exits;10'
*### EQUATE BCB.WRITE.DATA.MD      TO 'U$piclan.user.exits;11'
*### EQUATE BCB.WRITE.DATA.WS.MD   TO 'U$piclan.user.exits;12'
*### EQUATE BCB.OPEN.FILE.MD       TO 'U$piclan.user.exits;13'
*### EQUATE BCB.READ.ITEM.MD       TO 'U$piclan.user.exits;14'
*### EQUATE BCB.READ.ITEM.FLG.MD   TO 'U$piclan.user.exits;15'
*### EQUATE BCB.GET.MD             TO 'U$piclan.user.exits;16'
*### EQUATE BCB.PRINT.MD           TO 'U$piclan.user.exits;17'
*### EQUATE PRINT.MD               TO 'U$piclan.user.exits;18'
*### EQUATE GET.FRM.MD             TO 'U$piclan.user.exits;19'
*### EQUATE VIR.PEEK.MD            TO 'U$piclan.user.exits;20'
*### EQUATE VIR.POKE.MD            TO 'U$piclan.user.exits;21'
*### EQUATE PEEK.MD                TO 'U$piclan.user.exits;22'
*### EQUATE POKE.MD                TO 'U$piclan.user.exits;23'
*### EQUATE GET.GDTR.MD            TO 'U$piclan.user.exits;24'
*### EQUATE FIND.BYTE.MD           TO 'U$piclan.user.exits;25'
*### EQUATE FARCALL.MD             TO 'U$piclan.user.exits;26'
*### EQUATE LOCK.FRAME.MD          TO 'U$piclan.user.exits;27'
*### EQUATE INIT.MD                TO 'U$piclan.user.exits;28'
*### EQUATE GET2.MD                TO 'U$piclan.user.exits;29'
*### EQUATE INITNEW.MD             TO 'U$piclan.user.exits;30'
*### #END
*$PC ON
*========================================*
*=== PLW-MAIN 15 ===*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*$PC OFF
*
EQUATE FN.INIT                TO '0000'
EQUATE FN.CONFIG              TO '0001'
EQUATE FN.UNINIT              TO '0002'
EQUATE FN.ALLOC.PLCB          TO '0003'
EQUATE FN.DEALLOC.PLCB        TO '0004'
EQUATE FN.FIND.SERVERS        TO '0005'
EQUATE FN.GET.SERVER          TO '0006'
EQUATE FN.PLCB.STATUS         TO '0007'
EQUATE FN.OPEN                TO '0008'
EQUATE FN.CLOSE               TO '0009'
EQUATE FN.KILL.SESSION        TO '000A'
EQUATE FN.READ.AVAIL          TO '000B'
EQUATE FN.READ                TO '000C'
EQUATE FN.WRITE.AVAIL         TO '000D'
EQUATE FN.WRITE               TO '000E'
EQUATE FN.SEND.BREAK          TO '000F'
EQUATE FN.GET.CAP             TO '0010'
EQUATE FN.PUT.CAP             TO '0011'
EQUATE FN.SERVER.INIT         TO '0012'
EQUATE FN.SERVER.GETQ         TO '0013'
EQUATE FN.SERVER.KICK         TO '0014'
EQUATE FN.INIT.1              TO '0015'
EQUATE FN.INIT.2              TO '0016'
EQUATE FN.INIT.3              TO '0017'
EQUATE FN.ACTIVATE.PORT       TO '0018'
EQUATE FN.SERVER.PORT.INIT    TO '0019'
EQUATE FN.INIT.RANDOM.SN      TO '001A'
*### #IF UPBOARD
*### EQUATE FN.UPBOARD.PORT.PICLAN TO '001B'
*### EQUATE FN.FIND.DRIVER         TO 'FFFF'
*### #END
*### #IF AP|APPRO
*### EQUATE FN.AP.COMATOSE.SERVER  TO '001C'
*### #END
EQUATE FN.LOGOFF.COMPLETE     TO '001D'
EQUATE FN.PLTERM.KICK         TO '001E'
EQUATE FN.LOG.READ            TO '001F'
EQUATE FN.INIT.NEW.1          TO '0020'
EQUATE FN.INIT.NEW.2          TO '0021'
EQUATE FN.INIT.NEW.3          TO '0022'
*
EQUATE FNR.INIT                TO '00000000'
EQUATE FNR.CONFIG              TO '00010000'
EQUATE FNR.UNINIT              TO '00020000'
EQUATE FNR.ALLOC.PLCB          TO '00030000'
EQUATE FNR.DEALLOC.PLCB        TO '00040000'
EQUATE FNR.FIND.SERVERS        TO '00050000'
EQUATE FNR.GET.SERVER          TO '00060000'
EQUATE FNR.PLCB.STATUS         TO '00070000'
EQUATE FNR.OPEN                TO '00080000'
EQUATE FNR.CLOSE               TO '00090000'
EQUATE FNR.KILL.SESSION        TO '000A0000'
EQUATE FNR.READ.AVAIL          TO '000B0000'
EQUATE FNR.READ                TO '000C0000'
EQUATE FNR.WRITE.AVAIL         TO '000D0000'
EQUATE FNR.WRITE               TO '000E0000'
EQUATE FNR.SEND.BREAK          TO '000F0000'
EQUATE FNR.GET.CAP             TO '00100000'
EQUATE FNR.PUT.CAP             TO '00110000'
EQUATE FNR.SERVER.INIT         TO '00120000'
EQUATE FNR.SERVER.GETQ         TO '00130000'
EQUATE FNR.SERVER.KICK         TO '00140000'
EQUATE FNR.INIT.1              TO '00150000'
EQUATE FNR.INIT.2              TO '00160000'
EQUATE FNR.INIT.3              TO '00170000'
EQUATE FNR.ACTIVATE.PORT       TO '00180000'
EQUATE FNR.SERVER.PORT.INIT    TO '00190000'
EQUATE FNR.INIT.RANDOM.SN      TO '001A0000'
*### #IF UPBOARD
*### EQUATE FNR.UPBOARD.PORT.PICLAN TO '001B0000'
*### EQUATE FNR.FIND.DRIVER         TO 'FFFF0000'
*### #END
*### #IF AP|APPRO
*### EQUATE FNR.AP.COMATOSE.SERVER  TO '001C0000'
*### #END
EQUATE FNR.LOGOFF.COMPLETE     TO '001D0000'
EQUATE FNR.PLTERM.KICK         TO '001E0000'
EQUATE FNR.LOG.READ            TO '001F0000'
EQUATE FNR.INIT.NEW.1          TO '00200000'
EQUATE FNR.INIT.NEW.2          TO '00210000'
EQUATE FNR.INIT.NEW.3          TO '00220000'
*
*
*
*
EQUATE TP.AVAIL               TO 0
EQUATE TP.TERM.HOST           TO 1
EQUATE TP.TERM.NODE           TO 2
EQUATE TP.POLL                TO 7
EQUATE TP.XFR.HOST            TO 10
EQUATE TP.XFR.NODE            TO 11
*
EQUATE TP.ARP                 TO 64
EQUATE TP.IP.RECV.BUSY        TO 65
EQUATE TP.IP.RECV             TO 66
EQUATE TP.IP.XMIT             TO 67
EQUATE TP.UDP                 TO 68
EQUATE TP.TCP                 TO 69
*
EQUATE TP.LOGOFF              TO 254
*
EQUATE ERR.BAD.DRIVER.CALL    TO 1
*
EQUATE IPX.SOCKET.NO          TO '80E1'
*
EQUATE SIZEOF.VIR.BUF         TO 8192
*
EQUATE PLCB.STATUS.KICK       TO 128
*
EQUATE CAPABILITY.TERM        TO '01'
EQUATE CAPABILITY.XFR         TO '02'
EQUATE CAPABILITY.PRINT       TO '04'
EQUATE CAPABILITY.XFR.PRINT   TO '06'
EQUATE CAPABILITY.DSG         TO '10'
EQUATE CAPABILITY.DOS.FILE    TO '20'
*
*
*### #IF 0
*### #IF R83
*### EQUATE MAX.READ.LEN           TO 450
*### EQUATE MAX.WRITE.LEN          TO 450
*### EQUATE MAX.WRITE.LEN2         TO 900
*### #END
*### #IF AP
*### EQUATE MAX.READ.LEN           TO 950
*### EQUATE MAX.WRITE.LEN          TO 950
*### EQUATE MAX.WRITE.LEN2         TO 1900
*### #END
*### #IF UPBOARD|GA|PICK64|SEQ|SEQ32|P6432|ADDS|APPRO
*### EQUATE MAX.READ.LEN           TO 1950
*### EQUATE MAX.WRITE.LEN          TO 1950
*### EQUATE MAX.WRITE.LEN2         TO 3900
*### #END
*### #IF D3NT|MVBASE|UVNT|UDNT
*### EQUATE MAX.READ.LEN           TO 32000
*### EQUATE MAX.WRITE.LEN          TO 32000
*### EQUATE MAX.WRITE.LEN2         TO 16000
*### #END
*### #IF UNIX
*### EQUATE MAX.READ.LEN           TO 32000
*### EQUATE MAX.WRITE.LEN          TO 32000
*### EQUATE MAX.WRITE.LEN2         TO 16000
*### #END
*### #END
*
*### #IF R83|AP|PICK64|SEQ|SEQ32|P6432
*### EQUATE SIZEOF.PIB.IBUF        TO 128
*### #END
*### #IF GA
*### EQUATE SIZEOF.PIB.IBUF        TO 1024
*### #END
*
*#IF IP1
*### #IF APPRO|ADDS|SEQ32|P6432
*### EQUATE SIZEOF.PLCB            TO 427
*### #END
*### #IF MVBASE|D3|UV|UD
*### EQUATE SIZEOF.PLCB            TO 1000
*### #END
*#END
*### #IFN IP1
*### #IF R83|AP
*### EQUATE SIZEOF.PLCB            TO 224
*### #END
*### #IF PICK64|SEQ
*### EQUATE SIZEOF.PLCB            TO 246
*### #END
*### #IF UPBOARD
*### EQUATE SIZEOF.PLCB            TO 240
*### #END
*### #IF APPRO|ADDS|SEQ32|P6432
*### EQUATE SIZEOF.PLCB            TO 244
*### #END
*### #IF GA
*### EQUATE SIZEOF.PLCB            TO 238
*### #END
*### #END
*
*### #IF APPRO
*### EQUATE SIZEOF.QCB             TO 160
*### #END
*
*### #IF R83|AP
*### EQUATE SIZEOF.BUF             TO 130
*### #END
*### #IF GA|PICK64|SEQ|SEQ32|P6432|APPRO|ADDS|MVBASE|D3|UV|UD
*### EQUATE SIZEOF.BUF             TO 132
*### #END
*
*#IF IP1
EQUATE A.READ        TO 1
EQUATE A.WRITE       TO 2
EQUATE A.CONNECT     TO 4
EQUATE A.CLOSED      TO 8
EQUATE A.CLOSING     TO 16
*#END
*$PC ON
*========================================*
*=== PLW-MAIN 16 ===*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*$PC OFF
COMMON PLIP$FILES(10)
*
EQUATE PLIP$CTRL.FD        TO PLIP$FILES(1)
EQUATE PLIP$RES.FD         TO PLIP$FILES(2)
EQUATE PLIP$DNS.CACHE.FD   TO PLIP$FILES(3)
EQUATE PLIP$ERROR.LOG.FD   TO PLIP$FILES(4)
*
COMMON PLIP$VARS(100)
*$PC ON
*
*=== INCL..1.5 38 ===*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*$PC OFF
EQUATE PLIP$MYIPS             TO PLIP$VARS(1)
EQUATE PLIP$MASK              TO PLIP$VARS(2)
EQUATE PLIP$ROUTES            TO PLIP$VARS(3)
EQUATE PLIP$DNS               TO PLIP$VARS(4)
EQUATE PLIP$DNS.WAIT          TO PLIP$VARS(5)
EQUATE PLIP$DNS.RETRY         TO PLIP$VARS(6)
EQUATE PLIP$DNS.TIMEOUT       TO PLIP$VARS(7)
EQUATE PLIP$DNS.CLEANUP       TO PLIP$VARS(8)
EQUATE BCB.SEND.HEX.MD        TO PLIP$VARS(9)
EQUATE PLIP$CONN              TO PLIP$VARS(10)
EQUATE PLIP$CONN.CLEANUP      TO PLIP$VARS(11)
*
*
*
*
EQUATE PLIP$LOCAL.HOST.NAME   TO PLIP$VARS(15)
EQUATE PLIP$MAIL.TIMEOUT      TO PLIP$VARS(16)
EQUATE PLIP$MAIL.HOST         TO PLIP$VARS(17)
EQUATE PLIP$DNS.TIMEOUT.TTL   TO PLIP$VARS(18)
EQUATE PLIP$DNS.FAILURE.TTL   TO PLIP$VARS(19)
EQUATE PLIP$WWW.LOG.OPT       TO PLIP$VARS(20)
EQUATE PLIP$WWW.TIMEOUT       TO PLIP$VARS(21)
EQUATE PLIP$SUP.PORT          TO PLIP$VARS(22)
EQUATE PLIP$PROC.PORTS        TO PLIP$VARS(23)
EQUATE PLIP$SUP.POLL          TO PLIP$VARS(24)
EQUATE PLIP$SUP.TIMEOUT       TO PLIP$VARS(25)
*
EQUATE PLIP$TELNET.PORTS      TO PLIP$VARS(27)
EQUATE PLIP$MAIL.CONN.OUT     TO PLIP$VARS(28)
EQUATE PLIP$MAIL.LONG.TIMEOUT TO PLIP$VARS(29)
EQUATE PLIP$MAIL.RETRY.TIME   TO PLIP$VARS(30)
EQUATE PLIP$MAIL.MAX.TIME     TO PLIP$VARS(31)
EQUATE PLIP$ACCT.PSWD         TO PLIP$VARS(32)
EQUATE PLIP$MAIL.WARN.TIME    TO PLIP$VARS(33)
EQUATE PLIP$MAIL.WARN.MAX     TO PLIP$VARS(34)
EQUATE PLIP$MAIL.MAX.HOPS     TO PLIP$VARS(35)
EQUATE PLIP$TELNET.OPT.STR    TO PLIP$VARS(36)
EQUATE PLIP$WWW.CACHE.TIMEOUT TO PLIP$VARS(37)
EQUATE PLIP$INIT.SUBS         TO PLIP$VARS(38)
EQUATE PLIP$MAIL.DEL.SEND     TO PLIP$VARS(39)
*
*### #IF MVBASE
*### EQUATE PLIP$CALL.FAST.EP      TO PLIP$VARS(40)
*### EQUATE PLIP$CALL.FAST0.EP     TO PLIP$VARS(41)
*### #END
*### #IF UDNT
*### EQUATE PlipCall                TO PLIP$VARS(40)
*### #END
EQUATE PLIP$MAX.HTTP.HDR      TO PLIP$VARS(42)
EQUATE PLIP$RPC.NAME          TO PLIP$VARS(43)
EQUATE PLIP$RPC.KEY           TO PLIP$VARS(44)
EQUATE PLIP$NOKEEPALIVE       TO PLIP$VARS(45)
*
EQUATE PLIP$FIX.WRITE         TO PLIP$VARS(50)
EQUATE PLIP$MAX.IO.LEN        TO PLIP$VARS(51)
EQUATE PLIP$RESTART.CTR       TO PLIP$VARS(52)
*
EQUATE PLIP$TZ                TO PLIP$VARS(60)
EQUATE PLIP$TZ.ZONE           TO PLIP$VARS(61)
*
EQUATE PLIP$COMM.ADDR         TO PLIP$VARS(70)
EQUATE PLIP$COMM.PATH         TO PLIP$VARS(71)
EQUATE PLIP$COMM.TP           TO PLIP$VARS(72)
EQUATE PLIP$HOST.TP           TO PLIP$VARS(73)
*
EQUATE PLIP$AUTH              TO PLIP$VARS(81)
EQUATE PLIP$WEBBW             TO PLIP$VARS(82)
EQUATE PLIP$WEBBWAUTH         TO PLIP$VARS(83)
EQUATE PLIP$WEBBWSEC          TO PLIP$VARS(84)
EQUATE PLIP$OTHBW             TO PLIP$VARS(85)
EQUATE PLIP$OTHBWAUTH         TO PLIP$VARS(86)
EQUATE PLIP$OTHBWSEC          TO PLIP$VARS(87)
EQUATE PLIP$PICLANIPSN        TO PLIP$VARS(88)
EQUATE PLIP$AUTHDATE          TO PLIP$VARS(89)
EQUATE PLIP$TELNETLIC         TO PLIP$VARS(90)
EQUATE PLIP$POP3LIC           TO PLIP$VARS(91)
EQUATE PLIP$AUTHBITS          TO PLIP$VARS(92)
EQUATE PLIP$POP3DOMAIN        TO PLIP$VARS(93)
EQUATE PLIP$PLZ.CLEANUP.FLG   TO PLIP$VARS(94)
*
*
*
EQUATE PLIP$$MYIPS             TO 1
EQUATE PLIP$$MASK              TO 2
EQUATE PLIP$$ROUTES            TO 3
EQUATE PLIP$$DNS               TO 4
EQUATE PLIP$$DNS.WAIT          TO 5
EQUATE PLIP$$DNS.RETRY         TO 6
EQUATE PLIP$$DNS.TIMEOUT       TO 7
EQUATE PLIP$$DNS.CLEANUP       TO 8
*
EQUATE PLIP$$CONN              TO 10
EQUATE PLIP$$CONN.CLEANUP      TO 11
*
*
*
*
EQUATE PLIP$$LOCAL.HOST.NAME   TO 15
EQUATE PLIP$$MAIL.TIMEOUT      TO 16
EQUATE PLIP$$MAIL.HOST         TO 17
EQUATE PLIP$$DNS.TIMEOUT.TTL   TO 18
EQUATE PLIP$$DNS.FAILURE.TTL   TO 19
EQUATE PLIP$$WWW.LOG.OPT       TO 20
EQUATE PLIP$$WWW.TIMEOUT       TO 21
EQUATE PLIP$$SUP.PORT          TO 22
EQUATE PLIP$$PROC.PORTS        TO 23
EQUATE PLIP$$SUP.POLL          TO 24
EQUATE PLIP$$SUP.TIMEOUT       TO 25
*
EQUATE PLIP$$TELNET.PORTS      TO 27
EQUATE PLIP$$MAIL.CONN.OUT     TO 28
EQUATE PLIP$$MAIL.LONG.TIMEOUT TO 29
EQUATE PLIP$$MAIL.RETRY.TIME   TO 30
EQUATE PLIP$$MAIL.MAX.TIME     TO 31
EQUATE PLIP$$ACCT.PSWD         TO 32
EQUATE PLIP$$MAIL.WARN.TIME    TO 33
EQUATE PLIP$$MAIL.WARN.MAX     TO 34
EQUATE PLIP$$MAIL.MAX.HOPS     TO 35
EQUATE PLIP$$TELNET.OPT.STR    TO 36
EQUATE PLIP$$WWW.CACHE.TIMEOUT TO 37
EQUATE PLIP$$INIT.SUBS         TO 38
EQUATE PLIP$$MAIL.DEL.SEND     TO 39
*
EQUATE PLIP$$MAX.HTTP.HDR      TO 42
EQUATE PLIP$$RPC.NAME          TO 43
EQUATE PLIP$$RPC.KEY           TO 44
EQUATE PLIP$$NOKEEPALIVE       TO 45
EQUATE PLIP$$FIX.WRITE         TO 50
EQUATE PLIP$$MAX.IO.LEN        TO 51
EQUATE PLIP$$RESTART.CTR       TO 52
*
EQUATE PLIP$$TZ                TO 60
EQUATE PLIP$$TZ.ZONE           TO 61
*
EQUATE PLIP$$COMM.ADDR         TO 70
EQUATE PLIP$$COMM.PATH         TO 71
EQUATE PLIP$$COMM.TP           TO 72
EQUATE PLIP$$HOST.TP            TO 73
*
EQUATE PLIP$$AUTH              TO 81
EQUATE PLIP$$WEBBW             TO 82
EQUATE PLIP$$WEBBWAUTH         TO 83
EQUATE PLIP$$WEBBWSEC          TO 84
EQUATE PLIP$$OTHBW             TO 85
EQUATE PLIP$$OTHBWAUTH         TO 86
EQUATE PLIP$$OTHBWSEC          TO 87
EQUATE PLIP$$PICLANIPSN        TO 88
EQUATE PLIP$$AUTHDATE          TO 89
EQUATE PLIP$$TELNETLIC         TO 90
EQUATE PLIP$$POP3LIC           TO 91
EQUATE PLIP$$AUTHBITS          TO 92
EQUATE PLIP$$POP3DOMAIN        TO 93
EQUATE PLIP$$PLZ.CLEANUP.FLG   TO 94
*$PC ON
*========================================*
*========================================*
*=== PLW-MAIN 17 ===*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*=== INCL..1.7 27 ===*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*$PC OFF
*
EQUATE ST.TP.HTTP.LISTEN      TO 1
EQUATE ST.TP.HTTP             TO 2
EQUATE ST.TP.SMTP.SEND        TO 3
EQUATE ST.TP.SMTP.LISTEN      TO 4
EQUATE ST.TP.SMTP.RECV        TO 5
EQUATE ST.TP.TELNET.LISTEN    TO 6
EQUATE ST.TP.TELNET           TO 7
EQUATE ST.TP.POP3.LISTEN      TO 8
EQUATE ST.TP.POP3             TO 9
*
*
EQUATE PNO.CHK                TO 100000
EQUATE MSG.ACTIVITY           TO 0
EQUATE MSG.TIMEOUT            TO 1
EQUATE MSG.CONFIG             TO 2
EQUATE MSG.EXITFLG            TO 3
EQUATE MSG.MAILPOLL           TO 4
EQUATE MSG.AUTH               TO 5
EQUATE MSG.TELNET.TIMEOUT     TO 6
EQUATE MSG.SUB.CLEANUP        TO 7
EQUATE MSG.LONG.TIMEOUT       TO 8
*
*
EQUATE MSG.CONN.CLEANUP       TO 11
EQUATE MSG.TELNET.PING        TO 12
EQUATE MSG.BW                 TO 13
EQUATE MSG.EXT                TO 15
*
EQUATE EVENT.OPEN             TO 1
EQUATE EVENT.ACTIVITY         TO 2
EQUATE EVENT.TELNET           TO 3
*
EQUATE PNO.MAIL0              TO 1000000
EQUATE MSG.MAIL               TO 6
*
*$PC ON
*========================================*
*
*$PC OFF
*
COMMON PLS$VARS(50)
*
EQUATE PL$STATE.FD         TO PLS$VARS(1)
EQUATE PL$CONN.FD          TO PLS$VARS(2)
EQUATE PL$CTRL.FD          TO PLS$VARS(3)
EQUATE PL$DATA.FD          TO PLS$VARS(4)
EQUATE PL$MAIL.BOX.FD      TO PLS$VARS(5)
EQUATE PL$PROC.FD          TO PLS$VARS(6)
EQUATE PL$DSG.HANDLES      TO PLS$VARS(7)
EQUATE PL$FILE.LIST        TO PLS$VARS(8)
EQUATE PL$CFG              TO PLS$VARS(9)
EQUATE PL$LOG.FD           TO PLS$VARS(10)
EQUATE PL$V.PORT.NO        TO PLS$VARS(11)
EQUATE PL$LOGFNAME.FD      TO PLS$VARS(12)
EQUATE PL$LOGIP.FD         TO PLS$VARS(13)
EQUATE PL$MD.FD            TO PLS$VARS(14)
EQUATE PL$MAIL.FD          TO PLS$VARS(15)
*
EQUATE PL$BW.LOG.FD        TO PLS$VARS(17)
EQUATE PL$MAIL.DATA.FD     TO PLS$VARS(18)
EQUATE PL$MAIL.ROUTE.FD    TO PLS$VARS(19)
EQUATE PL$RESTART.FLG      TO PLS$VARS(20)
EQUATE PL$LISTEN.LST       TO PLS$VARS(21)
EQUATE PL$ILOCK.FD         TO PLS$VARS(22)
*
EQUATE PL$PGCTRL.FD        TO PLS$VARS(23)
EQUATE PL$PGCACHE.FD       TO PLS$VARS(24)
EQUATE PL$PGDATA.FD        TO PLS$VARS(25)
EQUATE PL$PGBASIC.FD       TO PLS$VARS(26)
EQUATE PL$PGNAME           TO PLS$VARS(27)
EQUATE PL$PRSTR            TO PLS$VARS(28)
EQUATE PL$OFFLINE          TO PLS$VARS(29)
EQUATE PL$CNLOCKCNT        TO PLS$VARS(30)
EQUATE PL$CRLFCRLF         TO PLS$VARS(31)
EQUATE PL$LFLF             TO PLS$VARS(32)
*
EQUATE PL$WORK.FD          TO PLS$VARS(33)
EQUATE PL$BASXREF.FD       TO PLS$VARS(34)
EQUATE PL$LOCK.FD          TO PLS$VARS(35)
EQUATE PL$APP.FD           TO PLS$VARS(36)
*
EQUATE PL$TELNET.LOG.FD    TO PLS$VARS(37)
EQUATE PL$LOGUSAGE.FD      TO PLS$VARS(38)
*
EQUATE PL$EXTRAHTTP        TO PLS$VARS(40)
EQUATE PL$PBHDR            TO PLS$VARS(41)
EQUATE PL$TELNET.LST       TO PLS$VARS(42)
*
EQUATE PL$RPC.FD           TO PLS$VARS(43)
EQUATE PL$RPC.SUBS.FD      TO PLS$VARS(44)
EQUATE PL$RPC.RESP.FD      TO PLS$VARS(45)
*
EQUATE RESX                TO PLS$VARS(50)
*
COMMON PLW$VARS(20)
*
EQUATE PLW$DIR             TO PLW$VARS(1)
EQUATE PLW$TELNET.LISTEN   TO PLW$VARS(2)
EQUATE PLW$SMTP.LISTEN     TO PLW$VARS(3)
EQUATE PLW$POP3.LISTEN     TO PLW$VARS(4)
EQUATE PLW$LEVEL           TO PLW$VARS(9)
*
EQUATE PLW$EXT             TO PLW$VARS(10)
EQUATE PLW$EXT.PARM        TO PLW$VARS(11)
*
COMMON PLTELNET$VARS(20)
*
EQUATE PLTELNET$LST        TO PLTELNET$VARS(1)
*
COMMON ST$ARRAY(50)
*
EQUATE ST$CFG              TO ST$ARRAY(1)
EQUATE ST$PLCB             TO ST$ARRAY(2)
EQUATE ST$OWN              TO ST$ARRAY(3)
EQUATE ST$OWN.ATTR         TO 3
EQUATE ST$TP               TO ST$ARRAY(4)
EQUATE ST$OBUF.BCB         TO ST$ARRAY(5)
EQUATE ST$OBUF.CNT         TO ST$ARRAY(6)
EQUATE ST$IBUF             TO ST$ARRAY(7)
EQUATE ST$OBUF             TO ST$ARRAY(8)
EQUATE ST$CLOSESENT        TO ST$ARRAY(9)
*
*
*
EQUATE ST$IP               TO ST$ARRAY(10)
EQUATE ST$KILL.TIME        TO ST$ARRAY(11)
EQUATE ST$CMD              TO ST$ARRAY(12)
EQUATE ST$HTTP.HDR         TO ST$ARRAY(13)
EQUATE ST$HTTP.VAL         TO ST$ARRAY(14)
EQUATE ST$POST.LEN         TO ST$ARRAY(15)
EQUATE ST$KEEP.ALIVE       TO ST$ARRAY(16)
EQUATE ST$RIP              TO ST$ARRAY(17)
EQUATE ST$LIP              TO ST$ARRAY(18)
EQUATE ST$POST.DATA        TO ST$ARRAY(19)
EQUATE ST$DATA.LEN         TO ST$ARRAY(20)
*
*
*
EQUATE ST$MAIL.ID          TO ST$ARRAY(10)
EQUATE ST$MAIL.MSG.BODY    TO ST$ARRAY(11)
EQUATE ST$MAIL.ST          TO ST$ARRAY(12)
EQUATE ST$MAIL.FR.ADDR     TO ST$ARRAY(13)
EQUATE ST$MAIL.TO.ADDR     TO ST$ARRAY(14)
EQUATE ST$MAIL.MBOX.LST    TO ST$ARRAY(15)
EQUATE ST$MAIL.FWD.HOST    TO ST$ARRAY(16)
EQUATE ST$MAIL.FWD.IP      TO ST$ARRAY(17)
EQUATE ST$MAIL.SUBST       TO ST$ARRAY(18)
EQUATE ST$MAIL.IBUF        TO ST$ARRAY(19)
EQUATE ST$MAIL.OBUF        TO ST$ARRAY(20)
EQUATE ST$MAIL.CMD         TO ST$ARRAY(21)
EQUATE ST$MAIL.ERROR       TO ST$ARRAY(22)
EQUATE ST$MAIL.MBOX.ERRS   TO ST$ARRAY(23)
*
*
*
EQUATE ST$SMTPR.IP         TO ST$ARRAY(10)
EQUATE ST$SMTPR.ST         TO ST$ARRAY(11)
EQUATE ST$SMTPR.HELO       TO ST$ARRAY(12)
EQUATE ST$SMTPR.FROM.LONG  TO ST$ARRAY(13)
EQUATE ST$SMTPR.FROM       TO ST$ARRAY(14)
EQUATE ST$SMTPR.TO.LONG    TO ST$ARRAY(15)
EQUATE ST$SMTPR.TO         TO ST$ARRAY(16)
EQUATE ST$SMTPR.DATA       TO ST$ARRAY(17)
EQUATE ST$SMTPR.RIP        TO ST$ARRAY(18)
EQUATE ST$SMTPR.FROM.FLG   TO ST$ARRAY(19)
*
*
*
EQUATE ST$TELNET.RULES     TO ST$ARRAY(10)
EQUATE ST$TELNET.PORT      TO ST$ARRAY(11)
EQUATE ST$TELNET.OPTIONS   TO ST$ARRAY(12)
EQUATE ST$TELNET.IP        TO ST$ARRAY(13)
*
*
*
EQUATE ST$POP3.IP          TO ST$ARRAY(10)
EQUATE ST$POP3.ST          TO ST$ARRAY(11)
EQUATE ST$POP3.USER        TO ST$ARRAY(12)
EQUATE ST$POP3.PSWD        TO ST$ARRAY(13)
EQUATE ST$POP3.MSGS        TO ST$ARRAY(14)
EQUATE ST$POP3.MSGS.SIZES  TO ST$ARRAY(15)
EQUATE ST$POP3.DEL.MSGS    TO ST$ARRAY(16)
EQUATE ST$POP3.MSG.CNT     TO ST$ARRAY(17)
EQUATE ST$POP3.TOT.SIZE    TO ST$ARRAY(18)
*
*
*
*
COMMON F$ARRAY(50)
*
COMMON CFG$ARRAY(6)
*
EQUATE CFG$IP              TO CFG$ARRAY(1)
EQUATE CFG$PATH            TO CFG$ARRAY(2)
EQUATE CFG$TP              TO CFG$ARRAY(3)
EQUATE CFG$PARM            TO CFG$ARRAY(4)
EQUATE CFG$OPT             TO CFG$ARRAY(5)
EQUATE CFG$NAME            TO CFG$ARRAY(6)
*
COMMON NCFG$ARRAY(5)
*
EQUATE NCFG$IP             TO NCFG$ARRAY(1)
EQUATE NCFG$PATH           TO NCFG$ARRAY(2)
EQUATE NCFG$TP             TO NCFG$ARRAY(3)
EQUATE NCFG$PARM           TO NCFG$ARRAY(4)
EQUATE NCFG$OPT            TO NCFG$ARRAY(5)
*
COMMON DATA$ARRAY(10)
*
EQUATE DATA$TP             TO DATA$ARRAY(1)
EQUATE DATA$FNAME          TO DATA$ARRAY(2)
EQUATE DATA$FNUM           TO DATA$ARRAY(3)
EQUATE DATA$DSGPLCB        TO DATA$ARRAY(4)
EQUATE DATA$DSGPATH        TO DATA$ARRAY(5)
EQUATE DATA$HOSTPATH       TO DATA$ARRAY(5)
EQUATE DATA$OPT            TO DATA$ARRAY(6)
EQUATE DATA$PREFIX         TO DATA$ARRAY(7)
*
COMMON CTRL$ARRAY(10)
*
EQUATE CTRL$TP             TO CTRL$ARRAY(1)
EQUATE CTRL$MIME           TO CTRL$ARRAY(2)
EQUATE CTRL$TM             TO CTRL$ARRAY(3)
EQUATE CTRL$TMS            TO CTRL$ARRAY(4)
EQUATE CTRL$SUB            TO CTRL$ARRAY(5)
EQUATE CTRL$HDR            TO CTRL$ARRAY(6)
EQUATE CTRL$NMHDR          TO CTRL$ARRAY(7)
EQUATE CTRL$HEXFLG         TO CTRL$ARRAY(8)
EQUATE CTRL$CACHETM        TO CTRL$ARRAY(9)
EQUATE CTRL$CACHETM$N      TO 9
*
COMMON PR$ARRAY(10)
*
EQUATE PR$NOW              TO PR$ARRAY(1)
EQUATE PR$PLCB             TO PR$ARRAY(2)
EQUATE PR$STATE            TO PR$ARRAY(3)
*
COMMON VAR$VALS(500)
COMMON VAR$NAMES
COMMON VAR$CNT
*$PC ON
*========================================*
*=== PLW-MAIN 18 ===*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
PROMPT ':'
*
C0$BTREE = 1
C1$BTREE = ''
C2$BTREE = ''
*
CRLF = CR : LF
*
*#IFN MVBASE|D3|UV|UD|UN|JB
*=== INCL..1.9 34 ===*
OPEN 'PL.BP,DATA' TO PL.DATA.FD ELSE 
CALL PLXX.STOP(201, 'PL.BP,DATA')
END
*========================================*
*#END
*### #IF MVBASE|D3|UV|UD|JB
*### OPEN 'PLIP.CTRL' TO PL.DATA.FD ELSE CALL PLXX.STOP(201,'PLIP.CTRL')
*### #END
*### #IF ADDS|APPRO|MVBASE|SEQ32|P6432
*### MATREAD CONFIG.ARRAY FROM PL.DATA.FD , 'CONFIG.ARRAY' ELSE STOP 'PL-99'
*### #END
*### #IF D3|UV|UD|JB
*### MAT CONFIG.ARRAY = ''
*### #END
*### #IF UVNT
*### S = STR(CHAR(0),80)
*### CALL $PlipInit(S)
*### IF S <> '' THEN
*### PRINT
*### PRINT 'Error initializing GCI_PLIP DLL:'
*### PRINT
*### PRINT '   ' : S
*### STOP
*### END
*### #END
*
*### #IF D3|UV|UD|UN|JB
*### CALL PLIP.FN.INIT
*### #END
*
*
*
*
PORT.NO = FIELD(OCONV( '', 'U50BB'), ' ',1)
*=== INCL..1.9 65 ===*
IF PORT.NO < 0 THEN 
PORT.NO = ( -1 * PORT.NO )
END
*========================================*
ACCT.NAME = FIELD(OCONV( '', 'U50BB'), ' ',2)
*
*### #IF AP|APPRO|D3
*### TCLREAD S
*### #END
*=== INCL..1.9 71 ===*
*
*
*
*
*
*
*
*
*
*
*### #IF R83
*### OPEN 'PL.BP,DATA' TO WORK.FD ELSE CALL PLXX.STOP(201,'PL.BP,DATA')
*### READ SENT FROM WORK.FD , 'SENTENCE*' : PORT.NO ELSE SENTENCE = ''
*### SENT = INSERT(SENT,1,1,0,'.')
*### I1 = DCOUNT(SENT<1>,VM)
*### FOR I = I1 TO 1 STEP -1
*### IF SENT<1,I> = '' THEN
*### SENT = DELETE(SENT,1,I,0)
*### END
*### NEXT I
*### #END
*
*
S = SENTENCE()
*
*
*
*
*
*
*
O = FIELD(S, '(',2)
*### #IF UD
*### T = INDEX(S,' -',1)
*### IF T THEN S = S[1,T-1]
*### #END
S = TRIM(FIELD(S, '(',1))
SENT = ''
FOR I = 1 TO DCOUNT(S, ' ')
W = FIELD(S, ' ',I)
IF W # '' THEN
SENT<1,-1> = W
END
NEXT I
FOR I = 1 TO DCOUNT(O, ' ')
W = FIELD(O, ' ',I)
IF W # '' THEN
SENT<2,-1> = W
END
NEXT I
*#END
*========================================*
*
RESOURCE.LIST = ''
ERR = 0
RES = 0
*========================================*
*
*### #IF JB
*### E.FLG = ''
*### PRFIN = CHAR(0)
*### #END
*#IFN JB
E.FLG = '(E)'
PRFIN = ''
*#END
*
*### #IF D3UNIX
*### EXECUTE 'SET-CMEM 128 (Q'
*### #END
RELEASE
*
CALL PLIP.INIT.SUB
CALL PLIP.INIT.FASTCALL
*
EQUATE FINGER.PORT TO 79
EQUATE HTTP.PORT TO 80
*
EV.LIST = '1.2' : VM : '2.1' : VM : '2.3' : VM : '2.4' : VM : '2.5' : VM : '3.1' : VM : '3.3' : VM : '3.4' : VM : '3.5'
*
EQUATE SPINNER TO '|/-\'
*
*### #IF D3UNIX
*### OPEN 'ERRMSG' TO ERRMSG.FD ELSE CALL PLXX.STOP(201,'ERRMSG')
*### READ X FROM ERRMSG.FD , 'USER.BUILTIN' THEN
*### I1 = DCOUNT(X,AM)
*### FLG = NO
*### FOR I = 2 TO I1 UNTIL FLG
*### IF X<I,1> = 'PlipDll' THEN FLG = YES
*### NEXT I
*### IF NOT(FLG) THEN
*### X<-1> = 'PlipDll' : VM : '243'
*### END
*### END ELSE
*### X = ''
*### X<1> = 15
*### X<2> = 'PlipDll' : VM : '243'
*### END
*### WRITE X ON ERRMSG.FD, 'USER.BUILTIN'
*### #END
*
*### #IF D3NT
*### OPEN 'ERRMSG' TO ERRMSG.FD ELSE CALL PLXX.STOP(201,'ERRMSG')
*### X = ''
*### X<1> = '9'
*### X<2> = 'PlipDll' : VM : '1'
*### WRITE X ON ERRMSG.FD , 'PLIP.BUILTIN'
*### #END
*
BSS3 = STR(BS,3)
*
PL$CRLFCRLF = CR : LF : CR : LF
PL$LFLF = LF : LF
*
MAT DATA$ARRAY = ''
MAT PR$ARRAY = ''
MAT PLS$VARS = ''
*
*### #IF UV
*### PL_EXECUTE 'TERM ,32767'
*### HEADING "'N'"
*### #END
*
*
GOSUB 50500
*
RELEASE
*
PL$V.PORT.NO = ''
CALL PLW.INIT( 'RUN')
*
O.CFG = ''
GOSUB 92000
*
*=== PLW-MAIN 96 ===*
READU DUMMY FROM PL$LOCK.FD , 'V.PORT.NO*' : PL$V.PORT.NO ELSE
NULL
END
*========================================*
*
*### #IF JB
*### CALL PLS.GETEXT('RUN',CUR.EXT)
*### WRITE CUR.EXT ON PL$CTRL.FD , 'EXT*V.PORT.NO*' : PL$V.PORT.NO
*### #END
*
IF PLIP$INIT.SUBS <> '' THEN
*=== PLW-MAIN 104 ===*
S$ = 'Executing INIT subroutines ...'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
I1 = DCOUNT(PLIP$INIT.SUBS,VM)
FOR I = 1 TO I1
SUB.NAME = PLIP$INIT.SUBS<1,I>
*=== PLW-MAIN 108 ===*
PRINT '   ' : SUB.NAME : ' ...' :
IF NOT(PL$OFFLINE) THEN
PL$PRSTR = PL$PRSTR : '   ' : SUB.NAME : ' ...'
END
*========================================*
CALL @SUB.NAME
*=== PLW-MAIN 110 ===*
S$ = ''
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
NEXT I
*=== PLW-MAIN 112 ===*
S$ = ''
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
END
*
PRINT 'Running,  press <X> to exit ...'
PRINT ''
*
EXIT.FLG = NO
RESTART.FLG = NO
SPINNER.CNT = 1
RESTART.CTR = 0
*=== PLW-MAIN 122 ===*
FN$1 = DATE() * 86400 + INT(TIME()) + OCONV('TM.OFFSET','TPLIP.CTRL;X;;1')
LAST.IDLE.TM = FN$1
*========================================*
*=== PLW-MAIN 123 ===*
FN$1 = DATE() * 86400 + INT(TIME()) + OCONV('TM.OFFSET','TPLIP.CTRL;X;;1')
SLEEP.TM = FN$1
*========================================*
*
IF NOT(PL$V.PORT.NO) THEN
IF NOT(PL$RESTART.FLG) THEN
*=== PLW-MAIN 127 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00450000')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
*=== PLW-MAIN 128 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00490000':OCONV(0,'MCDX')'R%4':'0000':'0000')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
FN$1 = NOT(RES)
POP3LIC = OCONV(S$[15,4],'MCXD')
TELNETLIC = OCONV(S$[19,4],'MCXD')
END ELSE
FN$1 = 0
END
DUMMY = FN$1
*========================================*
IF POP3LIC THEN
*=== PLW-MAIN 130 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00430000':OCONV(-1,'MCDX')'R%4':OCONV(0,'MCDX')'R%4':OCONV(PNO.CHK,'MCDX')'R%8':OCONV(MSG.MAILPOLL,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
END
*=== PLW-MAIN 132 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00430000':OCONV(-1,'MCDX')'R%4':OCONV(0,'MCDX')'R%4':OCONV(PNO.CHK,'MCDX')'R%8':OCONV(MSG.AUTH,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
*=== PLW-MAIN 133 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00430000':OCONV(-1,'MCDX')'R%4':OCONV(0,'MCDX')'R%4':OCONV(PNO.CHK,'MCDX')'R%8':OCONV(MSG.SUB.CLEANUP,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
IF PLW$EXT <> '' THEN
*=== PLW-MAIN 135 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00430000':OCONV(-1,'MCDX')'R%4':OCONV(0,'MCDX')'R%4':OCONV(PNO.CHK,'MCDX')'R%8':OCONV(MSG.EXT,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
END
*=== PLW-MAIN 137 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00430000':OCONV(-1,'MCDX')'R%4':OCONV(0,'MCDX')'R%4':OCONV(PNO.CHK,'MCDX')'R%8':OCONV(MSG.BW,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
END
END
*
*=== PLW-MAIN 141 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00430000':OCONV(PL$V.PORT.NO,'MCDX')'R%4':OCONV(0,'MCDX')'R%4':OCONV(PNO.CHK,'MCDX')'R%8':OCONV(MSG.CONFIG,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
*=== PLW-MAIN 142 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00430000':OCONV(PL$V.PORT.NO,'MCDX')'R%4':OCONV(5,'MCDX')'R%4':OCONV(PNO.CHK,'MCDX')'R%8':OCONV(MSG.EXITFLG,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
*
*=== PLW-MAIN 144 ===*
FN$1 = DATE() * 86400 + INT(TIME()) + OCONV('TM.OFFSET','TPLIP.CTRL;X;;1')
LAST.EXIT.CHK = FN$1
*========================================*
*
LOOP
A.FLG = NO
D.FLG = NO
*=== PLW-MAIN 149 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00420000':OCONV(PL$V.PORT.NO,'MCDX')'R%4':'00000000':'0000':'0000':'0000')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END ELSE
P.NO = OCONV(S$[15,8],'MCXD')
MSG = OCONV(S$[23,4],'MCXD')
TP = OCONV(S$[27,4],'MCXD')
ST = OCONV(S$[31,4],'MCXD')
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 THEN
*========================================*
*
D.FLG = YES
BEGIN CASE
CASE P.NO = 0 AND MSG = MSG.ACTIVITY AND TP = 0 AND ST = 0
CASE P.NO = PNO.CHK
ON MSG GOSUB 50100,50200,50300,50400,50500,50600,50700,50800,50900,51000,51100,51200,51300,51400,51500
CASE YES
GOSUB 40000
IF ST$PLCB <> '' THEN
RELEASE PL$CONN.FD , ST$PLCB 'R%8'
END
MAT ST$ARRAY = ''
PR$PLCB = ''
*=== PLW-MAIN 163 ===*
IF PR$PLCB = '' THEN
T$$$ = 'FFFF'
END ELSE
T$$$ = OCONV(PR$PLCB,'MCDX') 'R%4'
END
SS$ = CALLFN( PLIP$CALL.FAST.EP:'0A0050':'004D0000':OCONV(PL$V.PORT.NO,'MCXD')'R%4':'0000' :T$$$ :( '' : NUL80 )[1,80])
*========================================*
END CASE
END
READU DUMMY FROM PL$LOCK.FD , 'V.PORT.NO*' : PL$V.PORT.NO LOCKED
STOP
*=== PLW-MAIN 168 ===*
END ELSE
 NULL
END
*========================================*
*=== PLW-MAIN 169 ===*
FN$1 = DATE() * 86400 + INT(TIME()) + OCONV('TM.OFFSET','TPLIP.CTRL;X;;1')
IF FN$1 - LAST.EXIT.CHK >= 10 THEN 
GOSUB 50300
END
*========================================*
IF PLIP$RESTART.CTR THEN
IF RESTART.CTR >= PLIP$RESTART.CTR THEN
RESTART.FLG = YES
END
END
IF RESTART.FLG THEN
*=== PLW-MAIN 176 ===*
S$ = ''
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
*=== PLW-MAIN 177 ===*
S$ = 'Process ' : PL$V.PORT.NO : ' is restarting.'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
WRITEV '' ON PL$PROC.FD , 'CFG*' : PL$V.PORT.NO , 12
*
*### #IF APPRO|D3|SEQ32|P6432|ADDS|MVBASE|JB
*### CHAIN 'PLW-MAIN RESTART ' : PL$V.PORT.NO : ' ' : E.FLG
*### #END
*### #IF UV
*### CHAIN 'PLW-MAIN RESTART ' : PL$V.PORT.NO : ' NOPAGE'
*### #END
*### #IF UD
*### CHAIN 'PLW-MAIN RESTART ' : PL$V.PORT.NO : ' -E'
*### #END
END
UNTIL EXIT.FLG DO
*=== PLW-MAIN 191 ===*
FN$1 = DATE() * 86400 + INT(TIME()) + OCONV('TM.OFFSET','TPLIP.CTRL;X;;1')
NW = FN$1
*========================================*
BEGIN CASE
CASE A.FLG
SLEEP.TM = PR$NOW
PRINT '+ ' :
CASE D.FLG
PRINT '+ ' :
CASE YES
*### #IF APPRO|ADDS|SEQ32|P6432
*### T = NW - SLEEP.TM
*### BEGIN CASE
*### CASE T > 3
*### PRINT '* ' :
*### SLEEP 1
*### CASE T < 0
*### SLEEP.TM = NW
*### PRINT '- ' :
*### SLEEP 0
*### CASE YES
*### PRINT '- ' :
*### SLEEP 0
*### END CASE
*### #END
*### #IF MVBASE|D3|UV|UD
*### PRINT '* ' :
*### #END
END CASE
IF ( PR$NOW <> NW ) OR ( PR$STATE <> '' ) THEN
PR$NOW = NW
*=== PLW-MAIN 220 ===*
IF PR$PLCB = '' THEN
T$$$ = 'FFFF'
END ELSE
T$$$ = OCONV(PR$PLCB,'MCDX') 'R%4'
END
SS$ = CALLFN( PLIP$CALL.FAST.EP:'0A0050':'004D0000':OCONV(PL$V.PORT.NO,'MCXD')'R%4':'0000' :T$$$ :( '' : NUL80 )[1,80])
*========================================*
END
PRINT SPINNER[SPINNER.CNT,1] : BSS3 : PRFIN :
SPINNER.CNT = SPINNER.CNT + 1
*=== PLW-MAIN 224 ===*
IF SPINNER.CNT > 4 THEN 
SPINNER.CNT = 1
END
*========================================*
REPEAT
*
LOCK 20
*#IFN UV
SELECT PL$CONN.FD TO SEL.VAR
*#END
*### #IF UV
*### SELECTV PL$CONN.FD TO SEL.VAR
*### #END
EOF = NO
LOOP
*=== PLW-MAIN 236 ===*
READNEXT ID FROM SEL.VAR ELSE 
EOF = YES
END
*========================================*
UNTIL EOF DO
IF ID MATCHES '8N' THEN
PLCB = ID + 0
ID = PLCB 'R%8'
*=== PLW-MAIN 241 ===*
MATREADU ST$ARRAY FROM PL$CONN.FD , ID LOCKED 
NULL 
END THEN
*========================================*
*
*
*=== PLW-MAIN 244 ===*
S$ = PLCB 'R#4' : ' KILLED on exit'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
GOSUB 990000
END ELSE
RELEASE PL$CONN.FD , PLCB 'R%8'
END
END
REPEAT
UNLOCK 20
*
*### #IF APPRO|ADDS|SEQ32|P6432
*### CALL PLSUB.INIT
*### #END
*
*=== PLW-MAIN 257 ===*
S$ = ''
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
*=== PLW-MAIN 258 ===*
S$ = 'PicLan-IP THREAD on port ' : PORT.NO : ' shutdown.'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
*
DELETE PL$PROC.FD , PL$V.PORT.NO
DELETE PL$PROC.FD , 'CFG*' : PL$V.PORT.NO
*
*### #IF UV
*### EXECUTE 'TERM ,50'
*### #END
STOP
*
200 NULL
*
O.FLG = NO
IF ST$POST.LEN AND LEN(ST$IBUF) < ST$POST.LEN THEN
LOOP
*=== PLW-MAIN 273 ===*
L$$$ = PLIP$MAX.IO.LEN
IF L$$$ > PLIP$MAX.IO.LEN THEN
L$$$ = PLIP$MAX.IO.LEN
END
S$ = CALLFN(PLIP$CALL.FAST.EP:'0A' : OCONV(L$$$,'MCDX')'R%4':'00360000':OCONV(ST$PLCB,'MCDX')'R%4':OCONV(L$$$,'MCDX')'R%4':'0000':STR(NUL,L$$$))
IF S$[7,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[11,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END ELSE
D = S$[27,RES]
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
*========================================*
*=== PLW-MAIN 274 ===*
S$ = ST$PLCB 'R#4' : ' Error reading from connection  CLOSED'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
GOSUB 990000
RETURN
END
IF D <> '' THEN
ST$IBUF = ST$IBUF : D
END
WHILE D <> '' AND LEN(ST$IBUF) < ST$POST.LEN DO REPEAT
END ELSE
CALL PLW.GET.HTTP.HDR(ERR.FLG)
IF ERR.FLG THEN
*=== PLW-MAIN 285 ===*
S$ = ST$PLCB 'R#4' : ' Error reading from connection  CLOSED'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
GOSUB 990000
RETURN
END
*
*=== PLW-MAIN 290 ===*
IF ST$CMD = '' THEN 
RETURN
END
*========================================*
END
*
ST$KEEP.ALIVE = NO
*
IF NOT(PLIP$NOKEEPALIVE) THEN
LOCATE( 'CONNECTION',ST$HTTP.HDR,1;LOC) THEN
T$$$ = OCONV(ST$HTTP.VAL<1,LOC>, 'MCU')
LOCATE( 'KEEP-ALIVE',T$$$,1,1;LOC2) THEN
ST$KEEP.ALIVE = YES
*
END
END
END
*
CMD = FIELD(ST$CMD, ' ',1)
BEGIN CASE
CASE CMD = 'GET'
CASE CMD = 'POST'
ST$POST.LEN = ''
LOCATE( 'CONTENT-LENGTH',ST$HTTP.HDR,1;LOC) THEN
ST$POST.LEN = FIELD(TRIM(ST$HTTP.VAL<1,LOC,1>), ' ',1)
*=== PLW-MAIN 312 ===*
IF NOT(ST$POST.LEN MATCHES '1N0N') THEN 
ST$POST.LEN = ''
END
*========================================*
END
IF NOT(ST$POST.LEN) THEN
*=== PLW-MAIN 315 ===*
S$ = ST$PLCB 'R#4' : ' ERROR - POST without content'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
GOSUB 990000
RETURN
END
*=== PLW-MAIN 319 ===*
IF LEN(ST$IBUF) < ST$POST.LEN THEN 
RETURN
END
*========================================*
CASE CMD = 'HEAD'
CASE YES
*=== PLW-MAIN 322 ===*
PRINT ST$PLCB 'R#4' : ' ' : ST$CMD<1,1> 'L#46' : '  ' :
IF NOT(PL$OFFLINE) THEN
PL$PRSTR = PL$PRSTR : ST$PLCB 'R#4' : ' ' : ST$CMD<1,1> 'L#46' : '  '
END
*========================================*
R.ERR = '501 NOT IMPLEMENTED [PLW-MAIN:1];The HTTP command ' : CMD : ' is not implemented by this server.  [PLW-MAIN:1]'
GOTO 99000
END CASE
*
*=== PLW-MAIN 327 ===*
IF ST$POST.LEN AND LEN(ST$IBUF) < ST$POST.LEN THEN 
RETURN
END
*========================================*
*
FNAME = FIELD(ST$CMD, ' ',2)
IF ST$POST.LEN THEN
PARM = ST$IBUF[1,ST$POST.LEN]
ST$POST.DATA = PARM
FNAME = OCONV(FIELD(FNAME, '?',1), 'MCU')
ST$IBUF = ST$IBUF[ST$POST.LEN+1,BIG.STR]
ST$POST.LEN = ''
END ELSE
PARM = OCONV(FNAME, 'G1?999')
FNAME = OCONV(FIELD(FNAME, '?',1), 'MCU')
ST$POST.DATA = ''
END
*
VAR$NAMES = ''
MAT VAR$VALS = ''
VAR$CNT = 0
*
FLG = NO
IF ST$POST.DATA <> '' THEN
LOCATE( 'CONTENT-TYPE',ST$HTTP.HDR,1;LOC) THEN
ENC.TP = OCONV(FIELD(TRIM(ST$HTTP.VAL<1,LOC,1>), ' ',1), 'MCU')
ENC.TP = FIELD(ENC.TP, ';',1)
BEGIN CASE
CASE ENC.TP = 'APPLICATION/X-WWW-FORM-URLENCODED'
FLG = YES
CASE ENC.TP = 'MULTIPART/FORM-DATA'
CALL PLW.DECODE.MULTIPART(ST$POST.DATA)
END CASE
END
END ELSE
FLG = YES
END
*
IF FLG THEN
I1 = DCOUNT(PARM, '&')
FOR I = 1 TO I1
PP = FIELD(PARM, '&',I)
V = FIELD(PP, '=',1)
GOSUB 91000
P.NM = V
V = FIELD(PP, '=',2)
GOSUB 91000
P.VAL = V
IF I1 <= 500 THEN
VAR$NAMES<I> = P.NM
VAR$VALS(I) = P.VAL
END ELSE
VAR$NAMES<I> = P.NM
VAR$VALS(MOD(I-1,500)+1)<INT((I-1)/500)+1> = P.VAL
END
NEXT I
VAR$CNT = DCOUNT(VAR$NAMES,AM)
END
*
*=== PLW-MAIN 383 ===*
R$$$ = ''
LOCATE('X-CONNADDR',ST$HTTP.HDR,1;L$$$) THEN
I1$$$ = DCOUNT(ST$HTTP.VAL<1,L$$$>,SVM)
FOR I$$$ = 1 TO I1$$$
R$$$<-1> = ST$HTTP.VAL<1,L$$$,I$$$>
NEXT I$$$
END
IF R$$$ <> '' THEN
T.R.ADDR = R$$$
END
IF R$$$ <> '' THEN
*========================================*
T.R.ADDR = FIELD(FIELD(T.R.ADDR, ' ',2), ':',1)
END ELSE
T.R.ADDR = FIELD(ST$RIP, ':',1)
END
*=== PLW-MAIN 388 ===*
PRINT ST$PLCB 'R#4' : ' ' : T.R.ADDR 'L#16' : ( CMD 'L#4' : ' ' : FNAME : ' ' : OCONV(PARM[1,40], 'MCP') ) 'L#40' : '  ' :
IF NOT(PL$OFFLINE) THEN
PL$PRSTR = PL$PRSTR : ST$PLCB 'R#4' : ' ' : T.R.ADDR 'L#16' : ( CMD 'L#4' : ' ' : FNAME : ' ' : OCONV(PARM[1,40], 'MCP') ) 'L#40' : '  '
END
*========================================*
*
LOCATE( 'IF-MODIFIED-SINCE',ST$HTTP.HDR,1;LOC) THEN
*=== PLW-MAIN 391 ===*
IF INDEX(ST$HTTP.VAL<1,LOC,1>,',',1) THEN
T$$$ = OCONV(TRIM(FIELD(ST$HTTP.VAL<1,LOC,1>,',',2)),'MCU')
WORDS$$$ = COUNT(T$$$,' ')
BEGIN CASE
CASE WORDS$$$ <= 1
FN$1 = 0
CASE WORDS$$$ <= 3
FN$1 = ICONV(FIELD(T$$$,' ',1),'D') * 86400 + ICONV(FIELD(T$$$,' ',2),'MTS')
CASE YES
FN$1 = ICONV(OCONV(T$$$,'G0 3'),'D') * 86400 + ICONV(FIELD(T$$$,' ',4),'MTS')
END CASE
END ELSE
T$$$ = OCONV(TRIM(ST$HTTP.VAL<1,LOC,1>),'MCU')
FN$1 = ICONV(OCONV(T$$$,'G1 3'),'D') * 86400 + ICONV(FIELD(T,' ',5),'MTS')
END
MOD.TM = FN$1
*========================================*
END ELSE
MOD.TM = ''
END
*
T = FIELD(FNAME, '/',DCOUNT(FNAME, '/'))
F.CH = T[1,1]
R.ERR = ''
RESX = ''
*
BEGIN CASE
CASE F.CH = '&'
CASE F.CH >= 'A' AND F.CH <= 'Z'
CASE F.CH >= '0' AND F.CH <= '9'
CASE F.CH = '_' AND T[2,1] <> '_'
CASE T = ''
CASE YES
MATREAD DATA$ARRAY FROM PL$DATA.FD , PL$V.PORT.NO : '*' : ST$IP : '/' ELSE
MAT DATA$ARRAY = ''
DATA$OPT = 'E'
END
R.ERR = '404 NOT FOUND [PLW-MAIN:2];The specified file name is invalid.  [PLW-MAIN:2:' : FNAME : ']'
PL$PGNAME = ''
PLW$LEVEL = 1
END CASE
IF R.ERR = '' THEN
PL$EXTRAHTTP = ''
PL$PGNAME = ''
PLW$LEVEL = 0
CALL PLW.PAGE(FNAME: '',MOD.TM,R.ERR)
END
IF R.ERR <> '' AND R.ERR[1,4] <> '304 ' THEN
IF INDEX(DATA$OPT, 'E',1) THEN
*=== PLW-MAIN 424 ===*
LOCATE('_ERROR',VAR$NAMES;T$$$) ELSE
VAR$NAMES<-1> = '_ERROR'
VAR$CNT = VAR$CNT + 1
END
LOCATE('_ERROR',VAR$NAMES;T$$$) THEN
IF VAR$CNT <= 500 THEN
VAR$VALS(T$$$) = R.ERR
END ELSE
VAR$VALS( MOD(T$$$-1,500)+1)<INT( ( T$$$ - 1 ) / 500 ) + 1> = R.ERR
END
END ELSE
T$$$ = 0
END
IF T$$$ ELSE
NULL
END
*========================================*
*=== PLW-MAIN 425 ===*
LOCATE('_FNAME',VAR$NAMES;T$$$) ELSE
VAR$NAMES<-1> = '_FNAME'
VAR$CNT = VAR$CNT + 1
END
LOCATE('_FNAME',VAR$NAMES;T$$$) THEN
IF VAR$CNT <= 500 THEN
VAR$VALS(T$$$) = FNAME
END ELSE
VAR$VALS( MOD(T$$$-1,500)+1)<INT( ( T$$$ - 1 ) / 500 ) + 1> = FNAME
END
END ELSE
T$$$ = 0
END
IF T$$$ ELSE
NULL
END
*========================================*
*=== PLW-MAIN 426 ===*
LOCATE('_MOD.TM',VAR$NAMES;T$$$) ELSE
VAR$NAMES<-1> = '_MOD.TM'
VAR$CNT = VAR$CNT + 1
END
LOCATE('_MOD.TM',VAR$NAMES;T$$$) THEN
IF VAR$CNT <= 500 THEN
VAR$VALS(T$$$) = MOD.TM
END ELSE
VAR$VALS( MOD(T$$$-1,500)+1)<INT( ( T$$$ - 1 ) / 500 ) + 1> = MOD.TM
END
END ELSE
T$$$ = 0
END
IF T$$$ ELSE
NULL
END
*========================================*
CALL PLW.PAGE( '__ERROR.HTM', '',ERROR2)
*=== PLW-MAIN 428 ===*
IF ERROR2 = '' THEN 
R.ERR = ''
END
*========================================*
END
END
*
IF RESX = AM THEN
*
*=== PLW-MAIN 434 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00380000':OCONV(ST$PLCB,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
ST$CLOSESENT = YES
*=== PLW-MAIN 436 ===*
T$$$ = ST$IBUF
ST$IBUF = ''
MATWRITE ST$ARRAY ON PL$CONN.FD , ST$PLCB 'R%8'
WRITE T$$$ ON PL$CONN.FD , ST$PLCB 'R%8' : '*IBUF'
ST$IBUF = T$$$
T$$$ = ''
*========================================*
*=== PLW-MAIN 437 ===*
IF ST$PLCB > 5000 THEN
PRINT 'IN TCP_SET_Q:  %1 = ' : ST$PLCB
DEBUG
END
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00410000':OCONV(ST$PLCB,'MCDX')'R%4':OCONV(A.CLOSED,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
CALL PLW.LOG(FNAME,R.ERR,ST$DATA.LEN)
MAT ST$ARRAY = ''
RETURN
END
*
*=== PLW-MAIN 443 ===*
READU DUMMY FROM PL$LOCK.FD , 'V.PORT.NO*' : PL$V.PORT.NO LOCKED 
NULL 
END ELSE 
NULL
END
*========================================*
*
IF RESX = '' AND R.ERR = '' THEN
R.ERR = '500 INTERNAL ERROR [PLW-MAIN:3];Invalid Page.  No content or error given.  [PLW-MAIN:3]'
END
*
IF RESX = '' AND FIELD(R.ERR, ' ',1) <> '304' THEN
CALL PLW.ERROR(R.ERR)
R.ERR = FIELD(R.ERR, ';',1)
END
*
IF R.ERR = '' THEN
R.ERR = '200 OK'
END
*
R.LEN = 0
IF RESX <> '' OR R.ERR <> '' THEN
IF CTRL$HEXFLG THEN
IF PL$PBHDR = '' OR PL$EXTRAHTTP <> '' THEN
CALL PLW.BLD.HTTP.HDR(0,FIELD(R.ERR, ';',1),ST$KEEP.ALIVE,CTRL$MIME,CTRL$TMS,LEN(RESX)/2,LL,PL$EXTRAHTTP)
PL$PBHDR = LL
END
*=== PLW-MAIN 465 ===*
S$ = R.ERR
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
BEGIN CASE
CASE CMD = 'GET' OR CMD = 'POST'
R.LEN = LEN(PL$PBHDR) + ( LEN(RESX) / 2 )
*=== PLW-MAIN 469 ===*
FN$1 = ''
LEN$$$ = LEN(PL$PBHDR)
IF LEN$$$ <= 50000 THEN
FOR I$$$ = 1 TO LEN$$$ STEP 1000
FN$1 = FN$1 : OCONV((PL$PBHDR)[I$$$,1000],'MX0C')
NEXT I$$$
END ELSE
FOR I$$$ = 1 TO LEN(PL$PBHDR) STEP 50000
S$$$ = (PL$PBHDR)[I$$$,50000]
T$$$ = ''
FOR J$$$ = 1 TO 50000 STEP 1000
T$$$ = T$$$ : OCONV(S$$$[J$$$,1000],'MX0C')
NEXT J$$$
FN$1 = FN$1 : T$$$
NEXT I$$$
S$$$ = ''
T$$$ = ''
END
CALL PLIP.BCB.SENDX(FN$1 : RESX)
*========================================*
CASE CMD = 'HEAD'
R.LEN = LEN(PL$PBHDR)
*=== PLW-MAIN 472 ===*
FN$1 = ''
LEN$$$ = LEN(PL$PBHDR)
IF LEN$$$ <= 50000 THEN
FOR I$$$ = 1 TO LEN$$$ STEP 1000
FN$1 = FN$1 : OCONV((PL$PBHDR)[I$$$,1000],'MX0C')
NEXT I$$$
END ELSE
FOR I$$$ = 1 TO LEN(PL$PBHDR) STEP 50000
S$$$ = (PL$PBHDR)[I$$$,50000]
T$$$ = ''
FOR J$$$ = 1 TO 50000 STEP 1000
T$$$ = T$$$ : OCONV(S$$$[J$$$,1000],'MX0C')
NEXT J$$$
FN$1 = FN$1 : T$$$
NEXT I$$$
S$$$ = ''
T$$$ = ''
END
CALL PLIP.BCB.SENDX(FN$1)
*========================================*
END CASE
END ELSE
IF PL$PBHDR = '' OR PL$EXTRAHTTP <> '' THEN
CALL PLW.BLD.HTTP.HDR(0,FIELD(R.ERR, ';',1),ST$KEEP.ALIVE,CTRL$MIME,CTRL$TMS,LEN(RESX),LL,PL$EXTRAHTTP)
PL$PBHDR = LL
END
*=== PLW-MAIN 479 ===*
S$ = R.ERR
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
BEGIN CASE
CASE CMD = 'GET' OR CMD = 'POST'
R.LEN = LEN(PL$PBHDR) + LEN(RESX)
CALL PLIP.BCB.SEND(PL$PBHDR : RESX)
CASE CMD = 'HEAD'
R.LEN = LEN(PL$PBHDR)
CALL PLIP.BCB.SEND(PL$PBHDR)
END CASE
END
CALL PLW.LOG(FNAME,R.ERR,R.LEN)
O.FLG = YES
RESX = ''
END
*
RETURN
*
10120 NULL
*
A.FLG = YES
T = ST$IP
*=== PLW-MAIN 500 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'003B0000':OCONV(ST$PLCB,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
L.PLCB = RES
*
*=== PLW-MAIN 503 ===*
IF ST$PLCB > 5000 THEN
PRINT 'IN TCP_SET_Q:  %1 = ' : ST$PLCB
DEBUG
END
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00410000':OCONV(ST$PLCB,'MCDX')'R%4':OCONV(A.READ,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
*
IF L.PLCB < 0 THEN
IF L.PLCB <> -29 THEN
*=== PLW-MAIN 507 ===*
S$ = 'Error getting listen ERR = ' : ERR : ' RES = ' : L.PLCB
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
END
RELEASE PL$CONN.FD , ST$PLCB 'R%8'
RETURN
END
*
RELEASE PL$CONN.FD , ST$PLCB 'R%8'
*
*=== PLW-MAIN 515 ===*
S$ = OCONV( CALL.DRIVER.EP:FNR.PLCB.STATUS:OCONV(L.PLCB,'MCDX')'R%4':'0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',CALL.DRIVER.MD)
IF S$[1,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[5,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
*
MAT ST$ARRAY = ''
*=== PLW-MAIN 518 ===*
IF PR$PLCB = '' THEN
T$$$ = 'FFFF'
END ELSE
T$$$ = OCONV(PR$PLCB,'MCDX') 'R%4'
END
SS$ = CALLFN( PLIP$CALL.FAST.EP:'0A0050':'004D0000':OCONV(PL$V.PORT.NO,'MCXD')'R%4':'0000' :T$$$ :( '' : NUL80 )[1,80])
*========================================*
ST$PLCB = L.PLCB
ST$TP = ST.TP.HTTP
ST$IP = T
ST$CFG = PL$CFG
*=== PLW-MAIN 523 ===*
FN$1 = OCONV(S$[41,4],'MCXD')
FN$2 = OCONV(S$[33,2],'MCXD') : '.' : OCONV(S$[35,2],'MCXD') : '.' : OCONV(S$[37,2],'MCXD') : '.' : OCONV(S$[39,2],'MCXD')
ST$RIP = FN$2 : ':' : FN$1
*========================================*
*
*=== PLW-MAIN 525 ===*
T$$$ = ST$IBUF
ST$IBUF = ''
MATWRITE ST$ARRAY ON PL$CONN.FD , ST$PLCB 'R%8'
WRITE T$$$ ON PL$CONN.FD , ST$PLCB 'R%8' : '*IBUF'
ST$IBUF = T$$$
T$$$ = ''
*========================================*
PR$PLCB = ST$PLCB
*=== PLW-MAIN 527 ===*
IF PR$PLCB = '' THEN
T$$$ = 'FFFF'
END ELSE
T$$$ = OCONV(PR$PLCB,'MCDX') 'R%4'
END
SS$ = CALLFN( PLIP$CALL.FAST.EP:'0A0050':'004D0000':OCONV(PL$V.PORT.NO,'MCXD')'R%4':'0000' :T$$$ :( '' : NUL80 )[1,80])
*========================================*
*
GOTO 10230
*
10210 NULL
*
A.FLG = YES
*
GOSUB 990000
MAT ST$ARRAY = ''
*
RETURN
*
10230 NULL
*
A.FLG = YES
*
IF ST$OBUF.CNT MATCHES '1N0N' AND ST$OBUF.CNT <> '0' THEN
CALL PLIP.BCB.SEND('')
IF ST$OBUF.CNT[1,1] = '*' THEN
*=== PLW-MAIN 547 ===*
S$ = ST$PLCB 'R#4' : ' KILLED write error'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
GOTO 990000
END
END ELSE
GOSUB 200
*
IF NOT(O.FLG) THEN
*=== PLW-MAIN 554 ===*
T$$$ = ST$IBUF
ST$IBUF = ''
MATWRITE ST$ARRAY ON PL$CONN.FD , ST$PLCB 'R%8'
WRITE T$$$ ON PL$CONN.FD , ST$PLCB 'R%8' : '*IBUF'
ST$IBUF = T$$$
T$$$ = ''
*========================================*
*=== PLW-MAIN 555 ===*
IF ST$PLCB > 5000 THEN
PRINT 'IN TCP_SET_Q:  %1 = ' : ST$PLCB
DEBUG
END
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00410000':OCONV(ST$PLCB,'MCDX')'R%4':OCONV(A.READ + A.CLOSED,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
MAT ST$ARRAY = ''
RETURN
END
*
IF ST$OBUF.CNT[1,1] = '*' THEN
*=== PLW-MAIN 561 ===*
S$ = ST$PLCB 'R#4' : ' KILLED write error'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
GOTO 990000
END
END
*
IF ST$OBUF.CNT MATCHES '1N0N' AND ST$OBUF.CNT <> '0' THEN
*=== PLW-MAIN 567 ===*
T$$$ = ST$IBUF
ST$IBUF = ''
MATWRITE ST$ARRAY ON PL$CONN.FD , ST$PLCB 'R%8'
WRITE T$$$ ON PL$CONN.FD , ST$PLCB 'R%8' : '*IBUF'
ST$IBUF = T$$$
T$$$ = ''
*========================================*
*=== PLW-MAIN 568 ===*
IF ST$PLCB > 5000 THEN
PRINT 'IN TCP_SET_Q:  %1 = ' : ST$PLCB
DEBUG
END
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00410000':OCONV(ST$PLCB,'MCDX')'R%4':OCONV(A.WRITE + A.CLOSED,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
MAT ST$ARRAY = ''
RETURN
END
*
IF NOT(ST$KEEP.ALIVE) THEN
*
*=== PLW-MAIN 575 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00380000':OCONV(ST$PLCB,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
ST$CLOSESENT = YES
*=== PLW-MAIN 577 ===*
T$$$ = ST$IBUF
ST$IBUF = ''
MATWRITE ST$ARRAY ON PL$CONN.FD , ST$PLCB 'R%8'
WRITE T$$$ ON PL$CONN.FD , ST$PLCB 'R%8' : '*IBUF'
ST$IBUF = T$$$
T$$$ = ''
*========================================*
*=== PLW-MAIN 578 ===*
IF ST$PLCB > 5000 THEN
PRINT 'IN TCP_SET_Q:  %1 = ' : ST$PLCB
DEBUG
END
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00410000':OCONV(ST$PLCB,'MCDX')'R%4':OCONV(A.CLOSED,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
MAT ST$ARRAY = ''
RETURN
END
*
*=== PLW-MAIN 583 ===*
T$$$ = ST$IBUF
ST$IBUF = ''
MATWRITE ST$ARRAY ON PL$CONN.FD , ST$PLCB 'R%8'
WRITE T$$$ ON PL$CONN.FD , ST$PLCB 'R%8' : '*IBUF'
ST$IBUF = T$$$
T$$$ = ''
*========================================*
*=== PLW-MAIN 584 ===*
IF ST$PLCB > 5000 THEN
PRINT 'IN TCP_SET_Q:  %1 = ' : ST$PLCB
DEBUG
END
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00410000':OCONV(ST$PLCB,'MCDX')'R%4':OCONV(A.READ + A.CLOSED,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
MAT ST$ARRAY = ''
RETURN
*
10240 NULL
*
A.FLG = YES
*
IF ST$OBUF.CNT MATCHES '1N0N' AND ST$OBUF.CNT <> '0' THEN
CALL PLIP.BCB.SEND('')
IF ST$OBUF.CNT[1,1] = '*' THEN
*=== PLW-MAIN 595 ===*
S$ = ST$PLCB 'R#4' : ' KILLED write error'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
GOTO 990000
END
END ELSE
GOSUB 200
IF ST$OBUF.CNT[1,1] = '*' THEN
*=== PLW-MAIN 601 ===*
S$ = ST$PLCB 'R#4' : ' KILLED write error'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
GOTO 990000
END
END
*
IF ST$OBUF.CNT MATCHES '1N0N' AND ST$OBUF.CNT <> '0' THEN
*=== PLW-MAIN 607 ===*
T$$$ = ST$IBUF
ST$IBUF = ''
MATWRITE ST$ARRAY ON PL$CONN.FD , ST$PLCB 'R%8'
WRITE T$$$ ON PL$CONN.FD , ST$PLCB 'R%8' : '*IBUF'
ST$IBUF = T$$$
T$$$ = ''
*========================================*
*=== PLW-MAIN 608 ===*
IF ST$PLCB > 5000 THEN
PRINT 'IN TCP_SET_Q:  %1 = ' : ST$PLCB
DEBUG
END
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00410000':OCONV(ST$PLCB,'MCDX')'R%4':OCONV(A.WRITE + A.CLOSED,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
MAT ST$ARRAY = ''
RETURN
END
*
IF NOT(ST$CLOSESENT) THEN
*
*=== PLW-MAIN 615 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00380000':OCONV(ST$PLCB,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
ST$CLOSESENT = YES
END
*=== PLW-MAIN 618 ===*
T$$$ = ST$IBUF
ST$IBUF = ''
MATWRITE ST$ARRAY ON PL$CONN.FD , ST$PLCB 'R%8'
WRITE T$$$ ON PL$CONN.FD , ST$PLCB 'R%8' : '*IBUF'
ST$IBUF = T$$$
T$$$ = ''
*========================================*
*=== PLW-MAIN 619 ===*
IF ST$PLCB > 5000 THEN
PRINT 'IN TCP_SET_Q:  %1 = ' : ST$PLCB
DEBUG
END
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00410000':OCONV(ST$PLCB,'MCDX')'R%4':OCONV(A.CLOSED,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
MAT ST$ARRAY = ''
RETURN
*
10250 NULL
*
*=== PLW-MAIN 625 ===*
S$ = ST$PLCB 'R#4' : ' FREE'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
GOSUB 990000
*
RETURN
*
10300 NULL
*
CALL PLW.MAIL.SUB(ST$MAIL.ID,WORK.FLG,0)
*
RETURN
*
*
*
*
*
40000 NULL
*
RESTART.CTR = RESTART.CTR + 1
*
ST$PLCB = P.NO
IF ST = 15 THEN
*=== PLW-MAIN 646 ===*
MATREAD ST$ARRAY FROM PL$CONN.FD , ST$PLCB 'R%8' THEN
T$$$ = 1
READ ST$IBUF FROM PL$CONN.FD , ST$PLCB 'R%8' : '*IBUF' ELSE
ST$IBUF = ''
END
END ELSE
T$$$ = 0
ST$IBUF = ''
END
IF T$$$ ELSE
GOTO 40099
END
*========================================*
END ELSE
*=== PLW-MAIN 648 ===*
MATREADU ST$ARRAY FROM PL$CONN.FD , ST$PLCB 'R%8' THEN
T$$$ = 1
READ ST$IBUF FROM PL$CONN.FD , ST$PLCB 'R%8' : '*IBUF' ELSE
ST$IBUF = ''
END
END ELSE
T$$$ = 0
ST$IBUF = ''
END
IF T$$$ ELSE
GOTO 40099
END
*========================================*
END
*
PR$PLCB = ST$PLCB
*=== PLW-MAIN 652 ===*
IF PR$PLCB = '' THEN
T$$$ = 'FFFF'
END ELSE
T$$$ = OCONV(PR$PLCB,'MCDX') 'R%4'
END
SS$ = CALLFN( PLIP$CALL.FAST.EP:'0A0050':'004D0000':OCONV(PL$V.PORT.NO,'MCXD')'R%4':'0000' :T$$$ :( 'Processing event [' : P.NO : ',' : MSG : ',' : TP : ',' : ST : ']' : NUL80 )[1,80])
*========================================*
*
IF NOT(NUM(ST$TP)) AND PLW$EXT <> '' THEN
SUB.NAME = FIELD(ST$TP, ' ',1)
LOCATE(SUB.NAME,PLW$EXT,1,1;L) THEN
CALL @SUB.NAME(P.NO,MSG,TP,ST)
RETURN
END ELSE
*=== PLW-MAIN 660 ===*
S$ = '40000: Unknown ST$TP = ' : ST$TP
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
GOSUB 990000
RETURN
END
END
*
BEGIN CASE
CASE ST$TP = ST.TP.HTTP.LISTEN
IF ST <> 15 THEN
*=== PLW-MAIN 669 ===*
S$ = '40000: Mul Listen PLCB not state 15 ' : ST$PLCB : ' ' : ST
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
*=== PLW-MAIN 670 ===*
S$ = '       Sending supervisor a RECYCLE signal'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
WRITE '99' ON PL$CTRL.FD , 'CONFIG-EXIT'
GOTO 990000
END
GOTO 10120
CASE ST$TP = ST.TP.HTTP
BEGIN CASE
CASE MSG = MSG.ACTIVITY
BEGIN CASE
CASE ST <= 1
GOTO 10210
CASE ST = 3 OR ST = 4 OR ST = 5 OR ST = 6 OR ST = 7
GOTO 10230
CASE ST = 8 OR ST = 9 OR ST = 10 OR ST = 11
GOTO 10240
CASE YES
*=== PLW-MAIN 686 ===*
S$ = '40000: Invalid ST on TCP PLCB ' : ST$PLCB : ' ' : ST
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
GOTO 990000
END CASE
CASE MSG = MSG.TIMEOUT OR MSG = MSG.LONG.TIMEOUT
GOTO 40100
END CASE
CASE ST$TP = ST.TP.SMTP.SEND
BEGIN CASE
CASE MSG = MSG.TIMEOUT
CALL PLS.MAIL.SEND.DONE( 'TIMEOUT')
CASE MSG = MSG.LONG.TIMEOUT
CALL PLS.MAIL.SEND.DONE( 'LONG TIMEOUT')
*
*
CASE YES
CALL PLS.MAIL.SEND
END CASE
A.FLG = YES
CASE ST$TP = ST.TP.SMTP.LISTEN
CALL PLS.SMTP.RECV.LISTEN
A.FLG = YES
CASE ST$TP = ST.TP.SMTP.RECV
BEGIN CASE
CASE MSG = MSG.TIMEOUT OR MSG = MSG.LONG.TIMEOUT
*=== PLW-MAIN 710 ===*
S$ = ST$PLCB 'R#4' : ' SMTP recv TIMEOUT'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
GOSUB 990000
CASE MSG = MSG.ACTIVITY AND ( ST <= 1 OR ST >= 8 )
*=== PLW-MAIN 713 ===*
S$ = ST$PLCB 'R#4' : ' SMTP RECV CLOSED'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
GOSUB 990000
CASE YES
CALL PLS.SMTP.RECV
END CASE
A.FLG = YES
CASE ST$TP = ST.TP.POP3.LISTEN
CALL PLS.POP3.LISTEN
A.FLG = YES
CASE ST$TP = ST.TP.POP3
BEGIN CASE
CASE MSG = MSG.TIMEOUT OR MSG = MSG.LONG.TIMEOUT
*=== PLW-MAIN 725 ===*
S$ = ST$PLCB 'R#4' : ' POP3 TIMEOUT'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
GOSUB 990000
CASE MSG = MSG.ACTIVITY AND ( ST <= 1 OR ST >= 8 )
*=== PLW-MAIN 728 ===*
S$ = ST$PLCB 'R#4' : ' POP3 CLOSED'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
GOSUB 990000
CASE YES
CALL PLS.POP3
END CASE
A.FLG = YES
*### #IF TELNET
*### CASE ST$TP = ST.TP.TELNET.LISTEN
*### CALL PLW.TELNET.LISTEN
*### A.FLG = YES
*### CASE ST$TP = ST.TP.TELNET
*### BEGIN CASE
*### CASE MSG = MSG.TELNET.TIMEOUT OR MSG = MSG.LONG.TIMEOUT
*### CALL PLW.TELNET.DISCONNECT('TIMEOUT')
*### CASE ST > 5
*### CALL PLW.TELNET.DISCONNECT('DISCONNECT')
*### CASE MSG = MSG.ACTIVITY
*### CASE YES
*### PL_PRINT '40000: Invalid MSG on TCP TELNET ' : ST$PLCB : ' ' : MSG
*### CALL PLW.TELNET.DISCONNECT('DISCONNECT')
*### END CASE
*### A.FLG = YES
*### #END
CASE YES
*=== PLW-MAIN 752 ===*
S$ = '40000: Unknown ST$TP ' : ST$PLCB : ' ' : ST$TP
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
GOSUB 990000
END CASE
*
RETURN
*
40099 NULL
*
RELEASE PL$CONN.FD , P.NO 'R%8'
P2 = '40000: Error reading ST$ARRAY ' : P.NO 'R%8'
DESC = 'PL$V.PORT.NO = ' : PL$V.PORT.NO
DESC<-1> = 'P.NO         = ' : P.NO
DESC<-1> = 'MSG          = ' : MSG
DESC<-1> = 'TP           = ' : TP
DESC<-1> = 'ST           = ' : ST
CALL PLU.ERROR.LOG( 'PLW-MAIN',P2,DESC)
*
MAT ST$ARRAY = ''
*
RETURN
*
40100 NULL
*
IF ST$TP = ST.TP.HTTP.LISTEN THEN
*=== PLW-MAIN 776 ===*
S$ = '40100: HTTP LISTEN TIMEOUT'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
RETURN
END
*
*=== PLW-MAIN 780 ===*
S$ = ST$PLCB 'R#4' : ' TIMEOUT'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
GOTO 990000
*
50100 NULL
*
RETURN
*
50200 NULL
*
*=== PLW-MAIN 789 ===*
READ N.CFG FROM PLIP$CTRL.FD , PL$CFG ELSE 
CALL PLXX.STOP(202,PL$CFG)
END
*========================================*
*
IF N.CFG <> O.CFG THEN
*### #IF APPRO|ADDS|SEQ32|P6432
*### CALL PLSUB.INIT
*### #END
CALL PLW.READ.CONFIG( 'RUN')
O.CFG = N.CFG
END
*
*=== PLW-MAIN 799 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00430000':OCONV(PL$V.PORT.NO,'MCDX')'R%4':OCONV(30,'MCDX')'R%4':OCONV(PNO.CHK,'MCDX')'R%8':OCONV(MSG.CONFIG,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
*
RETURN
*
50300 NULL
*
*=== PLW-MAIN 805 ===*
FN$1 = KEYREADY()
IF FN$1 THEN
*========================================*
*=== PLW-MAIN 806 ===*
FN$1 = OCONV(1,GET.MD)
CMD = FN$1
*========================================*
CMD = OCONV(CMD, 'MCU')
IF CMD = 'X' THEN
EXIT.FLG = YES
RETURN
END
IF CMD = 'R' THEN
RESTART.FLG = YES
END
END
*
READV X FROM PL$PROC.FD , 'CFG*' : PL$V.PORT.NO , 11 THEN
IF X = '1' THEN
EXIT.FLG = YES
RETURN
END
END
*
READV X FROM PL$PROC.FD , 'CFG*' : PL$V.PORT.NO , 12 THEN
IF X = '1' THEN
RESTART.FLG = YES
RETURN
END
END
*
*=== PLW-MAIN 831 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00430000':OCONV(PL$V.PORT.NO,'MCDX')'R%4':OCONV(5,'MCDX')'R%4':OCONV(PNO.CHK,'MCDX')'R%8':OCONV(MSG.EXITFLG,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
*=== PLW-MAIN 832 ===*
FN$1 = DATE() * 86400 + INT(TIME()) + OCONV('TM.OFFSET','TPLIP.CTRL;X;;1')
LAST.EXIT.CHK = FN$1
*========================================*
*
*### #IF UV|JB
*### READU DUMMY FROM PL$LOCK.FD , 'V.PORT.NO*' : PL$V.PORT.NO LOCKED
*### PRINT 'LOCKED'
*### END ELSE NULL
*### #END
*
RETURN
*
50400 NULL
*
CALL PLW.MAIL.POLL
*
*
RETURN
*
50500 NULL
*
*=== PLW-MAIN 851 ===*
FN$1 = INT((DATE()*86400+OCONV('TM.OFFSET','TPLIP.CTRL;X;;1')+INT(TIME()))/86400)
FN$2 = MOD(INT(TIME())+OCONV('TM.OFFSET','TPLIP.CTRL;X;;1'),86400)
S$ = SPACE(21) : OCONV(FN$2, 'MT') : ' ' : OCONV(FN$1, 'D0-') : ' Validating PicLan-IP License'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
*=== PLW-MAIN 852 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'003F0000':OCONV(PLIP$PICLANIPSN,'MCDX')'R%4':OCONV(DATE(),'MCDX')'R%4':OCONV(PLIP$AUTHDATE,'MCDX')'R%4':OCONV(PLIP$WEBBW,'MCDX')'R%4':OCONV(PLIP$WEBBWSEC,'MCDX')'R%4':OCONV(PLIP$WEBBWAUTH,'MCDX')'R%4':OCONV(PLIP$OTHBW,'MCDX')'R%4':OCONV(PLIP$OTHBWSEC,'MCDX')'R%4':OCONV(PLIP$OTHBWAUTH,'MCDX')'R%4':OCONV(PLIP$TELNETLIC,'MCDX')'R%4':OCONV(PLIP$POP3LIC,'MCDX')'R%4':OCONV(PLIP$AUTHBITS,'MCDX')'R%4':OCONV(PLIP$AUTH,'MCDX')'R%8':'00000000')
IF S$[3,4] = IPX.SOCKET.NO THEN
ERR = 0
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
*========================================*
*=== PLW-MAIN 853 ===*
S$ = SPACE(21) : '*** Warning - Invalid PicLan-IP Authorization code'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
*=== PLW-MAIN 854 ===*
S$ = SPACE(21) : '***           or demo time period expired.'
PRINT CHANGE(S$,AM,CRLF)
IF NOT(PL$OFFLINE) THEN
S$ = PL$PRSTR : S$
T$ = PORT.NO 'R#3' : ' '
S$ = T$ : CHANGE(S$,AM,CRLF:T$) : CRLF
L$ = OCONV(LEN(S$),'MCDX')'R%4'
S$ = CALLFN( PLIP$CALL.FAST.EP:'06':L$:'004B0000':L$:S$)
END
PL$PRSTR = ''
*========================================*
END
*=== PLW-MAIN 856 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00430000':OCONV(-1,'MCDX')'R%4':OCONV(600,'MCDX')'R%4':OCONV(PNO.CHK,'MCDX')'R%8':OCONV(MSG.AUTH,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
*
RETURN
*
50600 NULL
*
RETURN
*
50700 NULL
*
CALL PLW.CLEANUP.SUBS
*=== PLW-MAIN 867 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00430000':OCONV(-1,'MCDX')'R%4':OCONV(( 30 * 60 ),'MCDX')'R%4':OCONV(PNO.CHK,'MCDX')'R%8':OCONV(MSG.SUB.CLEANUP,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
*
RETURN
*
50800 NULL
*
RETURN
*
50900 NULL
*
*
RELEASE PL$CONN.FD , ST$PLCB 'R%8'
*
RETURN
*
51000 NULL
*
*
*
*
RETURN
*
51100 NULL
*
CALL PLW.CONN.CLEANUP
*=== PLW-MAIN 892 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00430000':OCONV(-1,'MCDX')'R%4':OCONV(PLIP$CONN.CLEANUP,'MCDX')'R%4':OCONV(PNO.CHK,'MCDX')'R%8':OCONV(MSG.CONN.CLEANUP,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
*
RETURN
*
51200 *
*
RETURN
*
51300 *
*
CALL PLW.BW.LOG
*
*=== PLW-MAIN 904 ===*
FN$1 = DATE() * 86400 + INT(TIME()) + OCONV('TM.OFFSET','TPLIP.CTRL;X;;1')
NW = FN$1
*========================================*
*=== PLW-MAIN 905 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00430000':OCONV(-1,'MCDX')'R%4':OCONV(60,'MCDX')'R%4':OCONV(PNO.CHK,'MCDX')'R%8':OCONV(MSG.BW,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
*
RETURN
*
51400 *
*
RETURN
*
51500 NULL
*
I1 = DCOUNT(PLW$EXT,SVM)
FOR I = 1 TO I1
SUB.NAME = PLW$EXT<1,1,I>
CALL @SUB.NAME( '',MSG.EXT, '', '')
NEXT I
*
*=== PLW-MAIN 921 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00430000':OCONV(-1,'MCDX')'R%4':OCONV(10,'MCDX')'R%4':OCONV(PNO.CHK,'MCDX')'R%8':OCONV(MSG.EXT,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
*
RETURN
*
*
*
91000 NULL
*
*=== PLW-MAIN 929 ===*
FN$1 = CHANGE(V,'+',' ')
V = FN$1
*========================================*
*
*=== PLW-MAIN 931 ===*
IF NOT(INDEX(V, '%',1)) THEN 
RETURN
END
*========================================*
*
IF INDEX(V, '%25',1) THEN
*=== PLW-MAIN 934 ===*
FN$1 = CHANGE(V,CHAR(249),CHAR(249): '~~~Q$$$')
V = FN$1
*========================================*
*=== PLW-MAIN 935 ===*
FN$1 = CHANGE(V,'%25',CHAR(249): '~~~P$$$')
V = FN$1
*========================================*
PERCENT.FLG = YES
END ELSE
PERCENT.FLG = NO
END
*
LOOP
T = INDEX(V, '%',1)
WHILE T DO
*#IFN UV
CH = ICONV(V[T+1,2], 'MX')
*#END
*### #IF UV
*### CH = ICONV(V[T+1,2],'MX0C')
*### #END
*=== PLW-MAIN 950 ===*
FN$1 = CHANGE(V,(V[T,3]),CH)
V = FN$1
*========================================*
REPEAT
*
IF PERCENT.FLG THEN
*=== PLW-MAIN 954 ===*
FN$1 = CHANGE(V,CHAR(249): '~~~Q$$$',CHAR(249))
V = FN$1
*========================================*
*=== PLW-MAIN 955 ===*
FN$1 = CHANGE(V,CHAR(249): '~~~P$$$','%')
V = FN$1
*========================================*
END
*
RETURN
*
92000 NULL
*
*=== PLW-MAIN 962 ===*
READ N.CFG FROM PLIP$CTRL.FD , 'CONFIG' ELSE 
CALL PLXX.STOP(202, 'CONFIG')
END
*========================================*
*
IF N.CFG <> O.CFG THEN
*### #IF APPRO|ADDS|SEQ32|P6432
*### CALL PLSUB.INIT
*### #END
CALL PLW.READ.CONFIG( 'RUN')
O.CFG = N.CFG
END
*
RETURN
*
99000 NULL
*
*
T = FIELD(R.ERR, ';',2)
*=== PLW-MAIN 978 ===*
IF T = '' THEN 
T = R.ERR
END
*========================================*
X = T : CRLF : CRLF
CALL PLW.BLD.HTTP.HDR(0,FIELD(FIELD(R.ERR, ';',1), ';',1),ST$KEEP.ALIVE, 'text/plain', '',LEN(X),LL,PL$EXTRAHTTP)
CALL PLIP.BCB.SEND(LL : X)
*
RETURN
*
*=== PLW-MAIN 985 ===*
*
*
*
*
*
*
*
*
*
*
*
990000 NULL
*
BEGIN CASE
CASE ST$TP = ST.TP.SMTP.SEND
CALL PLS.MAIL.SEND.DONE( 'SHUTDOWN')
CASE ST$TP = ST.TP.SMTP.RECV
CALL PLS.SMTP.RECV.ABORT
CASE ST$TP = ST.TP.POP3
CALL PLS.POP3.ABORT
*### #IF TELNET
*### CASE ST$TP = ST.TP.TELNET
*### CALL PLW.TELNET.LOGOFF(ST$TELNET.PORT,ST$TELNET.OPTIONS)
*### PL_DEALLOC.PLCB ST$PLCB ELSE NULL
*### PL_TCP_DEL_Q -1 , ST$PLCB , 0 ELSE NULL
*### INCLUDE PLW.DEL.STATE.FILES.INCLUDE
*### #END
CASE YES
IF ST$PLCB <> '' THEN
IF ST$OBUF.BCB <> '' THEN
T$$$ = 0
END
*=== INCL..1.134 33 ===*
S$ = CALLFN( PLIP$CALL.FAST0.EP:'00440000':OCONV(-1,'MCDX')'R%4':OCONV(ST$PLCB,'MCDX')'R%8':OCONV(0,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END
ERR = 0
END ELSE
ERR = 1
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
*=== INCL..1.134 34 ===*
IF ST$PLCB < 100000 THEN
S$ = CALLFN( PLIP$CALL.FAST0.EP:FNR.DEALLOC.PLCB:OCONV(ST$PLCB,'MCDX')'R%4')
IF S$[3,4] = IPX.SOCKET.NO THEN
ERR = 0
RES = OCONV(S$[7,4],'MCXD')
IF RES > 32768 THEN
RES = RES - 65536
END ELSE
LOCATE(ST$PLCB,RESOURCE.LIST,1;L$$$) THEN
RESOURCE.LIST = DELETE(RESOURCE.LIST,1,L$$$,0)
END
END
END ELSE
ERR = 1
RES = 0
END
END ELSE
ERR = 0
RES = 0
END
IF NOT(ERR) AND RES >= 0 ELSE
NULL
END
*========================================*
END
*=== INCL..1.134 36 ===*
*
*
*
*
*
*
*
*
*
*
*
*=== INCL..1.137 12 ===*
DELETE PL$CONN.FD , ST$PLCB 'R%8'
DELETE PL$CONN.FD , ST$PLCB 'R%8' : '*IBUF'
*========================================*
IF ST$IBUF<1,1> = '~EXTERNAL~' AND ST$IBUF<1,2> MATCHES '1N0N' THEN
FOR I = 1 TO ST$IBUF<1,2> + 1
DELETE PL$CONN.FD , ST$PLCB 'R%8' : '*IBUF*' : I
NEXT I
END
*========================================*
END CASE
*
IF ST$PLCB <> '' THEN
RELEASE PL$CONN.FD , ST$PLCB 'R%8'
END
*
MAT ST$ARRAY = ''
*
RETURN
*========================================*
END
