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  _cfpcontext
 
struct  CFConstant
 

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)"
 

Typedefs

typedef struct _cfpcontext CFPContext
 

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 59 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 302 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 199 of file cfpython.h.

◆ MODULEAPI

#define MODULEAPI

Definition at line 74 of file cfpython.h.

◆ PLUGIN_NAME

#define PLUGIN_NAME   "Python"

Definition at line 78 of file cfpython.h.

◆ PLUGIN_VERSION

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

Definition at line 79 of file cfpython.h.

Typedef Documentation

◆ CFPContext

typedef struct _cfpcontext CFPContext

Variable Documentation

◆ CFPythonMethods

PyMethodDef CFPythonMethods[]

Definition at line 762 of file cfpython.c.

Referenced by main().

◆ context_stack

CFPContext* context_stack

Definition at line 101 of file cfpython.c.

◆ cstAttackMovement

const CFConstant cstAttackMovement[]

Definition at line 1359 of file cfpython.c.

Referenced by initConstants(), and main().

◆ cstAttackType

const CFConstant cstAttackType[]

Definition at line 1241 of file cfpython.c.

Referenced by initConstants(), and main().

◆ cstAttackTypeNumber

const CFConstant cstAttackTypeNumber[]

Definition at line 1271 of file cfpython.c.

Referenced by initConstants(), and main().

◆ cstDirection

const CFConstant cstDirection[]

Definition at line 1082 of file cfpython.c.

Referenced by initConstants(), and main().

◆ cstEventType

const CFConstant cstEventType[]

Definition at line 1301 of file cfpython.c.

Referenced by initConstants(), and main().

◆ cstMessageFlag

const CFConstant cstMessageFlag[]

Definition at line 1221 of file cfpython.c.

Referenced by initConstants(), and main().

◆ cstMove

const CFConstant cstMove[]

Definition at line 1210 of file cfpython.c.

Referenced by initConstants(), and main().

◆ cstReplyTypes

const CFConstant cstReplyTypes[]

Definition at line 1352 of file cfpython.c.

Referenced by initConstants(), and main().

◆ cstTime

const CFConstant cstTime[]

Definition at line 1342 of file cfpython.c.

Referenced by initConstants(), and main().

◆ cstType

const CFConstant cstType[]

Definition at line 1094 of file cfpython.c.

Referenced by initConstants(), and main().

◆ current_context

CFPContext* current_context

Definition at line 103 of file cfpython.c.

◆ gethook

f_plug_api gethook

Definition at line 41 of file cfnewspaper.c.