LL_SYNCH

Synchronize duplicate linked-list control structures

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
xcall LL_SYNCH(mentor, protege[, deleted])

mentor

The linked-list control structure that contains the most up-to-date information. (a)

protege

Another linked-list control structure for the same linked list. (a)

deleted

(optional) Returned true if the protege’s current record has been deleted. (n)

LL_SYNCH synchronizes two control structures for the same linked list.

It is possible to maintain more than one context in a linked list simply by copying the control structure and using one or the other copy in calls to %LL_PROCESS. The only time this can cause a problem is if records are inserted, appended, deleted, or moved in the list. In any of these cases, the secondary control structure will become outdated and will need to be updated.

This subroutine updates one control structure from another. The mentor control structure is assumed to possess the most up-to-date information about the linked list, and the protege control structure will learn from it, while maintaining its own current context in the linked list.

If the control structures do not refer to the same linked list, no action will be taken.

If protege’s current item has been deleted, deleted may optionally be returned true. In this case, the previous and next records will also be checked for deletion, and if they are deleted their pointers will be erased. It is therefore recommended that you re-sync control structures after each such operation, or else discard the protege control structure altogether.

Any “marked” record (through D_LL_MARK passed to %LL_PROCESS) will also be checked for deletion. If it has been deleted, there will be no marked record for the protege control structure.

The example below updates the information in lnkctl2 from the information in lnkctl, and returns delflg set to true if the current item in lnkctl2 has been deleted.

xcall ll_synch(lnkctl, lnkctl2, delflg)