Crossfire Server, Trunk
cfpython.h File Reference
#include <Python.h>
#include <plugin.h>
#include <plugin_common.h>
#include <cfpython_object.h>
#include <cfpython_map.h>
#include <cfpython_archetype.h>
#include <cfpython_party.h>
#include <cfpython_region.h>
#include <cfpython_proto.h>
+ Include dependency graph for cfpython.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  CFConstant
 
struct  CFPContext
 

Macros

#define CF_IS_PYSTR(cfpy_obj)   (PyUnicode_Check(cfpy_obj))
 
#define CF_PYTHON_NUMBER_METHODS(NAME, LONG)
 
#define CF_PYTHON_OBJECT(NAME, DEALLOC, CONVERT, HASH, FLAGS, DOC, CMP, METHODS, GETSET, BASE, OBNEW)
 
#define MODULEAPI
 
#define PLUGIN_NAME   "Python"
 
#define PLUGIN_VERSION   "CFPython Plugin 2.0a13 (Fido)"
 

Variables

PyMethodDef CFPythonMethods []
 
CFPContextcontext_stack
 
const CFConstant cstAttackMovement []
 
const CFConstant cstAttackType []
 
const CFConstant cstAttackTypeNumber []
 
const CFConstant cstDirection []
 
const CFConstant cstEventType []
 
const CFConstant cstMessageFlag []
 
const CFConstant cstMove []
 
const CFConstant cstReplyTypes []
 
const CFConstant cstTime []
 
const CFConstant cstType []
 
CFPContextcurrent_context
 
f_plug_api gethook
 

Macro Definition Documentation

◆ CF_IS_PYSTR

#define CF_IS_PYSTR (   cfpy_obj)    (PyUnicode_Check(cfpy_obj))

Definition at line 65 of file cfpython.h.

◆ CF_PYTHON_NUMBER_METHODS

#define CF_PYTHON_NUMBER_METHODS (   NAME,
  LONG 
)

Macro to define a PyNumberMethods. Arguments are:

  • NAME: object's name, like "Object" or "Map", without quotes
  • LONG: name of a function converting the Python object to a long

Definition at line 360 of file cfpython.h.

◆ CF_PYTHON_OBJECT

#define CF_PYTHON_OBJECT (   NAME,
  DEALLOC,
  CONVERT,
  HASH,
  FLAGS,
  DOC,
  CMP,
  METHODS,
  GETSET,
  BASE,
  OBNEW 
)

Macro to define a PyTypeObject. It should make it simpler to adjust to various Python versions, one macro to change only. Arguments are:

  • NAME: object's name, like "Object" or "Map", without quotes
  • DEALLOC: deallocation function, of type Python::destructor
  • CONVERT: pointer to a PyNumberMethods variable
  • HASH: hash, PyObject_HashNotImplemented or NULL (for Player only, to inherit)
  • FLAGS: Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE or Py_TPFLAGS_DEFAULT (for Player)
  • DOC: Base description, with quotes
  • CMP: Python::richcmpfunc to compare 2 objects
  • METHODS: array of PyMethodDef to declare functions
  • GETSET: array of PyGetSetDef to declare attributes
  • BASE: base class, only used for Player
  • OBNEW: Python::newfunc to create a new object

Definition at line 257 of file cfpython.h.

◆ MODULEAPI

#define MODULEAPI

Definition at line 80 of file cfpython.h.

◆ PLUGIN_NAME

#define PLUGIN_NAME   "Python"

Definition at line 84 of file cfpython.h.

◆ PLUGIN_VERSION

#define PLUGIN_VERSION   "CFPython Plugin 2.0a13 (Fido)"

Definition at line 85 of file cfpython.h.

Variable Documentation

◆ CFPythonMethods

PyMethodDef CFPythonMethods[]

Definition at line 765 of file cfpython.cpp.

Referenced by main().

◆ context_stack

CFPContext* context_stack

Definition at line 104 of file cfpython.cpp.

◆ cstAttackMovement

const CFConstant cstAttackMovement[]

Definition at line 1390 of file cfpython.cpp.

Referenced by initConstants(), and main().

◆ cstAttackType

const CFConstant cstAttackType[]

Definition at line 1271 of file cfpython.cpp.

Referenced by initConstants(), and main().

◆ cstAttackTypeNumber

const CFConstant cstAttackTypeNumber[]

Definition at line 1301 of file cfpython.cpp.

Referenced by initConstants(), and main().

◆ cstDirection

const CFConstant cstDirection[]

Definition at line 1112 of file cfpython.cpp.

Referenced by initConstants(), and main().

◆ cstEventType

const CFConstant cstEventType[]

Definition at line 1331 of file cfpython.cpp.

Referenced by initConstants(), and main().

◆ cstMessageFlag

const CFConstant cstMessageFlag[]

Definition at line 1251 of file cfpython.cpp.

Referenced by initConstants(), and main().

◆ cstMove

const CFConstant cstMove[]

Definition at line 1240 of file cfpython.cpp.

Referenced by initConstants(), and main().

◆ cstReplyTypes

const CFConstant cstReplyTypes[]

Definition at line 1383 of file cfpython.cpp.

Referenced by initConstants(), and main().

◆ cstTime

const CFConstant cstTime[]

Definition at line 1373 of file cfpython.cpp.

Referenced by initConstants(), and main().

◆ cstType

const CFConstant cstType[]

Definition at line 1124 of file cfpython.cpp.

Referenced by initConstants(), and main().

◆ current_context

CFPContext* current_context

Definition at line 106 of file cfpython.cpp.

◆ gethook

f_plug_api gethook

Definition at line 41 of file cfnewspaper.cpp.