chiark / gitweb /
Rename F_TYPE_CMP() to F_TYPE_EQUAL()
[elogind.git] / src / shared / macro.h
index bfe03f2ae055ce713d07ef16dc53b3cf8a9229bd..0d3ff1cda578808ec2cb225ee4d97ce5ba213099 100644 (file)
@@ -186,6 +186,8 @@ static inline size_t ALIGN_TO(size_t l, size_t ali) {
 
 #define char_array_0(x) x[sizeof(x)-1] = 0;
 
+#define hasprefix(s, prefix) (memcmp(s, prefix, strlen(prefix)) == 0)
+
 #define IOVEC_SET_STRING(i, s)                  \
         do {                                    \
                 struct iovec *_i = &(i);        \
@@ -271,7 +273,7 @@ do {                                                                    \
   * the const magic to the type, otherwise the compiler warns about
   * signed/unsigned comparison, because the magic can be 32 bit unsigned.
  */
-#define F_TYPE_CMP(a, b) (a == (typeof(a)) b)
+#define F_TYPE_EQUAL(a, b) (a == (typeof(a)) b)
 
 
 /* Returns the number of chars needed to format variables of the