queue.h 658 Bytes
#ifndef __QUEUE_H_
#define __QUEUE_H_

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <stddef.h>
#include "device.h"

struct action {
  int command;
  int running;
  double start;
  double data;
  double end;
  struct action *next;
};

struct action *head = NULL;
struct action *tail = NULL;
struct action *current = NULL;

void enqueue(int command, double start, double duration, int level);

void loop_queue();
void setup_queue();

void entry_running(struct action *ptr);
int entry_start(struct action *ptr);
void entry_end(struct action *ptr);
void entry_end(struct button *ptr);
void entry_end(int source);

#endif