lnkfsl |
Table of contents
ProcedureLNKFSL ( LNK, free sublist of a list ) SUBROUTINE LNKFSL ( HEAD, TAIL, POOL ) AbstractFree a specified sublist in a list. Required_ReadingNone. KeywordsLIST DeclarationsIMPLICIT NONE INTEGER LBPOOL PARAMETER ( LBPOOL = -5 ) INTEGER HEAD INTEGER TAIL INTEGER POOL ( 2, LBPOOL : * ) Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- HEAD, TAIL I Head and tail nodes of a sublist to be freed. POOL I-O A doubly linked list pool. Detailed_InputHEAD, TAIL are, respectively, the head and tail nodes of a sublist to be extracted. POOL is a doubly linked list pool. Detailed_OutputPOOL is the input pool, with the following modifications: -- All of the nodes of the sublist bounded by HEAD and by TAIL have now been returned to the free list. If on input, HEAD was preceded by the node PREV, and tail was followed by the node NEXT, then on output -- The successor of PREV is NEXT. -- The predecessor of NEXT is PREV. ParametersLBPOOL is the lower bound of the column indices of the POOL array. The columns indexed LBPOOL to 0 are reserved as a control area for the pool. Exceptions1) If either of HEAD or TAIL are not valid node numbers, the error SPICE(INVALIDNODE) is signaled. POOL will not be modified. 2) If either of HEAD or TAIL are valid node numbers but are not allocated, the error SPICE(UNALLOCATEDNODE) is signaled. POOL will not be modified. 3) If TAIL cannot be reached by forward traversal of the list containing HEAD, the error SPICE(INVALIDSUBLIST) is signaled. POOL will not be modified. FilesNone. ParticularsDeleting a sublist from a list returns all of the nodes in the sublist to the free list. To remove a sublist from a list and retain the sublist as a second list, use the routine LNKXSL ( LNK, extract sublist ). Examples1) Let POOL be a doubly linked list pool containing the list 1002 <--> 3 <--> 7 <--> 88 <--> 2 To delete the sublist 3 <--> 7 <--> 88 the call CALL LNKFSL ( 3, 88, POOL ) can be used. The resulting list will be: 1002 <--> 2 The nodes 3, 7, and 88 will now be on the free list. 2) Let POOL be a doubly linked list pool containing the list 1002 <--> 3 <--> 7 <--> 88 <--> 2 To free the entire list, the call CALL LNKFSL ( 1002, 2, POOL ) should be used. Restrictions1) Linked list pools must be initialized via the routine LNKINI. Failure to initialize a linked list pool will almost certainly lead to confusing results. Literature_ReferencesNone. Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) W.L. Taber (JPL) VersionSPICELIB Version 1.0.1, 24-NOV-2021 (JDR) Edited the header to comply with NAIF standard. SPICELIB Version 1.0.0, 19-DEC-1995 (NJB) (WLT) |
Fri Dec 31 18:36:31 2021