Atrinik Server 2.5
Functions | Variables
plugins/plugin_python/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 *at)

Variables

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

Detailed Description

Atrinik Python plugin archetype related code.

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 84 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 165 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 64 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 98 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 53 of file atrinik_archetype.c.

PyObject* wrap_archetype ( archetype at)

Utility method to wrap an archetype.

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

Definition at line 200 of file atrinik_archetype.c.


Variable Documentation

PyTypeObject Atrinik_ArchetypeType

Our actual Python ArchetypeType.

Definition at line 124 of file atrinik_archetype.c.

fields_struct fields[] [static]
Initial value:
{
    {"name", FIELDTYPE_SHSTR, offsetof(archetype, name), 0, 0},
    {"next", FIELDTYPE_ARCH, offsetof(archetype, next), 0, 0},
    {"head", FIELDTYPE_ARCH, offsetof(archetype, head), 0, 0},
    {"more", FIELDTYPE_ARCH, offsetof(archetype, more), 0, 0},
    {"clone", FIELDTYPE_OBJECT2, offsetof(archetype, clone), 0, 0}
}

Archetype fields.

Definition at line 38 of file atrinik_archetype.c.

PyGetSetDef getseters[NUM_FIELDS+1] [static]

This is filled in when we initialize our archetype type.

Definition at line 121 of file atrinik_archetype.c.