Crossfire Server, Branches 1.12  R18729
cfpython_archetype.c
Go to the documentation of this file.
1 /*****************************************************************************/
2 /* CFPython - A Python module for Crossfire RPG. */
3 /* Version: 2.0beta8 (also known as "Alexander") */
4 /* Contact: yann.chachkoff@myrealbox.com */
5 /*****************************************************************************/
6 /* That code is placed under the GNU General Public Licence (GPL) */
7 /* (C)2001-2005 by Chachkoff Yann (Feel free to deliver your complaints) */
8 /*****************************************************************************/
9 /* CrossFire, A Multiplayer game for X-windows */
10 /* */
11 /* Copyright (C) 2000 Mark Wedel */
12 /* Copyright (C) 1992 Frank Tore Johansen */
13 /* */
14 /* This program is free software; you can redistribute it and/or modify */
15 /* it under the terms of the GNU General Public License as published by */
16 /* the Free Software Foundation; either version 2 of the License, or */
17 /* (at your option) any later version. */
18 /* */
19 /* This program is distributed in the hope that it will be useful, */
20 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
21 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
22 /* GNU General Public License for more details. */
23 /* */
24 /* You should have received a copy of the GNU General Public License */
25 /* along with this program; if not, write to the Free Software */
26 /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
27 /* */
28 /*****************************************************************************/
29 
30 #include <cfpython.h>
32 
33 static PyObject *Crossfire_Archetype_GetName(Crossfire_Archetype *whoptr, void *closure) {
34  return Py_BuildValue("s", cf_archetype_get_name(whoptr->arch));
35 }
36 
37 static PyObject *Crossfire_Archetype_GetNext(Crossfire_Archetype *who, void *closure) {
39 }
40 
41 static PyObject *Crossfire_Archetype_GetMore(Crossfire_Archetype *who, void *closure) {
43 }
44 
45 static PyObject *Crossfire_Archetype_GetHead(Crossfire_Archetype *who, void *closure) {
47 }
48 
49 static PyObject *Crossfire_Archetype_GetClone(Crossfire_Archetype *who, void *closure) {
51 }
52 
53 static PyObject *Crossfire_Archetype_GetNewObject(Crossfire_Archetype *who, PyObject *args) {
55 }
56 
58  Crossfire_Archetype *wrapper;
59 
60  /* return None if no object was to be wrapped */
61  if (what == NULL) {
62  Py_INCREF(Py_None);
63  return Py_None;
64  }
65 
66  wrapper = PyObject_NEW(Crossfire_Archetype, &Crossfire_ArchetypeType);
67  if (wrapper != NULL)
68  wrapper->arch = what;
69  return (PyObject *)wrapper;
70 }
71 
73  return (left->arch < right->arch ? -1 : (left->arch == right->arch ? 0 : 1));
74 }
object * cf_archetype_get_clone(archetype *arch)
static PyObject * Crossfire_Archetype_GetClone(Crossfire_Archetype *who, void *closure)
PyObject_HEAD archetype * arch
archetype * cf_archetype_get_next(archetype *arch)
archetype * cf_archetype_get_head(archetype *arch)
Definition: object.h:321
static PyObject * Crossfire_Archetype_GetMore(Crossfire_Archetype *who, void *closure)
static PyObject * Crossfire_Archetype_GetName(Crossfire_Archetype *whoptr, void *closure)
static PyObject * Crossfire_Archetype_GetNewObject(Crossfire_Archetype *who, PyObject *args)
PyObject * Crossfire_Object_wrap(object *what)
static PyObject * Crossfire_Archetype_GetNext(Crossfire_Archetype *who, void *closure)
static PyObject * Crossfire_Archetype_GetHead(Crossfire_Archetype *who, void *closure)
static int Crossfire_Archetype_InternalCompare(Crossfire_Archetype *left, Crossfire_Archetype *right)
archetype * cf_archetype_get_more(archetype *arch)
PyTypeObject Crossfire_ArchetypeType
PyObject * Crossfire_Archetype_wrap(archetype *what)
sstring cf_archetype_get_name(archetype *arch)
object * cf_create_object_by_name(const char *name)