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:
parent
ce7b0b9906
commit
e0abd1938a
@ -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,
|
NTSTATUS dbwrap_fetch_bystring(struct db_context *db, TALLOC_CTX *mem_ctx,
|
||||||
const char *key, TDB_DATA *value);
|
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,
|
NTSTATUS dbwrap_fetch_int32_bystring(struct db_context *db, const char *keystr,
|
||||||
int32_t *result);
|
int32_t *result);
|
||||||
NTSTATUS dbwrap_store_int32_bystring(struct db_context *db, const char *keystr,
|
NTSTATUS dbwrap_store_int32_bystring(struct db_context *db, const char *keystr,
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include "dbwrap.h"
|
#include "dbwrap.h"
|
||||||
#include "lib/util/util_tdb.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)
|
int32_t *result)
|
||||||
{
|
{
|
||||||
TDB_DATA dbuf;
|
TDB_DATA dbuf;
|
||||||
@ -36,7 +36,7 @@ NTSTATUS dbwrap_fetch_int32_bystring(struct db_context *db, const char *keystr,
|
|||||||
return NT_STATUS_INVALID_PARAMETER;
|
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)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@ -51,6 +51,12 @@ NTSTATUS dbwrap_fetch_int32_bystring(struct db_context *db, const char *keystr,
|
|||||||
return NT_STATUS_OK;
|
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,
|
NTSTATUS dbwrap_store_int32_bystring(struct db_context *db, const char *keystr,
|
||||||
int32_t v)
|
int32_t v)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user