VgwDocSetFreeFnc


Use the VgwDocSetFreeFnc function to destroy the context created by the VgwDocSetNewFnc function for a document set. The Verity engine calls your VgwDocSetFreeFnc function after all keys have been processed.


Syntax

VdkError VgwDocSetFreeFnc (
   VgwDocSet vgwDocSet)

Arguments

 


vgwDocSet

VgwDocSet A reference to the gateway’s document set handle to be freed.


Returns

This function must return one of the following error codes:

VdkSuccess for success

 

VdkError_* for a standard Verity Developer Kit API error as described in the Verity Developer’s Kit Programming Reference

 


Discussion

Your VgwDocSetFreeFnc function must free the document set handle specified by the vgwDocSet argument and any structures used to access the document set. Static structures need not be freed.

There is no guarantee to the order in which a document set will be freed.


Example

static VdkError
VDK_CALLBACK VgwDocSetFree(VgwDocSet pVDSet)
{
if (!pVDSet)
return VdkSuccess;

/*********************************
* freeing pre-fetched table here
*********************************/

if (pVDSet->queue)
free(pVDSet->queue);

/***************************************************
* no need to free static field column info members
***************************************************/

if (pVDSet->columnArray[0])
free(pVDSet->columnArray[0]);
if (pVDSet->columnArray)
free(pVDSet->columnArray);

if (pVDSet->startPoint)
free((void*)pVDSet->startPoint);


/****************************************
* free the data created in VgwDocSetNew
****************************************/

free(pVDSet);
return VdkSuccess;
}