library/src/datastructures/BP-LinkedList.cc
// links an existing chunk into a tailqueue (does a length check, max 100mb length)
links an existing chunk into a tailqueue (does a length check, max 100mb length)
links an existing chunk into a tailqueue ( does a length check max 100mb length )
BP_ERROR_T tq_link_str(P_BP_LINKL head, char * addr,BPLN_PARMS)
{
	if(!head)
		return ERR_FAILURE;
	if(!addr)
		return ERR_FAILURE;
	size_t max_len = 100 * BP_MEGABYTE;
	size_t length = strnlen(addr, max_len);
	if(length >= max_len)
		return ERR_FAILURE;
	if(BP_AddDataToLinkLTail(head, addr, length , BP_MEMPROF_ALLOC_TYPE_STRDUP, file_name, line_number, func) != ERR_SUCCESS)
	{
		return ERR_FAILURE;
	}
	return ERR_SUCCESS;
}
BP_ERROR_T tq_link_str ( P_BP_LINKL head , char * addr , BPLN_PARMS ) { if ( ! head ) return ERR_FAILURE ; if ( ! addr ) return ERR_FAILURE ; size_t max_len = 100 * BP_MEGABYTE ; size_t length = strnlen ( addr , max_len ) ; if ( length >= max_len ) return ERR_FAILURE ; if ( BP_AddDataToLinkLTail ( head , addr , length , BP_MEMPROF_ALLOC_TYPE_STRDUP , file_name , line_number , func ) != ERR_SUCCESS ) { return ERR_FAILURE ; } return ERR_SUCCESS ; }
links an existing chunk into a tailqueue (does a length check, max 100mb length)
links an existing chunk into a tailqueue ( does a length check max 100mb length )
// ensure we have a head entry to work with // set max lookup for strnlen(might fault anyway) // get length // don't link strings > 100mb // attempt to add the chunk and return directly // return indicating success