aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2006-05-24 07:54:20 +0000
committerAndreas Steffen <andreas.steffen@strongswan.org>2006-05-24 07:54:20 +0000
commit77ad0fa043dcf823a49de688e89e21eaa5c99598 (patch)
tree8070ea62dd72f7b457e892180d5d97f40af60ad0 /src
parent4df5f60bd3e043a9a0c2d7f261b09dca6d8f94e2 (diff)
downloadstrongswan-77ad0fa043dcf823a49de688e89e21eaa5c99598.tar.bz2
strongswan-77ad0fa043dcf823a49de688e89e21eaa5c99598.tar.xz
added streq() macro and defined default BUF_LEN
Diffstat (limited to 'src')
-rw-r--r--src/libstrongswan/definitions.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libstrongswan/definitions.h b/src/libstrongswan/definitions.h
index c9ef066c1..f3e0cc690 100644
--- a/src/libstrongswan/definitions.h
+++ b/src/libstrongswan/definitions.h
@@ -59,16 +59,25 @@
#error "BYTE_ORDER must be defined"
#endif
+/**
+ * Default length for various auxiliary text buffers
+ */
+#define BUF_LEN 512
+
+/**
+ * Macro compares to strings for equality
+ */
+#define streq(x,y) (strcmp(x, y) == 0)
/**
* Macro gives back larger of two values.
*/
-#define max(x,y) (x > y ? x : y)
+#define max(x,y) ((x) > (y) ? (x):(y))
/**
* Macro gives back smaller of two values.
*/
-#define min(x,y) (x < y ? x : y)
+#define min(x,y) ((x) < (y) ? (x):(y))
/**
* Debug macro to follow control flow