Important: The information in this document is obsolete and should not be used for new development.
Adding an Entry to the AppleTalk Transition Queue
To ensure that your application is not adversely affected by a transition event, your application places an entry in the AppleTalk Transition Queue.To do this, you must create an AppleTalk Transition Queue entry record of type
ATQentry
and give the LAP Manager a pointer to it. See "The AppleTalk Transition Queue Entry" on page 10-25 for a description of the AppleTalk Transition Queue entry record. This record includes aCallAddr
field that holds a pointer to a transition event handler routine that you provide, which is described in the following section "How the LAP Manager Calls Your Transition Event Handler Routine."Because you provide the memory for the queue entry, you can add as many fields to the end of the entry as you wish for your own purposes. Whenever the LAP Manager calls your transition event handler routine, it provides you with a pointer to the queue entry so that you can have access to the information you stored at the end of your queue entry.
After you have created the AppleTalk Transition Queue entry record, you use the
LAPAddATQ
function to add the entry to the AppleTalk Transition Queue. You pass a pointer to the entry record as the value of the function'stheATQEntry
parameter. Listing 10-2 shows how to do this using assembly language: you place a routine selector in the D0 register, place a pointer to your AppleTalk Transition Queue entry in the A0 register, and execute a JSR instruction to an offset past the start of the LAP Manager. The start of the LAP Manager is contained in the global variableLAPMgrPtr
($B18). The offset to the LAP Manager routines is given by the constantLAPMgrCall
(2).Listing 10-2 Adding an AppleTalk Transition Queue entry
LAPMgrPtr EQU $B18 ;entry point for LAP Manager LAPMgrCall EQU 2 ;offset to LAP Manager ; routines ATQEntry EQU * ;pointer to ATQ entry MOVEQ #23,D0 ;place routine selector ; in D0 MOVE.L LAPMgrPtr,An ;put pointer to LAP Mgr in An MOVE.L ATQEntry,A0 ;put ATQ entry in A0 JSR LAPMgrCall(An) ;jump to start of LAP Mgr ; routinesWhen you no longer want to be notified of transition events or before your program exits, you use theLAPRmvATQ
function to remove your AppleTalk Transition Queue entry from the queue. Listing 10-3 shows how to do this from assembly language; you place the routine selector in the D0 register, place a pointer to your AppleTalk Transition Queue entry in the A0 register, and execute a JSR instruction to an offset past the start
of the LAP Manager. The start of the LAP Manager is contained in the global variableLAPMgrPtr
($B18). The offset to the LAP Manager routines is given by the constantLAPMgrCall
(2).Listing 10-3 Removing an AppleTalk Transition Queue entry
LAPMgrPtr EQU $B18 ;entry point for LAP Manager LAPMgrCall EQU 2 ;offset to LAP Manager ; routines ATQEntry EQU * ;pointer to ATQ entry MOVEQ #24,D0 ;place routine selector ; in D0 (24 to remove an ; entry) MOVE.L LAPMgrPtr,An ;put pointer to LAP Mgr in An MOVE.L ATQEntry,A0 ;put ATQ entry in A0 JSR LAPMgrCall(An) ;jump to start of LAP Mgr ; routines