summaryrefslogtreecommitdiffstats
path: root/source3/lib/talloc/talloc.i
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-02-12 17:56:02 -0800
committerJeremy Allison <jra@samba.org>2008-02-12 17:56:02 -0800
commit089227e52012f307c311530f9b677cad81ef0105 (patch)
tree2c7123aa33e2c886031308889ec96453fb7ce55d /source3/lib/talloc/talloc.i
parenta6997bb2ffbca8f38d40f2631066c23b0472e13c (diff)
parentfbe8014b650d1b104d1a7624669fa92fbc6605b8 (diff)
downloadsamba-089227e52012f307c311530f9b677cad81ef0105.tar.gz
samba-089227e52012f307c311530f9b677cad81ef0105.tar.xz
samba-089227e52012f307c311530f9b677cad81ef0105.zip
Merge branch 'v3-2-test' of ssh://jra@git.samba.org/data/git/samba into v3-2-test
(This used to be commit 5116c9d9f4bd1a523ac7a2a31b3b1552388f040f)
Diffstat (limited to 'source3/lib/talloc/talloc.i')
-rw-r--r--source3/lib/talloc/talloc.i31
1 files changed, 31 insertions, 0 deletions
diff --git a/source3/lib/talloc/talloc.i b/source3/lib/talloc/talloc.i
new file mode 100644
index 0000000000..a9afb97ed7
--- /dev/null
+++ b/source3/lib/talloc/talloc.i
@@ -0,0 +1,31 @@
+/*
+ Unix SMB/CIFS implementation.
+ Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
+
+ 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/>.
+*/
+
+/* Don't expose talloc contexts in Python code. Python does reference
+ counting for us, so just create a new top-level talloc context.
+ */
+%typemap(in, numinputs=0, noblock=1) TALLOC_CTX * {
+ $1 = NULL;
+}
+
+%define %talloctype(TYPE)
+%nodefaultctor TYPE;
+%extend TYPE {
+ ~TYPE() { talloc_free($self); }
+}
+%enddef