summaryrefslogtreecommitdiff
path: root/source4/lib/util/util_tdb.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-08-27 17:21:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:02:53 -0500
commit4fb038b0b8e7a4bb69ac0d9022684eeaca8a491a (patch)
treeb2465bb451c73232e640d2c2718a6af084be2345 /source4/lib/util/util_tdb.c
parent8a1d019f53ef6d1a6900a005b335bdc10d14bbe4 (diff)
downloadsamba-4fb038b0b8e7a4bb69ac0d9022684eeaca8a491a.tar.gz
samba-4fb038b0b8e7a4bb69ac0d9022684eeaca8a491a.tar.bz2
samba-4fb038b0b8e7a4bb69ac0d9022684eeaca8a491a.zip
r24710: Use standard boolean type for easier use by external users.
(This used to be commit 99f4124137d4a61216e8189f26d4da32882c0f4a)
Diffstat (limited to 'source4/lib/util/util_tdb.c')
-rw-r--r--source4/lib/util/util_tdb.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/source4/lib/util/util_tdb.c b/source4/lib/util/util_tdb.c
index 6c95b58893..1112f1587c 100644
--- a/source4/lib/util/util_tdb.c
+++ b/source4/lib/util/util_tdb.c
@@ -148,7 +148,7 @@ int tdb_store_int32(struct tdb_context *tdb, const char *keystr, int32_t v)
Output is uint32_t in native byte order.
****************************************************************************/
-BOOL tdb_fetch_uint32_byblob(struct tdb_context *tdb, const char *keyval, size_t len, uint32_t *value)
+bool tdb_fetch_uint32_byblob(struct tdb_context *tdb, const char *keyval, size_t len, uint32_t *value)
{
TDB_DATA key = make_tdb_data(keyval, len);
TDB_DATA data;
@@ -156,12 +156,12 @@ BOOL tdb_fetch_uint32_byblob(struct tdb_context *tdb, const char *keyval, size_t
data = tdb_fetch(tdb, key);
if (!data.dptr || data.dsize != sizeof(uint32_t)) {
SAFE_FREE(data.dptr);
- return False;
+ return false;
}
*value = IVAL(data.dptr,0);
SAFE_FREE(data.dptr);
- return True;
+ return true;
}
/****************************************************************************
@@ -169,7 +169,7 @@ BOOL tdb_fetch_uint32_byblob(struct tdb_context *tdb, const char *keyval, size_t
Output is uint32_t in native byte order.
****************************************************************************/
-BOOL tdb_fetch_uint32(struct tdb_context *tdb, const char *keystr, uint32_t *value)
+bool tdb_fetch_uint32(struct tdb_context *tdb, const char *keystr, uint32_t *value)
{
return tdb_fetch_uint32_byblob(tdb, keystr, strlen(keystr) + 1, value);
}
@@ -179,19 +179,19 @@ BOOL tdb_fetch_uint32(struct tdb_context *tdb, const char *keystr, uint32_t *val
Input is uint32_t in native byte order. Output in tdb is in little-endian.
****************************************************************************/
-BOOL tdb_store_uint32_byblob(struct tdb_context *tdb, const char *keystr, size_t len, uint32_t value)
+bool tdb_store_uint32_byblob(struct tdb_context *tdb, const char *keystr, size_t len, uint32_t value)
{
TDB_DATA key = make_tdb_data(keystr, len);
TDB_DATA data;
uint32_t v_store;
- BOOL ret = True;
+ bool ret = true;
SIVAL(&v_store, 0, value);
data.dptr = (void *)&v_store;
data.dsize = sizeof(uint32_t);
if (tdb_store(tdb, key, data, TDB_REPLACE) == -1)
- ret = False;
+ ret = false;
return ret;
}
@@ -201,7 +201,7 @@ BOOL tdb_store_uint32_byblob(struct tdb_context *tdb, const char *keystr, size_t
Input is uint32_t in native byte order. Output in tdb is in little-endian.
****************************************************************************/
-BOOL tdb_store_uint32(struct tdb_context *tdb, const char *keystr, uint32_t value)
+bool tdb_store_uint32(struct tdb_context *tdb, const char *keystr, uint32_t value)
{
return tdb_store_uint32_byblob(tdb, keystr, strlen(keystr) + 1, value);
}
@@ -285,13 +285,13 @@ int32_t tdb_change_int32_atomic(struct tdb_context *tdb, const char *keystr, int
Atomic unsigned integer change. Returns old value. To create, set initial value in *oldval.
****************************************************************************/
-BOOL tdb_change_uint32_atomic(struct tdb_context *tdb, const char *keystr, uint32_t *oldval, uint32_t change_val)
+bool tdb_change_uint32_atomic(struct tdb_context *tdb, const char *keystr, uint32_t *oldval, uint32_t change_val)
{
uint32_t val;
- BOOL ret = False;
+ bool ret = false;
if (tdb_lock_bystring(tdb, keystr) == -1)
- return False;
+ return false;
if (!tdb_fetch_uint32(tdb, keystr, &val)) {
/* It failed */
@@ -315,7 +315,7 @@ BOOL tdb_change_uint32_atomic(struct tdb_context *tdb, const char *keystr, uint3
if (!tdb_store_uint32(tdb, keystr, val))
goto err_out;
- ret = True;
+ ret = true;
err_out: