library/src/events/BP-Events.cc
// Attempts to pickup an event (removing it from the registry) by name.  Once the event is picked up,
// the pickup routine must destroy the event itself using it's own destructors.  It will no longer be
// tracked by the event system.
Attempts to pickup an event (removing it from the registry) by name.  Once the event is picked up,
the pickup routine must destroy the event itself using it's own destructors.  It will no longer be
tracked by the event system.
Attempts to pickup an event ( removing it from the registry ) by name . Once the event is picked up the pickup routine must destroy the event itself using it ' s own destructors . It will no longer be tracked by the event system .
P_BP_EVENT BP_EventLoopPickupEventFromPollRegistryByName
(
	P_BP_EVENT_MANAGER mgr,
	char              *event_name
)
{
	if(!mgr)
		return NULL;
	if(!event_name)
		return NULL;
	if(!mgr->events_polled_for_main_loop)
		return NULL;
	if(!BP_StringIsReasonablePrintableString(event_name, bpstrlen(event_name), BP_FALSE, BP_FALSE))
		return NULL;
	BP_HASH_TABLE_ENTER_CRITICAL_SECTION(mgr->events_polled_for_main_loop);
	char *table_path[10];
	BP_ZERO_STACK(table_path);
	table_path[0] = "events";
	table_path[1] = event_name;
	P_BP_HASH_TABLE_KEYED_ENTRY entry_lookup = BP_HashRegLookupTableEntryByPath(mgr->events_polled_for_main_loop, (char **) &table_path);
	if(!entry_lookup)
		BP_HASH_TABLE_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC(mgr->events_polled_for_main_loop, NULL);
	printf("\n [+] Entry Lookup Table Here?: %p - %s", entry_lookup, entry_lookup->key);
	BP_HashRegDisplay(mgr->events_polled_for_main_loop, BP_FALSE, BP_TRUE);
	P_BP_EVENT event_lookup = (P_BP_EVENT) entry_lookup->data;
	printf("\n Got Event Lookup During Pickup: %p - %s", event_lookup, event_lookup->name);
	BP_HashRegDestroyEntry(mgr->events_polled_for_main_loop, entry_lookup);
	BP_HASH_TABLE_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC(mgr->events_polled_for_main_loop, event_lookup);
}
P_BP_EVENT BP_EventLoopPickupEventFromPollRegistryByName ( P_BP_EVENT_MANAGER mgr , char * event_name ) { if ( ! mgr ) return NULL ; if ( ! event_name ) return NULL ; if ( ! mgr -> events_polled_for_main_loop ) return NULL ; if ( ! BP_StringIsReasonablePrintableString ( event_name , bpstrlen ( event_name ) , BP_FALSE , BP_FALSE ) ) return NULL ; BP_HASH_TABLE_ENTER_CRITICAL_SECTION ( mgr -> events_polled_for_main_loop ) ; char * table_path [ 10 ] ; BP_ZERO_STACK ( table_path ) ; table_path [ 0 ] = " " ; table_path [ 1 ] = event_name ; P_BP_HASH_TABLE_KEYED_ENTRY entry_lookup = BP_HashRegLookupTableEntryByPath ( mgr -> events_polled_for_main_loop , ( char * * ) & table_path ) ; if ( ! entry_lookup ) BP_HASH_TABLE_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC ( mgr -> events_polled_for_main_loop , NULL ) ; printf ( " \n " , entry_lookup , entry_lookup -> key ) ; BP_HashRegDisplay ( mgr -> events_polled_for_main_loop , BP_FALSE , BP_TRUE ) ; P_BP_EVENT event_lookup = ( P_BP_EVENT ) entry_lookup -> data ; printf ( " \n " , event_lookup , event_lookup -> name ) ; BP_HashRegDestroyEntry ( mgr -> events_polled_for_main_loop , entry_lookup ) ; BP_HASH_TABLE_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC ( mgr -> events_polled_for_main_loop , event_lookup ) ; }
Attempts to pickup an event (removing it from the registry) by name.
Attempts to pickup an event ( removing it from the registry ) by name .
// run basic checks // attempt to enter critical section // declare and zero out table path // set table path entries // attempt lookup by key name // optional debug display of the manager // set event lookup // destroy hash registry entry here (frees memory) // return the looked up event