Envoy Application Programming Manual

Table Of Contents
BISYNC Multipoint Tributary Protocol
Envoy Application Programming Manual427159-001
5-46
Programming Examples
Example 5-15. Program Code for BISYNC Multipoint Tributary (Page 7 of 7)
! 2 ! done := 1; ! end-of-file.
! 3 ! ; ! retry.
! 4 ! CALL ABEND; ! fatal error.
END;
CASE (line^done := check^line) OF
BEGIN
! 0 ! ; ! no completion.
! 1 ! BEGIN ! selected.
CALL CANCEL (termfnum);
IF = THEN term^done := 2;
CALL write^term (slinebuf[4],
slinebuf[7],
linelen - 8);
END;
! 2 ! BEGIN ! polled.
CALL send (termbuf,termlen);
term^done := 2;
END;
! 3 ! ; ! error.
END;
END; ! while not done loop.
END; ! doit.
PROC example MAIN;
BEGIN
INT .buf[0:66], ! general purpose buffer.
count;
! read the start-up message to identify home terminal.
buf ’:=’ ["$RECEIVE", 8 * [" "]];
CALL OPEN (buf,count);
CALL READ (count,buf,66);
CALL CLOSE (count);
! open the home terminal for use by the application.
CALL OPEN (buf[9], termfnum, 1); ! nowait.
IF < THEN CALL ABEND;
! open the line.
CALL OPEN (buf[21], linefnum, 1); ! nowait.
IF < THEN CALL ABEND;
! pass the address list to Envoy.
CALL DEFINELIST (linefnum,addr^list,addr^size,
num^entries,poll^count,1);
IF < THEN CALL DEBUG; ! start processing.
CALL doit;
END; ! example.