library/src/datastructures/BP-LinkedList.cc
// displays a single linked list item
displays a single linked list item
displays a single linked list item
BP_ERROR_T BP_DisplayLinkLItem(P_BP_LINKL_DATA item)
{
	if(!item)
		return ERR_FAILURE;
	printf("\n\t [+] List Item: %p", item);
	if(item->file)
		printf("\n\t\t allocated at: (%s:%u) : %s", item->file, item->line_number, item->function);
	printf("\n\t\t data:        %p", item->data);
	printf("\n\t\t data_size:   %u", item->data_size);
	printf("\n\t\t data_type:   ");
	switch(item->data_type)
	{
		case BP_MEMPROF_ALLOC_TYPE_UNSET:
			printf("BP_MEMPROF_ALLOC_TYPE_UNSET");
			break;
		case BP_MEMPROF_ALLOC_TYPE_MALLOC:
			printf("BP_MEMPROF_ALLOC_TYPE_MALLOC");
			break;
		case BP_MEMPROF_ALLOC_TYPE_CALLOC:
			printf("BP_MEMPROF_ALLOC_TYPE_CALLOC");
			break;
		case BP_MEMPROF_ALLOC_TYPE_STRDUP:
			printf("BP_MEMPROF_ALLOC_TYPE_STRDUP");
			break;
		case BP_MEMPROF_ALLOC_TYPE_STRNDUP:
			printf("BP_MEMPROF_ALLOC_TYPE_STRNDUP");
			break;
		case BP_MEMPROF_ALLOC_TYPE_REALLOC:
			printf("BP_MEMPROF_ALLOC_TYPE_REALLOC");
			break;
		case BP_MEMPROF_ALLOC_TYPE_USER_DEFINED_ASCII:
			printf("BP_MEMPROF_ALLOC_TYPE_USER_DEFINED_ASCII");
			break;
		default:
			printf("UNKNOWN TYPE");
			break;
	}
	printf("\n");
	return ERR_SUCCESS;
}
BP_ERROR_T BP_DisplayLinkLItem ( P_BP_LINKL_DATA item ) { if ( ! item ) return ERR_FAILURE ; printf ( " \n \t " , item ) ; if ( item -> file ) printf ( " \n \t \t " , item -> file , item -> line_number , item -> function ) ; printf ( " \n \t \t " , item -> data ) ; printf ( " \n \t \t " , item -> data_size ) ; printf ( " \n \t \t " ) ; switch ( item -> data_type ) { case BP_MEMPROF_ALLOC_TYPE_UNSET : printf ( " " ) ; break ; case BP_MEMPROF_ALLOC_TYPE_MALLOC : printf ( " " ) ; break ; case BP_MEMPROF_ALLOC_TYPE_CALLOC : printf ( " " ) ; break ; case BP_MEMPROF_ALLOC_TYPE_STRDUP : printf ( " " ) ; break ; case BP_MEMPROF_ALLOC_TYPE_STRNDUP : printf ( " " ) ; break ; case BP_MEMPROF_ALLOC_TYPE_REALLOC : printf ( " " ) ; break ; case BP_MEMPROF_ALLOC_TYPE_USER_DEFINED_ASCII : printf ( " " ) ; break ; default : printf ( " " ) ; break ; } printf ( " \n " ) ; return ERR_SUCCESS ; }
displays a single linked list item
displays a single linked list item
// ensure we have an item // display source debug information if necessary // add trailing newline // return indicating success