Atrinik Server  4.0
Functions | Variables
atrinik_archetype.c File Reference
#include <plugin_python.h>

Go to the source code of this file.

Functions

static PyObject * get_attribute (Atrinik_Archetype *at, void *context)
 
static PyObject * Atrinik_Archetype_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
 
static void Atrinik_Archetype_dealloc (Atrinik_Archetype *at)
 
static PyObject * Atrinik_Archetype_str (Atrinik_Archetype *at)
 
static int Atrinik_Archetype_InternalCompare (Atrinik_Archetype *left, Atrinik_Archetype *right)
 
static PyObject * Atrinik_Archetype_RichCompare (Atrinik_Archetype *left, Atrinik_Archetype *right, int op)
 
int Atrinik_Archetype_init (PyObject *module)
 
PyObject * wrap_archetype (archetype_t *at)
 

Variables

static fields_struct fields []
 
static PyGetSetDef getseters [NUM_FIELDS+1]
 
PyTypeObject Atrinik_ArchetypeType
 

Detailed Description

Atrinik Python plugin archetype related code.

Author
Alex Tokar

Definition in file atrinik_archetype.c.

Function Documentation

static void Atrinik_Archetype_dealloc ( Atrinik_Archetype at)
static

Free an archetype wrapper.

Parameters
plThe wrapper to free.

Definition at line 93 of file atrinik_archetype.c.

int Atrinik_Archetype_init ( PyObject *  module)

Initialize the archetype wrapper.

Parameters
moduleThe Atrinik Python module.
Returns
1 on success, 0 on failure.

Definition at line 187 of file atrinik_archetype.c.

static PyObject* Atrinik_Archetype_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  kwds 
)
static

Create a new archetype wrapper.

Parameters
typeType object.
argsUnused.
kwdsUnused.
Returns
The new wrapper.

Definition at line 77 of file atrinik_archetype.c.

static PyObject* Atrinik_Archetype_str ( Atrinik_Archetype at)
static

Return a string representation of an archetype.

Parameters
atThe archetype.
Returns
Python object containing the name of the archetype.

Definition at line 110 of file atrinik_archetype.c.

static PyObject* get_attribute ( Atrinik_Archetype at,
void *  context 
)
static

Get archetype's attribute.

Parameters
atPython archetype wrapper.
contextVoid pointer to the field ID.
Returns
Python object with the attribute value, NULL on failure.

Definition at line 61 of file atrinik_archetype.c.

PyObject* wrap_archetype ( archetype_t at)

Utility method to wrap an archetype.

Parameters
whatArchetype to wrap.
Returns
Python object wrapping the real archetype.

Definition at line 224 of file atrinik_archetype.c.

Variable Documentation

PyTypeObject Atrinik_ArchetypeType

Our actual Python ArchetypeType.

Definition at line 141 of file atrinik_archetype.c.

fields_struct fields[]
static
Initial value:
= {
{"name", FIELDTYPE_SHSTR, offsetof(archetype_t, name), 0, 0,
"Name of the archetype.; str (readonly)"},
{"head", FIELDTYPE_ARCH, offsetof(archetype_t, head), 0, 0,
"The main part of a linked object.; Atrinik.Object.Object or None "
"(readonly)"},
{"more", FIELDTYPE_ARCH, offsetof(archetype_t, more), 0, 0,
"Next part of a linked object.; Atrinik.Object.Object or None "
"(readonly)"},
{"clone", FIELDTYPE_OBJECT2, offsetof(archetype_t, clone), 0, 0,
"Archetype's default object from which new objects are created "
"using functions such as :func:`Atrinik.CreateObject`.; "
"Atrinik.Object.Object (readonly)"}
}
Definition: arch.h:40

Archetype fields.

Definition at line 37 of file atrinik_archetype.c.

PyGetSetDef getseters[NUM_FIELDS+1]
static

This is filled in when we initialize our archetype type.

Definition at line 138 of file atrinik_archetype.c.