mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s3: Add tdb_data_equal
This commit is contained in:
parent
a035062f11
commit
ebc08b9938
@ -38,6 +38,14 @@ TDB_DATA make_tdb_data(const uint8_t *dptr, size_t dsize)
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool tdb_data_equal(TDB_DATA t1, TDB_DATA t2)
|
||||
{
|
||||
if (t1.dsize != t2.dsize) {
|
||||
return false;
|
||||
}
|
||||
return (memcmp(t1.dptr, t2.dptr, t1.dsize) == 0);
|
||||
}
|
||||
|
||||
TDB_DATA string_tdb_data(const char *string)
|
||||
{
|
||||
return make_tdb_data((const uint8_t *)string, string ? strlen(string) : 0 );
|
||||
|
@ -6,6 +6,7 @@
|
||||
Make a TDB_DATA and keep the const warning in one place
|
||||
****************************************************************/
|
||||
TDB_DATA make_tdb_data(const uint8_t *dptr, size_t dsize);
|
||||
bool tdb_data_equal(TDB_DATA t1, TDB_DATA t2);
|
||||
TDB_DATA string_tdb_data(const char *string);
|
||||
TDB_DATA string_term_tdb_data(const char *string);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user