diff options
author | Volker Lendecke <vl@samba.org> | 2012-02-15 15:17:33 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2012-04-19 22:24:18 +0200 |
commit | 99fa29ae09da5bd2e860bca914a7314586a27994 (patch) | |
tree | f8cab02721f52f0daa03b57d2199c3d1be4526c6 /source3/lib/dbwrap/dbwrap_watch.h | |
parent | 61c97506e8ccb878d06edae72f4216ad58b96a9b (diff) | |
download | samba-99fa29ae09da5bd2e860bca914a7314586a27994.tar.gz samba-99fa29ae09da5bd2e860bca914a7314586a27994.tar.bz2 samba-99fa29ae09da5bd2e860bca914a7314586a27994.zip |
s3-dbwrap: Add dbwrap_record_watch_send/recv
With this API you can asynchronously wait for a record to be modified
Diffstat (limited to 'source3/lib/dbwrap/dbwrap_watch.h')
-rw-r--r-- | source3/lib/dbwrap/dbwrap_watch.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/source3/lib/dbwrap/dbwrap_watch.h b/source3/lib/dbwrap/dbwrap_watch.h new file mode 100644 index 0000000000..e242fa188a --- /dev/null +++ b/source3/lib/dbwrap/dbwrap_watch.h @@ -0,0 +1,46 @@ +/* + Unix SMB/CIFS implementation. + Watch dbwrap record changes + Copyright (C) Volker Lendecke 2012 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __DBWRAP_WATCH_H__ +#define __DBWRAP_WATCH_H__ + +#include <tevent.h> +#include "dbwrap.h" +#include "messages.h" + +void dbwrap_watch_db(struct db_context *db, struct messaging_context *msg); + +struct tevent_req *dbwrap_record_watch_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct db_record *rec, + struct messaging_context *msg); +NTSTATUS dbwrap_record_watch_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + struct db_record **prec); + +void dbwrap_watchers_traverse_read( + int (*fn)(const uint8_t *db_id, size_t db_id_len, const TDB_DATA key, + const struct server_id *watchers, size_t num_watchers, + void *private_data), + void *private_data); + +void dbwrap_watchers_wakeall(struct messaging_context *msg); + + +#endif /* __DBWRAP_H__ */ |