From: Serhiy Storchaka Date: Sun, 1 May 2016 10:07:14 +0000 (+0300) Subject: Fixed declarations of _Py_DumpTraceback() and _Py_DumpTracebackThreads(). X-Git-Tag: v3.6.0a1~89 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b608196b20483ef69fab0383e61d3e53aed04ece;p=thirdparty%2FPython%2Fcpython.git Fixed declarations of _Py_DumpTraceback() and _Py_DumpTracebackThreads(). --- b608196b20483ef69fab0383e61d3e53aed04ece diff --cc Include/traceback.h index f767ea84cdd1,c3ecbe296f90..dbc769bb8231 --- a/Include/traceback.h +++ b/Include/traceback.h @@@ -62,54 -60,12 +62,54 @@@ PyAPI_FUNC(void) _Py_DumpTraceback only write the traceback of the first 100 threads: write "..." if there are more threads. + If current_tstate is NULL, the function tries to get the Python thread state + of the current thread. It is not an error if the function is unable to get + the current Python thread state. + + If interp is NULL, the function tries to get the interpreter state from + the current Python thread state, or from + _PyGILState_GetInterpreterStateUnsafe() in last resort. + + It is better to pass NULL to interp and current_tstate, the function tries + different options to retrieve these informations. + This function is signal safe. */ - PyAPI_DATA(const char*) _Py_DumpTracebackThreads( + PyAPI_FUNC(const char*) _Py_DumpTracebackThreads( - int fd, PyInterpreterState *interp, - PyThreadState *current_thread); + int fd, + PyInterpreterState *interp, + PyThreadState *current_tstate); + +#ifndef Py_LIMITED_API + +/* Write a Unicode object into the file descriptor fd. Encode the string to + ASCII using the backslashreplace error handler. + + Do nothing if text is not a Unicode object. The function accepts Unicode + string which is not ready (PyUnicode_WCHAR_KIND). + + This function is signal safe. */ +PyAPI_FUNC(void) _Py_DumpASCII(int fd, PyObject *text); + +/* Format an integer as decimal into the file descriptor fd. + + This function is signal safe. */ +PyAPI_FUNC(void) _Py_DumpDecimal( + int fd, + unsigned long value); + +/* Format an integer as hexadecimal into the file descriptor fd with at least + width digits. + + The maximum width is sizeof(unsigned long)*2 digits. + + This function is signal safe. */ +PyAPI_FUNC(void) _Py_DumpHexadecimal( + int fd, + unsigned long value, + Py_ssize_t width); +#endif /* !Py_LIMITED_API */ #ifdef __cplusplus }