library/src/datastructures/BP-LinkedList.cc
// links a pointer array to a tailqueue
links a pointer array to a tailqueue
links a pointer array to a tailqueue
BP_ERROR_T tq_link_ptr_array(P_BP_LINKL head, void ** ptrs, size_t ptr_n, size_t *lengths, BP_BOOL link_ptr_container, BPLN_PARMS)
{
	if(!head)
		return ERR_FAILURE;
	if(!ptrs || !ptr_n || !lengths)
		return ERR_FAILURE;
	size_t n = 0;
	for(; n < ptr_n; n++)
	{
		if(BP_AddDataToLinkLTail(head, (void *) ptrs[n], 100, BP_MEMPROF_ALLOC_TYPE_MALLOC, file_name, line_number, func) != ERR_SUCCESS)
		{
			printf("\n Failed to link.");
		}
	}
	if(BP_AddDataToLinkLTail(head, (void *) ptrs, ptr_n*sizeof(size_t) , BP_MEMPROF_ALLOC_TYPE_MALLOC, file_name, line_number, func) != ERR_SUCCESS)
	{
		printf("\n Failed to link.");
	}
	return ERR_SUCCESS;
}
BP_ERROR_T tq_link_ptr_array ( P_BP_LINKL head , void * * ptrs , size_t ptr_n , size_t * lengths , BP_BOOL link_ptr_container , BPLN_PARMS ) { if ( ! head ) return ERR_FAILURE ; if ( ! ptrs || ! ptr_n || ! lengths ) return ERR_FAILURE ; size_t n = 0 ; for ( ; n < ptr_n ; n ++ ) { if ( BP_AddDataToLinkLTail ( head , ( void * ) ptrs [ n ] , 100 , BP_MEMPROF_ALLOC_TYPE_MALLOC , file_name , line_number , func ) != ERR_SUCCESS ) { printf ( " \n " ) ; } } if ( BP_AddDataToLinkLTail ( head , ( void * ) ptrs , ptr_n * sizeof ( size_t ) , BP_MEMPROF_ALLOC_TYPE_MALLOC , file_name , line_number , func ) != ERR_SUCCESS ) { printf ( " \n " ) ; } return ERR_SUCCESS ; }
links a pointer array to a tailqueue
links a pointer array to a tailqueue
// ensure we have a head entry to work with // walk pointers and link // link the item // tq_link(head, ptrs[n], lengths[n], file_name, line_number, func); // return indicating success