1 /* $Id: commonproto.h,v 5.7 2003/09/16 21:02:23 bertg Exp $ 2 * 3 * XPilot, a multiplayer gravity war game. Copyright (C) 1991-2001 by 4 * 5 * Bj�rn Stabell <bjoern@xpilot.org> 6 * Ken Ronny Schouten <ken@xpilot.org> 7 * Bert Gijsbers <bert@xpilot.org> 8 * Dick Balaska <dick@xpilot.org> 9 * 10 * This program is free software; you can redistribute it and/or modify 11 * it under the terms of the GNU General Public License as published by 12 * the Free Software Foundation; either version 2 of the License, or 13 * (at your option) any later version. 14 * 15 * This program is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU General Public License for more details. 19 * 20 * You should have received a copy of the GNU General Public License 21 * along with this program; if not, write to the Free Software 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 */ 24 25 #ifndef COMMONPROTO_H 26 #define COMMONPROTO_H 27 28 #ifndef TYPES_H 29 /* need DFLOAT */ 30 #include "types.h" 31 #endif 32 33 /* randommt.c */ 34 extern void seedMT(unsigned int seed); 35 extern unsigned int reloadMT(void); 36 extern unsigned int randomMT(void); 37 38 /* math.c */ 39 extern double rfrac(void); 40 extern int mod(int x, int y); 41 extern void Make_table(void); 42 43 /* strdup.c */ 44 extern char *xp_strdup(const char *); 45 extern char *xp_safe_strdup(const char *old_string); 46 47 /* default.c */ 48 unsigned String_hash(const char *s); 49 50 /* strlcpy.c */ 51 size_t strlcpy(char *dest, const char *src, size_t size); 52 size_t strlcat(char *dest, const char *src, size_t size); 53 54 /* xpmemory.c */ 55 56 void *xp_malloc(size_t size); 57 void *xp_realloc(void *oldptr, size_t size); 58 void *xp_calloc(size_t nmemb, size_t size); 59 void xp_free(void *p); 60 void *xp_safe_malloc(size_t size); 61 void *xp_safe_realloc(void *oldptr, size_t size); 62 void *xp_safe_calloc(size_t nmemb, size_t size); 63 void xp_safe_free(void *p); 64 65 #endif 66