library/src/network/BP-Network.cc
// this assigns the provided data list with network callbacks oriented with the provided net_handle.  They
// can be overridden before entry activation to perform whatever action the user prefers but by default
// they utilize BP_NetRead and BP_NetWrite depending on the chunk type.
this assigns the provided data list with network callbacks oriented with the provided net_handle.  They
can be overridden before entry activation to perform whatever action the user prefers but by default
they utilize BP_NetRead and BP_NetWrite depending on the chunk type.
this assigns the provided data list with network callbacks oriented with the provided net_handle . They can be overridden before entry activation to perform whatever action the user prefers but by default they utilize BP_NetRead and BP_NetWrite depending on the chunk type .
BP_ERROR_T BP_DataListSetDefaultNetworkCallbacks(P_BP_DATA_LIST data_list, P_BP_NETWORK_HANDLE net_handle)
{
	if(!data_list)
		return ERR_FAILURE;
	if(!net_handle)
		return ERR_FAILURE;
	P_BP_DATA_LIST_ENTRY entry = (P_BP_DATA_LIST_ENTRY) NULL;
	size_t n = 0;
	for(; n < data_list->entries_n; n++)
	{
			entry = &data_list->entries[n];
			if(entry->data_type != BP_DATA_ENTRY_TYPE_READ)
			{
				entry->custom_write_params = (void *) net_handle;
				entry->custom_write = BP_DataListNetSend;
			}
			else
			{
				entry->custom_read_params = (void *) net_handle;
				entry->custom_read = BP_DataListNetRead;
			}
	}
	return ERR_SUCCESS;
}
BP_ERROR_T BP_DataListSetDefaultNetworkCallbacks ( P_BP_DATA_LIST data_list , P_BP_NETWORK_HANDLE net_handle ) { if ( ! data_list ) return ERR_FAILURE ; if ( ! net_handle ) return ERR_FAILURE ; P_BP_DATA_LIST_ENTRY entry = ( P_BP_DATA_LIST_ENTRY ) NULL ; size_t n = 0 ; for ( ; n < data_list -> entries_n ; n ++ ) { entry = & data_list -> entries [ n ] ; if ( entry -> data_type != BP_DATA_ENTRY_TYPE_READ ) { entry -> custom_write_params = ( void * ) net_handle ; entry -> custom_write = BP_DataListNetSend ; } else { entry -> custom_read_params = ( void * ) net_handle ; entry -> custom_read = BP_DataListNetRead ; } } return ERR_SUCCESS ; }
this assigns the provided data list with network callbacks oriented with the provided net_handle.
this assigns the provided data list with network callbacks oriented with the provided net_handle .
// ensure we have a datalist and a network handle // reference pointer used in the loop below for // simply increasing code readability. // walk the available entries, and plumb them with // the network oriented functions. // set the entry // check entry type // return indicating success