Added module for direct control over pins
[matches/MCTX3420.git] / server / common.h
1 /**
2  * @file common.h
3  * @brief Common header includes
4  */
5
6 #ifndef _COMMON_H
7 #define _COMMON_H
8
9 #define _POSIX_C_SOURCE 200809L
10 #define _BSD_SOURCE
11 #define _XOPEN_SOURCE 600
12
13 /** The current API version **/
14 #define API_VERSION 0
15
16 #include <stdlib.h>
17 #include <stdio.h>
18 #include <stdbool.h>
19 #include <string.h>
20 #include <errno.h>
21 #include <pthread.h>
22 #include <unistd.h>
23 #include <assert.h>
24 #include <sys/time.h>
25 #include <time.h>
26
27 #include "log.h"
28 #include "fastcgi.h"
29 #include "control.h"
30
31 /**Converts a timeval to a double**/
32 #define TIMEVAL_TO_DOUBLE(tv) ((tv).tv_sec + 1e-6 * ((tv).tv_usec))
33 /**Takes the tv1-tv2 between two timevals and returns the result as a double*/
34 #define TIMEVAL_DIFF(tv1, tv2) ((tv1).tv_sec - (tv2).tv_sec + 1e-6 * ((tv1).tv_usec - (tv2).tv_usec))
35
36
37
38
39 #endif //_COMMON_H

UCC git Repository :: git.ucc.asn.au