functions.h

Go to the documentation of this file.
00001 /********************************************************************************/
00002 /*                                                                              */
00003 /*  Netrinjo-Engine - a library for game-development                            */
00004 /*  Copyright (C) 2005 by Tobias Nadler                                         */
00005 /*                                                                              */
00006 /*  This library is free software; you can redistribute it and/or               */
00007 /*  modify it under the terms of the GNU Lesser General Public                  */
00008 /*  License as published by the Free Software Foundation; either                */
00009 /*  version 2.1 of the License, or (at your option) any later version.          */
00010 /*                                                                              */
00011 /*  This library is distributed in the hope that it will be useful,             */
00012 /*  but WITHOUT ANY WARRANTY; without even the implied warranty of              */
00013 /*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU           */
00014 /*  Lesser General Public License for more details.                             */
00015 /*                                                                              */
00016 /*  You should have received a copy of the GNU Lesser General Public            */
00017 /*  License along with this library; if not, write to the Free Software         */
00018 /*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   */
00019 /*                                                                              */
00020 /********************************************************************************/
00021 
00022 #ifndef FUNCTIONS_H
00023 #define FUNCTIONS_H
00024 
00025 #ifndef DOXYGEN
00026 #include "SDL/SDL.h"
00027 #include "SDL/SDL_net.h"
00028 #include <string>
00029 #endif
00030 
00059 DECLSPEC const char *intToStr( int i, int base = 10 );// not thread-safe!
00060 
00070 DECLSPEC char *intToStr( int i, char *buf, int base = 10 );
00075 DECLSPEC char *uintToStr( unsigned int i, char *buf, unsigned int base = 10 );// as intToStr(x,y,z), but for unsigned numbers
00076 
00093 DECLSPEC Uint32 xStrToUL( const char *str, bool *err = NULL );
00094 
00102 DECLSPEC SDL_Rect strToRect( const char *str );
00103 
00109 DECLSPEC bool strToBool( const char *s );
00110 
00117 DECLSPEC Uint32 strToIP( const char *str );
00118 
00125 DECLSPEC IPaddress strToIPaddress( const char *str );
00126 
00132 DECLSPEC SDLKey strToKey( const char *str );
00133 
00139 DECLSPEC SDLMod strToMod( const char *str );
00140 
00147 DECLSPEC int byteToStr( Uint8 b, char *buf );
00148 
00156 DECLSPEC const char * IPToStr( Uint32 ip, char *buf );
00164 DECLSPEC const char * IPToStr( const IPaddress &ip, char *buf );
00165 
00172 DECLSPEC SDL_Color ULToColor( Uint32 v );
00173 
00177 DECLSPEC const char * getUserDirectory();
00178 
00185 DECLSPEC std::string makeEnvStr(const char *str);
00186 
00195 DECLSPEC std::string makeEnvPath(const char *str);
00196 
00204 DECLSPEC bool patMatch (const char* pattern, const char* string);
00212 DECLSPEC bool patiMatch (const char* pattern, const char* string);
00213 
00214 #ifndef __windows__
00215 
00225 char *getLocalIP( bool bIPv4 = true );
00226 #endif
00227 
00228 #endif

Generated on Wed May 9 17:35:55 2007 for netrinjo by  doxygen 1.5.1