src/c/scheduler.c
static void iot_schedule_dequeue (iot_schd_queue_t * queue, iot_schedule_t * schedule)
{
  if (schedule->next == NULL)
  {
    if (schedule->previous == NULL) /* If only one schedule in the queue */
    {
      queue->front = NULL;
    }
    else /* If the schedule is at the back of the queue */
    {
      schedule->previous->next = NULL;
    }
  }
  else if (schedule->previous == NULL) /* If the schedule is at the front of the queue */
  {
    schedule->next->previous = NULL;
    queue->front = schedule->next;
  }
  else /* If the schedule is in the middle of the queue */
  {
    schedule->next->previous = schedule->previous;
    schedule->previous->next = schedule->next;
  }
  schedule->next = NULL;
  schedule->previous = NULL;
  queue->length -= 1;
}
/* Remove a schedule from the queue */
Remove a schedule from the queue
Remove a schedule from the queue
static void iot_schedule_dequeue (iot_schd_queue_t * queue, iot_schedule_t * schedule)
{
  if (schedule->next == NULL)
  {
    if (schedule->previous == NULL) 
    {
      queue->front = NULL;
    }
    else 
    {
      schedule->previous->next = NULL;
    }
  }
  else if (schedule->previous == NULL) 
  {
    schedule->next->previous = NULL;
    queue->front = schedule->next;
  }
  else 
  {
    schedule->next->previous = schedule->previous;
    schedule->previous->next = schedule->next;
  }
  schedule->next = NULL;
  schedule->previous = NULL;
  queue->length -= 1;
}
static void iot_schedule_dequeue ( iot_schd_queue_t * queue , iot_schedule_t * schedule ) { if ( schedule -> next == NULL ) { if ( schedule -> previous == NULL ) { queue -> front = NULL ; } else { schedule -> previous -> next = NULL ; } } else if ( schedule -> previous == NULL ) { schedule -> next -> previous = NULL ; queue -> front = schedule -> next ; } else { schedule -> next -> previous = schedule -> previous ; schedule -> previous -> next = schedule -> next ; } schedule -> next = NULL ; schedule -> previous = NULL ; queue -> length -= 1 ; }
Remove a schedule from the queue
Remove a schedule from the queue
/* If only one schedule in the queue */ /* If the schedule is at the back of the queue */ /* If the schedule is at the front of the queue */ /* If the schedule is in the middle of the queue */