Convert lib/wb_reqtrans.c to unix calling conventions
[ira/wip.git] / source3 / include / wbc_async.h
1 /*
2    Unix SMB/CIFS implementation.
3    Headers for the async winbind client library
4    Copyright (C) Kai Blin 2009
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef _WBC_ASYNC_H_
21 #define _WBC_ASYNC_H_
22
23 #include "nsswitch/libwbclient/wbclient.h"
24
25 struct wb_context;
26
27 struct tevent_req *wb_trans_send(TALLOC_CTX *mem_ctx,
28                                  struct tevent_context *ev,
29                                  struct wb_context *wb_ctx, bool need_priv,
30                                  struct winbindd_request *wb_req);
31 wbcErr wb_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
32                      struct winbindd_response **presponse);
33 struct wb_context *wb_context_init(TALLOC_CTX *mem_ctx);
34
35 /* Definitions from wb_reqtrans.c */
36 wbcErr map_wbc_err_from_errno(int error);
37
38 bool tevent_req_is_wbcerr(struct tevent_req *req, wbcErr *pwbc_err);
39 wbcErr tevent_req_simple_recv_wbcerr(struct tevent_req *req);
40
41 struct tevent_req *wb_req_read_send(TALLOC_CTX *mem_ctx,
42                                     struct tevent_context *ev,
43                                     int fd, size_t max_extra_data);
44 ssize_t wb_req_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
45                          struct winbindd_request **preq, int *err);
46
47 struct tevent_req *wb_req_write_send(TALLOC_CTX *mem_ctx,
48                                      struct tevent_context *ev,
49                                      struct tevent_queue *queue, int fd,
50                                      struct winbindd_request *wb_req);
51 ssize_t wb_req_write_recv(struct tevent_req *req, int *err);
52
53 struct tevent_req *wb_resp_read_send(TALLOC_CTX *mem_ctx,
54                                      struct tevent_context *ev, int fd);
55 ssize_t wb_resp_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
56                           struct winbindd_response **presp, int *err);
57
58 struct tevent_req *wb_resp_write_send(TALLOC_CTX *mem_ctx,
59                                       struct tevent_context *ev,
60                                       struct tevent_queue *queue, int fd,
61                                       struct winbindd_response *wb_resp);
62 ssize_t wb_resp_write_recv(struct tevent_req *req, int *err);
63
64 #endif /*_WBC_ASYNC_H_*/