/* vi:set ts=8 sts=4 sw=4 noet: * * VIM - Vi IMproved by Bram Moolenaar * * Do ":help uganda" in Vim to read copying and usage conditions. * Do ":help credits" in Vim to see a list of people who contributed. * See README.txt for an overview of the Vim source code. *//* * Python extensions by Paul Moore. * Changes for Unix by David Leonard. * * This consists of four parts: * 1. Python interpreter main program * 2. Python output stream: writes output via [e]msg(). * 3. Implementation of the Vim module for Python * 4. Utility functions for handling the interface between Vim and Python. */#include"vim.h"#include<limits.h>/* uncomment this if used with the debug version of python. * Checked on 2.7.4. *//* #define Py_DEBUG *//* Note: most of time you can add -DPy_DEBUG to CFLAGS in place of uncommenting *//* uncomment this if used with the debug version of python, but without its * allocator *//* #define Py_DEBUG_NO_PYMALLOC *//* Python.h defines _POSIX_THREADS itself (if needed) */#ifdef _POSIX_THREADS# undef _POSIX_THREADS#endif#if defined(_WIN32) && defined(HAVE_FCNTL_H)# undef HAVE_FCNTL_H#endif#ifdef _DEBUG# undef _DEBUG#endif#ifdef HAVE_STDARG_H# undef HAVE_STDARG_H /* Python's config.h defines it as well. */#endif#ifdef _POSIX_C_SOURCE# undef _POSIX_C_SOURCE /* pyconfig.h defines it as well. */#endif#ifdef _XOPEN_SOURCE# undef _XOPEN_SOURCE /* pyconfig.h defines it as well. */#endif#define PY_SSIZE_T_CLEAN#include<Python.h>#if !defined(PY_VERSION_HEX) || PY_VERSION_HEX < 0x02050000# undef PY_SSIZE_T_CLEAN