From 7c321d614e8d91b23434b13bfcf89274797815ec Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Sat, 22 Apr 2017 22:24:06 +0200 Subject: Initial Commit. --- src/pervasive.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/pervasive.h (limited to 'src/pervasive.h') diff --git a/src/pervasive.h b/src/pervasive.h new file mode 100644 index 0000000..e69d077 --- /dev/null +++ b/src/pervasive.h @@ -0,0 +1,31 @@ +#ifndef _JH_PERVASIVE_H_ +#define _JH_PERVASIVE_H_ + +#include + +#define JH_PROGRAM_VERSION 1 +#define JH_PROTOCOL_VERSION 1 + +#ifdef __FRAMA_C__ + #define JH_RUNNING_FRAMA_C 1 +#endif + +#define JH_DEBUG_ALL 1 + +#ifndef JH_DEBUG_ALL + #define JH_DEBUG_ALL 0 +#endif +#ifndef JH_DEBUG_DISPLAY_IRC_MSG_EXCHANGES + #define JH_DEBUG_DISPLAY_IRC_MSG_EXCHANGES JH_DEBUG_ALL +#endif + +#define JH__TO_STRING(x) #x +#define JH_TO_STRING(x) JH__TO_STRING(x) +#define JH_ISOLATE(a) do {a} while (0) + +/* strncmp stops at '\0' and strlen does not count '\0'. */ +#define JH_IS_PREFIX(a, b) (strncmp(a, b, strlen(a)) == 0) + +#define JH_STRING_EQUALS(a, b) (strcmp(a, b) == 0) + +#endif -- cgit v1.2.3-70-g09d2