| lnknfn |
|
Table of contents
Procedure
LNKNFN ( LNK, number of free nodes )
INTEGER FUNCTION LNKNFN ( POOL )
Abstract
Return the number of free nodes in a doubly linked list pool.
Required_Reading
None.
Keywords
LIST
Declarations
IMPLICIT NONE
INTEGER LBPOOL
PARAMETER ( LBPOOL = -5 )
INTEGER POOL ( 2, LBPOOL : * )
Brief_I/O
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
POOL I A doubly linked list pool.
LBPOOL P Lower bound of pool column indices.
The function returns the number of free nodes in the pool.
Detailed_Input
SIZE is the number of nodes in the pool.
POOL is a doubly linked list pool.
Detailed_Output
The function returns the number of free nodes in the pool.
Parameters
LBPOOL 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.
Exceptions
Error free.
Files
None.
Particulars
This routine allows the caller to find the number of free nodes
available in a doubly linked list pool, without having to make
use of knowledge of the internal structure of the pool.
Routines that allocate nodes can use this routine to determine
how many nodes can be allocated safely---an attempt to allocate
a node when no free nodes are available causes a SPICELIB error
to be signaled.
Examples
1) Let POOL be a doubly linked list pool containing 5 nodes.
If POOL contains the list
4 <--> 5 <--> 1 <--> 2
and the node 3 is unallocated, then the function reference
NFREE = LNKNFN ( POOL )
will assign the value 1 to NFREE.
Restrictions
1) 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_References
None.
Author_and_Institution
N.J. Bachman (JPL)
J. Diaz del Rio (ODC Space)
W.L. Taber (JPL)
Version
SPICELIB 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