X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Fcommon.h;h=d4defd95c949046007bfbc2820d612302739b30b;hb=826791abc3a3bb383c2908d7d39618b99ad7665c;hp=5f71f9fcaa05f998aa0dda0fc5c3f0b0ab5b0e5e;hpb=7ca215713fa73c84ba0b46c9e7299386bd5cf5b8;p=matches%2FMCTX3420.git diff --git a/server/common.h b/server/common.h index 5f71f9f..d4defd9 100644 --- a/server/common.h +++ b/server/common.h @@ -1,13 +1,28 @@ /** * @file common.h - * @purpose Common header includes + * @brief Common header includes */ #ifndef _COMMON_H #define _COMMON_H +/** Defines required to allow various C standard functions to be used **/ #define _POSIX_C_SOURCE 200809L #define _BSD_SOURCE +#define _XOPEN_SOURCE 600 + +/** Determine if we're running on the BBB **/ +#ifdef __arm__ + #define _BBB +#else + //#warning This software was designed for the BeagleBone Black. Some features may not work. +#endif //__arm__ + +/** The current API version **/ +#define API_VERSION 0 + + + #include #include @@ -17,8 +32,22 @@ #include #include #include +#include +#include #include "log.h" #include "fastcgi.h" +#include "control.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)) + + +extern bool PathExists(const char * path); + + + #endif //_COMMON_H