ekdelr |
Table of contents
ProcedureEKDELR ( EK, delete record from segment ) SUBROUTINE EKDELR ( HANDLE, SEGNO, RECNO ) AbstractDelete a specified record from a specified E-kernel segment. Required_ReadingEK KeywordsPRIVATE UTILITY DeclarationsIMPLICIT NONE INCLUDE 'ekbool.inc' INCLUDE 'ekcoldsc.inc' INCLUDE 'ekcnamsz.inc' INCLUDE 'eksegdsc.inc' INCLUDE 'ektype.inc' INTEGER HANDLE INTEGER SEGNO INTEGER RECNO Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- HANDLE I File handle. SEGNO I Segment number. RECNO I Record number. Detailed_InputHANDLE is a file handle of an EK open for write access. SEGNO is the number of the segment from which to delete the specified record. RECNO is the index of the record to delete. RECNO must be in the range 1 : NREC, where NREC is the number of records in the segment prior to the insertion. Detailed_OutputNone. See the $Particulars section for a description of the effect of this routine. ParametersNone. Exceptions1) If HANDLE is invalid, an error is signaled by a routine in the call tree of this routine. The file will not be modified. 2) If SEGNO is out of range, the error SPICE(INVALIDINDEX) is signaled. The file will not be modified. 3) If RECNO is out of range, the error SPICE(INVALIDINDEX) is signaled. The file will not be modified. 4) If an I/O error occurs while reading or writing the indicated file, the error is signaled by a routine in the call tree of this routine. The file may be corrupted. FilesSee the EK Required Reading ek.req for a discussion of the EK file format. ParticularsThis routine operates by side effects: it deletes a record from an EK segment. Deleting a record implies: 1) All column entries in the record are deleted. 2) Link counts are decremented for data pages containing column entries in the record to be deleted. Pages whose link counts drop to zero are freed. 3) All column indexes are updated for the parent segment. 4) The link count is decremented for the page containing the record pointer structure of the record to be deleted. If the link count drops to zero, the page is freed. 5) The pointer to the deleted record is deleted from the record tree for the parent segment. 6) The segment's metadata is updated to reflect the new record count. Examples1) Suppose the second segment of an EK file designated by HANDLE contains 5 records: +-----------------+ | Record 1 | +-----------------+ | Record 2 | +-----------------+ | Record 3 | +-----------------+ | Record 4 | +-----------------+ | Record 5 | +-----------------+ Then the call CALL EKDELR ( HANDLE, 2, 3 ) deletes the third record from the segment, leaving the segment's contents as follows: +-----------------+ | Record 1 | +-----------------+ | Record 2 | +-----------------+ | Record 4 | +-----------------+ | Record 5 | +-----------------+ RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) VersionSPICELIB Version 1.1.0, 26-MAY-2021 (JDR) Added IMPLICIT NONE statement. Edited the header to comply with NAIF standard. SPICELIB Version 1.0.0, 19-DEC-1995 (NJB) |
Fri Dec 31 18:36:18 2021