mirror of
https://github.com/samba-team/samba.git
synced 2025-12-05 12:23:50 +03:00
r21987: split tdb_prs_*() functions in version which take a keystr and a TDB_DATA key
metze
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
08d23a1c4f
commit
724c6fa337
@@ -1454,22 +1454,24 @@ BOOL prs_uint32_post(const char *name, prs_struct *ps, int depth, uint32 *data32
|
||||
}
|
||||
|
||||
/* useful function to store a structure in rpc wire format */
|
||||
int tdb_prs_store(TDB_CONTEXT *tdb, char *keystr, prs_struct *ps)
|
||||
int tdb_prs_store(TDB_CONTEXT *tdb, TDB_DATA kbuf, prs_struct *ps)
|
||||
{
|
||||
TDB_DATA kbuf, dbuf;
|
||||
kbuf.dptr = keystr;
|
||||
kbuf.dsize = strlen(keystr)+1;
|
||||
TDB_DATA dbuf;
|
||||
dbuf.dptr = ps->data_p;
|
||||
dbuf.dsize = prs_offset(ps);
|
||||
return tdb_trans_store(tdb, kbuf, dbuf, TDB_REPLACE);
|
||||
}
|
||||
|
||||
/* useful function to fetch a structure into rpc wire format */
|
||||
int tdb_prs_fetch(TDB_CONTEXT *tdb, char *keystr, prs_struct *ps, TALLOC_CTX *mem_ctx)
|
||||
int tdb_prs_store_bystring(TDB_CONTEXT *tdb, char *keystr, prs_struct *ps)
|
||||
{
|
||||
TDB_DATA kbuf, dbuf;
|
||||
kbuf.dptr = keystr;
|
||||
kbuf.dsize = strlen(keystr)+1;
|
||||
TDB_DATA kbuf = string_term_tdb_data(keystr);
|
||||
return tdb_prs_store(tdb, kbuf, ps);
|
||||
}
|
||||
|
||||
/* useful function to fetch a structure into rpc wire format */
|
||||
int tdb_prs_fetch(TDB_CONTEXT *tdb, TDB_DATA kbuf, prs_struct *ps, TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
TDB_DATA dbuf;
|
||||
|
||||
prs_init(ps, 0, mem_ctx, UNMARSHALL);
|
||||
|
||||
@@ -1482,6 +1484,12 @@ int tdb_prs_fetch(TDB_CONTEXT *tdb, char *keystr, prs_struct *ps, TALLOC_CTX *me
|
||||
return 0;
|
||||
}
|
||||
|
||||
int tdb_prs_fetch_bystring(TDB_CONTEXT *tdb, char *keystr, prs_struct *ps, TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
TDB_DATA kbuf = string_term_tdb_data(keystr);
|
||||
return tdb_prs_fetch(tdb, kbuf, ps, mem_ctx);
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
hash a stream.
|
||||
********************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user