00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef PLUGIN_PYTHON_H
00030 #define PLUGIN_PYTHON_H
00031
00032
00033 #ifdef WIN32
00034 #ifdef _DEBUG
00035 #undef _DEBUG
00036 #include <Python.h>
00037 #define _DEBUG
00038 #else
00039 #include <Python.h>
00040 #endif
00041 #else
00042 #include <Python.h>
00043 #endif
00044
00045
00046
00047
00048 #if PY_MAJOR_VERSION >= 3
00049 # define IS_PY3K
00050 #else
00051 # if PY_MINOR_VERSION >= 6
00052 # define IS_PY26
00053 # else
00054 # define IS_PY_LEGACY
00055 # endif
00056 # if PY_MINOR_VERSION >= 5
00057 # define IS_PY25
00058 # endif
00059 #endif
00060
00061
00062 #ifndef Py_SIZE
00063 # define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
00064 #endif
00065 #ifndef Py_TYPE
00066 # define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
00067 #endif
00068
00069
00070
00071
00072 #ifdef IS_PY_LEGACY
00073 # define PyObject_HashNotImplemented NULL
00074 #endif
00075
00076
00077 #ifdef IS_PY3K
00078 # define CF_IS_PYSTR(cfpy_obj) (PyUnicode_Check(cfpy_obj))
00079 #else
00080 # define CF_IS_PYSTR(cfpy_obj) (PyString_Check(cfpy_obj) || PyUnicode_Check(cfpy_obj))
00081 #endif
00082
00083
00084 #ifdef HAVE_GETTIMEOFDAY
00085 #undef HAVE_GETTIMEOFDAY
00086 #endif
00087
00088
00089
00090
00091 #include <compile.h>
00092 #include <plugin.h>
00093
00094 #undef MODULEAPI
00095 #ifdef WIN32
00096 #ifdef PYTHON_PLUGIN_EXPORTS
00097 #define MODULEAPI __declspec(dllexport)
00098 #else
00099 #define MODULEAPI __declspec(dllimport)
00100 #endif
00101
00102 #else
00103 #define MODULEAPI
00104 #endif
00105
00106 #define PLUGIN_NAME "Python"
00107 #define PLUGIN_VERSION "CFPython Plugin 2.0a13 (Fido)"
00108
00109 #include <plugin_common.h>
00110 #include <cfpython_object.h>
00111 #include <cfpython_map.h>
00112 #include <cfpython_archetype.h>
00113 #include <cfpython_party.h>
00114 #include <cfpython_region.h>
00115
00116 typedef struct _cfpcontext {
00117 struct _cfpcontext *down;
00118 PyObject *who;
00119 PyObject *activator;
00120 PyObject *third;
00121 PyObject *event;
00122 char message[1024];
00123 int fix;
00124 int event_code;
00125 char script[1024];
00126 char options[1024];
00127 int returnvalue;
00128 int parms[5];
00129 } CFPContext;
00130
00131 extern f_plug_api gethook;
00132
00133 extern CFPContext *context_stack;
00134
00135 extern CFPContext *current_context;
00136
00137
00138 typedef struct PythonCmdStruct {
00139 char *name;
00140 char *script;
00141 double speed;
00142 } PythonCmd;
00143
00144
00145 #define NR_CUSTOM_CMD 1024
00146 #include <cfpython_proto.h>
00147
00148 #endif