library/src/decoders/HTML/BP-HTMLDeconstructors.cc
// destroy all allocated parts of an extraction
destroy all allocated parts of an extraction
destroy all allocated parts of an extraction
int HTMLDestroyExtraction(P_BP_HTML_FULL_EXTRACTION extracted)
{
	if(!extracted)
		return ERR_FAILURE;
	if(extracted->anchors)
	{
		HTMLDestroyAnchorList(extracted->anchors, extracted->gc);
		extracted->anchors = NULL;
	}
	if(extracted->delims)
	{
		HTMLDestroyAnchorDelimiters(extracted->delims, extracted->gc);
		extracted->delims = NULL;
	}
	if(extracted->forms)
	{
		HTMLDestroyFormList(extracted->forms, extracted);
		extracted->forms = NULL;
	}
	if(extracted->gc)
	{
		BP_DestroyGarbageCollector(extracted->gc);
		extracted->gc = NULL;
	}
	BP_DestroyLinkL(extracted->tq, BP_TRUE);
	bpfree(extracted);
	return ERR_SUCCESS;
}
int HTMLDestroyExtraction ( P_BP_HTML_FULL_EXTRACTION extracted ) { if ( ! extracted ) return ERR_FAILURE ; if ( extracted -> anchors ) { HTMLDestroyAnchorList ( extracted -> anchors , extracted -> gc ) ; extracted -> anchors = NULL ; } if ( extracted -> delims ) { HTMLDestroyAnchorDelimiters ( extracted -> delims , extracted -> gc ) ; extracted -> delims = NULL ; } if ( extracted -> forms ) { HTMLDestroyFormList ( extracted -> forms , extracted ) ; extracted -> forms = NULL ; } if ( extracted -> gc ) { BP_DestroyGarbageCollector ( extracted -> gc ) ; extracted -> gc = NULL ; } BP_DestroyLinkL ( extracted -> tq , BP_TRUE ) ; bpfree ( extracted ) ; return ERR_SUCCESS ; }
destroy all allocated parts of an extraction
destroy all allocated parts of an extraction
// default NULL checks // destroy anchors and sub-var list // destroy forms // destroy the garbage collector // set null // destroy the linkl here // destroy final structure // return indicating success