summaryrefslogtreecommitdiff
path: root/lib/tevent/pytevent.c
AgeCommit message (Collapse)AuthorFilesLines
2023-11-20Use python.h from libreplaceAndreas Schneider1-1/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15513 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-05-16python: Safely clear structure membersJoseph Sutton1-2/+2
Using Py_CLEAR() ensures that these structures are observed in a consistent state by any Python code that may run during deconstruction. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-02-03tevent/pytevent: remove no-op defineDouglas Bagnall1-1/+0
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-02-03tevent/pytevent: remove py2 ifdefsDouglas Bagnall1-16/+0
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-01-18tevent: remove unused register_backend() from python bindingsStefan Metzmacher1-130/+0
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Pavel Filipenský <pfilipen@redhat.com> Reviewed-by: Volker Lendecke <vl@samba.org>
2021-09-04Fix Python docstringsJoseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Sep 4 00:55:32 UTC 2021 on sn-devel-184
2020-05-08Fix clang 9 missing-field-initializer warningsGary Lockyer1-8/+8
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
2020-03-23py3: Remove #define PyInt_FromLong PyLong_FromLongAndrew Bartlett1-2/+2
This allows us to end the use of Python 2/3 compatability macros. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power
2019-06-24py3: Remove duplicated PyUnicode_Check() after the py3 compat macros were ↵Andrew Bartlett1-1/+1
removed This came about because in py2 we had to check for strings and unicode. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Mon Jun 24 18:48:53 UTC 2019 on sn-devel-184
2019-06-24py3: Remove PyStr_AsUTF8() compatability macroAndrew Bartlett1-4/+1
We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
2019-06-24py3: Remove PyStr_FromString() compatability macroAndrew Bartlett1-3/+1
We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
2019-06-24py3: Remove PyStr_Check() compatability macroAndrew Bartlett1-3/+1
We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
2019-05-16lib/tevent: squash 'cast between incompatible function types' warningNoel Power1-23/+50
squash 'cast between incompatible function types' warning To avoid warning above produced by using -Wcast-function-type we; + ensure PyCFunctions of type METH_NOARGS defined dummy arg + ensure PyCFunctions of type METH_KEYWORDS use PY_DISCARD_FUNC_SIG macro Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org>
2019-02-08py_tevent: add_timer takes float argumentDouglas Bagnall1-2/+6
We were already using it that way. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2018-04-30lib/tevent: Additionally accept unicode as string param in Py2Noel Power1-1/+1
With the changes to make samba python code Py2/Py3 compatible there now are many instances where string content is decoded. Decoded string variables in Py2 are returned as the unicode type. Many Py2 c-module functions that take string arguments only check for the string type. However now it's quite possibe the content formally passed as a string argument is now passed as unicode after being decoded, such arguments are rejected and code can fail subtly. This only affects places where the type is directly checked e.g. via PyStr_Check etc. arguments that are parsed by ParseTuple* functions generally already accept both string and unicode (if 's', 'z', 's*' format specifiers are used) Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2015-06-12pytevent: add a TeventTimer_Object_ref helper structure to make the code clearerStefan Metzmacher1-9/+13
This gives talloc_set_destructor to verify the type, which removes a compiler warning. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2015-06-12pytevent: remove const warnings using discard_const_p()Stefan Metzmacher1-13/+23
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2015-06-12pytevent: remove dead code TEVENT_DEPRECATED is never definedStefan Metzmacher1-48/+0
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2015-06-10pytevent: Port to Python 3Petr Viktorin1-13/+57
- Use PyStr (String on py2, Unicode on py3) for text strings - Use PyLong instead of PyInt on Python 3 - Use new module initialization Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2015-06-10pytalloc: Improve timer wrapper, and test itPetr Viktorin1-17/+130
Using Context.add_timer resulted in crashes due to missing type object and bad reference handling. Add a TeventTimer_Type struct, and introduce a clear ownership/lifetime model. Add a "add_timer_offset" to allow adding timers from Python. (add_timer requires passing struct timeval as a Python integer, which can't really be done portably). Add tests. Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2015-06-10pytevent: Define missing TeventFd_Type objectPetr Viktorin1-0/+13
The type objects for Fd was declared but never defined, resulting in segfaults when it was used. Define it. Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2015-06-10pytevent: Better error and reference handlingPetr Viktorin1-6/+25
py_backend_list: - Handle cases of PyString_FromString or PyList_Append failing. - Properly decrease the reference count of the returned strings. py_register_backend: - Decref "name" after use Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2015-01-22Remove use of the "staticforward" macroPetr Viktorin1-6/+6
This macro was used for compatibility with broken compilers. Since Python 2.3, it is always defined as `static`, and only exists "for source compatibility with old C extensions". Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2012-01-31tevent: Fix python documentation stringsAmitay Isaacs1-2/+2
Autobuild-User: Amitay Isaacs <amitay@samba.org> Autobuild-Date: Tue Jan 31 16:59:29 CET 2012 on sn-devel-104
2011-12-07Add version attribute for pytevent.Jelmer Vernooij1-0/+2
Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Wed Dec 7 15:07:49 CET 2011 on sn-devel-104
2011-03-19lib/: Fix prototypes for functions.Jelmer Vernooij1-1/+3
2010-11-11s4:pytevent.c - fix a discard const warningMatthias Dieter Wallnöfer1-1/+1
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Thu Nov 11 09:47:55 UTC 2010 on sn-devel-104
2010-09-25pyteven: Fix build warnings.Jelmer Vernooij1-6/+16
2010-09-25pytevent: Add more tests.Jelmer Vernooij1-2/+19
2010-09-25pytevent: Fill in client side fnuctions.Jelmer Vernooij1-52/+393
2010-09-25tevent: Add infrastructure for python bindings.Jelmer Vernooij1-0/+394
2009-05-16tevent: Remove python module.Jelmer Vernooij1-143/+0
This module didn't have any functionality that we actually used yet, and it was quite small. Tevent is quite low level and perhaps doesn't make much sense to expose directly as a Python module. It was also causing build problems when used with a system-tevent. We can always back later if necessary.
2009-03-01Avoid using tevent_util.h, which won't be available if we use the systemJelmer Vernooij1-2/+2
tevent.
2009-02-16tevent: fix compiler warning in pytevent.cStefan Metzmacher1-1/+3
metze
2009-02-16lib/tevent: change to LGPLv3+Stefan Metzmacher1-12/+16
metze
2009-01-30lib/tevent: include replace.h in pytevent.cStefan Metzmacher1-0/+1
This fixes the build on Tru64. metze
2009-01-08Avoid using a utility header for Python replacements included in Samba,Jelmer Vernooij1-1/+6
since this will not be shipped with talloc/tdb/tevent/etc.
2009-01-07s3/s4 build: Fix Py_RETURN_NONE to work with python versions < 2.4Tim Prouty1-1/+1
2009-01-06py: Properly increase the reference counter of Py_None.Jelmer Vernooij1-1/+1
2009-01-02tevent: change pytevent to tevent_*Stefan Metzmacher1-19/+20
metze
2008-12-29s4:lib/tevent: rename structsStefan Metzmacher1-2/+2
list="" list="$list event_context:tevent_context" list="$list fd_event:tevent_fd" list="$list timed_event:tevent_timer" for s in $list; do o=`echo $s | cut -d ':' -f1` n=`echo $s | cut -d ':' -f2` r=`git grep "struct $o" |cut -d ':' -f1 |sort -u` files=`echo "$r" | grep -v source3 | grep -v nsswitch | grep -v packaging4` for f in $files; do cat $f | sed -e "s/struct $o/struct $n/g" > $f.tmp mv $f.tmp $f done done metze
2008-12-23python/tevent: Remove use of pytalloc.h.Jelmer Vernooij1-8/+21
2008-12-21Fix various Python-related bugs.Jelmer Vernooij1-0/+1
2008-12-20Fix tevent python module build as part of samba 4.Jelmer Vernooij1-0/+6
2008-12-20Stop using SWIG for ldb Python bindings.Jelmer Vernooij1-0/+110