Atrinik Server 2.5
Functions | Variables
plugins/plugin_python/atrinik_region.c File Reference
#include <plugin_python.h>

Go to the source code of this file.

Functions

static PyObject * Region_GetAttribute (Atrinik_Region *r, void *context)
static PyObject * Atrinik_Region_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
static void Atrinik_Region_dealloc (Atrinik_Region *self)
static PyObject * Atrinik_Region_str (Atrinik_Region *self)
static int Atrinik_Region_InternalCompare (Atrinik_Region *left, Atrinik_Region *right)
static PyObject * Atrinik_Region_RichCompare (Atrinik_Region *left, Atrinik_Region *right, int op)
int Atrinik_Region_init (PyObject *module)
PyObject * wrap_region (region *what)

Variables

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

Detailed Description

Atrinik Python plugin region related code.

Definition in file atrinik_region.c.


Function Documentation

static void Atrinik_Region_dealloc ( Atrinik_Region self) [static]

Free a region wrapper.

Parameters:
selfThe wrapper to free.

Definition at line 87 of file atrinik_region.c.

int Atrinik_Region_init ( PyObject *  module)

Initialize the region wrapper.

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

Definition at line 168 of file atrinik_region.c.

static PyObject* Atrinik_Region_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  kwds 
) [static]

Create a new region wrapper.

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

Definition at line 67 of file atrinik_region.c.

static PyObject* Atrinik_Region_str ( Atrinik_Region self) [static]

Return a string representation of a region.

Parameters:
selfThe region type.
Returns:
Python object containing the name of the region.

Definition at line 101 of file atrinik_region.c.

static PyObject* Region_GetAttribute ( Atrinik_Region r,
void *  context 
) [static]

Get region's attribute.

Parameters:
rPython region wrapper.
contextVoid pointer to the field ID.
Returns:
Python object with the attribute value, NULL on failure.

Definition at line 56 of file atrinik_region.c.

PyObject* wrap_region ( region what)

Utility method to wrap a region.

Parameters:
whatRegion to wrap.
Returns:
Python object wrapping the real region.

Definition at line 203 of file atrinik_region.c.


Variable Documentation

PyTypeObject Atrinik_RegionType

Our actual Python RegionType.

Definition at line 127 of file atrinik_region.c.

fields_struct fields[] [static]
Initial value:
{
    {"next", FIELDTYPE_REGION, offsetof(region, next), 0, 0},
    {"parent", FIELDTYPE_REGION, offsetof(region, parent), 0, 0},
    {"name", FIELDTYPE_CSTR, offsetof(region, name), 0, 0},
    {"longname", FIELDTYPE_CSTR, offsetof(region, longname), 0, 0},
    {"msg", FIELDTYPE_CSTR, offsetof(region, msg), 0, 0},
    {"jailmap", FIELDTYPE_CSTR, offsetof(region, jailmap), 0, 0},
    {"jailx", FIELDTYPE_SINT16, offsetof(region, jailx), 0, 0},
    {"jaily", FIELDTYPE_SINT16, offsetof(region, jaily), 0, 0}
}

Region fields.

Definition at line 38 of file atrinik_region.c.

PyGetSetDef getseters[NUM_FIELDS+1] [static]

This is filled in when we initialize our region type.

Definition at line 124 of file atrinik_region.c.