2023-11-16 04:38:29 +01:00
|
|
|
#ifndef TIMER_H
|
|
|
|
#define TIMER_H
|
2023-10-24 05:14:31 +02:00
|
|
|
|
|
|
|
#include <signal.h>
|
|
|
|
|
2023-10-25 16:30:08 +02:00
|
|
|
#include "block.h"
|
|
|
|
|
2023-10-24 05:14:31 +02:00
|
|
|
#define TIMER_SIGNAL SIGALRM
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
unsigned int time;
|
|
|
|
const unsigned int tick;
|
|
|
|
const unsigned int reset_value;
|
|
|
|
} timer;
|
|
|
|
|
2023-10-25 16:30:08 +02:00
|
|
|
timer timer_new(const block *const blocks, const unsigned short block_count);
|
2023-10-24 05:14:31 +02:00
|
|
|
int timer_arm(timer *const timer);
|
2023-11-16 04:38:29 +01:00
|
|
|
|
|
|
|
#endif // TIMER_H
|