Crossfire Server, Branch 1.12  R12190
cfpython_map.h
Go to the documentation of this file.
00001 /*****************************************************************************/
00002 /* CFPython - A Python module for Crossfire RPG.                             */
00003 /* Version: 2.0beta8 (also known as "Alexander")                             */
00004 /* Contact: yann.chachkoff@myrealbox.com                                     */
00005 /*****************************************************************************/
00006 /* That code is placed under the GNU General Public Licence (GPL)            */
00007 /* (C)2001-2005 by Chachkoff Yann (Feel free to deliver your complaints)     */
00008 /*****************************************************************************/
00009 /*  CrossFire, A Multiplayer game for X-windows                              */
00010 /*                                                                           */
00011 /*  Copyright (C) 2000 Mark Wedel                                            */
00012 /*  Copyright (C) 1992 Frank Tore Johansen                                   */
00013 /*                                                                           */
00014 /*  This program is free software; you can redistribute it and/or modify     */
00015 /*  it under the terms of the GNU General Public License as published by     */
00016 /*  the Free Software Foundation; either version 2 of the License, or        */
00017 /*  (at your option) any later version.                                      */
00018 /*                                                                           */
00019 /*  This program is distributed in the hope that it will be useful,          */
00020 /*  but WITHOUT ANY WARRANTY; without even the implied warranty of           */
00021 /*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            */
00022 /*  GNU General Public License for more details.                             */
00023 /*                                                                           */
00024 /*  You should have received a copy of the GNU General Public License        */
00025 /*  along with this program; if not, write to the Free Software              */
00026 /*  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                */
00027 /*                                                                           */
00028 /*****************************************************************************/
00029 #ifndef CFPYTHON_MAP_H
00030 #define CFPYTHON_MAP_H
00031 
00032 typedef struct {
00033     PyObject_HEAD
00034     mapstruct *map;
00035     int valid;
00036 } Crossfire_Map;
00037 
00038 extern PyTypeObject Crossfire_MapType;
00039 
00040 #define MAPEXISTCHECK(map) { \
00041     if (!(map) || ((map)->valid == 0)) { \
00042         PyErr_SetString(PyExc_ReferenceError, "Crossfire map no longer exists"); \
00043         return NULL; \
00044     } \
00045 }
00046 
00047 #define MAPEXISTCHECK_INT(map) { \
00048     if (!(map) || ((map)->valid == 0)) { \
00049         PyErr_SetString(PyExc_ReferenceError, "Crossfire map no longer exists"); \
00050         return -1; \
00051     } \
00052 }
00053 
00054 extern PyObject *Crossfire_Map_wrap(mapstruct *what);
00055 
00056 #endif /* CFPYTHON_MAP_H */