Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

FreeHistoryNbr

Free space allocated for a transaction history.

Short Name

FREHSTN()

Type

Low-Level function

Declaration

COUNT FreeHistoryNbr(COUNT hstnum)

Description

FreeHistoryNbr() frees history number hstnum. This routine permits flexible use of a large number of histories within particular code segments responsible for the creation and clean up of the particular histories. Instead of freeing all histories any time one history needs to be freed, this function frees histories one at a time.

Return

This routine returns an error code, but should return NO_ERROR (0) even if the hstnum given does not exist. See FairCom DB Error Codes for a complete listing of valid FairCom DB error values.

Example

ChangeHistory(0);

if ((retval = TransactionHistory(CUSTIDX, target, &bufptr, 0L,

(VRLEN) INPBUFSIZ+40,

ctHISTfirst | ctHISTkey | ctHISTdata)) > 0) {

printf("\nError in first call : %d", retval);

isam_error();

return;

}

displayhistorybuffer(bufptr, INPBUFSIZ);

repeat("\n\nGet next match? ", choice);


while ((choice[0] == 'Y') || (choice[0] == 'y')) {

if ((retval = TransactionHistory(-1, (pVOID) 0, &bufptr,

0L, (VRLEN) INPBUFSIZ+40, ctHISTnext)) > 0) {

if (retval == HENT_ERR) {

printf("\nEnd of logs or bad logs.");

} else {

printf("\nError in subsequent call : %d", retval);

isam_error();

}

return;

} else {

displayhistorybuffer(bufptr, INPBUFSIZ);

repeat("\n\nGet more data? ", &choice);

}

}

TransactionHistory(-1,(pVOID) 0, (pVOID) 0, -1L, (VRLEN) 0, ctHISTlog);

/* Default terminating call */

FreeHistoryNbr(0);

See also

TransactionHistory(), FreeHistory(), ChangeHistory()

TOCIndex