Mescal
Loading...
Searching...
No Matches
interrupt.h
Go to the documentation of this file.
1
6
7#ifndef INTERRUPT_H_
8#define INTERRUPT_H_
9
10#include <setjmp.h>
11#include <signal.h>
12#include <stdbool.h>
13#include <stdio.h>
14#include <stdlib.h>
15#include <unistd.h>
16
17#include "error.h"
18
24#define TIMEOUT_DEFAULT 0
25
31extern int timeout_value;
32
38extern bool timeout_flag;
39
45#define LIMIT_DEFAULT 1000000
46
52extern unsigned int limit_value;
53
58extern bool limit_flag;
59
66extern bool interrupt_flag;
67
72void ignore_timeout(void);
73
78void listen_timeout(int value
79);
80
85void ignore_interrupt(void);
86
91void listen_interrupt(void);
92
97void handler(int signum
98);
99
104void listening_mode(int value);
105
110void normal_mode(void);
111
112#endif // INTERRUPT_H_
Macros for displaying error messages.
void ignore_interrupt(void)
Ignores the interrupt signal.
Definition interrupt.c:36
void ignore_timeout(void)
Ignores the timeout signal.
Definition interrupt.c:9
void handler(int signum)
The interrupt handler.
Definition interrupt.c:57
void normal_mode(void)
Ignores all signals and cancel pending alarm, if any.
Definition interrupt.c:83
void listen_interrupt(void)
Listens to the interrupt signal.
Definition interrupt.c:45
void listen_timeout(int value)
Sets an alarm and listens to the SIGALRM signal.
Definition interrupt.c:21
void listening_mode(int value)
Listens to all signals (SIGINT and SIGALRM).
Definition interrupt.c:78