added memeq() macro
This commit is contained in:
@@ -24,8 +24,6 @@
|
|||||||
#ifndef DEFINITIONS_H_
|
#ifndef DEFINITIONS_H_
|
||||||
#define DEFINITIONS_H_
|
#define DEFINITIONS_H_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* stolen from strongswan */
|
/* stolen from strongswan */
|
||||||
#if linux
|
#if linux
|
||||||
# if defined(i386) && !defined(__i386__)
|
# if defined(i386) && !defined(__i386__)
|
||||||
@@ -65,10 +63,15 @@
|
|||||||
#define BUF_LEN 512
|
#define BUF_LEN 512
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Macro compares to strings for equality
|
* Macro compares two strings for equality
|
||||||
*/
|
*/
|
||||||
#define streq(x,y) (strcmp(x, y) == 0)
|
#define streq(x,y) (strcmp(x, y) == 0)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Macro compares two binary blobs for equality
|
||||||
|
*/
|
||||||
|
#define memeq(x,y,len) (memcmp(x, y, len) == 0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Macro gives back larger of two values.
|
* Macro gives back larger of two values.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user