.title JTsubprc_control ; ; content : subprc-routines ; Starts and sends output to a subprocess. ; $DSCDEF $CLIDEF $IODEF $SSDEF TRUE=-1 FALSE=0 .macro fixdesc,l,a .word l .byte DSC$K_DTYPE_T .byte DSC$K_CLASS_S .address a .endm .macro ascstr,s .ascii "s" .align long .endm ; ; readonly data section ; .psect $PDATA quad,pic,con,lcl,shr,noexe,nowrt argl_spawn: ; argumentlist LIB$SPAWN .long 12 .long 0 ; command-string .address JRTides ; input-file .address JRTodes ; output-file .address flags ; flags .long 0 ; process-name .long 0 ; process-name .long 0 ; command-status .long 0 ; event-flag .long 0 ; ast-address .long 0 ; ast-parameter .long 0 ; prompt .long 0 ; cli JRTides: fixdesc 12,JRTiadr ; input-mailbox descriptor JRTiadr: ascstr JRTodes: fixdesc 13,JRToadr ; output-mailbox descriptor JRToadr: ascstr flags: .long CLI$M_NOWAIT messiz: .long 128 bufsiz: .long 4096 ; ; writeread data section ; .psect $LOCAL quad,pic,con,lcl,noshr,noexe,wrt argl_crembx: ; argumentlist SYS$CREMBX .long 7 .long 0 ; perm-flag .blkl 1 ; channel .address messiz ; max-message .address bufsiz ; buffer-quota .long 0 ; protection-mask .long 0 ; access-mode .blkl 1 ; lognam argl_qio: ; argumentlist SYS$QIOW .long 12 .long 0 ; efn .blkl 1 ; chan .blkl 1 ; func .address stat ; iosb .long 0 ; astadr .long 0 ; astprm .blkl 1 ; p1 .blkl 1 ; p2 .long 0 ; p3 .long 0 ; p4 .long 0 ; p5 .long 0 ; p6 stat: .blkq 1 chani: .blkw 1 chano: .blkw 1 ; ; code section ; .psect $CODE quad,pic,con,lcl,shr,exe,nowrt ;*************************************** ; ; JRT3_SUB_GET ( LIN , LINLEN , OK ) ; ; subprocess get output line ; ;*************************************** .entry JRT3_sub_get,^m<> movw chano,argl_qio+8 movl #IO$_READVBLK!IO$M_NOW,argl_qio+12 movl B^4(ap),r0 movw (r0),argl_qio+32 movl B^4(r0),argl_qio+28 callg argl_qio,G^SYS$QIOW cmpw r0,#SS$_NORMAL bneq 100$ cmpw stat,#SS$_NORMAL bneq 100$ movzwl stat+2,@B^8(ap) movl #TRUE,@B^12(ap) ret 100$: movl #FALSE,@B^12(ap) ret ;*************************************** ; ; JRT3_SUB_INIT ; ; subprocess initiate ; ;*************************************** .entry JRT3_sub_init,^m<> moval chani,argl_crembx+8 moval JRTides,argl_crembx+28 callg argl_crembx,G^SYS$CREMBX moval chano,argl_crembx+8 moval JRTodes,argl_crembx+28 callg argl_crembx,G^SYS$CREMBX callg argl_spawn,G^LIB$SPAWN ret ;*************************************** ; ; JRT3_SUB_PUT ( CMD ) ; ; subprocess put command ; ;*************************************** .entry JRT3_sub_put,^m<> movw chani,argl_qio+8 movl #IO$_WRITEVBLK!IO$M_NOW,argl_qio+12 movl B^4(ap),r0 movw (r0),argl_qio+32 movl B^4(r0),argl_qio+28 callg argl_qio,G^SYS$QIOW ret .end