summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
Diffstat (limited to 'Include')
-rw-r--r--Include/Python.h2
-rw-r--r--Include/frameobject.h4
-rw-r--r--Include/pyerrors.h6
-rw-r--r--Include/pyexpat.h4
-rw-r--r--Include/pyport.h8
-rw-r--r--Include/pystate.h5
-rw-r--r--Include/pythread.h3
-rw-r--r--Include/setobject.h6
-rw-r--r--Include/unicodeobject.h7
-rw-r--r--Include/weakrefobject.h2
10 files changed, 33 insertions, 14 deletions
diff --git a/Include/Python.h b/Include/Python.h
index ca16c64..bbb9a08 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -35,7 +35,7 @@
#endif
#include <string.h>
-#ifndef DONT_HAVE_ERRNO_H
+#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#include <stdlib.h>
diff --git a/Include/frameobject.h b/Include/frameobject.h
index cce598b..794f651 100644
--- a/Include/frameobject.h
+++ b/Include/frameobject.h
@@ -41,8 +41,6 @@ typedef struct _frame {
/* As of 2.3 f_lineno is only valid when tracing is active (i.e. when
f_trace is set) -- at other times use PyCode_Addr2Line instead. */
int f_lineno; /* Current line number */
- int f_restricted; /* Flag set if restricted operations
- in this scope */
int f_iblock; /* index in f_blockstack */
PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */
PyObject *f_localsplus[1]; /* locals+stack, dynamically sized */
@@ -54,6 +52,8 @@ typedef struct _frame {
PyAPI_DATA(PyTypeObject) PyFrame_Type;
#define PyFrame_Check(op) ((op)->ob_type == &PyFrame_Type)
+#define PyFrame_IsRestricted(f) \
+ ((f)->f_builtins != (f)->f_tstate->interp->builtins)
PyAPI_FUNC(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *,
PyObject *, PyObject *);
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index 6006ac7..5df334b 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -218,10 +218,14 @@ PyAPI_FUNC(PyObject *) PyErr_NewException(char *name, PyObject *base,
PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *);
/* Issue a warning or exception */
-PyAPI_FUNC(int) PyErr_Warn(PyObject *, char *);
+PyAPI_FUNC(int) PyErr_WarnEx(PyObject *category, const char *msg,
+ Py_ssize_t stack_level);
PyAPI_FUNC(int) PyErr_WarnExplicit(PyObject *, const char *,
const char *, int,
const char *, PyObject *);
+/* PyErr_Warn is only for backwards compatability and will be removed.
+ Use PyErr_WarnEx instead. */
+#define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1)
/* In sigcheck.c or signalmodule.c */
PyAPI_FUNC(int) PyErr_CheckSignals(void);
diff --git a/Include/pyexpat.h b/Include/pyexpat.h
index 50ed49f..1e79f4e 100644
--- a/Include/pyexpat.h
+++ b/Include/pyexpat.h
@@ -16,8 +16,8 @@ struct PyExpat_CAPI
the end, if needed */
const XML_LChar * (*ErrorString)(enum XML_Error code);
enum XML_Error (*GetErrorCode)(XML_Parser parser);
- int (*GetErrorColumnNumber)(XML_Parser parser);
- int (*GetErrorLineNumber)(XML_Parser parser);
+ XML_Size (*GetErrorColumnNumber)(XML_Parser parser);
+ XML_Size (*GetErrorLineNumber)(XML_Parser parser);
enum XML_Status (*Parse)(
XML_Parser parser, const char *s, int len, int isFinal);
XML_Parser (*ParserCreate_MM)(
diff --git a/Include/pyport.h b/Include/pyport.h
index 47b9f70..be6c51f 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -240,10 +240,10 @@ typedef Py_intptr_t Py_ssize_t;
* to your pyconfig.h. Python code beyond this should check HAVE_STAT and
* HAVE_FSTAT instead.
* Also
- * #define DONT_HAVE_SYS_STAT_H
- * if <sys/stat.h> doesn't exist on your platform, and
+ * #define HAVE_SYS_STAT_H
+ * if <sys/stat.h> exists on your platform, and
* #define HAVE_STAT_H
- * if <stat.h> does (don't look at me -- ths mess is inherited).
+ * if <stat.h> does.
*/
#ifndef DONT_HAVE_STAT
#define HAVE_STAT
@@ -258,7 +258,7 @@ typedef Py_intptr_t Py_ssize_t;
#include "unixstuff.h"
#endif
-#ifndef DONT_HAVE_SYS_STAT_H
+#ifdef HAVE_SYS_STAT_H
#if defined(PYOS_OS2) && defined(PYCC_GCC)
#include <sys/types.h>
#endif
diff --git a/Include/pystate.h b/Include/pystate.h
index bfd3548..cf29695 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -171,6 +171,11 @@ PyAPI_FUNC(void) PyGILState_Release(PyGILState_STATE);
*/
PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void);
+/* The implementation of sys._current_frames() Returns a dict mapping
+ thread id to that thread's current frame.
+*/
+PyAPI_FUNC(PyObject *) _PyThread_CurrentFrames(void);
+
/* Routines for advanced debuggers, requested by David Beazley.
Don't use unless you know what you are doing! */
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Head(void);
diff --git a/Include/pythread.h b/Include/pythread.h
index 0fa8db0..f26db16 100644
--- a/Include/pythread.h
+++ b/Include/pythread.h
@@ -25,6 +25,9 @@ PyAPI_FUNC(int) PyThread_acquire_lock(PyThread_type_lock, int);
#define NOWAIT_LOCK 0
PyAPI_FUNC(void) PyThread_release_lock(PyThread_type_lock);
+PyAPI_FUNC(size_t) PyThread_get_stacksize(void);
+PyAPI_FUNC(int) PyThread_set_stacksize(size_t);
+
#ifndef NO_EXIT_PROG
PyAPI_FUNC(void) PyThread_exit_prog(int);
PyAPI_FUNC(void) PyThread__PyThread_exit_prog(int);
diff --git a/Include/setobject.h b/Include/setobject.h
index cc93968..a16c2f7 100644
--- a/Include/setobject.h
+++ b/Include/setobject.h
@@ -35,14 +35,14 @@ typedef struct _setobject PySetObject;
struct _setobject {
PyObject_HEAD
- int fill; /* # Active + # Dummy */
- int used; /* # Active */
+ Py_ssize_t fill; /* # Active + # Dummy */
+ Py_ssize_t used; /* # Active */
/* The table contains mask + 1 slots, and that's a power of 2.
* We store the mask instead of the size because the mask is more
* frequently needed.
*/
- int mask;
+ Py_ssize_t mask;
/* table points to smalltable for small tables, else to
* additional malloc'ed memory. table is never NULL! This rule
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 3177051..c7e07a8 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -938,6 +938,13 @@ PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCS(
const char *errors /* error handling */
);
+PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCSStateful(
+ const char *string, /* MBCS encoded string */
+ Py_ssize_t length, /* size of string */
+ const char *errors, /* error handling */
+ Py_ssize_t *consumed /* bytes consumed */
+ );
+
PyAPI_FUNC(PyObject*) PyUnicode_AsMBCSString(
PyObject *unicode /* Unicode object */
);
diff --git a/Include/weakrefobject.h b/Include/weakrefobject.h
index daf490f..0a659b0 100644
--- a/Include/weakrefobject.h
+++ b/Include/weakrefobject.h
@@ -62,7 +62,7 @@ PyAPI_FUNC(PyObject *) PyWeakref_NewProxy(PyObject *ob,
PyObject *callback);
PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref);
-PyAPI_FUNC(long) _PyWeakref_GetWeakrefCount(PyWeakReference *head);
+PyAPI_FUNC(Py_ssize_t) _PyWeakref_GetWeakrefCount(PyWeakReference *head);
PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self);