2007-03-22 10:30:00 -07:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is MOZCE Lib.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Doug Turner <dougt@meer.net>.
|
|
|
|
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2005
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* John Wolfe <wolfe@lobo.us>
|
2008-02-20 09:56:09 -08:00
|
|
|
*
|
2007-03-22 10:30:00 -07:00
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#ifndef MOZCE_SHUNT_H
|
|
|
|
#define MOZCE_SHUNT_H
|
|
|
|
|
2009-04-24 10:31:18 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _WCHAR_T_DEFINED
|
|
|
|
typedef unsigned short wchar_t;
|
|
|
|
#define _WCHAR_T_DEFINED
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif
|
2009-03-23 18:16:03 -07:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2009-04-24 10:31:18 -07:00
|
|
|
} //extern "C"
|
|
|
|
#endif
|
2009-03-23 18:16:03 -07:00
|
|
|
|
2009-04-24 10:31:18 -07:00
|
|
|
#ifdef MOZ_MEMORY
|
2009-03-23 18:16:03 -07:00
|
|
|
|
2009-04-24 10:31:18 -07:00
|
|
|
#ifdef __cplusplus
|
2009-03-23 18:16:03 -07:00
|
|
|
#define _NEW_
|
|
|
|
void * operator new(size_t _Size);
|
|
|
|
void operator delete(void * ptr);
|
|
|
|
void *operator new[](size_t size);
|
|
|
|
void operator delete[](void *ptr);
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#undef _strdup
|
|
|
|
#undef strdup
|
|
|
|
#undef _strndup
|
|
|
|
#undef strndup
|
|
|
|
#undef _wcsdup
|
|
|
|
#undef wcsdup
|
|
|
|
#undef _wcsndup
|
|
|
|
#undef wcsndup
|
|
|
|
|
2009-04-24 10:31:18 -07:00
|
|
|
char * __cdecl
|
|
|
|
_strdup(const char*);
|
2009-03-23 18:16:03 -07:00
|
|
|
|
2009-04-24 10:31:18 -07:00
|
|
|
wchar_t * __cdecl
|
|
|
|
_wcsdup(const wchar_t *);
|
2009-03-23 18:16:03 -07:00
|
|
|
|
2009-04-24 10:31:18 -07:00
|
|
|
char * __cdecl
|
|
|
|
_strndup(const char *, unsigned int);
|
2009-03-23 18:16:03 -07:00
|
|
|
|
2009-04-24 10:31:18 -07:00
|
|
|
wchar_t * __cdecl
|
|
|
|
_wcsndup(const wchar_t *, unsigned int);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} //extern "C"
|
|
|
|
#endif
|
2009-03-23 18:16:03 -07:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2008-10-24 10:39:07 -07:00
|
|
|
#define strdup _strdup
|
2009-03-23 18:16:03 -07:00
|
|
|
#define strndup _strndup
|
|
|
|
#define wcsdup _wcsdup
|
|
|
|
#define wcsndup _wcsndup
|
|
|
|
|
|
|
|
|
2008-10-24 10:39:07 -07:00
|
|
|
#define strcmpi _stricmp
|
|
|
|
#define stricmp _stricmp
|
|
|
|
#define wgetcwd _wgetcwd
|
2009-02-10 15:10:07 -08:00
|
|
|
#define vsnprintf _vsnprintf
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-11-03 14:58:15 -08:00
|
|
|
#define SHGetSpecialFolderPathW SHGetSpecialFolderPath
|
|
|
|
#define SHGetPathFromIDListW SHGetPathFromIDList
|
|
|
|
#define FONTENUMPROCW FONTENUMPROC
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2008-11-03 10:52:23 -08:00
|
|
|
/* errno and family */
|
2009-04-24 10:31:18 -07:00
|
|
|
extern int errno;
|
|
|
|
char* strerror(int);
|
2008-11-03 10:52:23 -08:00
|
|
|
|
|
|
|
/* abort */
|
2009-04-24 10:31:18 -07:00
|
|
|
void abort(void);
|
2008-10-24 10:39:07 -07:00
|
|
|
|
|
|
|
/* Environment stuff */
|
2009-04-24 10:31:18 -07:00
|
|
|
char* getenv(const char* inName);
|
|
|
|
int putenv(const char *a);
|
|
|
|
char SetEnvironmentVariableW(const unsigned short * name, const unsigned short * value );
|
|
|
|
char GetEnvironmentVariableW(const unsigned short * lpName, unsigned short* lpBuffer, unsigned long nSize);
|
2008-10-24 10:39:07 -07:00
|
|
|
|
2009-04-24 10:31:18 -07:00
|
|
|
unsigned int ExpandEnvironmentStringsW(const unsigned short* lpSrc,
|
|
|
|
unsigned short* lpDst,
|
|
|
|
unsigned int nSize);
|
2008-12-15 10:16:07 -08:00
|
|
|
|
2008-10-24 10:39:07 -07:00
|
|
|
/* File system stuff */
|
2009-04-24 10:31:18 -07:00
|
|
|
unsigned short * _wgetcwd(unsigned short* dir, unsigned long size);
|
|
|
|
unsigned short *_wfullpath( unsigned short *absPath, const unsigned short *relPath, unsigned long maxLength );
|
|
|
|
int _unlink(const char *filename );
|
2009-07-08 08:46:36 -07:00
|
|
|
int _wchdir(const unsigned short* path);
|
2008-10-24 10:39:07 -07:00
|
|
|
|
|
|
|
/* The time stuff should be defined here, but it can't be because it
|
|
|
|
is already defined in time.h.
|
|
|
|
|
2009-04-24 10:31:18 -07:00
|
|
|
size_t strftime(char *, size_t, const char *, const struct tm *)
|
|
|
|
struct tm* localtime(const time_t* inTimeT)
|
|
|
|
struct tm* mozce_gmtime_r(const time_t* inTimeT, struct tm* outRetval)
|
|
|
|
struct tm* gmtime(const time_t* inTimeT)
|
|
|
|
time_t mktime(struct tm* inTM)
|
|
|
|
time_t time(time_t *)
|
|
|
|
clock_t clock()
|
2008-10-24 10:39:07 -07:00
|
|
|
|
|
|
|
*/
|
2009-04-24 12:55:12 -07:00
|
|
|
|
|
|
|
struct tm;
|
|
|
|
|
|
|
|
#ifndef _TIME_T_DEFINED
|
|
|
|
typedef long time_t;
|
|
|
|
#define _TIME_T_DEFINED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct tm* gmtime_r(const time_t* inTimeT, struct tm* outRetval);
|
|
|
|
struct tm* localtime_r(const time_t* inTimeT, struct tm* outRetval);
|
|
|
|
|
2008-10-24 10:39:07 -07:00
|
|
|
/* Locale Stuff */
|
|
|
|
|
|
|
|
/* The locale stuff should be defined here, but it can't be because it
|
|
|
|
is already defined in locale.h.
|
|
|
|
|
2009-04-24 10:31:18 -07:00
|
|
|
struct lconv * localeconv(void)
|
2008-10-24 10:39:07 -07:00
|
|
|
|
|
|
|
*/
|
2008-02-22 17:33:02 -08:00
|
|
|
|
2008-09-29 10:48:58 -07:00
|
|
|
|
2009-04-24 10:31:18 -07:00
|
|
|
unsigned short* mozce_GetEnvironmentCL();
|
2009-02-05 15:50:44 -08:00
|
|
|
|
2009-03-31 09:27:25 -07:00
|
|
|
/* square root of 1/2, missing from math.h */
|
|
|
|
#define M_SQRT1_2 0.707106781186547524401
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif //MOZCE_SHUNT_H
|