Commit a421de43 authored by Jan Včelák's avatar Jan Včelák 🚀
Browse files

events: add zone_events_is_scheduled() API

parent e25c49ed
......@@ -282,6 +282,11 @@ void zone_events_schedule_at(zone_t *zone, zone_event_type_t type, time_t time)
pthread_mutex_unlock(&events->mx);
}
bool zone_events_is_scheduled(zone_t *zone, zone_event_type_t type)
{
return zone_events_get_time(zone, type) > 0;
}
void zone_events_enqueue(zone_t *zone, zone_event_type_t type)
{
if (!zone || !valid_event(type)) {
......
......@@ -119,6 +119,14 @@ void zone_events_schedule_at(struct zone_t *zone, zone_event_type_t type, time_t
*/
void zone_events_schedule(struct zone_t *zone, zone_event_type_t type, unsigned dt);
/*!
* \brief Check if zone event is scheduled.
*
* \param zone Zone to check event of.
* \param type Type of event.
*/
bool zone_events_is_scheduled(struct zone_t *zone, zone_event_type_t type);
/*!
* \brief Cancel one zone event.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment