library/src/decoders/HTML/BP-HTMLDeconstructors.cc
// destroy a form list and its child input list
destroy a form list and its child input list
destroy a form list and its child input list
int HTMLDestroyFormList(P_BP_HTML_FORM_LIST formList, P_BP_HTML_FULL_EXTRACTION extraction)
{
	if(formList == NULL)
		return ERR_FAILURE;
	for
	(
			formList = formList->first;
			formList;
	)
	{
		if(formList->inputs)
		{
			HTMLDestroyFormInputList(formList->inputs->first, extraction);
		}
		if(formList->properties != NULL)
		{
			HTMLDestroyFormPropertiesList(formList->properties->first, extraction);
		}
		if(!formList->next)
		{
			tq_free(extraction->tq, formList);
			formList = NULL;
			break;
		}
		formList = formList->next;
		if(formList->prev)
		{
			tq_free(extraction->tq, formList->prev);
		}
	}
	return ERR_SUCCESS;
}
int HTMLDestroyFormList ( P_BP_HTML_FORM_LIST formList , P_BP_HTML_FULL_EXTRACTION extraction ) { if ( formList == NULL ) return ERR_FAILURE ; for ( formList = formList -> first ; formList ; ) { if ( formList -> inputs ) { HTMLDestroyFormInputList ( formList -> inputs -> first , extraction ) ; } if ( formList -> properties != NULL ) { HTMLDestroyFormPropertiesList ( formList -> properties -> first , extraction ) ; } if ( ! formList -> next ) { tq_free ( extraction -> tq , formList ) ; formList = NULL ; break ; } formList = formList -> next ; if ( formList -> prev ) { tq_free ( extraction -> tq , formList -> prev ) ; } } return ERR_SUCCESS ; }
destroy a form list and its child input list
destroy a form list and its child input list
// default null check // destroy inputs // destroy properties // list termination logic // move to the next position // return indicating success