X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Fcommon.h;h=a690149a1a175b330435dcf82fa990b471d5b699;hb=e98b2d71aa507c8656b47752a529a3a2a619875a;hp=67ea195185011e063d12b8c7eaca4bcae278e7ab;hpb=0f827545e0eb6846608da4aaf4dc8047478070a4;p=matches%2FMCTX3420.git diff --git a/server/common.h b/server/common.h index 67ea195..a690149 100644 --- a/server/common.h +++ b/server/common.h @@ -10,6 +10,9 @@ #define _BSD_SOURCE #define _XOPEN_SOURCE 600 +/** The current API version **/ +#define API_VERSION 0 + #include #include #include @@ -23,6 +26,11 @@ #include "log.h" #include "fastcgi.h" -#include "thread.h" + +/**Converts a timeval to a double**/ +#define TIMEVAL_TO_DOUBLE(tv) ((tv).tv_sec + 1e-6 * ((tv).tv_usec)) +/**Takes the tv1-tv2 between two timevals and returns the result as a double*/ +#define TIMEVAL_DIFF(tv1, tv2) ((tv1).tv_sec - (tv2).tv_sec + 1e-6 * ((tv1).tv_usec - (tv2).tv_usec)) + #endif //_COMMON_H