chunk_equals_ptr added to compare chunks given as pointers.
This commit is contained in:
@@ -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);
|
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.
|
* Increment a chunk, as it would reprensent a network order integer.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user