include/event_queue.c
// Initialize a new queue
// return 1 on failure and 0 on success.
Initialize a new queue
return 1 on failure and 0 on success.
Initialize a new queue return 1 on failure and 0 on success .
int event_queue_init(struct event_queue *queue, unsigned int cap) {
  queue->count = 0;
  queue->cap = cap;
  queue->data = (struct event *)malloc(cap * sizeof(struct event));
  if (queue->data == NULL) return 1;
  return 0;
}
int event_queue_init ( struct event_queue * queue , unsigned int cap ) { queue -> count = 0 ; queue -> cap = cap ; queue -> data = ( struct event * ) malloc ( cap * sizeof ( struct event ) ) ; if ( queue -> data == NULL ) return 1 ; return 0 ; }
Initialize a new queue
return 1 on failure and 0 on success.
Initialize a new queue return 1 on failure and 0 on success .