Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

ReleaseVData

Release variable-length data record for reuse.

Short Name

RETVREC()

Type

Low-Level data file function

Declaration

COUNT ReleaseVData(FILNO datno, LONG recbyt)

Description

In V12 the file number typedef was formally changed from COUNT, a two-byte value to FILNO, a four-byte value. Refer to this link for compatibility details. Four Byte File Numbering

ReleaseVData() adds record position recbyt to the pool of deleted records for variable-length file datno. ReleaseVData() should be called when a data record is no longer needed so that the space can be reused. Records returned by ReleaseVData() are reused by NewVData() before the data file is extended. ReleaseVData() is automatically called by DeleteVRecord().

Return

Value

Symbolic Constant

Explanation

0

NO_ERROR

Successful return operation.

2

KDUP_ERR

Attempt to delete a record already in reuse list.

48

FMOD_ERR

datno is not assigned to a variable-length data file.

57

DADV_ERR

Proper lock not found by the FairCom Server.

159

VPNT_ERR

recbyt is zero.

See c-tree Error Codes for a complete listing of valid c-tree error values.

Example

FILNO keyno,datno;

LONG recbyt;


pTEXT target;

if (recbyt = GetKey(keyno,target))

if (DeleteKey(keyno,target,recbyt) == NO_ERROR)

if (ReleaseVData(datno,recbyt) == NO_ERROR)

printf("\nSUCCESS.");

Limitations

The recbyt parameter in this function is a 4-byte value capable of addressing at most 4 gigabytes. If your application supports HUGE files (greater than 4 gigabytes), you must use the ctSETHGH() and ctGETHGH() functions to set or get the high-order 4 bytes of the file offset. See also Record Offsets Under Huge File Support.

See also

ctSETHGH(), ctGETHGH(), DeleteVRecord(), LockCtData(), NewVData()

TOCIndex