.TITLE CNCT .IDENT /08MY89/ ; An external procedure to provide parent-offspring connect services to ; Pascal-3 programs. The exit AST is not available to Pascal. ; ; File: [22,310]CNCT.MAC ; HISTORY: ; ; 08-May-89. Philip Hannay. Created from SPAWN.MAC. ; ; Last Edit: 8-MAY-1989 17:41:47 ; ; ; PROCEDURE CNCT(Task:Rad56; EFN:Event_Flag; VAR Status:SPAWN_Status_array); ; ;{*USER* ;CNCT will let the calling task connect to another active task for purposes ;of exit notification. The program using the CNCT directive (caller) will ;become the "parent" task, and the program named in TASK parameter will ;become the "offspring" task. When the offspring task exits, the parent will ;be notified by the setting of the event flag specified by the EFN parameter ;and the exit status information will be placed in the STATUS parameter. ;The type SPAWN_STATUS_ARRAY is defined in PAS$EXT:SPAWN.TYP. ; ;Note that the offspring task may exit at any time, so the STATUS parameter ;must be available to the executive. Normally this means that STATUS ;must be a global variable. It can also be a local variable, if you ;will not leave that procedure before the offspring task exits. ; ;If the parent task exits before the offspring task, the connection block ;will be removed from pool with no effect on the system. Once a connection ;is made, the parent may not remove the connection except by exiting, or ;by passing all current connections to another task using the RPOI ;directive. ; ;There is no restriction on the number of connections that can be ;made, including the number made to the same task. For this reason, it ;is important not to indiscrimately make connections to the same task, ;as multiple connections to the same task will increase pool ;consumption. Use the directive status to determine if a connection ;has been made. A connection is made ONLY if a success IS.SUC (1) ;is returned in $DSW. The only "normal" error codes are IE.INS or IE.ACT. ;All other errors indicate a programming error or a congested/crashing system. ; ;*STATUS CODES* ; ; 1 = successful completion (IS.SUC) ; -1 = insufficient pool for connection block (IE.UPN) ; -2 = specified task was a CLI or not installed (IE.INS) ; -7 = specified task was not active (IE.ACT) ; -97 = invalid event flag specified (IE.IEF) ; -98 = DPB not in user's program space (IE.ADP) ; -99 - DIC/DPB size is invalid (IE.SDP) ; ; } ; PROC CNCT PARAM TASK, 2*INTEGER ; RAD-50 TASK NAME PARAM EFN, INTEGER ; event flag PARAM STAT, ADDRESS ; STATUS ARRAY POINTER SAVE BEGIN .MCALL CNCT$S MOV SP,R0 ;PRESERVE STACK REFERENCE MOV SP, R1 ;GET POINTER TO TASK NAME ADD #TASK, R1 ; R1 -> TASK NAME CLR R2 MOVB EFN(SP), R2 ; GET BYTE ONLY CNCT$S R1,R2,,STAT(0) ENDPR .END