PixelLightAPI  .
PLCoreLinuxWrapper.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  PLCore Library                                       *
00003  *  ----------------------------------------------------
00004  *  File: PLCoreLinuxWrapper.h
00005  *      Linux wrapper definitions for PLCore (use them ONLY if REALLY required!)
00006  *
00007  *  Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/)
00008  *
00009  *  This file is part of PixelLight.
00010  *
00011  *  PixelLight is free software: you can redistribute it and/or modify
00012  *  it under the terms of the GNU Lesser General Public License as published by
00013  *  the Free Software Foundation, either version 3 of the License, or
00014  *  (at your option) any later version.
00015  *
00016  *  PixelLight is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00019  *  GNU Lesser General Public License for more details.
00020  *
00021  *  You should have received a copy of the GNU Lesser General Public License
00022  *  along with PixelLight. If not, see <http://www.gnu.org/licenses/>.
00023 \*********************************************************/
00024 
00025 
00026 #ifndef __PLCORE_LINUXWRAPPER_H__
00027 #define __PLCORE_LINUXWRAPPER_H__
00028 #pragma once
00029 
00030 
00031 //[-------------------------------------------------------]
00032 //[ Includes                                              ]
00033 //[-------------------------------------------------------]
00034 #include <stdio.h>
00035 #include <stdarg.h>
00036 #include <stdint.h>
00037 #include "PLCore/PLCore.h"
00038 
00039 
00040 //[-------------------------------------------------------]
00041 //[ Functions                                             ]
00042 //[-------------------------------------------------------]
00043 PLCORE_API char *_strupr(char *s);
00044 PLCORE_API char *strlwr(char *s);
00045 PLCORE_API int _vscprintf(const char *format, va_list ap);
00046 
00047 // wchar functions
00048 PLCORE_API int _vscwprintf(const wchar_t *fmt,va_list ap);
00049 PLCORE_API int _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list args);
00050 PLCORE_API int _wtoi( const wchar_t *str );
00051 PLCORE_API long _wtol( const wchar_t *str );
00052 PLCORE_API float _wtof( const wchar_t *str );
00053 PLCORE_API wchar_t *_wcsupr(wchar_t *s);
00054 PLCORE_API wchar_t *_wcslwr(wchar_t *s);
00055 #if (ANDROID || APPLE)
00056     // Even if there's a "wchar.h"-header, wchar_t is officially not supported by Android
00057     // (no problem, wchar_t is for Windows, UTF-8 for Linux and the string class handles both as well as ASCII)
00058     PLCORE_API int wcscasecmp(const wchar_t *s1, const wchar_t *s2);
00059     PLCORE_API int wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n);
00060     PLCORE_API uintmax_t wcstoumax(const wchar_t *nptr, wchar_t **endptr, int base);
00061 #endif
00062 
00063 
00064 //[-------------------------------------------------------]
00065 //[ Definitions                                           ]
00066 //[-------------------------------------------------------]
00067 #define stricmp(a, b)       strcasecmp(a, b)
00068 #define _stricmp(a, b)      strcasecmp(a, b)
00069 #define _strnicmp(a, b, n)  strncasecmp(a, b, n)
00070 #define strnicmp(a, b, n)   strncasecmp(a, b, n)
00071 #define _strlwr(a)          strlwr(a)
00072 #define _atoi64(a)          atoll(a)
00073 #define _snprintf           snprintf
00074 
00075 // wchar functions definitions
00076 #define _wcsicmp(a, b)      wcscasecmp(a, b)
00077 #define _wcsnicmp(a, b, c)  wcsncasecmp(a, b, c)
00078 #undef  vswprintf
00079 #define vswprintf           _vsnwprintf
00080 
00081 // system functions
00082 #define _fdopen(a, b)       fdopen(a, b)
00083 
00084 
00085 #endif // __PLCORE_LINUXWRAPPER_H__


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:08:58
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported