library/src/datastructures/BP-DataLists.cc
// activates a data list entry by calling relevant callbacks
// within the datalist.
activates a data list entry by calling relevant callbacks
within the datalist.
activates a data list entry by calling relevant callbacks within the datalist .
BP_ERROR_T BP_DataListActivateEntry(P_BP_DATA_LIST data_list, P_BP_DATA_LIST_ENTRY entry)
{
	if(!data_list)
		return ERR_FAILURE;
	if(!entry)
		return ERR_FAILURE;
	if(data_list->prevent_activations == BP_TRUE)
	{
		entry->activation_administratively_prevented = BP_TRUE;
		return ERR_FAILURE;
	}
	if(entry->activation_enabled != BP_TRUE)
	{
		entry->activation_administratively_prevented = BP_TRUE;
		return ERR_FAILURE;
	}
	if(entry->custom_prepare)
	{
		entry->custom_prepare(entry, entry->custom_prepare_params);
	}
	if(entry->data_type == BP_DATA_ENTRY_TYPE_READ)
	{
		if(entry->custom_read)
		{
			entry->custom_read(entry, entry->custom_read_params);
		}
	}
	if(
			(entry->data_type != BP_DATA_ENTRY_TYPE_READ) &&
			(entry->data_type != BP_DATA_ENTRY_TYPE_UNSET)
	)
	{
		if(entry->custom_write)
		{
			entry->custom_write(entry, entry->custom_write_params);
		}
	}
	if(entry->custom_post)
	{
		entry->custom_post(entry, entry->custom_post_params);
	}
	return ERR_SUCCESS;
}
BP_ERROR_T BP_DataListActivateEntry ( P_BP_DATA_LIST data_list , P_BP_DATA_LIST_ENTRY entry ) { if ( ! data_list ) return ERR_FAILURE ; if ( ! entry ) return ERR_FAILURE ; if ( data_list -> prevent_activations == BP_TRUE ) { entry -> activation_administratively_prevented = BP_TRUE ; return ERR_FAILURE ; } if ( entry -> activation_enabled != BP_TRUE ) { entry -> activation_administratively_prevented = BP_TRUE ; return ERR_FAILURE ; } if ( entry -> custom_prepare ) { entry -> custom_prepare ( entry , entry -> custom_prepare_params ) ; } if ( entry -> data_type == BP_DATA_ENTRY_TYPE_READ ) { if ( entry -> custom_read ) { entry -> custom_read ( entry , entry -> custom_read_params ) ; } } if ( ( entry -> data_type != BP_DATA_ENTRY_TYPE_READ ) && ( entry -> data_type != BP_DATA_ENTRY_TYPE_UNSET ) ) { if ( entry -> custom_write ) { entry -> custom_write ( entry , entry -> custom_write_params ) ; } } if ( entry -> custom_post ) { entry -> custom_post ( entry , entry -> custom_post_params ) ; } return ERR_SUCCESS ; }
activates a data list entry by calling relevant callbacks
within the datalist.
activates a data list entry by calling relevant callbacks within the datalist .
// check to ensure we have a data list // check to ensure we have an entry pointer // check to see if the data list heads preventative activation flag is set, if so // exit. // mark as administratively prevented // return indicating failure // Next check if the individual entries activation flag is enabled or not.  If not // exit. // mark as administratively prevented // return indicating failure // if custom prepare is set, run it // activate read callback if type is read // activate write callback if type is read // run custom post function if set // return indicating success