git.samba.org
/
npower
/
samba.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
talloc: add pytalloc_get_name() helper
[npower/samba.git]
/
lib
/
talloc
/
pytalloc_util.c
diff --git
a/lib/talloc/pytalloc_util.c
b/lib/talloc/pytalloc_util.c
index 7a426d6c2a60cc1ed365a40cf15b78f6fba687b5..82b95e7f144fec1f60aa032172e61ca22481c666 100644
(file)
--- a/
lib/talloc/pytalloc_util.c
+++ b/
lib/talloc/pytalloc_util.c
@@
-331,3
+331,12
@@
_PUBLIC_ int pytalloc_BaseObject_PyType_Ready(PyTypeObject *type)
return PyType_Ready(type);
}
+
+_PUBLIC_ const char *_pytalloc_get_name(PyObject *obj)
+{
+ void *ptr = pytalloc_get_ptr(obj);
+ if (ptr == NULL) {
+ return "non-talloc object";
+ }
+ return talloc_get_name(ptr);
+}