summaryrefslogtreecommitdiff
path: root/lib/talloc/pytalloc.h
AgeCommit message (Collapse)AuthorFilesLines
2021-03-16Bug 9931: change pytalloc source to LGPLDavid Disseldorp1-11/+15
pytalloc is currently GPL, while the rest of talloc is LGPL. This situation arose because pytalloc was originally developed under source4/scripting/python/, and moved into talloc proper with commit 0f043c197c473c801fc32c727194b5a2d6ae232f ("Move pytalloc to talloc directory.", October 2008). BUG: https://bugzilla.samba.org/show_bug.cgi?id=9931 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Björn Jacke <bjacke@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Mar 16 18:17:43 UTC 2021 on sn-devel-184
2020-11-10talloc/pytalloc: fix studio compler buildBjörn Jacke1-16/+16
Solaris Studio compiler 12.4 is pedantic about prototypes in headers having the external visibility declarations too. It throws errors like: redeclaration must have the same or more restrictive linker scoping: ... Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-22talloc: add pytalloc_get_name() helperDouglas Bagnall1-0/+4
In several places we go talloc_get_name(pytalloc_get_ptr(py_obj)) which is a certain NULL derefernce if py_obj is not a talloc object. This is a helper function that chooses to say "non-talloc object" rather than crash. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-03-26pytalloc: Refactor the pytalloc_reference and pytalloc_steal to use a common ↵Kristján Valur1-2/+2
method. Signed-off-by: Kristján Valur <kristjan@rvx.is> Reviewed-by: Noel Power <npower@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-03-21pytalloc: Remove deprecated pytalloc_CObject_FromTallocPtr()Andrew Bartlett1-15/+0
This function makes it harder to remove the --extra-python handlers and is only provided for Python 2.x, support for which Samba is removing. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2017-02-25pytalloc: add pytalloc_GenericObject_{steal,reference}[_ex]()Stefan Metzmacher1-1/+27
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-08pytalloc: Add pytalloc_BaseObject_PyType_Ready() wrapperAndrew Bartlett1-0/+1
This avoids the need for the caller to set tp_base and tp_basicsize and so removes those as possible errors. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-08pytalloc: Add new BaseObjectAndrew Bartlett1-1/+9
This new object not only avoids the ABI issues of talloc.Object it stores one more pointer, being the start of the array, and so can be used to fix the PIDL bindings/talloc refcount issue. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-08pytalloc: add a _pytalloc_get_type() helper function and generate ↵Stefan Metzmacher1-4/+2
PyExc_TypeError on mismatch Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-08talloc: add _pytalloc_get_ptr/_pytalloc_get_mem_ctx helper functionsAndrew Bartlett1-2/+4
This allows us to check which type is involved, and dereference that type correctly Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-05-19pytalloc: Port to Python 3Petr Viktorin1-0/+2
- Use native string for repr - Use rich comparison Removes the deprecated tp_compare in favor of tp_richcompare. Disparate types cannot be compared (except for == and !=), and True or False objects are returned explicitly. - Use Py_TYPE instead of ob_type This changed to conform to C aliasing rules, see http://legacy.python.org/dev/peps/pep-3123/ - Don't provide CObject creation function A PyCapsule based replacement would be possible, but might not be necessary considering the function is not used much. - Use new-style module initialization Build changes: - Use ABI flag in the lib name and pkg-config template - Use the SAMBA_CHECK_PYTHON macro for finding Python Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2013-11-28Add a basic guide on pytalloc.Jelmer Vernooij1-0/+3
Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-By: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org> Autobuild-Date(master): Thu Nov 28 02:24:45 CET 2013 on sn-devel-104
2011-08-10pytalloc: Use consistent prefix for functions, add ABI file.Jelmer Vernooij1-19/+17
2010-12-01pytalloc: Make py_talloc_default_cmp private.Jelmer Vernooij1-1/+0
2010-12-01pytalloc: Make py_talloc_dealloc private.Jelmer Vernooij1-3/+0
2010-12-01pytalloc: Make py_talloc_default_repr private (now exposed by talloc.Object).Jelmer Vernooij1-3/+0
2010-12-01pytalloc: Expose PyTalloc_GetObjectTypeJelmer Vernooij1-0/+1
2010-12-01pytalloc: Add convenience function for checking if something is a tallocJelmer Vernooij1-0/+2
object.
2010-09-21pytalloc: Add default compare function.Jelmer Vernooij1-0/+1
2010-09-20pidl: Fix segfault when accessing unicode objects.Jelmer Vernooij1-2/+0
2010-09-02pidl-python: cope with NULL pointers in more placesAndrew Tridgell1-0/+4
NULL is converted to Py_None
2010-08-25pytalloc: fixed py_talloc_steal()Andrew Tridgell1-1/+1
py_talloc_steal() was implemented as a macro which evaluated it's 2nd argument twice. It was often called via a macro with a 2nd argument that was a function call, for example an allocation in py_talloc_new(). This meant it allocated memory twice, and leaked one of them. This re-implements py_talloc_steal() as a function, so that it only does the allocation once.
2009-09-28pidl: Avoid using talloc_free as function pointer, since it may be aJelmer Vernooij1-0/+2
macro.
2009-07-30DCE/RPC(Python): Rename py_talloc_import to py_talloc_steal.Jelmer Vernooij1-4/+5
Use py_talloc_reference in DCE/RPC code, fixes access to SAMR pipe.
2009-07-01fixed use of reference in pytallocAndrew Tridgell1-0/+1
The previous code caused memory leaks, and also caused situations where talloc_free could be called on pointers with multiple parents The new approach is to have two functions: py_talloc_import : steals the pointer, so it becomes wholly owned by the python object py_talloc_reference: uses a reference, so it is owned by both python and C
2008-12-21Fix more introduced regressions in new bindings.Jelmer Vernooij1-1/+1
2008-12-21Create and use convenience function for creating new talloc-wrapping Python ↵Jelmer Vernooij1-0/+2
Objects, support subtypes of DCE/RPC interfaces properly
2008-12-19Initial work using manual Python bindings for LDB, rather than ↵Jelmer Vernooij1-2/+2
SWIG-generated ones.
2008-10-24Move pytalloc to talloc directory.Jelmer Vernooij1-0/+51