net lua
[sfrench/samba-autobuild/.git] / source4 / lib / events / events.i
1 /* 
2    Unix SMB/CIFS implementation.
3    Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
4    
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 3 of the License, or
8    (at your option) any later version.
9    
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14    
15    You should have received a copy of the GNU General Public License
16    along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 %module(docstring="Event management.",package="samba.events") events;
20
21 %import "../../../lib/talloc/talloc.i";
22
23 %{
24 #include "events.h"
25 typedef struct event_context event;
26 %}
27
28 typedef struct event_context {
29     %extend {
30         %feature("docstring") event "S.__init__()";
31         event(TALLOC_CTX *mem_ctx) { return event_context_init(mem_ctx); }
32         %feature("docstring") loop_once "S.loop_once() -> int";
33         int loop_once(void);
34         %feature("docstring") loop_wait "S.loop_wait() -> int";
35         int loop_wait(void);
36     }
37 } event;
38 %talloctype(event);
39
40 %typemap(default,noblock=1) struct event_context * {
41     $1 = event_context_init(NULL);
42 }
43
44 %typemap(default,noblock=1) struct event_context * {
45     $1 = event_context_init(NULL);
46 }
47
48 struct event_context *event_context_init_byname(TALLOC_CTX *mem_ctx, const char *name);
49
50 %feature("docstring") event_backend_list "event_backend_list() -> list";
51 const char **event_backend_list(TALLOC_CTX *mem_ctx);
52 %feature("docstring") event_set_default_backend "event_set_default_backend(name) -> None";
53 %rename(set_default_backend) event_set_default_backend;
54 void event_set_default_backend(const char *backend);