1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

dbwrap: Add dbwrap_fetch_int32

Signed-off-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Volker Lendecke 2012-06-15 10:52:07 +02:00 committed by Stefan Metzmacher
parent ce7b0b9906
commit e0abd1938a
2 changed files with 11 additions and 3 deletions

View File

@ -93,6 +93,8 @@ NTSTATUS dbwrap_store_bystring(struct db_context *db, const char *key,
NTSTATUS dbwrap_fetch_bystring(struct db_context *db, TALLOC_CTX *mem_ctx,
const char *key, TDB_DATA *value);
NTSTATUS dbwrap_fetch_int32(struct db_context *db, TDB_DATA key,
int32_t *result);
NTSTATUS dbwrap_fetch_int32_bystring(struct db_context *db, const char *keystr,
int32_t *result);
NTSTATUS dbwrap_store_int32_bystring(struct db_context *db, const char *keystr,

View File

@ -26,7 +26,7 @@
#include "dbwrap.h"
#include "lib/util/util_tdb.h"
NTSTATUS dbwrap_fetch_int32_bystring(struct db_context *db, const char *keystr,
NTSTATUS dbwrap_fetch_int32(struct db_context *db, TDB_DATA key,
int32_t *result)
{
TDB_DATA dbuf;
@ -36,7 +36,7 @@ NTSTATUS dbwrap_fetch_int32_bystring(struct db_context *db, const char *keystr,
return NT_STATUS_INVALID_PARAMETER;
}
status = dbwrap_fetch_bystring(db, talloc_tos(), keystr, &dbuf);
status = dbwrap_fetch(db, talloc_tos(), key, &dbuf);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@ -51,6 +51,12 @@ NTSTATUS dbwrap_fetch_int32_bystring(struct db_context *db, const char *keystr,
return NT_STATUS_OK;
}
NTSTATUS dbwrap_fetch_int32_bystring(struct db_context *db, const char *keystr,
int32_t *result)
{
return dbwrap_fetch_int32(db, string_term_tdb_data(keystr), result);
}
NTSTATUS dbwrap_store_int32_bystring(struct db_context *db, const char *keystr,
int32_t v)
{