254
K
A
DAK
AMX 86 Procedures
ajlmerg ajlmergPurpose Merge Two Lists
Used by n Task n IS P n Timer Procedure n Restart Procedure n Exit Procedure
Setup #include "amx831sd.h"
.
.
struct amxlhs destlist, srclist;
struct appobj *destobj, *srcobj;
.
.
ajlmerg(&destlist, &srclist, destobj, srcobj);
see note
Where &destlist is a pointer to the destination list header.
&srclist is a pointer to the source list header.
destobj is a pointer to the insertion point on the destination list.
srcobj is a pointer to the extraction point on the source list.
Results Interrupts are disabled and then restored to their state at the time of the
call.
All of the objects on the source list are inserted on the destination list
before destobj. Objects are removed from the source list starting with
srcobj, wrapping around from the tail to the head, and ending with the
object immediately previous to srcobj. This list of source objects is then
inserted in order before destobj. The following example illustrates this
process.
Before srcobj
srclist --- X -- Y -- Z
destlist -- A -- B -- C -- D -- E
destobj
After
srclist --- empty
destlist -- A -- B -- Y -- Z -- X -- C -- D -- E