library/src/decoders/HTML/BP-HTMLDeconstructors.cc
// destroy an anchor lists sub variable list
destroy an anchor lists sub variable list
destroy an anchor lists sub variable list
int HTMLDestroyAnchorVarSublist(P_BP_HTML_ANCHOR_VAR_LIST anchorVars, P_BP_GARBAGE_COLLECTOR_DATA gc){
	if(anchorVars == NULL) return ERR_FAILURE;
	if(anchorVars->first != NULL)
	for(anchorVars = anchorVars->first; anchorVars != NULL; ){
		if(anchorVars->content != NULL){
			BP_free(gc, NULL, anchorVars->content);
			anchorVars->content = NULL;
		}
		if(anchorVars->name != NULL){
			BP_free(gc, NULL, anchorVars->name);
			anchorVars->name = NULL;
		}
		if(anchorVars->next == NULL){
			BP_free(gc, NULL, anchorVars);
			anchorVars = NULL;
			break;
		} else {
			anchorVars = anchorVars->next;
			if(anchorVars->prev != NULL){
				BP_free(gc, NULL, anchorVars->prev);
				anchorVars->prev = NULL;
			}
		}
	}
	return ERR_SUCCESS;
}
int HTMLDestroyAnchorVarSublist ( P_BP_HTML_ANCHOR_VAR_LIST anchorVars , P_BP_GARBAGE_COLLECTOR_DATA gc ) { if ( anchorVars == NULL ) return ERR_FAILURE ; if ( anchorVars -> first != NULL ) for ( anchorVars = anchorVars -> first ; anchorVars != NULL ; ) { if ( anchorVars -> content != NULL ) { BP_free ( gc , NULL , anchorVars -> content ) ; anchorVars -> content = NULL ; } if ( anchorVars -> name != NULL ) { BP_free ( gc , NULL , anchorVars -> name ) ; anchorVars -> name = NULL ; } if ( anchorVars -> next == NULL ) { BP_free ( gc , NULL , anchorVars ) ; anchorVars = NULL ; break ; } else { anchorVars = anchorVars -> next ; if ( anchorVars -> prev != NULL ) { BP_free ( gc , NULL , anchorVars -> prev ) ; anchorVars -> prev = NULL ; } } } return ERR_SUCCESS ; }
destroy an anchor lists sub variable list
destroy an anchor lists sub variable list
// default NULL checks // deconstruct the list // destroy content // destroy name string // list element deconstruction logic // return indicating success