chunk_equals_ptr added to compare chunks given as pointers.

This commit is contained in:
Tobias Brunner 2012-02-29 18:06:49 +01:00
parent 1726795fa9
commit 68611395dc

View File

@ -250,6 +250,15 @@ static inline bool chunk_equals(chunk_t a, chunk_t b)
a.len == b.len && memeq(a.ptr, b.ptr, a.len);
}
/**
* Compare two chunks (given as pointers) for equality (useful as callback),
* NULL chunks are never equal.
*/
static inline bool chunk_equals_ptr(chunk_t *a, chunk_t *b)
{
return a != NULL && b != NULL && chunk_equals(*a, *b);
}
/**
* Increment a chunk, as it would reprensent a network order integer.
*