library/src/datastructures/BP-DataLists.cc
// creates a new data list entry
creates a new data list entry
creates a new data list entry
P_BP_DATA_LIST BP_CreateDataList(char *description)
{
	P_BP_DATA_LIST data_list = NULL;
	data_list = (P_BP_DATA_LIST) bpcalloc(sizeof(BP_DATA_LIST), 1);
	if(!data_list)
		return NULL;
	data_list->tq = (P_BP_LINKL) BP_CreateLinkL("datalist", BP_TRUE);
	if(!data_list->tq)
		return NULL;
	if(description)
		data_list->desc = tq_strndup(data_list->tq, description, strnlen(description, 512), BPLN);
	char *tmp = (char *) BP_GenRandomUUID();
	data_list->uuid = (char *) tq_strndup(data_list->tq, tmp, strnlen(tmp, 512), BPLN);
	bpfree(tmp);
	return data_list;
}
P_BP_DATA_LIST BP_CreateDataList ( char * description ) { P_BP_DATA_LIST data_list = NULL ; data_list = ( P_BP_DATA_LIST ) bpcalloc ( sizeof ( BP_DATA_LIST ) , 1 ) ; if ( ! data_list ) return NULL ; data_list -> tq = ( P_BP_LINKL ) BP_CreateLinkL ( " " , BP_TRUE ) ; if ( ! data_list -> tq ) return NULL ; if ( description ) data_list -> desc = tq_strndup ( data_list -> tq , description , strnlen ( description , 512 ) , BPLN ) ; char * tmp = ( char * ) BP_GenRandomUUID ( ) ; data_list -> uuid = ( char * ) tq_strndup ( data_list -> tq , tmp , strnlen ( tmp , 512 ) , BPLN ) ; bpfree ( tmp ) ; return data_list ; }
creates a new data list entry
creates a new data list entry
// set data list // allocate space for the list (zero memory) // ensure we created a data list // create our linkl for storing chunks // check to see that we have created a tail queue // duplicate the description here // create new uuid for the list // set the uuid in the data list // destroy the string // return the new data list