big dialogs: dlg_format_text: no need to pass the term.
[elinks.git] / src / scripting / python / core.h
blob1c9d1a7a2daae17df742c45e02b0c0bce46799f8
2 #ifndef EL__SCRIPTING_PYTHON_CORE_H
3 #define EL__SCRIPTING_PYTHON_CORE_H
5 #ifdef HAVE_CONFIG_H
6 #include "config.h"
7 #endif
9 /* PyString_AsStringAndSize() takes a Py_ssize_t * in Python 2.5 but
10 * an int * in Python 2.4. To be compatible with both, ELinks uses
11 * Py_ssize_t and defines it here if necessary. The public-domain
12 * PEP 353 <http://www.python.org/dev/peps/pep-0353/> suggests the
13 * following snippet, so we can use the Py_ssize_t name even though
14 * Python generally reserves names starting with "Py_". */
15 #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
16 typedef int Py_ssize_t;
17 #define PY_SSIZE_T_MAX INT_MAX
18 #define PY_SSIZE_T_MIN INT_MIN
19 #endif
20 /* End of PEP 353 snippet. */
22 struct module;
24 extern struct session *python_ses;
25 extern PyObject *python_elinks_err;
27 void alert_python_error(void);
29 void init_python(struct module *module);
30 void cleanup_python(struct module *module);
32 int add_python_methods(PyObject *dict, PyObject *name, PyMethodDef *methods);
34 #ifndef CONFIG_SMALL
35 #define PYTHON_DOCSTRING(str) str
36 #else
37 #define PYTHON_DOCSTRING(str) ""
38 #endif
40 #endif