diff options
Diffstat (limited to 'public/sdk/inc/crt')
53 files changed, 11797 insertions, 0 deletions
diff --git a/public/sdk/inc/crt/assert.h b/public/sdk/inc/crt/assert.h new file mode 100644 index 000000000..70871a05f --- /dev/null +++ b/public/sdk/inc/crt/assert.h @@ -0,0 +1,86 @@ +/*** +*assert.h - define the assert macro +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* Defines the assert(exp) macro. +* [ANSI/System V] +* +* [Public] +* +****/ + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +#undef assert + +#ifdef NDEBUG + +#define assert(exp) ((void)0) + +#else + +#ifdef __cplusplus +extern "C" { +#endif + +_CRTIMP void __cdecl _assert(void *, void *, unsigned); + +#ifdef __cplusplus +} +#endif + +#define assert(exp) (void)( (exp) || (_assert(#exp, __FILE__, __LINE__), 0) ) + +#endif /* NDEBUG */ diff --git a/public/sdk/inc/crt/conio.h b/public/sdk/inc/crt/conio.h new file mode 100644 index 000000000..5d6ebbfce --- /dev/null +++ b/public/sdk/inc/crt/conio.h @@ -0,0 +1,148 @@ +/*** +*conio.h - console and port I/O declarations +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This include file contains the function declarations for +* the MS C V2.03 compatible console I/O routines. +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_CONIO +#define _INC_CONIO + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifndef _MAC + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +/* Function prototypes */ + +_CRTIMP char * __cdecl _cgets(char *); +_CRTIMP int __cdecl _cprintf(const char *, ...); +_CRTIMP int __cdecl _cputs(const char *); +_CRTIMP int __cdecl _cscanf(const char *, ...); +_CRTIMP int __cdecl _getch(void); +_CRTIMP int __cdecl _getche(void); +#ifdef _M_IX86 +int __cdecl _inp(unsigned short); +unsigned short __cdecl _inpw(unsigned short); +unsigned long __cdecl _inpd(unsigned short); +#endif /* _M_IX86 */ +_CRTIMP int __cdecl _kbhit(void); +#ifdef _M_IX86 +int __cdecl _outp(unsigned short, int); +unsigned short __cdecl _outpw(unsigned short, unsigned short); +unsigned long __cdecl _outpd(unsigned short, unsigned long); +#endif /* _M_IX86 */ +_CRTIMP int __cdecl _putch(int); +_CRTIMP int __cdecl _ungetch(int); + + +#if !__STDC__ + +/* Non-ANSI names for compatibility */ + +#ifdef _NTSDK + +#define cgets _cgets +#define cprintf _cprintf +#define cputs _cputs +#define cscanf _cscanf +#define getch _getch +#define getche _getche +#define kbhit _kbhit +#define putch _putch +#define ungetch _ungetch + +#else /* ndef _NTSDK */ + +_CRTIMP char * __cdecl cgets(char *); +_CRTIMP int __cdecl cprintf(const char *, ...); +_CRTIMP int __cdecl cputs(const char *); +_CRTIMP int __cdecl cscanf(const char *, ...); +#ifdef _M_IX86 +int __cdecl inp(unsigned short); +unsigned short __cdecl inpw(unsigned short); +#endif /* _M_IX86 */ +_CRTIMP int __cdecl getch(void); +_CRTIMP int __cdecl getche(void); +_CRTIMP int __cdecl kbhit(void); +#ifdef _M_IX86 +int __cdecl outp(unsigned short, int); +unsigned short __cdecl outpw(unsigned short, unsigned short); +#endif /* _M_IX86 */ +_CRTIMP int __cdecl putch(int); +_CRTIMP int __cdecl ungetch(int); + +#endif /* _NTSDK */ + +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* _MAC */ + +#endif /* _INC_CONIO */ diff --git a/public/sdk/inc/crt/crtdbg.h b/public/sdk/inc/crt/crtdbg.h new file mode 100644 index 000000000..ca04036ca --- /dev/null +++ b/public/sdk/inc/crt/crtdbg.h @@ -0,0 +1,525 @@ +/*** +*crtdbg.h - Supports debugging features of the C runtime library. +* +* Copyright (c) 1994-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* Support CRT debugging features. +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_CRTDBG +#define _INC_CRTDBG + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +#ifndef _DEBUG + + /**************************************************************************** + * + * Debug OFF + * Debug OFF + * Debug OFF + * + ***************************************************************************/ + +#define _ASSERT(expr) ((void)0) + +#define _ASSERTE(expr) ((void)0) + + +#define _RPT0(rptno, msg) + +#define _RPT1(rptno, msg, arg1) + +#define _RPT2(rptno, msg, arg1, arg2) + +#define _RPT3(rptno, msg, arg1, arg2, arg3) + +#define _RPT4(rptno, msg, arg1, arg2, arg3, arg4) + + +#define _RPTF0(rptno, msg) + +#define _RPTF1(rptno, msg, arg1) + +#define _RPTF2(rptno, msg, arg1, arg2) + +#define _RPTF3(rptno, msg, arg1, arg2, arg3) + +#define _RPTF4(rptno, msg, arg1, arg2, arg3, arg4) + +#define _malloc_dbg(s, t, f, l) malloc(s) +#define _calloc_dbg(c, s, t, f, l) calloc(c, s) +#define _realloc_dbg(p, s, t, f, l) realloc(p, s) +#define _expand_dbg(p, s, t, f, l) _expand(p, s) +#define _free_dbg(p, t) free(p) +#define _msize_dbg(p, t) _msize(p) + +#define _CrtSetReportHook(f) ((void)0) +#define _CrtSetReportMode(t, f) ((int)0) +#define _CrtSetReportFile(t, f) ((void)0) + +#define _CrtDbgBreak() ((void)0) + +#define _CrtSetBreakAlloc(a) ((long)0) + +#define _CrtSetAllocHook(f) ((void)0) + +#define _CrtCheckMemory() ((int)1) +#define _CrtSetDbgFlag(f) ((int)0) +#define _CrtDoForAllClientObjects(f, c) ((void)0) +#define _CrtIsValidPointer(p, n, r) ((int)1) +#define _CrtIsValidHeapPointer(p) ((int)1) +#define _CrtIsMemoryBlock(p, t, r, f, l) ((int)1) + +#define _CrtSetDumpClient(f) ((void)0) + +#define _CrtMemCheckpoint(s) ((void)0) +#define _CrtMemDifference(s1, s2, s3) ((int)0) +#define _CrtMemDumpAllObjectsSince(s) ((void)0) +#define _CrtMemDumpStatistics(s) ((void)0) +#define _CrtDumpMemoryLeaks() ((int)0) + + +#else /* _DEBUG */ + + + /**************************************************************************** + * + * Debug ON + * Debug ON + * Debug ON + * + ***************************************************************************/ + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#define _SIZE_T_DEFINED +#endif + +/* Define NULL pointer value */ + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + + /**************************************************************************** + * + * Debug Reporting + * + ***************************************************************************/ + +typedef void *_HFILE; /* file handle pointer */ + +#define _CRT_WARN 0 +#define _CRT_ERROR 1 +#define _CRT_ASSERT 2 +#define _CRT_ERRCNT 3 + +#define _CRTDBG_MODE_FILE 0x1 +#define _CRTDBG_MODE_DEBUG 0x2 +#define _CRTDBG_MODE_WNDW 0x4 +#define _CRTDBG_REPORT_MODE -1 + +#define _CRTDBG_INVALID_HFILE ((_HFILE)-1) +#define _CRTDBG_HFILE_ERROR ((_HFILE)-2) +#define _CRTDBG_FILE_STDOUT ((_HFILE)-4) +#define _CRTDBG_FILE_STDERR ((_HFILE)-5) +#define _CRTDBG_REPORT_FILE ((_HFILE)-6) + +#if defined(_DLL) && defined(_M_IX86) +#define _crtAssertBusy (*__p__crtAssertBusy()) +_CRTIMP long * __cdecl __p__crtAssertBusy(void); +#else /* !(defined(_DLL) && defined(_M_IX86)) */ +_CRTIMP extern long _crtAssertBusy; +#endif /* defined(_DLL) && defined(_M_IX86) */ + +typedef int (__cdecl * _CRT_REPORT_HOOK)(int, char *, int *); + +_CRTIMP _CRT_REPORT_HOOK __cdecl _CrtSetReportHook( + _CRT_REPORT_HOOK + ); + +_CRTIMP int __cdecl _CrtSetReportMode( + int, + int + ); + +_CRTIMP _HFILE __cdecl _CrtSetReportFile( + int, + _HFILE + ); + +_CRTIMP int __cdecl _CrtDbgReport( + int, + const char *, + int, + const char *, + const char *, + ...); + +/* Asserts */ + +#define _ASSERT(expr) \ + do { if (!(expr) && \ + (1 == _CrtDbgReport(_CRT_ASSERT, __FILE__, __LINE__, NULL, NULL))) \ + _CrtDbgBreak(); } while (0) + +#define _ASSERTE(expr) \ + do { if (!(expr) && \ + (1 == _CrtDbgReport(_CRT_ASSERT, __FILE__, __LINE__, NULL, #expr))) \ + _CrtDbgBreak(); } while (0) + + +/* Reports with no file/line info */ + +#define _RPT0(rptno, msg) \ + do { if ((1 == _CrtDbgReport(rptno, NULL, 0, NULL, "%s", msg))) \ + _CrtDbgBreak(); } while (0) + +#define _RPT1(rptno, msg, arg1) \ + do { if ((1 == _CrtDbgReport(rptno, NULL, 0, NULL, msg, arg1))) \ + _CrtDbgBreak(); } while (0) + +#define _RPT2(rptno, msg, arg1, arg2) \ + do { if ((1 == _CrtDbgReport(rptno, NULL, 0, NULL, msg, arg1, arg2))) \ + _CrtDbgBreak(); } while (0) + +#define _RPT3(rptno, msg, arg1, arg2, arg3) \ + do { if ((1 == _CrtDbgReport(rptno, NULL, 0, NULL, msg, arg1, arg2, arg3))) \ + _CrtDbgBreak(); } while (0) + +#define _RPT4(rptno, msg, arg1, arg2, arg3, arg4) \ + do { if ((1 == _CrtDbgReport(rptno, NULL, 0, NULL, msg, arg1, arg2, arg3, arg4))) \ + _CrtDbgBreak(); } while (0) + + +/* Reports with file/line info */ + +#define _RPTF0(rptno, msg) \ + do { if ((1 == _CrtDbgReport(rptno, __FILE__, __LINE__, NULL, "%s", msg))) \ + _CrtDbgBreak(); } while (0) + +#define _RPTF1(rptno, msg, arg1) \ + do { if ((1 == _CrtDbgReport(rptno, __FILE__, __LINE__, NULL, msg, arg1))) \ + _CrtDbgBreak(); } while (0) + +#define _RPTF2(rptno, msg, arg1, arg2) \ + do { if ((1 == _CrtDbgReport(rptno, __FILE__, __LINE__, NULL, msg, arg1, arg2))) \ + _CrtDbgBreak(); } while (0) + +#define _RPTF3(rptno, msg, arg1, arg2, arg3) \ + do { if ((1 == _CrtDbgReport(rptno, __FILE__, __LINE__, NULL, msg, arg1, arg2, arg3))) \ + _CrtDbgBreak(); } while (0) + +#define _RPTF4(rptno, msg, arg1, arg2, arg3, arg4) \ + do { if ((1 == _CrtDbgReport(rptno, __FILE__, __LINE__, NULL, msg, arg1, arg2, arg3, arg4))) \ + _CrtDbgBreak(); } while (0) + +#if defined(_M_IX86) && !defined(_CRT_PORTABLE) +#define _CrtDbgBreak() __asm { int 3 } +#elif defined(_M_ALPHA) && !defined(_CRT_PORTABLE) +void _BPT(); +#pragma intrinsic(_BPT) +#define _CrtDbgBreak() _BPT() +#else +_CRTIMP void __cdecl _CrtDbgBreak( + void + ); +#endif + + /**************************************************************************** + * + * Heap routines + * + ***************************************************************************/ + +#ifdef _CRTDBG_MAP_ALLOC + +#define malloc(s) _malloc_dbg(s, _NORMAL_BLOCK, __FILE__, __LINE__) +#define calloc(c, s) _calloc_dbg(c, s, _NORMAL_BLOCK, __FILE__, __LINE__) +#define realloc(p, s) _realloc_dbg(p, s, _NORMAL_BLOCK, __FILE__, __LINE__) +#define _expand(p, s) _expand_dbg(p, s, _NORMAL_BLOCK, __FILE__, __LINE__) +#define free(p) _free_dbg(p, _NORMAL_BLOCK) +#define _msize(p) _msize_dbg(p, _NORMAL_BLOCK) + +#endif /* _CRTDBG_MAP_ALLOC */ + +#if defined(_DLL) && defined(_M_IX86) +#define _crtBreakAlloc (*__p__crtBreakAlloc()) +_CRTIMP long * __cdecl __p__crtBreakAlloc(void); +#else /* !(defined(_DLL) && defined(_M_IX86)) */ +_CRTIMP extern long _crtBreakAlloc; /* Break on this allocation */ +#endif /* defined(_DLL) && defined(_M_IX86) */ + +_CRTIMP long __cdecl _CrtSetBreakAlloc( + long + ); + +/* + * Prototypes for malloc, free, realloc, etc are in malloc.h + */ + +_CRTIMP void * __cdecl _malloc_dbg( + size_t, + int, + const char *, + int + ); + +_CRTIMP void * __cdecl _calloc_dbg( + size_t, + size_t, + int, + const char *, + int + ); + +_CRTIMP void * __cdecl _realloc_dbg( + void *, + size_t, + int, + const char *, + int + ); + +_CRTIMP void * __cdecl _expand_dbg( + void *, + size_t, + int, + const char *, + int + ); + +_CRTIMP void __cdecl _free_dbg( + void *, + int + ); + +_CRTIMP size_t __cdecl _msize_dbg ( + void *, + int + ); + + + /**************************************************************************** + * + * Client-defined allocation hook + * + ***************************************************************************/ + +#define _HOOK_ALLOC 1 +#define _HOOK_REALLOC 2 +#define _HOOK_FREE 3 + +typedef int (__cdecl * _CRT_ALLOC_HOOK)(int, void *, size_t, int, long, const char *, int); + +_CRTIMP _CRT_ALLOC_HOOK __cdecl _CrtSetAllocHook( + _CRT_ALLOC_HOOK + ); + + + /**************************************************************************** + * + * Memory management + * + ***************************************************************************/ + +/* + * Bitfield flag that controls CRT heap behavior + * Default setting is _CRTDBG_ALLOC_MEM_DF + */ + +#if defined(_DLL) && defined(_M_IX86) +#define _crtDbgFlag (*__p__crtDbgFlag()) +_CRTIMP int * __cdecl __p__crtDbgFlag(void); +#else /* !(defined(_DLL) && defined(_M_IX86)) */ +_CRTIMP extern int _crtDbgFlag; +#endif /* defined(_DLL) && defined(_M_IX86) */ + +/* + * Bit values for _crtDbgFlag flag: + * + * These bitflags control debug heap behavior. + */ + +#define _CRTDBG_ALLOC_MEM_DF 0x01 /* Turn on debug allocation */ +#define _CRTDBG_DELAY_FREE_MEM_DF 0x02 /* Don't actually free memory */ +#define _CRTDBG_CHECK_ALWAYS_DF 0x04 /* Check heap every alloc/dealloc */ +#define _CRTDBG_RESERVED_DF 0x08 /* Reserved - do not use */ +#define _CRTDBG_CHECK_CRT_DF 0x10 /* Leak check/diff CRT blocks */ +#define _CRTDBG_LEAK_CHECK_DF 0x20 /* Leak check at program exit */ + +#define _CRTDBG_REPORT_FLAG -1 /* Query bitflag status */ + +#define _BLOCK_TYPE(block) (block & 0xFFFF) +#define _BLOCK_SUBTYPE(block) (block >> 16 & 0xFFFF) + +_CRTIMP int __cdecl _CrtCheckMemory( + void + ); + +_CRTIMP int __cdecl _CrtSetDbgFlag( + int + ); + +_CRTIMP void __cdecl _CrtDoForAllClientObjects( + void (*pfn)(void *, void *), + void * + ); + +_CRTIMP int __cdecl _CrtIsValidPointer( + const void *, + unsigned int, + int + ); + +_CRTIMP int __cdecl _CrtIsValidHeapPointer( + const void * + ); + +_CRTIMP int __cdecl _CrtIsMemoryBlock( + const void *, + unsigned int, + long *, + char **, + int * + ); + + + /**************************************************************************** + * + * Memory state + * + ***************************************************************************/ + +/* Memory block identification */ +#define _FREE_BLOCK 0 +#define _NORMAL_BLOCK 1 +#define _CRT_BLOCK 2 +#define _IGNORE_BLOCK 3 +#define _CLIENT_BLOCK 4 +#define _MAX_BLOCKS 5 + +typedef void (__cdecl * _CRT_DUMP_CLIENT)(void *, size_t); + +_CRTIMP _CRT_DUMP_CLIENT __cdecl _CrtSetDumpClient( + _CRT_DUMP_CLIENT + ); + +typedef struct _CrtMemState +{ + struct _CrtMemBlockHeader * pBlockHeader; + unsigned long lCounts[_MAX_BLOCKS]; + unsigned long lSizes[_MAX_BLOCKS]; + unsigned long lHighWaterCount; + unsigned long lTotalCount; +} _CrtMemState; + + +_CRTIMP void __cdecl _CrtMemCheckpoint( + _CrtMemState * + ); + +_CRTIMP int __cdecl _CrtMemDifference( + _CrtMemState *, + const _CrtMemState *, + const _CrtMemState * + ); + +_CRTIMP void __cdecl _CrtMemDumpAllObjectsSince( + const _CrtMemState * + ); + +_CRTIMP void __cdecl _CrtMemDumpStatistics( + const _CrtMemState * + ); + +_CRTIMP int __cdecl _CrtDumpMemoryLeaks( + void + ); + +#endif /* _DEBUG */ + +#ifdef __cplusplus +} + +#ifndef _DEBUG + + /**************************************************************************** + * + * Debug OFF + * Debug OFF + * Debug OFF + * + ***************************************************************************/ + +inline void* __cdecl operator new(unsigned int s, int, const char *, int) + { return ::operator new(s); } + +#else /* _DEBUG */ + + /**************************************************************************** + * + * Debug ON + * Debug ON + * Debug ON + * + ***************************************************************************/ + +_CRTIMP void * __cdecl operator new( + unsigned int, + int, + const char *, + int + ); + +#ifdef _CRTDBG_MAP_ALLOC + +inline void* __cdecl operator new(unsigned int s) + { return ::operator new(s, _NORMAL_BLOCK, __FILE__, __LINE__); } + +#endif /* _CRTDBG_MAP_ALLOC */ + +#endif /* _DEBUG */ + +#endif /* __cplusplus */ + + +#endif /* _INC_CRTDBG */ diff --git a/public/sdk/inc/crt/ctype.h b/public/sdk/inc/crt/ctype.h new file mode 100644 index 000000000..432ba1017 --- /dev/null +++ b/public/sdk/inc/crt/ctype.h @@ -0,0 +1,349 @@ +/*** +*ctype.h - character conversion macros and ctype macros +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* Defines macros for character classification/conversion. +* [ANSI/System V] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_CTYPE +#define _INC_CTYPE + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + +#ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif + +#ifndef _MAC +#ifndef _WCTYPE_T_DEFINED +typedef wchar_t wint_t; +typedef wchar_t wctype_t; +#define _WCTYPE_T_DEFINED +#endif + +#ifndef WEOF +#define WEOF (wint_t)(0xFFFF) +#endif +#endif /* ndef _MAC */ + +/* + * These declarations allow the user access to the ctype look-up + * array _ctype defined in ctype.obj by simply including ctype.h + */ +#ifndef _CTYPE_DISABLE_MACROS + +#ifdef _NTSDK + +/* Definitions and declarations compatible with the NT SDK */ + +#ifdef _DLL + +extern unsigned short * _ctype; +#define _pctype (*_pctype_dll) +extern unsigned short **_pctype_dll; +#define _pwctype (*_pwctype_dll) +extern unsigned short **_pwctype_dll; + +#else /* _DLL */ + + +extern unsigned short _ctype[]; +extern unsigned short *_pctype; +extern wctype_t *_pwctype; + +#endif /* _DLL */ + +#else /* ndef _NTSDK */ + +/* Current declarations */ +_CRTIMP extern unsigned short _ctype[]; + +#if defined(_DLL) && defined(_M_IX86) + +#define _pctype (*__p__pctype()) +_CRTIMP unsigned short ** __cdecl __p__pctype(void); + +#define _pwctype (*__p__pwctype()) +_CRTIMP wctype_t ** __cdecl ___p__pwctype(void); + +#else /* !(defined(_DLL) && defined(_M_IX86)) */ + +_CRTIMP extern unsigned short *_pctype; +#ifndef _MAC +_CRTIMP extern wctype_t *_pwctype; +#endif /* ndef _MAC */ + +#endif /* defined(_DLL) && defined(_M_IX86) */ + +#endif /* _NTSDK */ + +#endif /* _CTYPE_DISABLE_MACROS */ + +/* set bit masks for the possible character types */ + +#define _UPPER 0x1 /* upper case letter */ +#define _LOWER 0x2 /* lower case letter */ +#define _DIGIT 0x4 /* digit[0-9] */ +#define _SPACE 0x8 /* tab, carriage return, newline, */ + /* vertical tab or form feed */ +#define _PUNCT 0x10 /* punctuation character */ +#define _CONTROL 0x20 /* control character */ +#define _BLANK 0x40 /* space char */ +#define _HEX 0x80 /* hexadecimal digit */ + +#define _LEADBYTE 0x8000 /* multibyte leadbyte */ +#define _ALPHA (0x0100|_UPPER|_LOWER) /* alphabetic character */ + +/* character classification function prototypes */ + +#ifndef _CTYPE_DEFINED + +_CRTIMP int __cdecl _isctype(int, int); + +_CRTIMP int __cdecl isalpha(int); +_CRTIMP int __cdecl isupper(int); +_CRTIMP int __cdecl islower(int); +_CRTIMP int __cdecl isdigit(int); +_CRTIMP int __cdecl isxdigit(int); +_CRTIMP int __cdecl isspace(int); +_CRTIMP int __cdecl ispunct(int); +_CRTIMP int __cdecl isalnum(int); +_CRTIMP int __cdecl isprint(int); +_CRTIMP int __cdecl isgraph(int); +_CRTIMP int __cdecl iscntrl(int); +_CRTIMP int __cdecl toupper(int); +_CRTIMP int __cdecl tolower(int); +_CRTIMP int __cdecl _tolower(int); +_CRTIMP int __cdecl _toupper(int); +_CRTIMP int __cdecl __isascii(int); +_CRTIMP int __cdecl __toascii(int); +_CRTIMP int __cdecl __iscsymf(int); +_CRTIMP int __cdecl __iscsym(int); +#define _CTYPE_DEFINED +#endif + +#ifndef _MAC +#ifndef _WCTYPE_DEFINED + +/* wide function prototypes, also declared in wchar.h */ + +/* character classification function prototypes */ + +_CRTIMP int __cdecl iswalpha(wint_t); +_CRTIMP int __cdecl iswupper(wint_t); +_CRTIMP int __cdecl iswlower(wint_t); +_CRTIMP int __cdecl iswdigit(wint_t); +_CRTIMP int __cdecl iswxdigit(wint_t); +_CRTIMP int __cdecl iswspace(wint_t); +_CRTIMP int __cdecl iswpunct(wint_t); +_CRTIMP int __cdecl iswalnum(wint_t); +_CRTIMP int __cdecl iswprint(wint_t); +_CRTIMP int __cdecl iswgraph(wint_t); +_CRTIMP int __cdecl iswcntrl(wint_t); +_CRTIMP int __cdecl iswascii(wint_t); +_CRTIMP int __cdecl isleadbyte(int); + +_CRTIMP wchar_t __cdecl towupper(wchar_t); +_CRTIMP wchar_t __cdecl towlower(wchar_t); + +_CRTIMP int __cdecl iswctype(wint_t, wctype_t); + +/* --------- The following functions are OBSOLETE --------- */ +_CRTIMP int __cdecl is_wctype(wint_t, wctype_t); +/* --------- The preceding functions are OBSOLETE --------- */ + +#define _WCTYPE_DEFINED +#endif +#endif /* ndef _MAC */ + +/* the character classification macro definitions */ + +#ifndef _CTYPE_DISABLE_MACROS + +/* + * Maximum number of bytes in multi-byte character in the current locale + * (also defined in stdlib.h). + */ +#ifndef MB_CUR_MAX + +#ifdef _NTSDK + +/* definition compatible with NT SDK */ +#ifdef _DLL +#define __mb_cur_max (*__mb_cur_max_dll) +#define MB_CUR_MAX (*__mb_cur_max_dll) +extern unsigned short *__mb_cur_max_dll; +#else /* ndef _DLL */ +#define MB_CUR_MAX __mb_cur_max +extern unsigned short __mb_cur_max; +#endif /* _DLL */ + +#else /* ndef _NTSDK */ + +/* current definition */ +#if defined(_DLL) && defined(_M_IX86) +#define MB_CUR_MAX (*__p___mb_cur_max()) +_CRTIMP int * __cdecl __p___mb_cur_max(void); +#else /* !(defined(_DLL) && defined(_M_IX86)) */ +#define MB_CUR_MAX __mb_cur_max +_CRTIMP extern int __mb_cur_max; +#endif /* defined(_DLL) && defined(_M_IX86) */ + +#endif /* _NTSDK */ + +#endif /* MB_CUR_MAX */ + +#if defined(_M_MPPC) || defined(_M_M68K) +#define isalpha(_c) ( _pctype[_c] & (_UPPER|_LOWER) ) +#define isupper(_c) ( _pctype[_c] & _UPPER ) +#define islower(_c) ( _pctype[_c] & _LOWER ) +#define isdigit(_c) ( _pctype[_c] & _DIGIT ) +#define isxdigit(_c)( _pctype[_c] & _HEX ) +#define isspace(_c) ( _pctype[_c] & _SPACE ) +#define ispunct(_c) ( _pctype[_c] & _PUNCT ) +#define isalnum(_c) ( _pctype[_c] & (_UPPER|_LOWER|_DIGIT) ) +#define isprint(_c) ( _pctype[_c] & (_BLANK|_PUNCT|_UPPER|_LOWER|_DIGIT) ) +#define isgraph(_c) ( _pctype[_c] & (_PUNCT|_UPPER|_LOWER|_DIGIT) ) +#define iscntrl(_c) ( _pctype[_c] & _CONTROL ) +#else +#define isalpha(_c) (MB_CUR_MAX > 1 ? _isctype(_c,_ALPHA) : _pctype[_c] & _ALPHA) +#define isupper(_c) (MB_CUR_MAX > 1 ? _isctype(_c,_UPPER) : _pctype[_c] & _UPPER) +#define islower(_c) (MB_CUR_MAX > 1 ? _isctype(_c,_LOWER) : _pctype[_c] & _LOWER) +#define isdigit(_c) (MB_CUR_MAX > 1 ? _isctype(_c,_DIGIT) : _pctype[_c] & _DIGIT) +#define isxdigit(_c) (MB_CUR_MAX > 1 ? _isctype(_c,_HEX) : _pctype[_c] & _HEX) +#define isspace(_c) (MB_CUR_MAX > 1 ? _isctype(_c,_SPACE) : _pctype[_c] & _SPACE) +#define ispunct(_c) (MB_CUR_MAX > 1 ? _isctype(_c,_PUNCT) : _pctype[_c] & _PUNCT) +#define isalnum(_c) (MB_CUR_MAX > 1 ? _isctype(_c,_ALPHA|_DIGIT) : _pctype[_c] & (_ALPHA|_DIGIT)) +#define isprint(_c) (MB_CUR_MAX > 1 ? _isctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT) : _pctype[_c] & (_BLANK|_PUNCT|_ALPHA|_DIGIT)) +#define isgraph(_c) (MB_CUR_MAX > 1 ? _isctype(_c,_PUNCT|_ALPHA|_DIGIT) : _pctype[_c] & (_PUNCT|_ALPHA|_DIGIT)) +#define iscntrl(_c) (MB_CUR_MAX > 1 ? _isctype(_c,_CONTROL) : _pctype[_c] & _CONTROL) +#endif /* _M_MPPC || _M_M68K */ + +#define _tolower(_c) ( (_c)-'A'+'a' ) +#define _toupper(_c) ( (_c)-'a'+'A' ) + +#define __isascii(_c) ( (unsigned)(_c) < 0x80 ) +#define __toascii(_c) ( (_c) & 0x7f ) + +#define iswalpha(_c) ( iswctype(_c,_ALPHA) ) +#define iswupper(_c) ( iswctype(_c,_UPPER) ) +#define iswlower(_c) ( iswctype(_c,_LOWER) ) +#define iswdigit(_c) ( iswctype(_c,_DIGIT) ) +#define iswxdigit(_c) ( iswctype(_c,_HEX) ) +#define iswspace(_c) ( iswctype(_c,_SPACE) ) +#define iswpunct(_c) ( iswctype(_c,_PUNCT) ) +#define iswalnum(_c) ( iswctype(_c,_ALPHA|_DIGIT) ) +#define iswprint(_c) ( iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT) ) +#define iswgraph(_c) ( iswctype(_c,_PUNCT|_ALPHA|_DIGIT) ) +#define iswcntrl(_c) ( iswctype(_c,_CONTROL) ) +#define iswascii(_c) ( (unsigned)(_c) < 0x80 ) + +#define isleadbyte(_c) (_pctype[(unsigned char)(_c)] & _LEADBYTE) + +/* MS C version 2.0 extended ctype macros */ + +#define __iscsymf(_c) (isalpha(_c) || ((_c) == '_')) +#define __iscsym(_c) (isalnum(_c) || ((_c) == '_')) + +#endif /* _CTYPE_DISABLE_MACROS */ + + +#if !__STDC__ + +/* Non-ANSI names for compatibility */ + +#ifdef _NTSDK + +#define isascii __isascii +#define toascii __toascii +#define iscsymf __iscsymf +#define iscsym __iscsym + +#else /* ndef _NTSDK */ + +#ifndef _CTYPE_DEFINED +_CRTIMP int __cdecl isascii(int); +_CRTIMP int __cdecl toascii(int); +_CRTIMP int __cdecl iscsymf(int); +_CRTIMP int __cdecl iscsym(int); +#else +#define isascii __isascii +#define toascii __toascii +#define iscsymf __iscsymf +#define iscsym __iscsym +#endif + +#endif /* _NTSDK */ + +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + + +#endif /* _INC_CTYPE */ diff --git a/public/sdk/inc/crt/direct.h b/public/sdk/inc/crt/direct.h new file mode 100644 index 000000000..261d3c060 --- /dev/null +++ b/public/sdk/inc/crt/direct.h @@ -0,0 +1,177 @@ +/*** +*direct.h - function declarations for directory handling/creation +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This include file contains the function declarations for the library +* functions related to directory handling and creation. +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_DIRECT +#define _INC_DIRECT + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +/* + * Currently, all MS C compilers for Win32 platforms default to 8 byte + * alignment. + */ +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + +#ifndef _MAC +#ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif +#endif /* ndef _MAC */ + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#define _SIZE_T_DEFINED +#endif + +#ifndef _MAC +/* _getdiskfree structure for _getdiskfree() */ +#ifndef _DISKFREE_T_DEFINED + +struct _diskfree_t { + unsigned total_clusters; + unsigned avail_clusters; + unsigned sectors_per_cluster; + unsigned bytes_per_sector; + }; + +#define _DISKFREE_T_DEFINED +#endif +#endif /* ndef _MAC */ + +/* function prototypes */ + +_CRTIMP int __cdecl _chdir(const char *); +_CRTIMP char * __cdecl _getcwd(char *, int); +_CRTIMP int __cdecl _mkdir(const char *); +_CRTIMP int __cdecl _rmdir(const char *); + +#ifndef _MAC +_CRTIMP int __cdecl _chdrive(int); +_CRTIMP char * __cdecl _getdcwd(int, char *, int); +_CRTIMP int __cdecl _getdrive(void); +_CRTIMP unsigned long __cdecl _getdrives(void); +_CRTIMP unsigned __cdecl _getdiskfree(unsigned, struct _diskfree_t *); +#endif /* ndef _MAC */ + + +#ifndef _MAC +#ifndef _WDIRECT_DEFINED + +/* wide function prototypes, also declared in wchar.h */ + +_CRTIMP int __cdecl _wchdir(const wchar_t *); +_CRTIMP wchar_t * __cdecl _wgetcwd(wchar_t *, int); +_CRTIMP wchar_t * __cdecl _wgetdcwd(int, wchar_t *, int); +_CRTIMP int __cdecl _wmkdir(const wchar_t *); +_CRTIMP int __cdecl _wrmdir(const wchar_t *); + +#define _WDIRECT_DEFINED +#endif +#endif /* ndef _MAC */ + + +#if !__STDC__ + +/* Non-ANSI names for compatibility */ + +#ifdef _NTSDK + +#define chdir _chdir +#define getcwd _getcwd +#define mkdir _mkdir +#define rmdir _rmdir + +#else /* _NTSDK */ + +_CRTIMP int __cdecl chdir(const char *); +_CRTIMP char * __cdecl getcwd(char *, int); +_CRTIMP int __cdecl mkdir(const char *); +_CRTIMP int __cdecl rmdir(const char *); + +#endif /* _NTSDK */ + +#ifndef _MAC +#define diskfree_t _diskfree_t +#endif /* ndef _MAC */ + +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_DIRECT */ diff --git a/public/sdk/inc/crt/dos.h b/public/sdk/inc/crt/dos.h new file mode 100644 index 000000000..e9d4c351a --- /dev/null +++ b/public/sdk/inc/crt/dos.h @@ -0,0 +1,205 @@ +/*** +*dos.h - definitions for MS-DOS interface routines +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* Defines the structs and unions used for the direct DOS interface +* routines; includes macros to access the segment and offset +* values of far pointers, so that they may be used by the routines; and +* provides function prototypes for direct DOS interface functions. +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_DOS +#define _INC_DOS + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +/* + * Currently, all MS C compilers for Win32 platforms default to 8 byte + * alignment. + */ +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + +#ifndef _MAC +#ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif +#endif /* ndef _MAC */ + +#ifndef _MAC +#ifndef _DISKFREE_T_DEFINED +/* _getdiskfree structure (duplicated in DIRECT.H) */ +struct _diskfree_t { + unsigned total_clusters; + unsigned avail_clusters; + unsigned sectors_per_cluster; + unsigned bytes_per_sector; + }; + +#define _DISKFREE_T_DEFINED +#endif +#endif /* ndef _MAC */ + +/* File attribute constants */ + +#define _A_NORMAL 0x00 /* Normal file - No read/write restrictions */ +#define _A_RDONLY 0x01 /* Read only file */ +#define _A_HIDDEN 0x02 /* Hidden file */ +#define _A_SYSTEM 0x04 /* System file */ +#define _A_SUBDIR 0x10 /* Subdirectory */ +#define _A_ARCH 0x20 /* Archive file */ + +#ifdef _NTSDK + +/* External variable declarations */ + +/* + * WARNING! The _osversion, _osmajor, _osminor, _baseversion, _basemajor and + * _baseminor variables were never meaningfully defined in the C runtime + * libraries for Win32 platforms. Any code which references these variables + * should be revised (see the declarations for version information variables + * in stdlib.h). + */ + +#ifdef _DLL + +/* --------- The following block is OBSOLETE --------- */ + +#define _osversion (*_osversion_dll) +#define _osmajor (*_osmajor_dll) +#define _osminor (*_osminor_dll) +#define _baseversion (*_baseversion_dll) +#define _basemajor (*_basemajor_dll) +#define _baseminor (*_baseminor_dll) + +extern unsigned int * _osversion_dll; +extern unsigned int * _osmajor_dll; +extern unsigned int * _osminor_dll; +extern unsigned int * _baseversion_dll; +extern unsigned int * _basemajor_dll; +extern unsigned int * _baseminor_dll; + +/* --------- The preceding block is OBSOLETE --------- */ + +#define _pgmptr (*_pgmptr_dll) +extern char ** _pgmptr_dll; + +#ifndef _MAC +#define _wpgmptr (*_wpgmptr_dll) +extern wchar_t ** _wpgmptr_dll; +#endif /* ndef _MAC */ + +#else /* ndef _DLL */ + +/* --------- The following block is OBSOLETE --------- */ + + +extern unsigned int _osversion; +extern unsigned int _osmajor; +extern unsigned int _osminor; +extern unsigned int _baseversion; +extern unsigned int _basemajor; +extern unsigned int _baseminor; + +/* --------- The preceding block is OBSOLETE --------- */ + + +extern char * _pgmptr; +#ifndef _MAC +extern wchar_t * _wpgmptr; +#endif /* ndef _MAC */ + +#endif /* _DLL */ + +#endif /* _NTSDK */ + +#ifndef _MAC +/* Function prototypes */ +_CRTIMP unsigned __cdecl _getdiskfree(unsigned, struct _diskfree_t *); +#endif /* ndef _MAC */ + +#ifdef _M_IX86 +void __cdecl _disable(void); +void __cdecl _enable(void); +#endif /* _M_IX86 */ + +#ifndef _MAC +#if !__STDC__ +/* Non-ANSI name for compatibility */ +#define diskfree_t _diskfree_t +#endif /* __STDC__ */ +#endif /* ndef _MAC */ + +#ifdef __cplusplus +} +#endif + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_DOS */ diff --git a/public/sdk/inc/crt/eh.h b/public/sdk/inc/crt/eh.h new file mode 100644 index 000000000..39da7ca7b --- /dev/null +++ b/public/sdk/inc/crt/eh.h @@ -0,0 +1,94 @@ +/*** +*eh.h - User include file for exception handling. +* +* Copyright (c) 1993-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* User include file for exception handling. +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_EH +#define _INC_EH + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +// Currently, all MS C compilers for Win32 platforms default to 8 byte +// alignment. +#pragma pack(push,8) +#endif // _MSC_VER + +#ifndef __cplusplus +#error "eh.h is only for C++!" +#endif + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + +typedef void (_CRTAPI1 *terminate_function)(); +typedef void (_CRTAPI1 *unexpected_function)(); + +#if !defined(_M_MPPC) && !defined(_M_M68K) +struct _EXCEPTION_POINTERS; +typedef void (_CRTAPI1 *_se_translator_function)(unsigned int, struct _EXCEPTION_POINTERS*); +#endif + +_CRTIMP void _CRTAPI1 terminate(void); +_CRTIMP void _CRTAPI1 unexpected(void); + +_CRTIMP terminate_function _CRTAPI1 set_terminate(terminate_function); +_CRTIMP unexpected_function _CRTAPI1 set_unexpected(unexpected_function); +#if !defined(_M_MPPC) && !defined(_M_M68K) +_CRTIMP _se_translator_function _CRTAPI1 _set_se_translator(_se_translator_function); +#endif + +#ifdef _MSC_VER +#pragma pack(pop) +#endif // _MSC_VER + +#endif // _INC_EH diff --git a/public/sdk/inc/crt/errno.h b/public/sdk/inc/crt/errno.h new file mode 100644 index 000000000..f0a4a4e35 --- /dev/null +++ b/public/sdk/inc/crt/errno.h @@ -0,0 +1,138 @@ +/*** +*errno.h - system wide error numbers (set by system calls) +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the system-wide error numbers (set by +* system calls). Conforms to the XENIX standard. Extended +* for compatibility with Uniforum standard. +* [System V] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_ERRNO +#define _INC_ERRNO + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +/* declare reference to errno */ + +#if (defined(_MT) || defined(_DLL)) && (!defined(_M_MPPC) && !defined(_M_M68K)) +_CRTIMP extern int * __cdecl _errno(void); +#define errno (*_errno()) +#else /* ndef _MT && ndef _DLL */ +_CRTIMP extern int errno; +#endif /* _MT || _DLL */ + +/* Error Codes */ + +#define EPERM 1 +#define ENOENT 2 +#define ESRCH 3 +#define EINTR 4 +#define EIO 5 +#define ENXIO 6 +#define E2BIG 7 +#define ENOEXEC 8 +#define EBADF 9 +#define ECHILD 10 +#define EAGAIN 11 +#define ENOMEM 12 +#define EACCES 13 +#define EFAULT 14 +#define EBUSY 16 +#define EEXIST 17 +#define EXDEV 18 +#define ENODEV 19 +#define ENOTDIR 20 +#define EISDIR 21 +#define EINVAL 22 +#define ENFILE 23 +#define EMFILE 24 +#define ENOTTY 25 +#define EFBIG 27 +#define ENOSPC 28 +#define ESPIPE 29 +#define EROFS 30 +#define EMLINK 31 +#define EPIPE 32 +#define EDOM 33 +#define ERANGE 34 +#define EDEADLK 36 +#define ENAMETOOLONG 38 +#define ENOLCK 39 +#define ENOSYS 40 +#define ENOTEMPTY 41 +#define EILSEQ 42 + +/* + * Support EDEADLOCK for compatibiity with older MS-C versions. + */ +#define EDEADLOCK EDEADLK + +#ifdef __cplusplus +} +#endif + +#endif /* _INC_ERRNO */ diff --git a/public/sdk/inc/crt/excpt.h b/public/sdk/inc/crt/excpt.h new file mode 100644 index 000000000..14c3684c5 --- /dev/null +++ b/public/sdk/inc/crt/excpt.h @@ -0,0 +1,181 @@ +/*** +*excpt.h - defines exception values, types and routines +* +* Copyright (c) 1990-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file contains the definitions and prototypes for the compiler- +* dependent intrinsics, support functions and keywords which implement +* the structured exception handling extensions. +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_EXCPT +#define _INC_EXCPT + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +/* + * Currently, all MS C compilers for Win32 platforms default to 8 byte + * alignment. + */ +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +/* + * Exception disposition return values. + */ +typedef enum _EXCEPTION_DISPOSITION { + ExceptionContinueExecution, + ExceptionContinueSearch, + ExceptionNestedException, + ExceptionCollidedUnwind +} EXCEPTION_DISPOSITION; + + +/* + * Prototype for SEH support function. + */ + +#ifdef _M_IX86 + +/* + * Declarations to keep MS C 8 (386/486) compiler happy + */ +struct _EXCEPTION_RECORD; +struct _CONTEXT; + +EXCEPTION_DISPOSITION __cdecl _except_handler ( + struct _EXCEPTION_RECORD *ExceptionRecord, + void * EstablisherFrame, + struct _CONTEXT *ContextRecord, + void * DispatcherContext + ); + +#elif defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) + +/* + * Declarations to keep MIPS, ALPHA, and PPC compiler happy + */ +typedef struct _EXCEPTION_POINTERS *Exception_info_ptr; +struct _EXCEPTION_RECORD; +struct _CONTEXT; +struct _DISPATCHER_CONTEXT; + + +_CRTIMP EXCEPTION_DISPOSITION __C_specific_handler ( + struct _EXCEPTION_RECORD *ExceptionRecord, + void *EstablisherFrame, + struct _CONTEXT *ContextRecord, + struct _DISPATCHER_CONTEXT *DispatcherContext + ); + +#endif + + +/* + * Keywords and intrinsics for SEH + */ + +#ifdef _MSC_VER + +#if defined(_NTSDK) && !defined(__cplusplus) +#define try __try +#define except __except +#define finally __finally +#define leave __leave +#endif /* _NTSDK */ +#define GetExceptionCode _exception_code +#define exception_code _exception_code +#define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info +#define exception_info (struct _EXCEPTION_POINTERS *)_exception_info +#define AbnormalTermination _abnormal_termination +#define abnormal_termination _abnormal_termination + +unsigned long __cdecl _exception_code(void); +void * __cdecl _exception_info(void); +int __cdecl _abnormal_termination(void); + +#endif + + +/* + * Legal values for expression in except(). + */ + +#define EXCEPTION_EXECUTE_HANDLER 1 +#define EXCEPTION_CONTINUE_SEARCH 0 +#define EXCEPTION_CONTINUE_EXECUTION -1 + + + +#ifdef __cplusplus +} +#endif + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_EXCPT */ diff --git a/public/sdk/inc/crt/fcntl.h b/public/sdk/inc/crt/fcntl.h new file mode 100644 index 000000000..e73a256bb --- /dev/null +++ b/public/sdk/inc/crt/fcntl.h @@ -0,0 +1,82 @@ +/*** +*fcntl.h - file control options used by open() +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines constants for the file control options used +* by the _open() function. +* [System V] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_FCNTL +#define _INC_FCNTL + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#define _O_RDONLY 0x0000 /* open for reading only */ +#define _O_WRONLY 0x0001 /* open for writing only */ +#define _O_RDWR 0x0002 /* open for reading and writing */ +#define _O_APPEND 0x0008 /* writes done at eof */ + +#define _O_CREAT 0x0100 /* create and open file */ +#define _O_TRUNC 0x0200 /* open and truncate */ +#define _O_EXCL 0x0400 /* open only if file doesn't already exist */ + +/* O_TEXT files have <cr><lf> sequences translated to <lf> on read()'s, +** and <lf> sequences translated to <cr><lf> on write()'s +*/ + +#define _O_TEXT 0x4000 /* file mode is text (translated) */ +#define _O_BINARY 0x8000 /* file mode is binary (untranslated) */ + +/* macro to translate the C 2.0 name used to force binary mode for files */ + +#define _O_RAW _O_BINARY + +/* Open handle inherit bit */ + +#define _O_NOINHERIT 0x0080 /* child process doesn't inherit file */ + +/* Temporary file bit - file is deleted when last handle is closed */ + +#define _O_TEMPORARY 0x0040 /* temporary file bit */ + +/* temporary access hint */ + +#define _O_SHORT_LIVED 0x1000 /* temporary storage file, try not to flush */ + +/* sequential/random access hints */ + +#define _O_SEQUENTIAL 0x0020 /* file access is primarily sequential */ +#define _O_RANDOM 0x0010 /* file access is primarily random */ + +#if !__STDC__ || defined(_POSIX_) +/* Non-ANSI names for compatibility */ +#define O_RDONLY _O_RDONLY +#define O_WRONLY _O_WRONLY +#define O_RDWR _O_RDWR +#define O_APPEND _O_APPEND +#define O_CREAT _O_CREAT +#define O_TRUNC _O_TRUNC +#define O_EXCL _O_EXCL +#define O_TEXT _O_TEXT +#define O_BINARY _O_BINARY +#define O_RAW _O_BINARY +#define O_TEMPORARY _O_TEMPORARY +#define O_NOINHERIT _O_NOINHERIT +#define O_SEQUENTIAL _O_SEQUENTIAL +#define O_RANDOM _O_RANDOM +#endif /* __STDC__ */ + +#endif /* _INC_FCNTL */ diff --git a/public/sdk/inc/crt/float.h b/public/sdk/inc/crt/float.h new file mode 100644 index 000000000..6c586e00c --- /dev/null +++ b/public/sdk/inc/crt/float.h @@ -0,0 +1,362 @@ +/*** +*float.h - constants for floating point values +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file contains defines for a number of implementation dependent +* values which are commonly used by sophisticated numerical (floating +* point) programs. +* [ANSI] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_FLOAT +#define _INC_FLOAT + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + +#define DBL_DIG 15 /* # of decimal digits of precision */ +#define DBL_EPSILON 2.2204460492503131e-016 /* smallest such that 1.0+DBL_EPSILON != 1.0 */ +#define DBL_MANT_DIG 53 /* # of bits in mantissa */ +#define DBL_MAX 1.7976931348623158e+308 /* max value */ +#define DBL_MAX_10_EXP 308 /* max decimal exponent */ +#define DBL_MAX_EXP 1024 /* max binary exponent */ +#define DBL_MIN 2.2250738585072014e-308 /* min positive value */ +#define DBL_MIN_10_EXP (-307) /* min decimal exponent */ +#define DBL_MIN_EXP (-1021) /* min binary exponent */ +#define _DBL_RADIX 2 /* exponent radix */ +#define _DBL_ROUNDS 1 /* addition rounding: near */ + +#define FLT_DIG 6 /* # of decimal digits of precision */ +#define FLT_EPSILON 1.192092896e-07F /* smallest such that 1.0+FLT_EPSILON != 1.0 */ +#define FLT_GUARD 0 +#define FLT_MANT_DIG 24 /* # of bits in mantissa */ +#define FLT_MAX 3.402823466e+38F /* max value */ +#define FLT_MAX_10_EXP 38 /* max decimal exponent */ +#define FLT_MAX_EXP 128 /* max binary exponent */ +#define FLT_MIN 1.175494351e-38F /* min positive value */ +#define FLT_MIN_10_EXP (-37) /* min decimal exponent */ +#define FLT_MIN_EXP (-125) /* min binary exponent */ +#define FLT_NORMALIZE 0 +#define FLT_RADIX 2 /* exponent radix */ +#define FLT_ROUNDS 1 /* addition rounding: near */ + +#ifndef _M_M68K +#define LDBL_DIG DBL_DIG /* # of decimal digits of precision */ +#define LDBL_EPSILON DBL_EPSILON /* smallest such that 1.0+LDBL_EPSILON != 1.0 */ +#define LDBL_MANT_DIG DBL_MANT_DIG /* # of bits in mantissa */ +#define LDBL_MAX DBL_MAX /* max value */ +#define LDBL_MAX_10_EXP DBL_MAX_10_EXP /* max decimal exponent */ +#define LDBL_MAX_EXP DBL_MAX_EXP /* max binary exponent */ +#define LDBL_MIN DBL_MIN /* min positive value */ +#define LDBL_MIN_10_EXP DBL_MIN_10_EXP /* min decimal exponent */ +#define LDBL_MIN_EXP DBL_MIN_EXP /* min binary exponent */ +#define _LDBL_RADIX DBL_RADIX /* exponent radix */ +#define _LDBL_ROUNDS DBL_ROUNDS /* addition rounding: near */ +#else +#define LDBL_DIG 18 /* # of decimal digits of precision */ +#define LDBL_EPSILON 1.08420217248550443412e-019L /* smallest such that 1.0+LDBL_EPSILON != 1.0 */ +#define LDBL_MANT_DIG 64 /* # of bits in mantissa */ +#define LDBL_MAX 1.189731495357231765e+4932L /* max value */ +#define LDBL_MAX_10_EXP 4932 /* max decimal exponent */ +#define LDBL_MAX_EXP 16384 /* max binary exponent */ +#define LDBL_MIN 3.3621031431120935063e-4932L /* min positive value */ +#define LDBL_MIN_10_EXP (-4931) /* min decimal exponent */ +#define LDBL_MIN_EXP (-16381) /* min binary exponent */ +#define _LDBL_RADIX 2 /* exponent radix */ +#define _LDBL_ROUNDS 1 /* addition rounding: near */ +#endif + +/* Function prototypes */ + +_CRTIMP unsigned int __cdecl _clearfp(void); +_CRTIMP unsigned int __cdecl _controlfp(unsigned int,unsigned int); +_CRTIMP unsigned int __cdecl _statusfp(void); +_CRTIMP void __cdecl _fpreset(void); + +#ifndef _MAC +#define _clear87 _clearfp +#define _status87 _statusfp +#endif /* _MAC */ + +/* + * Abstract User Control Word Mask and bit definitions + */ +#if !defined(_M_MPPC) && !defined(_M_M68K) +#define _MCW_EM 0x0008001f /* interrupt Exception Masks */ +#else +#define _MCW_EM 0x0000001f /* interrupt Exception Masks */ +#endif +#define _EM_INEXACT 0x00000001 /* inexact (precision) */ +#define _EM_UNDERFLOW 0x00000002 /* underflow */ +#define _EM_OVERFLOW 0x00000004 /* overflow */ +#define _EM_ZERODIVIDE 0x00000008 /* zero divide */ +#define _EM_INVALID 0x00000010 /* invalid */ + +#define _MCW_RC 0x00000300 /* Rounding Control */ +#define _RC_NEAR 0x00000000 /* near */ +#define _RC_DOWN 0x00000100 /* down */ +#define _RC_UP 0x00000200 /* up */ +#define _RC_CHOP 0x00000300 /* chop */ + +/* + * Abstract User Status Word bit definitions + */ + +#define _SW_INEXACT 0x00000001 /* inexact (precision) */ +#define _SW_UNDERFLOW 0x00000002 /* underflow */ +#define _SW_OVERFLOW 0x00000004 /* overflow */ +#define _SW_ZERODIVIDE 0x00000008 /* zero divide */ +#define _SW_INVALID 0x00000010 /* invalid */ + + +/* + * i386 specific definitions + */ +#define _MCW_PC 0x00030000 /* Precision Control */ +#if defined(_M_MPPC) +/* + * PowerMac specific definitions(no precision control) + */ +#define _PC_64 0x00000000 /* 64 bits */ +#define _PC_53 0x00000000 /* 53 bits */ +#define _PC_24 0x00000000 /* 24 bits */ +#else +#define _PC_64 0x00000000 /* 64 bits */ +#define _PC_53 0x00010000 /* 53 bits */ +#define _PC_24 0x00020000 /* 24 bits */ +#endif + +#define _MCW_IC 0x00040000 /* Infinity Control */ +#define _IC_AFFINE 0x00040000 /* affine */ +#define _IC_PROJECTIVE 0x00000000 /* projective */ + +#define _EM_DENORMAL 0x00080000 /* denormal exception mask (_control87 only) */ + +#define _SW_DENORMAL 0x00080000 /* denormal status bit */ + + +_CRTIMP unsigned int __cdecl _control87(unsigned int,unsigned int); + + +/* + * MIPS R4000 specific definitions + */ + +#define _MCW_DN 0x01000000 /* Denormal Control (R4000) */ +#define _DN_FLUSH 0x01000000 /* flush to zero */ +#define _DN_SAVE 0x00000000 /* save */ + + +/* initial Control Word value */ + +#if defined(_M_IX86) + +#define _CW_DEFAULT ( _RC_NEAR + _PC_53 + _EM_INVALID + _EM_ZERODIVIDE + _EM_OVERFLOW + _EM_UNDERFLOW + _EM_INEXACT + _EM_DENORMAL) + +#elif defined(_M_M68K) || defined(_M_MPPC) + +#define _CW_DEFAULT ( _RC_NEAR + _PC_64 + _EM_INVALID + _EM_ZERODIVIDE + _EM_OVERFLOW + _EM_UNDERFLOW + _EM_INEXACT ) + +#elif defined(_M_MRX000) || defined (_M_ALPHA) || defined(_M_PPC) + +#define _CW_DEFAULT ( _RC_NEAR + _DN_FLUSH + _EM_INVALID + _EM_ZERODIVIDE + _EM_OVERFLOW + _EM_UNDERFLOW + _EM_INEXACT ) + +#endif + +/* Global variable holding floating point error code */ + +#if defined(_MT) || defined(_DLL) +_CRTIMP extern int * __cdecl __fpecode(void); +#define _fpecode (*__fpecode()) +#else /* ndef _MT && ndef _DLL */ +extern int _fpecode; +#endif /* _MT || _DLL */ + +/* invalid subconditions (_SW_INVALID also set) */ + +#define _SW_UNEMULATED 0x0040 /* unemulated instruction */ +#define _SW_SQRTNEG 0x0080 /* square root of a neg number */ +#define _SW_STACKOVERFLOW 0x0200 /* FP stack overflow */ +#define _SW_STACKUNDERFLOW 0x0400 /* FP stack underflow */ + +/* Floating point error signals and return codes */ + +#define _FPE_INVALID 0x81 +#define _FPE_DENORMAL 0x82 +#define _FPE_ZERODIVIDE 0x83 +#define _FPE_OVERFLOW 0x84 +#define _FPE_UNDERFLOW 0x85 +#define _FPE_INEXACT 0x86 + +#define _FPE_UNEMULATED 0x87 +#define _FPE_SQRTNEG 0x88 +#define _FPE_STACKOVERFLOW 0x8a +#define _FPE_STACKUNDERFLOW 0x8b + +#define _FPE_EXPLICITGEN 0x8c /* raise( SIGFPE ); */ + + +/* IEEE recommended functions */ + +_CRTIMP double __cdecl _copysign (double, double); +_CRTIMP double __cdecl _chgsign (double); +_CRTIMP double __cdecl _scalb(double, long); +_CRTIMP double __cdecl _logb(double); +_CRTIMP double __cdecl _nextafter(double, double); +_CRTIMP int __cdecl _finite(double); +_CRTIMP int __cdecl _isnan(double); +_CRTIMP int __cdecl _fpclass(double); + +#define _FPCLASS_SNAN 0x0001 /* signaling NaN */ +#define _FPCLASS_QNAN 0x0002 /* quiet NaN */ +#define _FPCLASS_NINF 0x0004 /* negative infinity */ +#define _FPCLASS_NN 0x0008 /* negative normal */ +#define _FPCLASS_ND 0x0010 /* negative denormal */ +#define _FPCLASS_NZ 0x0020 /* -0 */ +#define _FPCLASS_PZ 0x0040 /* +0 */ +#define _FPCLASS_PD 0x0080 /* positive denormal */ +#define _FPCLASS_PN 0x0100 /* positive normal */ +#define _FPCLASS_PINF 0x0200 /* positive infinity */ + + +#if !__STDC__ + +/* Non-ANSI names for compatibility */ + +#ifndef _MAC +#define clear87 _clear87 +#define status87 _status87 +#define control87 _control87 +#endif /* _MAC */ + +#ifdef _NTSDK +#define fpreset _fpreset +#else /* ndef _NTSDK */ +_CRTIMP void __cdecl fpreset(void); +#endif /* _NTSDK */ + +#define DBL_RADIX _DBL_RADIX +#define DBL_ROUNDS _DBL_ROUNDS + +#define LDBL_RADIX _LDBL_RADIX +#define LDBL_ROUNDS _LDBL_ROUNDS + +#define MCW_EM _MCW_EM +#define EM_INVALID _EM_INVALID +#define EM_DENORMAL _EM_DENORMAL +#define EM_ZERODIVIDE _EM_ZERODIVIDE +#define EM_OVERFLOW _EM_OVERFLOW +#define EM_UNDERFLOW _EM_UNDERFLOW +#define EM_INEXACT _EM_INEXACT + +#define MCW_IC _MCW_IC +#define IC_AFFINE _IC_AFFINE +#define IC_PROJECTIVE _IC_PROJECTIVE + +#define MCW_RC _MCW_RC +#define RC_CHOP _RC_CHOP +#define RC_UP _RC_UP +#define RC_DOWN _RC_DOWN +#define RC_NEAR _RC_NEAR + +#define MCW_PC _MCW_PC +#define PC_24 _PC_24 +#define PC_53 _PC_53 +#define PC_64 _PC_64 + +#define CW_DEFAULT _CW_DEFAULT + +#define SW_INVALID _SW_INVALID +#define SW_DENORMAL _SW_DENORMAL +#define SW_ZERODIVIDE _SW_ZERODIVIDE +#define SW_OVERFLOW _SW_OVERFLOW +#define SW_UNDERFLOW _SW_UNDERFLOW +#define SW_INEXACT _SW_INEXACT + +#define SW_UNEMULATED _SW_UNEMULATED +#define SW_SQRTNEG _SW_SQRTNEG +#define SW_STACKOVERFLOW _SW_STACKOVERFLOW +#define SW_STACKUNDERFLOW _SW_STACKUNDERFLOW + +#define FPE_INVALID _FPE_INVALID +#define FPE_DENORMAL _FPE_DENORMAL +#define FPE_ZERODIVIDE _FPE_ZERODIVIDE +#define FPE_OVERFLOW _FPE_OVERFLOW +#define FPE_UNDERFLOW _FPE_UNDERFLOW +#define FPE_INEXACT _FPE_INEXACT + +#define FPE_UNEMULATED _FPE_UNEMULATED +#define FPE_SQRTNEG _FPE_SQRTNEG +#define FPE_STACKOVERFLOW _FPE_STACKOVERFLOW +#define FPE_STACKUNDERFLOW _FPE_STACKUNDERFLOW + +#define FPE_EXPLICITGEN _FPE_EXPLICITGEN + +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* _INC_FLOAT */ diff --git a/public/sdk/inc/crt/fpieee.h b/public/sdk/inc/crt/fpieee.h new file mode 100644 index 000000000..a918904a8 --- /dev/null +++ b/public/sdk/inc/crt/fpieee.h @@ -0,0 +1,286 @@ +/*** +*fpieee.h - Definitions for floating point IEEE exception handling +* +* Copyright (c) 1991-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file contains constant and type definitions for handling +* floating point exceptions [ANSI/IEEE std. 754] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_FPIEEE +#define _INC_FPIEEE + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifndef __assembler /* MIPS ONLY: Protect from assembler */ + +#ifdef _MSC_VER +/* + * Currently, all MS C compilers for Win32 platforms default to 8 byte + * alignment. + */ +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + +/* + * Define floating point IEEE compare result values. + */ + +typedef enum { + _FpCompareEqual, + _FpCompareGreater, + _FpCompareLess, + _FpCompareUnordered +} _FPIEEE_COMPARE_RESULT; + +/* + * Define floating point format and result precision values. + */ + +typedef enum { + _FpFormatFp32, + _FpFormatFp64, + _FpFormatFp80, + _FpFormatFp128, + _FpFormatI16, + _FpFormatI32, + _FpFormatI64, + _FpFormatU16, + _FpFormatU32, + _FpFormatU64, + _FpFormatBcd80, + _FpFormatCompare, + _FpFormatString +} _FPIEEE_FORMAT; + +/* + * Define operation code values. + */ + +typedef enum { + _FpCodeUnspecified, + _FpCodeAdd, + _FpCodeSubtract, + _FpCodeMultiply, + _FpCodeDivide, + _FpCodeSquareRoot, + _FpCodeRemainder, + _FpCodeCompare, + _FpCodeConvert, + _FpCodeRound, + _FpCodeTruncate, + _FpCodeFloor, + _FpCodeCeil, + _FpCodeAcos, + _FpCodeAsin, + _FpCodeAtan, + _FpCodeAtan2, + _FpCodeCabs, + _FpCodeCos, + _FpCodeCosh, + _FpCodeExp, + _FpCodeFabs, + _FpCodeFmod, + _FpCodeFrexp, + _FpCodeHypot, + _FpCodeLdexp, + _FpCodeLog, + _FpCodeLog10, + _FpCodeModf, + _FpCodePow, + _FpCodeSin, + _FpCodeSinh, + _FpCodeTan, + _FpCodeTanh, + _FpCodeY0, + _FpCodeY1, + _FpCodeYn, + _FpCodeLogb, + _FpCodeNextafter, + _FpCodeNegate + +} _FP_OPERATION_CODE; + +#endif /* #ifndef __assembler */ + +/* + * Define rounding modes. + */ + +#ifndef __assembler /* MIPS ONLY: Protect from assembler */ + +typedef enum { + _FpRoundNearest, + _FpRoundMinusInfinity, + _FpRoundPlusInfinity, + _FpRoundChopped +} _FPIEEE_ROUNDING_MODE; + +typedef enum { + _FpPrecisionFull, + _FpPrecision53, + _FpPrecision24 +} _FPIEEE_PRECISION; + + +/* + * Define floating point context record + */ + +typedef float _FP32; +typedef double _FP64; +typedef short _I16; +typedef int _I32; +typedef unsigned short _U16; +typedef unsigned int _U32; + + +typedef struct { + unsigned short W[5]; +} _FP80; + +typedef struct { + unsigned long W[4]; +} _FP128; + +typedef struct { + unsigned long W[2]; +} _I64; + +typedef struct { + unsigned long W[2]; +} _U64; + +typedef struct { + unsigned short W[5]; +} _BCD80; + + +typedef struct { + union { + _FP32 Fp32Value; + _FP64 Fp64Value; + _FP80 Fp80Value; + _FP128 Fp128Value; + _I16 I16Value; + _I32 I32Value; + _I64 I64Value; + _U16 U16Value; + _U32 U32Value; + _U64 U64Value; + _BCD80 Bcd80Value; + char *StringValue; + int CompareValue; + } Value; + + unsigned int OperandValid : 1; + unsigned int Format : 4; + +} _FPIEEE_VALUE; + + +typedef struct { + unsigned int Inexact : 1; + unsigned int Underflow : 1; + unsigned int Overflow : 1; + unsigned int ZeroDivide : 1; + unsigned int InvalidOperation : 1; +} _FPIEEE_EXCEPTION_FLAGS; + + +typedef struct { + unsigned int RoundingMode : 2; + unsigned int Precision : 3; + unsigned int Operation :12; + _FPIEEE_EXCEPTION_FLAGS Cause; + _FPIEEE_EXCEPTION_FLAGS Enable; + _FPIEEE_EXCEPTION_FLAGS Status; + _FPIEEE_VALUE Operand1; + _FPIEEE_VALUE Operand2; + _FPIEEE_VALUE Result; +} _FPIEEE_RECORD; + + +struct _EXCEPTION_POINTERS; + +/* + * Floating point IEEE exception filter routine + */ + +_CRTIMP int __cdecl _fpieee_flt( + unsigned long, + struct _EXCEPTION_POINTERS *, + int (__cdecl *)(_FPIEEE_RECORD *) + ); + +#ifdef __cplusplus +} +#endif + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ +#endif /* #ifndef __assembler */ + +#endif /* _INC_FPIEEE */ diff --git a/public/sdk/inc/crt/fstream.h b/public/sdk/inc/crt/fstream.h new file mode 100644 index 000000000..2abba6c36 --- /dev/null +++ b/public/sdk/inc/crt/fstream.h @@ -0,0 +1,173 @@ +/*** +*fstream.h - definitions/declarations for filebuf and fstream classes +* +* Copyright (c) 1991-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the classes, values, macros, and functions +* used by the filebuf and fstream classes. +* [AT&T C++] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifdef __cplusplus + +#ifndef _INC_FSTREAM +#define _INC_FSTREAM + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +// Currently, all MS C compilers for Win32 platforms default to 8 byte +// alignment. +#pragma pack(push,8) +#endif // _MSC_VER + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +#include <iostream.h> + +#ifdef _MSC_VER +// C4514: "unreferenced inline function has been removed" +#pragma warning(disable:4514) // disable C4514 warning +// #pragma warning(default:4514) // use this to reenable, if desired +#endif // _MSC_VER + +typedef int filedesc; + +class _CRTIMP filebuf : public streambuf { +public: +static const int openprot; // default share/prot mode for open + +// optional share values for 3rd argument (prot) of open or constructor +static const int sh_none; // exclusive mode no sharing +static const int sh_read; // allow read sharing +static const int sh_write; // allow write sharing +// use (sh_read | sh_write) to allow both read and write sharing + +// options for setmode member function +static const int binary; +static const int text; + + filebuf(); + filebuf(filedesc); + filebuf(filedesc, char *, int); + ~filebuf(); + + filebuf* attach(filedesc); + filedesc fd() const { return (x_fd==-1) ? EOF : x_fd; } + int is_open() const { return (x_fd!=-1); } + filebuf* open(const char *, int, int = filebuf::openprot); + filebuf* close(); + int setmode(int = filebuf::text); + +virtual int overflow(int=EOF); +virtual int underflow(); + +virtual streambuf* setbuf(char *, int); +virtual streampos seekoff(streamoff, ios::seek_dir, int); +// virtual streampos seekpos(streampos, int); +virtual int sync(); + +private: + filedesc x_fd; + int x_fOpened; +}; + +class _CRTIMP ifstream : public istream { +public: + ifstream(); + ifstream(const char *, int =ios::in, int = filebuf::openprot); + ifstream(filedesc); + ifstream(filedesc, char *, int); + ~ifstream(); + + streambuf * setbuf(char *, int); + filebuf* rdbuf() const { return (filebuf*) ios::rdbuf(); } + + void attach(filedesc); + filedesc fd() const { return rdbuf()->fd(); } + + int is_open() const { return rdbuf()->is_open(); } + void open(const char *, int =ios::in, int = filebuf::openprot); + void close(); + int setmode(int mode = filebuf::text) { return rdbuf()->setmode(mode); } +}; + +class _CRTIMP ofstream : public ostream { +public: + ofstream(); + ofstream(const char *, int =ios::out, int = filebuf::openprot); + ofstream(filedesc); + ofstream(filedesc, char *, int); + ~ofstream(); + + streambuf * setbuf(char *, int); + filebuf* rdbuf() const { return (filebuf*) ios::rdbuf(); } + + void attach(filedesc); + filedesc fd() const { return rdbuf()->fd(); } + + int is_open() const { return rdbuf()->is_open(); } + void open(const char *, int =ios::out, int = filebuf::openprot); + void close(); + int setmode(int mode = filebuf::text) { return rdbuf()->setmode(mode); } +}; + +class _CRTIMP fstream : public iostream { +public: + fstream(); + fstream(const char *, int, int = filebuf::openprot); + fstream(filedesc); + fstream(filedesc, char *, int); + ~fstream(); + + streambuf * setbuf(char *, int); + filebuf* rdbuf() const { return (filebuf*) ostream::rdbuf(); } + + void attach(filedesc); + filedesc fd() const { return rdbuf()->fd(); } + + int is_open() const { return rdbuf()->is_open(); } + void open(const char *, int, int = filebuf::openprot); + void close(); + int setmode(int mode = filebuf::text) { return rdbuf()->setmode(mode); } +}; + +// manipulators to dynamically change file access mode (filebufs only) +inline ios& binary(ios& _fstrm) \ + { ((filebuf*)_fstrm.rdbuf())->setmode(filebuf::binary); return _fstrm; } +inline ios& text(ios& _fstrm) \ + { ((filebuf*)_fstrm.rdbuf())->setmode(filebuf::text); return _fstrm; } + +#ifdef _MSC_VER +#pragma pack(pop) +#endif // _MSC_VER + +#endif // _INC_FSTREAM + +#endif /* __cplusplus */ diff --git a/public/sdk/inc/crt/io.h b/public/sdk/inc/crt/io.h new file mode 100644 index 000000000..3104359f2 --- /dev/null +++ b/public/sdk/inc/crt/io.h @@ -0,0 +1,306 @@ +/*** +*io.h - declarations for low-level file handling and I/O functions +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file contains the function declarations for the low-level +* file handling and I/O functions. +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_IO +#define _INC_IO + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +/* + * Currently, all MS C compilers for Win32 platforms default to 8 byte + * alignment. + */ +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifndef _POSIX_ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + +#ifndef _MAC +#ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif +#endif /* ndef _MAC */ + +#ifndef _TIME_T_DEFINED +typedef long time_t; /* time value */ +#define _TIME_T_DEFINED /* avoid multiple def's of time_t */ +#endif + +#ifndef _FSIZE_T_DEFINED +typedef unsigned long _fsize_t; /* Could be 64 bits for Win32 */ +#define _FSIZE_T_DEFINED +#endif + +#ifndef _MAC + +#ifndef _FINDDATA_T_DEFINED + +struct _finddata_t { + unsigned attrib; + time_t time_create; /* -1 for FAT file systems */ + time_t time_access; /* -1 for FAT file systems */ + time_t time_write; + _fsize_t size; + char name[260]; +}; + +#if _INTEGRAL_MAX_BITS >= 64 +struct _finddatai64_t { + unsigned attrib; + time_t time_create; /* -1 for FAT file systems */ + time_t time_access; /* -1 for FAT file systems */ + time_t time_write; + __int64 size; + char name[260]; +}; +#endif + +#define _FINDDATA_T_DEFINED +#endif + +#ifndef _WFINDDATA_T_DEFINED + +struct _wfinddata_t { + unsigned attrib; + time_t time_create; /* -1 for FAT file systems */ + time_t time_access; /* -1 for FAT file systems */ + time_t time_write; + _fsize_t size; + wchar_t name[260]; +}; + +#if _INTEGRAL_MAX_BITS >= 64 +struct _wfinddatai64_t { + unsigned attrib; + time_t time_create; /* -1 for FAT file systems */ + time_t time_access; /* -1 for FAT file systems */ + time_t time_write; + __int64 size; + wchar_t name[260]; +}; +#endif + +#define _WFINDDATA_T_DEFINED +#endif + +/* File attribute constants for _findfirst() */ + +#define _A_NORMAL 0x00 /* Normal file - No read/write restrictions */ +#define _A_RDONLY 0x01 /* Read only file */ +#define _A_HIDDEN 0x02 /* Hidden file */ +#define _A_SYSTEM 0x04 /* System file */ +#define _A_SUBDIR 0x10 /* Subdirectory */ +#define _A_ARCH 0x20 /* Archive file */ + +#endif /* ndef _MAC */ + +/* function prototypes */ + +_CRTIMP int __cdecl _access(const char *, int); +_CRTIMP int __cdecl _chmod(const char *, int); +_CRTIMP int __cdecl _chsize(int, long); +_CRTIMP int __cdecl _close(int); +_CRTIMP int __cdecl _commit(int); +_CRTIMP int __cdecl _creat(const char *, int); +_CRTIMP int __cdecl _dup(int); +_CRTIMP int __cdecl _dup2(int, int); +_CRTIMP int __cdecl _eof(int); +_CRTIMP long __cdecl _filelength(int); +#ifndef _MAC +_CRTIMP long __cdecl _findfirst(const char *, struct _finddata_t *); +_CRTIMP int __cdecl _findnext(long, struct _finddata_t *); +_CRTIMP int __cdecl _findclose(long); +#endif /* ndef _MAC */ +_CRTIMP int __cdecl _isatty(int); +_CRTIMP int __cdecl _locking(int, int, long); +_CRTIMP long __cdecl _lseek(int, long, int); +_CRTIMP char * __cdecl _mktemp(char *); +_CRTIMP int __cdecl _open(const char *, int, ...); +#ifndef _MAC +_CRTIMP int __cdecl _pipe(int *, unsigned int, int); +#endif /* ndef _MAC */ +_CRTIMP int __cdecl _read(int, void *, unsigned int); +_CRTIMP int __cdecl remove(const char *); +_CRTIMP int __cdecl rename(const char *, const char *); +_CRTIMP int __cdecl _setmode(int, int); +_CRTIMP int __cdecl _sopen(const char *, int, int, ...); +_CRTIMP long __cdecl _tell(int); +_CRTIMP int __cdecl _umask(int); +_CRTIMP int __cdecl _unlink(const char *); +_CRTIMP int __cdecl _write(int, const void *, unsigned int); + +#if _INTEGRAL_MAX_BITS >= 64 +_CRTIMP __int64 __cdecl _filelengthi64(int); +_CRTIMP long __cdecl _findfirsti64(const char *, struct _finddatai64_t *); +_CRTIMP int __cdecl _findnexti64(long, struct _finddatai64_t *); +_CRTIMP __int64 __cdecl _lseeki64(int, __int64, int); +_CRTIMP __int64 __cdecl _telli64(int); +#endif + +#ifndef _MAC +#ifndef _WIO_DEFINED + +/* wide function prototypes, also declared in wchar.h */ + +_CRTIMP int __cdecl _waccess(const wchar_t *, int); +_CRTIMP int __cdecl _wchmod(const wchar_t *, int); +_CRTIMP int __cdecl _wcreat(const wchar_t *, int); +_CRTIMP long __cdecl _wfindfirst(const wchar_t *, struct _wfinddata_t *); +_CRTIMP int __cdecl _wfindnext(long, struct _wfinddata_t *); +_CRTIMP int __cdecl _wunlink(const wchar_t *); +_CRTIMP int __cdecl _wrename(const wchar_t *, const wchar_t *); +_CRTIMP int __cdecl _wopen(const wchar_t *, int, ...); +_CRTIMP int __cdecl _wsopen(const wchar_t *, int, int, ...); +_CRTIMP wchar_t * __cdecl _wmktemp(wchar_t *); + +#if _INTEGRAL_MAX_BITS >= 64 +_CRTIMP long __cdecl _wfindfirsti64(const wchar_t *, struct _wfinddatai64_t *); +_CRTIMP int __cdecl _wfindnexti64(long, struct _wfinddatai64_t *); +#endif + +#define _WIO_DEFINED +#endif +#endif /* ndef _MAC */ + + +_CRTIMP long __cdecl _get_osfhandle(int); +_CRTIMP int __cdecl _open_osfhandle(long, int); + +#if !__STDC__ + +/* Non-ANSI names for compatibility */ + +#ifdef _NTSDK + +#ifndef __cplusplus +#define access _access +#define chmod _chmod +#define chsize _chsize +#define close _close +#define creat _creat +#define dup _dup +#define dup2 _dup2 +#define eof _eof +#define filelength _filelength +#define isatty _isatty +#define locking _locking +#define lseek _lseek +#define mktemp _mktemp +#define open _open +#define read _read +#define setmode _setmode +#define sopen _sopen +#define tell _tell +#define umask _umask +#define unlink _unlink +#define write _write +#endif /* __cplusplus */ + +#else /* ndef _NTSDK */ + +_CRTIMP int __cdecl access(const char *, int); +_CRTIMP int __cdecl chmod(const char *, int); +_CRTIMP int __cdecl chsize(int, long); +_CRTIMP int __cdecl close(int); +_CRTIMP int __cdecl creat(const char *, int); +_CRTIMP int __cdecl dup(int); +_CRTIMP int __cdecl dup2(int, int); +_CRTIMP int __cdecl eof(int); +_CRTIMP long __cdecl filelength(int); +_CRTIMP int __cdecl isatty(int); +_CRTIMP int __cdecl locking(int, int, long); +_CRTIMP long __cdecl lseek(int, long, int); +_CRTIMP char * __cdecl mktemp(char *); +_CRTIMP int __cdecl open(const char *, int, ...); +_CRTIMP int __cdecl read(int, void *, unsigned int); +_CRTIMP int __cdecl setmode(int, int); +_CRTIMP int __cdecl sopen(const char *, int, int, ...); +_CRTIMP long __cdecl tell(int); +_CRTIMP int __cdecl umask(int); +_CRTIMP int __cdecl unlink(const char *); +_CRTIMP int __cdecl write(int, const void *, unsigned int); + +#endif /* _NTSDK */ + +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* _POSIX_ */ + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_IO */ diff --git a/public/sdk/inc/crt/iomanip.h b/public/sdk/inc/crt/iomanip.h new file mode 100644 index 000000000..030d8f1b3 --- /dev/null +++ b/public/sdk/inc/crt/iomanip.h @@ -0,0 +1,150 @@ +/*** +*iomanip.h - definitions/declarations for iostream's parameterized manipulators +* +* Copyright (c) 1991-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the classes, values, macros, and functions +* used by the iostream classes' paramterized manipulators. +* [AT&T C++] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifdef __cplusplus + +#ifndef _INC_IOMANIP +#define _INC_IOMANIP + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +// Currently, all MS C compilers for Win32 platforms default to 8 byte +// alignment. +#pragma pack(push,8) +#endif // _MSC_VER + +#include <iostream.h> + +#ifdef _MSC_VER +#pragma warning(disable:4514) // disable unwanted /W4 warning +// #pragma warning(default:4514) // use this to reenable, if necessary +#endif // _MSC_VER + +// #define __MKMANIP(X) \#define X##(T) __##X##_ \#\# T +// __MKMANIP(SMANIP); +// __MKMANIP(SAPP); +// __MKMANIP(IMANIP); +// __MKMANIP(IAPP); +// __MKMANIP(OMANIP); +// __MKMANIP(OAPP); +// __MKMANIP(IOMANIP); +// __MKMANIP(IOAPP); + +#define SMANIP(T) __SMANIP_##T +#define SAPP(T) __SAPP_##T +#define IMANIP(T) __IMANIP_##T +#define IAPP(T) __IAPP_##T +#define OMANIP(T) __OMANIP_##T +#define OAPP(T) __OAPP_##T +#define IOMANIP(T) __IOMANIP_##T +#define IOAPP(T) __IOAPP_##T + +#define IOMANIPdeclare(T) \ +class SMANIP(T) { \ +public: \ + SMANIP(T)(ios& (*f)(ios&,T), T t) { _fp = f; _tp = t; } \ + friend istream& operator>>(istream& s, const SMANIP(T) & sm) { (*(sm._fp))(s,sm._tp); return s; } \ + friend ostream& operator<<(ostream& s, const SMANIP(T) & sm) { (*(sm._fp))(s,sm._tp); return s; } \ +private: \ + ios& (* _fp)(ios&,T); \ + T _tp; \ +}; \ +class SAPP(T) { \ +public: \ + SAPP(T)( ios& (*f)(ios&,T)) { _fp = f; } \ + SMANIP(T) operator()(T t) { return SMANIP(T)(_fp,t); } \ +private: \ + ios& (* _fp)(ios&,T); \ +}; \ +class IMANIP(T) { \ +public: \ + IMANIP(T)(istream& (*f)(istream&,T), T t) { _fp = f; _tp = t; } \ + friend istream& operator>>(istream& s, IMANIP(T) & sm) { (*sm._fp)(s,sm._tp); return s; } \ +private: \ + istream& (* _fp)(istream&,T); \ + T _tp; \ +}; \ +class IAPP(T) { \ +public: \ + IAPP(T)( istream& (*f)(istream&,T)) { _fp = f; } \ + IMANIP(T) operator()(T t) { return IMANIP(T)(_fp,t); } \ +private: \ + istream& (* _fp)(istream&,T); \ +}; \ +class OMANIP(T) { \ +public: \ + OMANIP(T)(ostream& (*f)(ostream&,T), T t) { _fp = f; _tp = t; } \ + friend ostream& operator<<(ostream& s, OMANIP(T) & sm) { (*sm._fp)(s,sm._tp); return s; } \ +private: \ + ostream& (* _fp)(ostream&,T); \ + T _tp; \ +}; \ +class OAPP(T) { \ +public: \ + OAPP(T)(ostream& (*f)(ostream&,T)) { _fp = f; } \ + OMANIP(T) operator()(T t) { return OMANIP(T)(_fp,t); } \ +private: \ + ostream& (* _fp)(ostream&,T); \ +}; \ +\ +class IOMANIP(T) { \ +public: \ + IOMANIP(T)(iostream& (*f)(iostream&,T), T t) { _fp = f; _tp = t; } \ + friend istream& operator>>(iostream& s, IOMANIP(T) & sm) { (*sm._fp)(s,sm._tp); return s; } \ + friend ostream& operator<<(iostream& s, IOMANIP(T) & sm) { (*sm._fp)(s,sm._tp); return s; } \ +private: \ + iostream& (* _fp)(iostream&,T); \ + T _tp; \ +}; \ +class IOAPP(T) { \ +public: \ + IOAPP(T)( iostream& (*f)(iostream&,T)) { _fp = f; } \ + IOMANIP(T) operator()(T t) { return IOMANIP(T)(_fp,t); } \ +private: \ + iostream& (* _fp)(iostream&,T); \ +}; \ + + +IOMANIPdeclare(int) + +IOMANIPdeclare(long) + +inline ios& __resetiosflags(ios& s, long _flg) { s.setf(0,_flg); return s; } +inline ios& __setfill(ios& s, int _fc) { s.fill((char)_fc); return s; } +inline ios& __setiosflags(ios& s, long _flg) { s.setf(_flg); return s; } +inline ios& __setprecision(ios& s, int _pre) { s.precision(_pre); return s; } +inline ios& __setw(ios& s, int _wid) { s.width(_wid); return s; } + +inline SMANIP(long) resetiosflags(long _l) { return SMANIP(long)(__resetiosflags, _l); } +inline SMANIP(int) setfill(int _m) {return SMANIP(int)(__setfill, _m); } +inline SMANIP(long) setiosflags(long _l) {return SMANIP(long)(__setiosflags, _l); } +inline SMANIP(int) setprecision(int _p) {return SMANIP(int)(__setprecision, _p); } +inline SMANIP(int) setw(int _w) { return SMANIP(int)(__setw, _w); } + +// Restore previous packing +#ifdef _MSC_VER +#pragma pack(pop) +#endif // _MSC_VER + +#endif // _INC_IOMANIP + +#endif /* __cplusplus */ diff --git a/public/sdk/inc/crt/ios.h b/public/sdk/inc/crt/ios.h new file mode 100644 index 000000000..d9113955b --- /dev/null +++ b/public/sdk/inc/crt/ios.h @@ -0,0 +1,311 @@ +/*** +*ios.h - definitions/declarations for the ios class. +* +* Copyright (c) 1990-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the classes, values, macros, and functions +* used by the ios class. +* [AT&T C++] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifdef __cplusplus + +#ifndef _INC_IOS +#define _INC_IOS + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +// Currently, all MS C compilers for Win32 platforms default to 8 byte +// alignment. +#pragma pack(push,8) +#endif // _MSC_VER + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + +#ifdef _MT + +typedef struct __CRT_LIST_ENTRY { + struct __CRT_LIST_ENTRY *Flink; + struct __CRT_LIST_ENTRY *Blink; +} _CRT_LIST_ENTRY; + +typedef struct _CRT_CRITICAL_SECTION_DEBUG { + unsigned short Type; + unsigned short CreatorBackTraceIndex; + struct _CRT_CRITICAL_SECTION *CriticalSection; + _CRT_LIST_ENTRY ProcessLocksList; + unsigned long EntryCount; + unsigned long ContentionCount; + unsigned long Depth; + void * OwnerBackTrace[ 5 ]; +} _CRT_CRITICAL_SECTION_DEBUG, *_PCRT_CRITICAL_SECTION_DEBUG; + +typedef struct _CRT_CRITICAL_SECTION { + _PCRT_CRITICAL_SECTION_DEBUG DebugInfo; + + // + // The following three fields control entering and exiting the critical + // section for the resource + // + + long LockCount; + long RecursionCount; + void * OwningThread; // from the thread's ClientId->UniqueThread + void * LockSemaphore; + unsigned long Reserved; +} _CRT_CRITICAL_SECTION, *_PCRT_CRITICAL_SECTION; + +extern "C" { +_CRTIMP void __cdecl _mtlock(_PCRT_CRITICAL_SECTION); +_CRTIMP void __cdecl _mtunlock(_PCRT_CRITICAL_SECTION); +} + +#endif /* _MT */ + +#ifndef NULL +#define NULL 0 +#endif + +#ifndef EOF +#define EOF (-1) +#endif + +#ifdef _MSC_VER +// C4514: "unreferenced inline function has been removed" +#pragma warning(disable:4514) // disable C4514 warning +// #pragma warning(default:4514) // use this to reenable, if desired +#endif // _MSC_VER + +class _CRTIMP streambuf; +class _CRTIMP ostream; + +class _CRTIMP ios { + +public: + enum io_state { goodbit = 0x00, + eofbit = 0x01, + failbit = 0x02, + badbit = 0x04 }; + + enum open_mode { in = 0x01, + out = 0x02, + ate = 0x04, + app = 0x08, + trunc = 0x10, + nocreate = 0x20, + noreplace = 0x40, + binary = 0x80 }; + + enum seek_dir { beg=0, cur=1, end=2 }; + + enum { skipws = 0x0001, + left = 0x0002, + right = 0x0004, + internal = 0x0008, + dec = 0x0010, + oct = 0x0020, + hex = 0x0040, + showbase = 0x0080, + showpoint = 0x0100, + uppercase = 0x0200, + showpos = 0x0400, + scientific = 0x0800, + fixed = 0x1000, + unitbuf = 0x2000, + stdio = 0x4000 + }; + + static const long basefield; // dec | oct | hex + static const long adjustfield; // left | right | internal + static const long floatfield; // scientific | fixed + + ios(streambuf*); // differs from ANSI + virtual ~ios(); + + inline long flags() const; + inline long flags(long _l); + + inline long setf(long _f,long _m); + inline long setf(long _l); + inline long unsetf(long _l); + + inline int width() const; + inline int width(int _i); + + inline ostream* tie(ostream* _os); + inline ostream* tie() const; + + inline char fill() const; + inline char fill(char _c); + + inline int precision(int _i); + inline int precision() const; + + inline int rdstate() const; + inline void clear(int _i = 0); + +// inline operator void*() const; + operator void *() const { if(state&(badbit|failbit) ) return 0; return (void *)this; } + inline int operator!() const; + + inline int good() const; + inline int eof() const; + inline int fail() const; + inline int bad() const; + + inline streambuf* rdbuf() const; + + inline long & iword(int) const; + inline void * & pword(int) const; + + static long bitalloc(); + static int xalloc(); + static void sync_with_stdio(); + +#ifdef _MT + inline void __cdecl setlock(); + inline void __cdecl clrlock(); + void __cdecl lock() { if (LockFlg<0) _mtlock(lockptr()); }; + void __cdecl unlock() { if (LockFlg<0) _mtunlock(lockptr()); } + inline void __cdecl lockbuf(); + inline void __cdecl unlockbuf(); +#else + void __cdecl lock() { } + void __cdecl unlock() { } + void __cdecl lockbuf() { } + void __cdecl unlockbuf() { } +#endif + +protected: + ios(); + ios(const ios&); // treat as private + ios& operator=(const ios&); + void init(streambuf*); + + enum { skipping, tied }; + streambuf* bp; + + int state; + int ispecial; // not used + int ospecial; // not used + int isfx_special; // not used + int osfx_special; // not used + int x_delbuf; // if set, rdbuf() deleted by ~ios + + ostream* x_tie; + long x_flags; + int x_precision; + char x_fill; + int x_width; + + static void (*stdioflush)(); // not used + +#ifdef _MT + static void lockc() { _mtlock(& x_lockc); } + static void unlockc() { _mtunlock( & x_lockc); } + _PCRT_CRITICAL_SECTION lockptr() { return & x_lock; } +#else + static void lockc() { } + static void unlockc() { } +#endif + +public: + int delbuf() const { return x_delbuf; } + void delbuf(int _i) { x_delbuf = _i; } + +private: + static long x_maxbit; + static int x_curindex; + static int sunk_with_stdio; // make sure sync_with done only once +#ifdef _MT +#define MAXINDEX 7 + static long x_statebuf[MAXINDEX+1]; // used by xalloc() + static int fLockcInit; // used to see if x_lockc initialized + static _CRT_CRITICAL_SECTION x_lockc; // used to lock static (class) data members + int LockFlg; // enable locking flag + _CRT_CRITICAL_SECTION x_lock; // used for multi-thread lock on object +#else + static long * x_statebuf; // used by xalloc() +#endif +}; + +#include <streamb.h> + +inline _CRTIMP ios& __cdecl dec(ios& _strm) { _strm.setf(ios::dec,ios::basefield); return _strm; } +inline _CRTIMP ios& __cdecl hex(ios& _strm) { _strm.setf(ios::hex,ios::basefield); return _strm; } +inline _CRTIMP ios& __cdecl oct(ios& _strm) { _strm.setf(ios::oct,ios::basefield); return _strm; } + +inline long ios::flags() const { return x_flags; } +inline long ios::flags(long _l){ long _lO; _lO = x_flags; x_flags = _l; return _lO; } + +inline long ios::setf(long _l,long _m){ long _lO; lock(); _lO = x_flags; x_flags = (_l&_m) | (x_flags&(~_m)); unlock(); return _lO; } +inline long ios::setf(long _l){ long _lO; lock(); _lO = x_flags; x_flags |= _l; unlock(); return _lO; } +inline long ios::unsetf(long _l){ long _lO; lock(); _lO = x_flags; x_flags &= (~_l); unlock(); return _lO; } + +inline int ios::width() const { return x_width; } +inline int ios::width(int _i){ int _iO; _iO = (int)x_width; x_width = _i; return _iO; } + +inline ostream* ios::tie(ostream* _os){ ostream* _osO; _osO = x_tie; x_tie = _os; return _osO; } +inline ostream* ios::tie() const { return x_tie; } +inline char ios::fill() const { return x_fill; } +inline char ios::fill(char _c){ char _cO; _cO = x_fill; x_fill = _c; return _cO; } +inline int ios::precision(int _i){ int _iO; _iO = (int)x_precision; x_precision = _i; return _iO; } +inline int ios::precision() const { return x_precision; } + +inline int ios::rdstate() const { return state; } + +// inline ios::operator void *() const { if(state&(badbit|failbit) ) return 0; return (void *)this; } +inline int ios::operator!() const { return state&(badbit|failbit); } + +inline int ios::bad() const { return state & badbit; } +inline void ios::clear(int _i){ lock(); state = _i; unlock(); } +inline int ios::eof() const { return state & eofbit; } +inline int ios::fail() const { return state & (badbit | failbit); } +inline int ios::good() const { return state == 0; } + +inline streambuf* ios::rdbuf() const { return bp; } + +inline long & ios::iword(int _i) const { return x_statebuf[_i] ; } +inline void * & ios::pword(int _i) const { return (void * &)x_statebuf[_i]; } + +#ifdef _MT + inline void ios::setlock() { LockFlg--; if (bp) bp->setlock(); } + inline void ios::clrlock() { if (LockFlg <= 0) LockFlg++; if (bp) bp->clrlock(); } + inline void ios::lockbuf() { bp->lock(); } + inline void ios::unlockbuf() { bp->unlock(); } +#endif + +#ifdef _MSC_VER +// Restore default packing +#pragma pack(pop) +#endif // _MSC_VER + +#endif // _INC_IOS + +#endif /* __cplusplus */ diff --git a/public/sdk/inc/crt/iostream.h b/public/sdk/inc/crt/iostream.h new file mode 100644 index 000000000..fa4a0aec6 --- /dev/null +++ b/public/sdk/inc/crt/iostream.h @@ -0,0 +1,104 @@ +/*** +*iostream.h - definitions/declarations for iostream classes +* +* Copyright (c) 1990-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the classes, values, macros, and functions +* used by the iostream classes. +* [AT&T C++] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifdef __cplusplus + +#ifndef _INC_IOSTREAM +#define _INC_IOSTREAM + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +// Currently, all MS C compilers for Win32 platforms default to 8 byte +// alignment. +#pragma pack(push,8) +#endif // _MSC_VER + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + +typedef long streamoff, streampos; + +#include <ios.h> // Define ios. + +#include <streamb.h> // Define streambuf. + +#include <istream.h> // Define istream. + +#include <ostream.h> // Define ostream. + +#ifdef _MSC_VER +// C4514: "unreferenced inline function has been removed" +#pragma warning(disable:4514) // disable C4514 warning +// #pragma warning(default:4514) // use this to reenable, if desired +#endif // _MSC_VER + +class _CRTIMP iostream : public istream, public ostream { +public: + iostream(streambuf*); + virtual ~iostream(); +protected: + iostream(); + iostream(const iostream&); +inline iostream& operator=(streambuf*); +inline iostream& operator=(iostream&); +private: + iostream(ios&); + iostream(istream&); + iostream(ostream&); +}; + +inline iostream& iostream::operator=(streambuf* _sb) { istream::operator=(_sb); ostream::operator=(_sb); return *this; } + +inline iostream& iostream::operator=(iostream& _strm) { return operator=(_strm.rdbuf()); } + +class _CRTIMP Iostream_init { +public: + Iostream_init(); + Iostream_init(ios &, int =0); // treat as private + ~Iostream_init(); +}; + +// used internally +// static Iostream_init __iostreaminit; // initializes cin/cout/cerr/clog + +#ifdef _MSC_VER +// Restore previous packing +#pragma pack(pop) +#endif // _MSC_VER + +#endif // _INC_IOSTREAM + +#endif /* __cplusplus */ diff --git a/public/sdk/inc/crt/istream.h b/public/sdk/inc/crt/istream.h new file mode 100644 index 000000000..52f64e384 --- /dev/null +++ b/public/sdk/inc/crt/istream.h @@ -0,0 +1,191 @@ +/*** +*istream.h - definitions/declarations for the istream class +* +* Copyright (c) 1990-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the classes, values, macros, and functions +* used by the istream class. +* [AT&T C++] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifdef __cplusplus + +#ifndef _INC_ISTREAM +#define _INC_ISTREAM + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +// Currently, all MS C compilers for Win32 platforms default to 8 byte +// alignment. +#pragma pack(push,8) +#endif // _MSC_VER + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +#include <ios.h> + +#ifdef _MSC_VER +// C4069: "long double != double" +#pragma warning(disable:4069) // disable C4069 warning +// #pragma warning(default:4069) // use this to reenable, if desired + +// C4514: "unreferenced inline function has been removed" +#pragma warning(disable:4514) // disable C4514 warning +// #pragma warning(default:4514) // use this to reenable, if desired +#endif // _MSC_VER + + +typedef long streamoff, streampos; + +class _CRTIMP istream : virtual public ios { + +public: + istream(streambuf*); + virtual ~istream(); + + int ipfx(int =0); + void isfx() { unlockbuf(); unlock(); } + + inline istream& operator>>(istream& (__cdecl * _f)(istream&)); + inline istream& operator>>(ios& (__cdecl * _f)(ios&)); + istream& operator>>(char *); + inline istream& operator>>(unsigned char *); + inline istream& operator>>(signed char *); + istream& operator>>(char &); + inline istream& operator>>(unsigned char &); + inline istream& operator>>(signed char &); + istream& operator>>(short &); + istream& operator>>(unsigned short &); + istream& operator>>(int &); + istream& operator>>(unsigned int &); + istream& operator>>(long &); + istream& operator>>(unsigned long &); + istream& operator>>(float &); + istream& operator>>(double &); + istream& operator>>(long double &); + istream& operator>>(streambuf*); + + int get(); + + inline istream& get( char *,int,char ='\n'); + inline istream& get(unsigned char *,int,char ='\n'); + inline istream& get( signed char *,int,char ='\n'); + + istream& get(char &); + inline istream& get(unsigned char &); + inline istream& get( signed char &); + + istream& get(streambuf&,char ='\n'); + inline istream& getline( char *,int,char ='\n'); + inline istream& getline(unsigned char *,int,char ='\n'); + inline istream& getline( signed char *,int,char ='\n'); + + inline istream& ignore(int =1,int =EOF); + istream& read(char *,int); + inline istream& read(unsigned char *,int); + inline istream& read(signed char *,int); + + int gcount() const { return x_gcount; } + int peek(); + istream& putback(char); + int sync(); + + istream& seekg(streampos); + istream& seekg(streamoff,ios::seek_dir); + streampos tellg(); + + void eatwhite(); + +protected: + istream(); + istream(const istream&); // treat as private + istream& operator=(streambuf* _isb); // treat as private + istream& operator=(const istream& _is) { return operator=(_is.rdbuf()); } + istream& get(char *, int, int); + int do_ipfx(int); + +private: + istream(ios&); + int getint(char *); + int getdouble(char *, int); + int _fGline; + int x_gcount; +}; + + inline istream& istream::operator>>(istream& (__cdecl * _f)(istream&)) { (*_f)(*this); return *this; } + inline istream& istream::operator>>(ios& (__cdecl * _f)(ios&)) { (*_f)(*this); return *this; } + + inline istream& istream::operator>>(unsigned char * _s) { return operator>>((char *)_s); } + inline istream& istream::operator>>( signed char * _s) { return operator>>((char *)_s); } + + inline istream& istream::operator>>(unsigned char & _c) { return operator>>((char &) _c); } + inline istream& istream::operator>>( signed char & _c) { return operator>>((char &) _c); } + + inline istream& istream::get( char * _b, int _lim, char _delim) { return get( _b, _lim, (int)(unsigned char)_delim); } + inline istream& istream::get(unsigned char * _b, int _lim, char _delim) { return get((char *)_b, _lim, (int)(unsigned char)_delim); } + inline istream& istream::get(signed char * _b, int _lim, char _delim) { return get((char *)_b, _lim, (int)(unsigned char)_delim); } + + inline istream& istream::get(unsigned char & _c) { return get((char &)_c); } + inline istream& istream::get( signed char & _c) { return get((char &)_c); } + + inline istream& istream::getline( char * _b,int _lim,char _delim) { lock(); _fGline++; get( _b, _lim, (int)(unsigned char)_delim); unlock(); return *this; } + inline istream& istream::getline(unsigned char * _b,int _lim,char _delim) { lock(); _fGline++; get((char *)_b, _lim, (int)(unsigned char)_delim); unlock(); return *this; } + inline istream& istream::getline( signed char * _b,int _lim,char _delim) { lock(); _fGline++; get((char *)_b, _lim, (int)(unsigned char)_delim); unlock(); return *this; } + + inline istream& istream::ignore(int _n,int _delim) { lock(); _fGline++; get((char *)0, _n+1, _delim); unlock(); return *this; } + + inline istream& istream::read(unsigned char * _ptr, int _n) { return read((char *) _ptr, _n); } + inline istream& istream::read( signed char * _ptr, int _n) { return read((char *) _ptr, _n); } + +class _CRTIMP istream_withassign : public istream { + public: + istream_withassign(); + istream_withassign(streambuf*); + ~istream_withassign(); + istream& operator=(const istream& _is) { return istream::operator=(_is); } + istream& operator=(streambuf* _isb) { return istream::operator=(_isb); } +}; + +extern _CRTIMP istream_withassign cin; + +inline _CRTIMP istream& __cdecl ws(istream& _ins) { _ins.eatwhite(); return _ins; } + +_CRTIMP ios& __cdecl dec(ios&); +_CRTIMP ios& __cdecl hex(ios&); +_CRTIMP ios& __cdecl oct(ios&); + +#ifdef _MSC_VER +// Restore default packing +#pragma pack(pop) +#endif // _MSC_VER + +#endif // _INC_ISTREAM + +#endif /* __cplusplus */ diff --git a/public/sdk/inc/crt/limits.h b/public/sdk/inc/crt/limits.h new file mode 100644 index 000000000..ce86d17c5 --- /dev/null +++ b/public/sdk/inc/crt/limits.h @@ -0,0 +1,118 @@ +/*** +*limits.h - implementation dependent values +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* Contains defines for a number of implementation dependent values +* which are commonly used in C programs. +* [ANSI] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_LIMITS +#define _INC_LIMITS + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#define CHAR_BIT 8 /* number of bits in a char */ +#define SCHAR_MIN (-128) /* minimum signed char value */ +#define SCHAR_MAX 127 /* maximum signed char value */ +#define UCHAR_MAX 0xff /* maximum unsigned char value */ + +#ifndef _CHAR_UNSIGNED +#define CHAR_MIN SCHAR_MIN /* mimimum char value */ +#define CHAR_MAX SCHAR_MAX /* maximum char value */ +#else +#define CHAR_MIN 0 +#define CHAR_MAX UCHAR_MAX +#endif /* _CHAR_UNSIGNED */ + +#define MB_LEN_MAX 2 /* max. # bytes in multibyte char */ +#define SHRT_MIN (-32768) /* minimum (signed) short value */ +#define SHRT_MAX 32767 /* maximum (signed) short value */ +#define USHRT_MAX 0xffff /* maximum unsigned short value */ +#define INT_MIN (-2147483647 - 1) /* minimum (signed) int value */ +#define INT_MAX 2147483647 /* maximum (signed) int value */ +#define UINT_MAX 0xffffffff /* maximum unsigned int value */ +#define LONG_MIN (-2147483647L - 1) /* minimum (signed) long value */ +#define LONG_MAX 2147483647L /* maximum (signed) long value */ +#define ULONG_MAX 0xffffffffUL /* maximum unsigned long value */ + +#if _INTEGRAL_MAX_BITS >= 8 +#define _I8_MIN (-127i8 - 1) /* minimum signed 8 bit value */ +#define _I8_MAX 127i8 /* maximum signed 8 bit value */ +#define _UI8_MAX 0xffui8 /* maximum unsigned 8 bit value */ +#endif + +#if _INTEGRAL_MAX_BITS >= 16 +#define _I16_MIN (-32767i16 - 1) /* minimum signed 16 bit value */ +#define _I16_MAX 32767i16 /* maximum signed 16 bit value */ +#define _UI16_MAX 0xffffui16 /* maximum unsigned 16 bit value */ +#endif + +#if _INTEGRAL_MAX_BITS >= 32 +#define _I32_MIN (-2147483647i32 - 1) /* minimum signed 32 bit value */ +#define _I32_MAX 2147483647i32 /* maximum signed 32 bit value */ +#define _UI32_MAX 0xffffffffui32 /* maximum unsigned 32 bit value */ +#endif + +#if _INTEGRAL_MAX_BITS >= 64 +/* minimum signed 64 bit value */ +#define _I64_MIN (-9223372036854775807i64 - 1) +/* maximum signed 64 bit value */ +#define _I64_MAX 9223372036854775807i64 +/* maximum unsigned 64 bit value */ +#define _UI64_MAX 0xffffffffffffffffui64 +#endif + +#if _INTEGRAL_MAX_BITS >= 128 +/* minimum signed 128 bit value */ +#define _I128_MIN (-170141183460469231731687303715884105727i128 - 1) +/* maximum signed 128 bit value */ +#define _I128_MAX 170141183460469231731687303715884105727i128 +/* maximum unsigned 128 bit value */ +#define _UI128_MAX 0xffffffffffffffffffffffffffffffffui128 +#endif + +#ifdef _POSIX_ + +#define _POSIX_ARG_MAX 4096 +#define _POSIX_CHILD_MAX 6 +#define _POSIX_LINK_MAX 8 +#define _POSIX_MAX_CANON 255 +#define _POSIX_MAX_INPUT 255 +#define _POSIX_NAME_MAX 14 +#define _POSIX_NGROUPS_MAX 0 +#define _POSIX_OPEN_MAX 16 +#define _POSIX_PATH_MAX 255 +#define _POSIX_PIPE_BUF 512 +#define _POSIX_SSIZE_MAX 32767 +#define _POSIX_STREAM_MAX 8 +#define _POSIX_TZNAME_MAX 3 + +#define ARG_MAX 14500 /* 16k heap, minus overhead */ +#define LINK_MAX 1024 +#define MAX_CANON _POSIX_MAX_CANON +#define MAX_INPUT _POSIX_MAX_INPUT +#define NAME_MAX 255 +#define NGROUPS_MAX 16 +#define OPEN_MAX 32 +#define PATH_MAX 512 +#define PIPE_BUF _POSIX_PIPE_BUF +#define SSIZE_MAX _POSIX_SSIZE_MAX +#define STREAM_MAX 20 +#define TZNAME_MAX 10 + +#endif /* POSIX */ + +#endif /* _INC_LIMITS */ diff --git a/public/sdk/inc/crt/locale.h b/public/sdk/inc/crt/locale.h new file mode 100644 index 000000000..3a1620169 --- /dev/null +++ b/public/sdk/inc/crt/locale.h @@ -0,0 +1,174 @@ +/*** +*locale.h - definitions/declarations for localization routines +* +* Copyright (c) 1988-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the structures, values, macros, and functions +* used by the localization routines. +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_LOCALE +#define _INC_LOCALE + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +/* + * Currently, all MS C compilers for Win32 platforms default to 8 byte + * alignment. + */ +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +#ifndef _MAC +#ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif +#endif /* ndef _MAC */ + + +/* define NULL pointer value */ + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +/* Locale categories */ + +#define LC_ALL 0 +#define LC_COLLATE 1 +#define LC_CTYPE 2 +#define LC_MONETARY 3 +#define LC_NUMERIC 4 +#define LC_TIME 5 + +#define LC_MIN LC_ALL +#define LC_MAX LC_TIME + +/* Locale convention structure */ + +#ifndef _LCONV_DEFINED +struct lconv { + char *decimal_point; + char *thousands_sep; + char *grouping; + char *int_curr_symbol; + char *currency_symbol; + char *mon_decimal_point; + char *mon_thousands_sep; + char *mon_grouping; + char *positive_sign; + char *negative_sign; + char int_frac_digits; + char frac_digits; + char p_cs_precedes; + char p_sep_by_space; + char n_cs_precedes; + char n_sep_by_space; + char p_sign_posn; + char n_sign_posn; + }; +#define _LCONV_DEFINED +#endif + +/* ANSI: char lconv members default is CHAR_MAX which is compile time + dependent. Defining and using _charmax here causes CRT startup code + to initialize lconv members properly */ + +#ifdef _CHAR_UNSIGNED +extern int _charmax; +extern __inline int __dummy() { return _charmax; } +#endif + +/* function prototypes */ + +_CRTIMP char * __cdecl setlocale(int, const char *); +_CRTIMP struct lconv * __cdecl localeconv(void); + +#ifndef _MAC +#ifndef _WLOCALE_DEFINED + +/* wide function prototypes, also declared in wchar.h */ + +_CRTIMP wchar_t * __cdecl _wsetlocale(int, const wchar_t *); + +#define _WLOCALE_DEFINED +#endif +#endif /* ndef _MAC */ + +#ifdef __cplusplus +} +#endif + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_LOCALE */ diff --git a/public/sdk/inc/crt/malloc.h b/public/sdk/inc/crt/malloc.h new file mode 100644 index 000000000..dc1f4aa71 --- /dev/null +++ b/public/sdk/inc/crt/malloc.h @@ -0,0 +1,198 @@ +/*** +*malloc.h - declarations and definitions for memory allocation functions +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* Contains the function declarations for memory allocation functions; +* also defines manifest constants and types used by the heap routines. +* [System V] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_MALLOC +#define _INC_MALLOC + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +/* + * Currently, all MS C compilers for Win32 platforms default to 8 byte + * alignment. + */ +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#define _SIZE_T_DEFINED +#endif + + +/* Maximum heap request the heap manager will attempt */ + +#define _HEAP_MAXREQ 0xFFFFFFE0 + +/* Constants for _heapchk/_heapset/_heapwalk routines */ + +#define _HEAPEMPTY (-1) +#define _HEAPOK (-2) +#define _HEAPBADBEGIN (-3) +#define _HEAPBADNODE (-4) +#define _HEAPEND (-5) +#define _HEAPBADPTR (-6) +#define _FREEENTRY 0 +#define _USEDENTRY 1 + +#ifndef _HEAPINFO_DEFINED +typedef struct _heapinfo { + int * _pentry; + size_t _size; + int _useflag; + } _HEAPINFO; +#define _HEAPINFO_DEFINED +#endif + +#ifndef _NTSDK + +/* External variable declarations */ + +#if defined(_DLL) && defined(_M_IX86) + +#define _amblksiz (*__p__amblksiz()) +_CRTIMP unsigned int * __cdecl __p__amblksiz(void); + +#else /* !(defined(_DLL) && defined(_M_IX86)) */ + +extern unsigned int _amblksiz; + +#endif /* defined(_DLL) && defined(_M_IX86) */ + +#endif /* _NTSDK */ + + +/* Function prototypes */ + +_CRTIMP void * __cdecl calloc(size_t, size_t); +_CRTIMP void __cdecl free(void *); +_CRTIMP void * __cdecl malloc(size_t); +_CRTIMP void * __cdecl realloc(void *, size_t); +#if defined(_M_M68K) || defined(_M_MPPC) +_CRTIMP size_t __cdecl _stackavail(void); +#endif + +#ifndef _POSIX_ + +void * __cdecl _alloca(size_t); +_CRTIMP void * __cdecl _expand(void *, size_t); +#ifndef _NTSDK +_CRTIMP int __cdecl _heapadd(void *, size_t); +_CRTIMP int __cdecl _heapchk(void); +_CRTIMP int __cdecl _heapmin(void); +_CRTIMP int __cdecl _heapset(unsigned int); +_CRTIMP int __cdecl _heapwalk(_HEAPINFO *); +_CRTIMP size_t __cdecl _heapused(size_t *, size_t *); +#endif /* _NTSDK */ +_CRTIMP size_t __cdecl _msize(void *); + +#if !__STDC__ +/* Non-ANSI names for compatibility */ +#define alloca _alloca +#endif /* __STDC__*/ + +#if defined(_M_MRX000) || defined(_M_PPC) || defined(_M_ALPHA) +#pragma intrinsic(_alloca) +#endif + +#endif /* _POSIX_ */ + +#ifdef HEAPHOOK +#ifndef _HEAPHOOK_DEFINED +/* hook function type */ +typedef int (__cdecl * _HEAPHOOK)(int, size_t, void *, void **); +#define _HEAPHOOK_DEFINED +#endif /* _HEAPHOOK_DEFINED */ + +/* set hook function */ +_CRTIMP _HEAPHOOK __cdecl _setheaphook(_HEAPHOOK); + +/* hook function must handle these types */ +#define _HEAP_MALLOC 1 +#define _HEAP_CALLOC 2 +#define _HEAP_FREE 3 +#define _HEAP_REALLOC 4 +#define _HEAP_MSIZE 5 +#define _HEAP_EXPAND 6 +#endif /* HEAPHOOK */ + + +#ifdef __cplusplus +} +#endif + + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_MALLOC */ diff --git a/public/sdk/inc/crt/math.h b/public/sdk/inc/crt/math.h new file mode 100644 index 000000000..7f777e753 --- /dev/null +++ b/public/sdk/inc/crt/math.h @@ -0,0 +1,429 @@ +/*** +*math.h - definitions and declarations for math library +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file contains constant definitions and external subroutine +* declarations for the math subroutine library. +* [ANSI/System V] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_MATH +#define _INC_MATH + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +/* + * Currently, all MS C compilers for Win32 platforms default to 8 byte + * alignment. + */ +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __assembler /* Protect from assembler */ + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +/* Definition of _exception struct - this struct is passed to the matherr + * routine when a floating point exception is detected + */ + +#ifndef _EXCEPTION_DEFINED +struct _exception { + int type; /* exception type - see below */ + char *name; /* name of function where error occured */ + double arg1; /* first argument to function */ + double arg2; /* second argument (if any) to function */ + double retval; /* value to be returned by function */ + } ; + +#define _EXCEPTION_DEFINED +#endif + + +/* Definition of a _complex struct to be used by those who use cabs and + * want type checking on their argument + */ + +#ifndef _COMPLEX_DEFINED +struct _complex { + double x,y; /* real and imaginary parts */ + } ; + +#if !__STDC__ +/* Non-ANSI name for compatibility */ +#define complex _complex +#endif + +#define _COMPLEX_DEFINED +#endif +#endif /* __assembler */ + + +/* Constant definitions for the exception type passed in the _exception struct + */ + +#define _DOMAIN 1 /* argument domain error */ +#define _SING 2 /* argument singularity */ +#define _OVERFLOW 3 /* overflow range error */ +#define _UNDERFLOW 4 /* underflow range error */ +#define _TLOSS 5 /* total loss of precision */ +#define _PLOSS 6 /* partial loss of precision */ + +#define EDOM 33 +#define ERANGE 34 + + +/* Definitions of _HUGE and HUGE_VAL - respectively the XENIX and ANSI names + * for a value returned in case of error by a number of the floating point + * math routines + */ +#ifndef __assembler /* Protect from assembler */ +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#ifdef _DLL +#define _HUGE (*_HUGE_dll) +extern double * _HUGE_dll; +#else /* ndef _DLL */ +extern double _HUGE; +#endif /* _DLL */ +#else /* ndef _NTSDK */ +/* current definition */ +_CRTIMP extern double _HUGE; +#endif /* _NTSDK */ +#endif /* __assembler */ + +#define HUGE_VAL _HUGE + + +/* Function prototypes */ + +#if !defined(__assembler) /* Protect from assembler */ +#if _M_MRX000 +_CRTIMP int __cdecl abs(int); +_CRTIMP double __cdecl acos(double); +_CRTIMP double __cdecl asin(double); +_CRTIMP double __cdecl atan(double); +_CRTIMP double __cdecl atan2(double, double); +_CRTIMP double __cdecl cos(double); +_CRTIMP double __cdecl cosh(double); +_CRTIMP double __cdecl exp(double); +_CRTIMP double __cdecl fabs(double); +_CRTIMP double __cdecl fmod(double, double); +_CRTIMP long __cdecl labs(long); +_CRTIMP double __cdecl log(double); +_CRTIMP double __cdecl log10(double); +_CRTIMP double __cdecl pow(double, double); +_CRTIMP double __cdecl sin(double); +_CRTIMP double __cdecl sinh(double); +_CRTIMP double __cdecl tan(double); +_CRTIMP double __cdecl tanh(double); +_CRTIMP double __cdecl sqrt(double); +#else + int __cdecl abs(int); + double __cdecl acos(double); + double __cdecl asin(double); + double __cdecl atan(double); + double __cdecl atan2(double, double); + double __cdecl cos(double); + double __cdecl cosh(double); + double __cdecl exp(double); + double __cdecl fabs(double); + double __cdecl fmod(double, double); + long __cdecl labs(long); + double __cdecl log(double); + double __cdecl log10(double); + double __cdecl pow(double, double); + double __cdecl sin(double); + double __cdecl sinh(double); + double __cdecl tan(double); + double __cdecl tanh(double); + double __cdecl sqrt(double); +#endif +_CRTIMP double __cdecl atof(const char *); +_CRTIMP double __cdecl _cabs(struct _complex); +_CRTIMP double __cdecl ceil(double); +_CRTIMP double __cdecl floor(double); +_CRTIMP double __cdecl frexp(double, int *); +_CRTIMP double __cdecl _hypot(double, double); +_CRTIMP double __cdecl _j0(double); +_CRTIMP double __cdecl _j1(double); +_CRTIMP double __cdecl _jn(int, double); +_CRTIMP double __cdecl ldexp(double, int); + int __cdecl _matherr(struct _exception *); +_CRTIMP double __cdecl modf(double, double *); + +_CRTIMP double __cdecl _y0(double); +_CRTIMP double __cdecl _y1(double); +_CRTIMP double __cdecl _yn(int, double); + + +#ifdef _M_MRX000 + +/* MIPS fast prototypes for float */ +/* ANSI C, 4.5 Mathematics */ + +/* 4.5.2 Trigonometric functions */ + +_CRTIMP float __cdecl acosf( float ); +_CRTIMP float __cdecl asinf( float ); +_CRTIMP float __cdecl atanf( float ); +_CRTIMP float __cdecl atan2f( float , float ); +_CRTIMP float __cdecl cosf( float ); +_CRTIMP float __cdecl sinf( float ); +_CRTIMP float __cdecl tanf( float ); + +/* 4.5.3 Hyperbolic functions */ +_CRTIMP float __cdecl coshf( float ); +_CRTIMP float __cdecl sinhf( float ); +_CRTIMP float __cdecl tanhf( float ); + +/* 4.5.4 Exponential and logarithmic functions */ +_CRTIMP float __cdecl expf( float ); +_CRTIMP float __cdecl logf( float ); +_CRTIMP float __cdecl log10f( float ); +_CRTIMP float __cdecl modff( float , float* ); + +/* 4.5.5 Power functions */ +_CRTIMP float __cdecl powf( float , float ); + float __cdecl sqrtf( float ); + +/* 4.5.6 Nearest integer, absolute value, and remainder functions */ + float __cdecl ceilf( float ); + float __cdecl fabsf( float ); + float __cdecl floorf( float ); +_CRTIMP float __cdecl fmodf( float , float ); + +_CRTIMP float __cdecl hypotf(float, float); + +#endif /* _M_MRX000 */ + +#if !defined(_M_M68K) +/* Macros defining long double functions to be their double counterparts + * (long double is synonymous with double in this implementation). + */ + + +#define acosl(x) ((long double)acos((double)(x))) +#define asinl(x) ((long double)asin((double)(x))) +#define atanl(x) ((long double)atan((double)(x))) +#define atan2l(x,y) ((long double)atan2((double)(x), (double)(y))) +#define _cabsl _cabs +#define ceill(x) ((long double)ceil((double)(x))) +#define cosl(x) ((long double)cos((double)(x))) +#define coshl(x) ((long double)cosh((double)(x))) +#define expl(x) ((long double)exp((double)(x))) +#define fabsl(x) ((long double)fabs((double)(x))) +#define floorl(x) ((long double)floor((double)(x))) +#define fmodl(x,y) ((long double)fmod((double)(x), (double)(y))) +#define frexpl(x,y) ((long double)frexp((double)(x), (y))) +#define _hypotl(x,y) ((long double)_hypot((double)(x), (double)(y))) +#define ldexpl(x,y) ((long double)ldexp((double)(x), (y))) +#define logl(x) ((long double)log((double)(x))) +#define log10l(x) ((long double)log10((double)(x))) +#define _matherrl _matherr +#define modfl(x,y) ((long double)modf((double)(x), (double *)(y))) +#define powl(x,y) ((long double)pow((double)(x), (double)(y))) +#define sinl(x) ((long double)sin((double)(x))) +#define sinhl(x) ((long double)sinh((double)(x))) +#define sqrtl(x) ((long double)sqrt((double)(x))) +#define tanl(x) ((long double)tan((double)(x))) +#define tanhl(x) ((long double)tanh((double)(x))) +#endif /* _M_M68K */ +#endif /* __assembler */ + +#if !__STDC__ + +/* Non-ANSI names for compatibility */ + +#define DOMAIN _DOMAIN +#define SING _SING +#define OVERFLOW _OVERFLOW +#define UNDERFLOW _UNDERFLOW +#define TLOSS _TLOSS +#define PLOSS _PLOSS + +#if !defined(_M_MPPC) && !defined(_M_M68K) +#define matherr _matherr +#endif /* !defined(_M_MPPC) && !defined(_M_M68K) */ + +#ifndef __assembler /* Protect from assembler */ + +#ifdef _NTSDK + +/* Definitions and declarations compatible with NT SDK */ + +#ifdef _DLL +#define HUGE (*HUGE_dll) +extern double * HUGE_dll; +#else /* ndef _DLL */ +extern double HUGE; +#endif /* _DLL */ + +#define cabs _cabs +#define hypot _hypot +#define j0 _j0 +#define j1 _j1 +#define jn _jn +#define y0 _y0 +#define y1 _y1 +#define yn _yn + +#else /* ndef _NTSDK */ + +/* Current definitions and declarations */ + +_CRTIMP extern double HUGE; + +_CRTIMP double __cdecl cabs(struct complex); +_CRTIMP double __cdecl hypot(double, double); +_CRTIMP double __cdecl j0(double); +_CRTIMP double __cdecl j1(double); +_CRTIMP double __cdecl jn(int, double); + int __cdecl matherr(struct _exception *); +_CRTIMP double __cdecl y0(double); +_CRTIMP double __cdecl y1(double); +_CRTIMP double __cdecl yn(int, double); + +#endif /* _NTSDK */ +#endif /* __assembler */ + +#endif /* __STDC__ */ + +#ifdef _M_M68K +/* definition of _exceptionl struct - this struct is passed to the _matherrl + * routine when a floating point exception is detected in a long double routine + */ + +#ifndef _LD_EXCEPTION_DEFINED + +struct _exceptionl { + int type; /* exception type - see below */ + char *name; /* name of function where error occured */ + long double arg1; /* first argument to function */ + long double arg2; /* second argument (if any) to function */ + long double retval; /* value to be returned by function */ +} ; +#define _LD_EXCEPTION_DEFINED +#endif + + +/* definition of a _complexl struct to be used by those who use _cabsl and + * want type checking on their argument + */ + +#ifndef _LD_COMPLEX_DEFINED +struct _complexl { + long double x,y; /* real and imaginary parts */ +} ; +#define _LD_COMPLEX_DEFINED +#endif + + +long double __cdecl acosl(long double); +long double __cdecl asinl(long double); +long double __cdecl atanl(long double); +long double __cdecl atan2l(long double, long double); +long double __cdecl _atold(const char *); +long double __cdecl _cabsl(struct _complexl); +long double __cdecl ceill(long double); +long double __cdecl cosl(long double); +long double __cdecl coshl(long double); +long double __cdecl expl(long double); +long double __cdecl fabsl(long double); +long double __cdecl floorl(long double); +long double __cdecl fmodl(long double, long double); +long double __cdecl frexpl(long double, int *); +long double __cdecl _hypotl(long double, long double); +long double __cdecl _j0l(long double); +long double __cdecl _j1l(long double); +long double __cdecl _jnl(int, long double); +long double __cdecl ldexpl(long double, int); +long double __cdecl logl(long double); +long double __cdecl log10l(long double); +int __cdecl _matherrl(struct _exceptionl *); +long double __cdecl modfl(long double, long double *); +long double __cdecl powl(long double, long double); +long double __cdecl sinl(long double); +long double __cdecl sinhl(long double); +long double __cdecl sqrtl(long double); +long double __cdecl tanl(long double); +long double __cdecl tanhl(long double); +long double __cdecl _y0l(long double); +long double __cdecl _y1l(long double); +long double __cdecl _ynl(int, long double); + +#endif /* _M_M68K */ + + +#ifdef __cplusplus +} +#endif + + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_MATH */ + diff --git a/public/sdk/inc/crt/mbctype.h b/public/sdk/inc/crt/mbctype.h new file mode 100644 index 000000000..7e3697816 --- /dev/null +++ b/public/sdk/inc/crt/mbctype.h @@ -0,0 +1,191 @@ +/*** +*mbctype.h - MBCS character conversion macros +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* Defines macros for MBCS character classification/conversion. +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_MBCTYPE +#define _INC_MBCTYPE + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +/* include the standard ctype.h header file */ + +#include <ctype.h> + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +/* + * MBCS - Multi-Byte Character Set + */ + +/* + * This declaration allows the user access the _mbctype[] look-up array. + */ + +#ifdef _NTSDK + +/* declarations compatible with NT SDK */ + +#ifdef _DLL +extern unsigned char * _mbctype; +#else /* ndef _DLL */ +extern unsigned char _mbctype[]; +#endif /* _DLL */ + +#else /* ndef _NTSDK */ + +/* current declaration */ +#if defined(_DLL) && defined(_M_IX86) +#define _mbctype (__p__mbctype()) +_CRTIMP unsigned char * __cdecl __p__mbctype(void); +#else /* !(defined(_DLL) && defined(_M_IX86)) */ +_CRTIMP extern unsigned char _mbctype[]; +#endif /* defined(_DLL) && defined(_M_IX86) */ + +#endif /* _NTSDK */ + + +/* bit masks for MBCS character types */ + +#define _MS 0x01 /* MBCS single-byte symbol */ +#define _MP 0x02 /* MBCS punct */ +#define _M1 0x04 /* MBCS 1st (lead) byte */ +#define _M2 0x08 /* MBCS 2nd byte*/ + +/* byte types */ + +#define _MBC_SINGLE 0 /* valid single byte char */ +#define _MBC_LEAD 1 /* lead byte */ +#define _MBC_TRAIL 2 /* trailing byte */ +#define _MBC_ILLEGAL (-1) /* illegal byte */ + +#define _KANJI_CP 932 + +/* _setmbcp parameter defines */ +#define _MB_CP_SBCS 0 +#define _MB_CP_OEM -2 +#define _MB_CP_ANSI -3 +#define _MB_CP_LOCALE -4 + + +#ifndef _MBCTYPE_DEFINED + +/* MB control routines */ + +_CRTIMP int __cdecl _setmbcp(int); +_CRTIMP int __cdecl _getmbcp(void); + + +/* MBCS character classification function prototypes */ + + +/* byte routines */ +_CRTIMP int __cdecl _ismbbkalnum( unsigned int ); +_CRTIMP int __cdecl _ismbbkana( unsigned int ); +_CRTIMP int __cdecl _ismbbkpunct( unsigned int ); +_CRTIMP int __cdecl _ismbbkprint( unsigned int ); +_CRTIMP int __cdecl _ismbbalpha( unsigned int ); +_CRTIMP int __cdecl _ismbbpunct( unsigned int ); +_CRTIMP int __cdecl _ismbbalnum( unsigned int ); +_CRTIMP int __cdecl _ismbbprint( unsigned int ); +_CRTIMP int __cdecl _ismbbgraph( unsigned int ); + +#ifndef _MBLEADTRAIL_DEFINED +_CRTIMP int __cdecl _ismbblead( unsigned int ); +_CRTIMP int __cdecl _ismbbtrail( unsigned int ); +_CRTIMP int __cdecl _ismbslead( const unsigned char *, const unsigned char *); +_CRTIMP int __cdecl _ismbstrail( const unsigned char *, const unsigned char *); +#define _MBLEADTRAIL_DEFINED +#endif + +#define _MBCTYPE_DEFINED +#endif + +/* + * char byte classification macros + */ + +#define _ismbbkalnum(_c) ((_mbctype+1)[(unsigned char)(_c)] & _MS) +#define _ismbbkprint(_c) ((_mbctype+1)[(unsigned char)(_c)] & (_MS|_MP)) +#define _ismbbkpunct(_c) ((_mbctype+1)[(unsigned char)(_c)] & _MP) + +#define _ismbbalnum(_c) (((_ctype+1)[(unsigned char)(_c)] & (_ALPHA|_DIGIT))||_ismbbkalnum(_c)) +#define _ismbbalpha(_c) (((_ctype+1)[(unsigned char)(_c)] & (_ALPHA))||_ismbbkalnum(_c)) +#define _ismbbgraph(_c) (((_ctype+1)[(unsigned char)(_c)] & (_PUNCT|_ALPHA|_DIGIT))||_ismbbkprint(_c)) +#define _ismbbprint(_c) (((_ctype+1)[(unsigned char)(_c)] & (_BLANK|_PUNCT|_ALPHA|_DIGIT))||_ismbbkprint(_c)) +#define _ismbbpunct(_c) (((_ctype+1)[(unsigned char)(_c)] & _PUNCT)||_ismbbkpunct(_c)) + +#define _ismbblead(_c) ((_mbctype+1)[(unsigned char)(_c)] & _M1) +#define _ismbbtrail(_c) ((_mbctype+1)[(unsigned char)(_c)] & _M2) + +#define _ismbbkana(_c) ((_mbctype+1)[(unsigned char)(_c)] & (_MS|_MP)) + +#ifdef __cplusplus +} +#endif + + +#endif /* _INC_MBCTYPE */ diff --git a/public/sdk/inc/crt/mbstring.h b/public/sdk/inc/crt/mbstring.h new file mode 100644 index 000000000..30a0e9c7f --- /dev/null +++ b/public/sdk/inc/crt/mbstring.h @@ -0,0 +1,229 @@ +/*** +* mbstring.h - MBCS string manipulation macros and functions +* +* Copyright (c) 1990-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file contains macros and function declarations for the MBCS +* string manipulation functions. +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_MBSTRING +#define _INC_MBSTRING + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +/* + * Currently, all MS C compilers for Win32 platforms default to 8 byte + * alignment. + */ +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#define _SIZE_T_DEFINED +#endif + + +#ifndef _NLSCMP_DEFINED +#define _NLSCMPERROR 2147483647 /* currently == INT_MAX */ +#define _NLSCMP_DEFINED +#endif + + +#ifndef _VA_LIST_DEFINED +#ifdef _M_ALPHA +typedef struct { + char *a0; /* pointer to first homed integer argument */ + int offset; /* byte offset of next parameter */ +} va_list; +#else +typedef char * va_list; +#endif +#define _VA_LIST_DEFINED +#endif + +#ifndef _FILE_DEFINED +struct _iobuf { + char *_ptr; + int _cnt; + char *_base; + int _flag; + int _file; + int _charbuf; + int _bufsiz; + char *_tmpfname; + }; +typedef struct _iobuf FILE; +#define _FILE_DEFINED +#endif + +/* + * MBCS - Multi-Byte Character Set + */ + +#ifndef _MBSTRING_DEFINED + +/* function prototypes */ + +_CRTIMP unsigned int __cdecl _mbbtombc(unsigned int); +_CRTIMP int __cdecl _mbbtype(unsigned char, int); +_CRTIMP unsigned int __cdecl _mbctombb(unsigned int); +_CRTIMP int __cdecl _mbsbtype(const unsigned char *, size_t); +_CRTIMP unsigned char * __cdecl _mbscat(unsigned char *, const unsigned char *); +_CRTIMP unsigned char * __cdecl _mbschr(const unsigned char *, unsigned int); +_CRTIMP int __cdecl _mbscmp(const unsigned char *, const unsigned char *); +_CRTIMP int __cdecl _mbscoll(const unsigned char *, const unsigned char *); +_CRTIMP unsigned char * __cdecl _mbscpy(unsigned char *, const unsigned char *); +_CRTIMP size_t __cdecl _mbscspn(const unsigned char *, const unsigned char *); +_CRTIMP unsigned char * __cdecl _mbsdec(const unsigned char *, const unsigned char *); +_CRTIMP unsigned char * __cdecl _mbsdup(const unsigned char *); +_CRTIMP int __cdecl _mbsicmp(const unsigned char *, const unsigned char *); +_CRTIMP int __cdecl _mbsicoll(const unsigned char *, const unsigned char *); +_CRTIMP unsigned char * __cdecl _mbsinc(const unsigned char *); +_CRTIMP size_t __cdecl _mbslen(const unsigned char *); +_CRTIMP unsigned char * __cdecl _mbslwr(unsigned char *); +_CRTIMP unsigned char * __cdecl _mbsnbcat(unsigned char *, const unsigned char *, size_t); +_CRTIMP int __cdecl _mbsnbcmp(const unsigned char *, const unsigned char *, size_t); +_CRTIMP int __cdecl _mbsnbcoll(const unsigned char *, const unsigned char *, size_t); +_CRTIMP size_t __cdecl _mbsnbcnt(const unsigned char *, size_t); +_CRTIMP unsigned char * __cdecl _mbsnbcpy(unsigned char *, const unsigned char *, size_t); +_CRTIMP int __cdecl _mbsnbicmp(const unsigned char *, const unsigned char *, size_t); +_CRTIMP int __cdecl _mbsnbicoll(const unsigned char *, const unsigned char *, size_t); +_CRTIMP unsigned char * __cdecl _mbsnbset(unsigned char *, unsigned int, size_t); +_CRTIMP unsigned char * __cdecl _mbsncat(unsigned char *, const unsigned char *, size_t); +_CRTIMP size_t __cdecl _mbsnccnt(const unsigned char *, size_t); +_CRTIMP int __cdecl _mbsncmp(const unsigned char *, const unsigned char *, size_t); +_CRTIMP int __cdecl _mbsncoll(const unsigned char *, const unsigned char *, size_t); +_CRTIMP unsigned char * __cdecl _mbsncpy(unsigned char *, const unsigned char *, size_t); +_CRTIMP unsigned int __cdecl _mbsnextc (const unsigned char *); +_CRTIMP int __cdecl _mbsnicmp(const unsigned char *, const unsigned char *, size_t); +_CRTIMP int __cdecl _mbsnicoll(const unsigned char *, const unsigned char *, size_t); +_CRTIMP unsigned char * __cdecl _mbsninc(const unsigned char *, size_t); +_CRTIMP unsigned char * __cdecl _mbsnset(unsigned char *, unsigned int, size_t); +_CRTIMP unsigned char * __cdecl _mbspbrk(const unsigned char *, const unsigned char *); +_CRTIMP unsigned char * __cdecl _mbsrchr(const unsigned char *, unsigned int); +_CRTIMP unsigned char * __cdecl _mbsrev(unsigned char *); +_CRTIMP unsigned char * __cdecl _mbsset(unsigned char *, unsigned int); +_CRTIMP size_t __cdecl _mbsspn(const unsigned char *, const unsigned char *); +_CRTIMP unsigned char * __cdecl _mbsspnp(const unsigned char *, const unsigned char *); +_CRTIMP unsigned char * __cdecl _mbsstr(const unsigned char *, const unsigned char *); +_CRTIMP unsigned char * __cdecl _mbstok(unsigned char *, const unsigned char *); +_CRTIMP unsigned char * __cdecl _mbsupr(unsigned char *); + +_CRTIMP size_t __cdecl _mbclen(const unsigned char *); +_CRTIMP void __cdecl _mbccpy(unsigned char *, const unsigned char *); +#define _mbccmp(_cpc1, _cpc2) _mbsncmp((_cpc1),(_cpc2),1) + +/* character routines */ + +_CRTIMP int __cdecl _ismbcalnum(unsigned int); +_CRTIMP int __cdecl _ismbcalpha(unsigned int); +_CRTIMP int __cdecl _ismbcdigit(unsigned int); +_CRTIMP int __cdecl _ismbcgraph(unsigned int); +_CRTIMP int __cdecl _ismbclegal(unsigned int); +_CRTIMP int __cdecl _ismbclower(unsigned int); +_CRTIMP int __cdecl _ismbcprint(unsigned int); +_CRTIMP int __cdecl _ismbcpunct(unsigned int); +_CRTIMP int __cdecl _ismbcspace(unsigned int); +_CRTIMP int __cdecl _ismbcupper(unsigned int); + +_CRTIMP unsigned int __cdecl _mbctolower(unsigned int); +_CRTIMP unsigned int __cdecl _mbctoupper(unsigned int); + +#define _MBSTRING_DEFINED +#endif + +#ifndef _MBLEADTRAIL_DEFINED +_CRTIMP int __cdecl _ismbblead( unsigned int ); +_CRTIMP int __cdecl _ismbbtrail( unsigned int ); +_CRTIMP int __cdecl _ismbslead( const unsigned char *, const unsigned char *); +_CRTIMP int __cdecl _ismbstrail( const unsigned char *, const unsigned char *); +#define _MBLEADTRAIL_DEFINED +#endif + +/* Kanji specific prototypes. */ + +_CRTIMP int __cdecl _ismbchira(unsigned int); +_CRTIMP int __cdecl _ismbckata(unsigned int); +_CRTIMP int __cdecl _ismbcsymbol(unsigned int); +_CRTIMP int __cdecl _ismbcl0(unsigned int); +_CRTIMP int __cdecl _ismbcl1(unsigned int); +_CRTIMP int __cdecl _ismbcl2(unsigned int); +_CRTIMP unsigned int __cdecl _mbcjistojms(unsigned int); +_CRTIMP unsigned int __cdecl _mbcjmstojis(unsigned int); +_CRTIMP unsigned int __cdecl _mbctohira(unsigned int); +_CRTIMP unsigned int __cdecl _mbctokata(unsigned int); + +#ifdef __cplusplus +} +#endif + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_MBSTRING */ diff --git a/public/sdk/inc/crt/memory.h b/public/sdk/inc/crt/memory.h new file mode 100644 index 000000000..87c935d2d --- /dev/null +++ b/public/sdk/inc/crt/memory.h @@ -0,0 +1,118 @@ +/*** +*memory.h - declarations for buffer (memory) manipulation routines +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This include file contains the function declarations for the +* buffer (memory) manipulation routines. +* [System V] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_MEMORY +#define _INC_MEMORY + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#define _SIZE_T_DEFINED +#endif + +/* Function prototypes */ + +_CRTIMP void * __cdecl _memccpy(void *, const void *, int, unsigned int); +_CRTIMP void * __cdecl memchr(const void *, int, size_t); +_CRTIMP int __cdecl _memicmp(const void *, const void *, unsigned int); +#ifdef _M_MRX000 +_CRTIMP int __cdecl memcmp(const void *, const void *, size_t); +_CRTIMP void * __cdecl memcpy(void *, const void *, size_t); +_CRTIMP void * __cdecl memset(void *, int, size_t); +#else + int __cdecl memcmp(const void *, const void *, size_t); + void * __cdecl memcpy(void *, const void *, size_t); + void * __cdecl memset(void *, int, size_t); +#endif + +#if !__STDC__ + +/* Non-ANSI names for compatibility */ + +#if defined(_NTSDK) +/* definitions compatible with the NT SDK */ +#define memccpy _memccpy +#define memicmp _memicmp +#else /* _NTSDK */ +/* current declarations */ +_CRTIMP void * __cdecl memccpy(void *, const void *, int, unsigned int); +_CRTIMP int __cdecl memicmp(const void *, const void *, unsigned int); +#endif /* _NTSDK */ + +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* _INC_MEMORY */ diff --git a/public/sdk/inc/crt/new.h b/public/sdk/inc/crt/new.h new file mode 100644 index 000000000..9f45b5649 --- /dev/null +++ b/public/sdk/inc/crt/new.h @@ -0,0 +1,125 @@ +/*** +*new.h - declarations and definitions for C++ memory allocation functions +* +* Copyright (c) 1990-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* Contains the declarations for C++ memory allocation functions. +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_NEW +#define _INC_NEW + +#ifdef __cplusplus + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + + +#include <stdexcpt.h> /* for class exception */ + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +/* types and structures */ + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#define _SIZE_T_DEFINED +#endif + +/* default new placement operator */ +inline void * operator new( size_t, void * ptr ) { return ptr; } + +/* + * new mode flag -- when set, makes malloc() behave like new() + */ + +_CRTIMP int __cdecl _query_new_mode( void ); +_CRTIMP int __cdecl _set_new_mode( int ); + +#ifndef _PNH_DEFINED +typedef int (__cdecl * _PNH)( size_t ); +#define _PNH_DEFINED +#endif + +_CRTIMP _PNH __cdecl _query_new_handler( void ); +_CRTIMP _PNH __cdecl _set_new_handler( _PNH ); + + +/* + * ANSI C++ new_handler and set_new_handler: + * + * WARNING: set_new_handler is a stub function that is provided to + * allow compilation of the Standard Template Library (STL). + * + * Do NOT use it to register a new handler. Use _set_new_handler instead. + * + * However, it can be called to remove the current handler: + * + * set_new_handler(NULL); // calls _set_new_handler(NULL) + */ + +#ifndef _ANSI_NH_DEFINED +typedef void (__cdecl * new_handler) (); +#define _ANSI_NH_DEFINED +#endif + +_CRTIMP new_handler __cdecl set_new_handler(new_handler); + + +#endif /* __cplusplus */ + +#endif /* _INC_NEW */ diff --git a/public/sdk/inc/crt/ostream.h b/public/sdk/inc/crt/ostream.h new file mode 100644 index 000000000..b32329013 --- /dev/null +++ b/public/sdk/inc/crt/ostream.h @@ -0,0 +1,161 @@ +/*** +*ostream.h - definitions/declarations for the ostream class +* +* Copyright (c) 1991-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the classes, values, macros, and functions +* used by the ostream class. +* [AT&T C++] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifdef __cplusplus + +#ifndef _INC_OSTREAM +#define _INC_OSTREAM + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +// Currently, all MS C compilers for Win32 platforms default to 8 byte +// alignment. +#pragma pack(push,8) +#endif // _MSC_VER + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +#include <ios.h> + +#ifdef _MSC_VER +// C4514: "unreferenced inline function has been removed" +#pragma warning(disable:4514) // disable C4514 warning +// #pragma warning(default:4514) // use this to reenable, if desired +#endif // _MSC_VER + +typedef long streamoff, streampos; + +class _CRTIMP ostream : virtual public ios { + +public: + ostream(streambuf*); + virtual ~ostream(); + + ostream& flush(); + int opfx(); + void osfx(); + +inline ostream& operator<<(ostream& (__cdecl * _f)(ostream&)); +inline ostream& operator<<(ios& (__cdecl * _f)(ios&)); + ostream& operator<<(const char *); +inline ostream& operator<<(const unsigned char *); +inline ostream& operator<<(const signed char *); +inline ostream& operator<<(char); + ostream& operator<<(unsigned char); +inline ostream& operator<<(signed char); + ostream& operator<<(short); + ostream& operator<<(unsigned short); + ostream& operator<<(int); + ostream& operator<<(unsigned int); + ostream& operator<<(long); + ostream& operator<<(unsigned long); +inline ostream& operator<<(float); + ostream& operator<<(double); + ostream& operator<<(long double); + ostream& operator<<(const void *); + ostream& operator<<(streambuf*); +inline ostream& put(char); + ostream& put(unsigned char); +inline ostream& put(signed char); + ostream& write(const char *,int); +inline ostream& write(const unsigned char *,int); +inline ostream& write(const signed char *,int); + ostream& seekp(streampos); + ostream& seekp(streamoff,ios::seek_dir); + streampos tellp(); + +protected: + ostream(); + ostream(const ostream&); // treat as private + ostream& operator=(streambuf*); // treat as private + ostream& operator=(const ostream& _os) {return operator=(_os.rdbuf()); } + int do_opfx(int); // not used + void do_osfx(); // not used + +private: + ostream(ios&); + ostream& writepad(const char *, const char *); + int x_floatused; +}; + +inline ostream& ostream::operator<<(ostream& (__cdecl * _f)(ostream&)) { (*_f)(*this); return *this; } +inline ostream& ostream::operator<<(ios& (__cdecl * _f)(ios& )) { (*_f)(*this); return *this; } + +inline ostream& ostream::operator<<(char _c) { return operator<<((unsigned char) _c); } +inline ostream& ostream::operator<<(signed char _c) { return operator<<((unsigned char) _c); } + +inline ostream& ostream::operator<<(const unsigned char * _s) { return operator<<((const char *) _s); } +inline ostream& ostream::operator<<(const signed char * _s) { return operator<<((const char *) _s); } + +inline ostream& ostream::operator<<(float _f) { x_floatused = 1; return operator<<((double) _f); } + +inline ostream& ostream::put(char _c) { return put((unsigned char) _c); } +inline ostream& ostream::put(signed char _c) { return put((unsigned char) _c); } + +inline ostream& ostream::write(const unsigned char * _s, int _n) { return write((char *) _s, _n); } +inline ostream& ostream::write(const signed char * _s, int _n) { return write((char *) _s, _n); } + + +class _CRTIMP ostream_withassign : public ostream { + public: + ostream_withassign(); + ostream_withassign(streambuf* _is); + ~ostream_withassign(); + ostream& operator=(const ostream& _os) { return ostream::operator=(_os.rdbuf()); } + ostream& operator=(streambuf* _sb) { return ostream::operator=(_sb); } +}; + +extern ostream_withassign _CRTIMP cout; +extern ostream_withassign _CRTIMP cerr; +extern ostream_withassign _CRTIMP clog; + +inline _CRTIMP ostream& __cdecl flush(ostream& _outs) { return _outs.flush(); } +inline _CRTIMP ostream& __cdecl endl(ostream& _outs) { return _outs << '\n' << flush; } +inline _CRTIMP ostream& __cdecl ends(ostream& _outs) { return _outs << char('\0'); } + +_CRTIMP ios& __cdecl dec(ios&); +_CRTIMP ios& __cdecl hex(ios&); +_CRTIMP ios& __cdecl oct(ios&); + +#ifdef _MSC_VER +// Restore default packing +#pragma pack(pop) +#endif // _MSC_VER + +#endif // _INC_OSTREAM + +#endif /* __cplusplus */ diff --git a/public/sdk/inc/crt/process.h b/public/sdk/inc/crt/process.h new file mode 100644 index 000000000..a07f6a923 --- /dev/null +++ b/public/sdk/inc/crt/process.h @@ -0,0 +1,310 @@ +/*** +*process.h - definition and declarations for process control functions +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the modeflag values for spawnxx calls. +* Also contains the function argument declarations for all +* process control related routines. +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_PROCESS +#define _INC_PROCESS + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifndef _POSIX_ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +#ifndef _MAC +#ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif +#endif /* ndef _MAC */ + + +/* modeflag values for _spawnxx routines */ + +#ifndef _MAC + +#define _P_WAIT 0 +#define _P_NOWAIT 1 +#define _OLD_P_OVERLAY 2 +#define _P_NOWAITO 3 +#define _P_DETACH 4 + +#ifdef _MT +#define _P_OVERLAY 2 +#else +extern int _p_overlay; +#define _P_OVERLAY _p_overlay +#endif /* _MT */ + +/* Action codes for _cwait(). The action code argument to _cwait is ignored + on Win32 though it is accepted for compatibilty with old MS CRT libs */ +#define _WAIT_CHILD 0 +#define _WAIT_GRANDCHILD 1 + +#else /* ndef _MAC */ + +#define _P_NOWAIT 1 +#define _P_OVERLAY 2 + +#endif /* ndef _MAC */ + + +/* function prototypes */ + +#ifdef _MT +_CRTIMP unsigned long __cdecl _beginthread (void (__cdecl *) (void *), + unsigned, void *); +_CRTIMP void __cdecl _endthread(void); +_CRTIMP unsigned long __cdecl _beginthreadex(void *, unsigned, + unsigned (__stdcall *) (void *), void *, unsigned, unsigned *); +_CRTIMP void __cdecl _endthreadex(unsigned); +#endif + +_CRTIMP void __cdecl abort(void); +_CRTIMP void __cdecl _cexit(void); +_CRTIMP void __cdecl _c_exit(void); +_CRTIMP void __cdecl exit(int); +_CRTIMP void __cdecl _exit(int); +_CRTIMP int __cdecl _getpid(void); + +#ifndef _MAC + +_CRTIMP int __cdecl _cwait(int *, int, int); +_CRTIMP int __cdecl _execl(const char *, const char *, ...); +_CRTIMP int __cdecl _execle(const char *, const char *, ...); +_CRTIMP int __cdecl _execlp(const char *, const char *, ...); +_CRTIMP int __cdecl _execlpe(const char *, const char *, ...); +_CRTIMP int __cdecl _execv(const char *, const char * const *); +_CRTIMP int __cdecl _execve(const char *, const char * const *, const char * const *); +_CRTIMP int __cdecl _execvp(const char *, const char * const *); +_CRTIMP int __cdecl _execvpe(const char *, const char * const *, const char * const *); +_CRTIMP int __cdecl _spawnl(int, const char *, const char *, ...); +_CRTIMP int __cdecl _spawnle(int, const char *, const char *, ...); +_CRTIMP int __cdecl _spawnlp(int, const char *, const char *, ...); +_CRTIMP int __cdecl _spawnlpe(int, const char *, const char *, ...); +_CRTIMP int __cdecl _spawnv(int, const char *, const char * const *); +_CRTIMP int __cdecl _spawnve(int, const char *, const char * const *, + const char * const *); +_CRTIMP int __cdecl _spawnvp(int, const char *, const char * const *); +_CRTIMP int __cdecl _spawnvpe(int, const char *, const char * const *, + const char * const *); +_CRTIMP int __cdecl system(const char *); + +#else /* ndef _MAC */ + +_CRTIMP int __cdecl _spawn(int, const char *); + +#endif /* ndef _MAC */ + +#ifndef _MAC +#ifndef _WPROCESS_DEFINED +/* wide function prototypes, also declared in wchar.h */ +_CRTIMP int __cdecl _wexecl(const wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl _wexecle(const wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl _wexeclp(const wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl _wexeclpe(const wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl _wexecv(const wchar_t *, const wchar_t * const *); +_CRTIMP int __cdecl _wexecve(const wchar_t *, const wchar_t * const *, const wchar_t * const *); +_CRTIMP int __cdecl _wexecvp(const wchar_t *, const wchar_t * const *); +_CRTIMP int __cdecl _wexecvpe(const wchar_t *, const wchar_t * const *, const wchar_t * const *); +_CRTIMP int __cdecl _wspawnl(int, const wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl _wspawnle(int, const wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl _wspawnlp(int, const wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl _wspawnlpe(int, const wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl _wspawnv(int, const wchar_t *, const wchar_t * const *); +_CRTIMP int __cdecl _wspawnve(int, const wchar_t *, const wchar_t * const *, + const wchar_t * const *); +_CRTIMP int __cdecl _wspawnvp(int, const wchar_t *, const wchar_t * const *); +_CRTIMP int __cdecl _wspawnvpe(int, const wchar_t *, const wchar_t * const *, + const wchar_t * const *); +_CRTIMP int __cdecl _wsystem(const wchar_t *); + +#define _WPROCESS_DEFINED +#endif + +/* --------- The following functions are OBSOLETE --------- */ +/* + * The Win32 API LoadLibrary, FreeLibrary and GetProcAddress should be used + * instead. + */ +int __cdecl _loaddll(char *); +int __cdecl _unloaddll(int); +int (__cdecl * __cdecl _getdllprocaddr(int, char *, int))(); +/* --------- The preceding functions are OBSOLETE --------- */ + + +#ifdef _DECL_DLLMAIN +/* + * Declare DLL notification (initialization/termination) routines + * The preferred method is for the user to provide DllMain() which will + * be called automatically by the DLL entry point defined by the C run- + * time library code. If the user wants to define the DLL entry point + * routine, the user's entry point must call _CRT_INIT on all types of + * notifications, as the very first thing on attach notifications and + * as the very last thing on detach notifications. + */ +#ifdef _WINDOWS_ /* Use types from WINDOWS.H */ +BOOL WINAPI DllMain(HANDLE, DWORD, LPVOID); +BOOL WINAPI _CRT_INIT(HANDLE, DWORD, LPVOID); +BOOL WINAPI _wCRT_INIT(HANDLE, DWORD, LPVOID); +extern BOOL (WINAPI *_pRawDllMain)(HANDLE, DWORD, LPVOID); +#else +int __stdcall DllMain(void *, unsigned, void *); +int __stdcall _CRT_INIT(void *, unsigned, void *); +int __stdcall _wCRT_INIT(void *, unsigned, void *); +extern int (__stdcall *_pRawDllMain)(void *, unsigned, void *); +#endif /* _WINDOWS_ */ +#endif +#endif /* ndef _MAC */ + +#if !__STDC__ + +/* Non-ANSI names for compatibility */ + + +#ifndef _MAC + +#define P_WAIT _P_WAIT +#define P_NOWAIT _P_NOWAIT +#define P_OVERLAY _P_OVERLAY +#define OLD_P_OVERLAY _OLD_P_OVERLAY +#define P_NOWAITO _P_NOWAITO +#define P_DETACH _P_DETACH +#define WAIT_CHILD _WAIT_CHILD +#define WAIT_GRANDCHILD _WAIT_GRANDCHILD + +#else /* ndef _MAC */ + +#define P_NOWAIT _P_NOWAIT +#define P_OVERLAY _P_OVERLAY + +#endif /* ndef _MAC */ + +#ifdef _NTSDK + +/* definitions compatible with NT SDK */ +#define cwait _cwait +#define execl _execl +#define execle _execle +#define execlp _execlp +#define execlpe _execlpe +#define execv _execv +#define execve _execve +#define execvp _execvp +#define execvpe _execvpe +#define getpid _getpid +#define spawnl _spawnl +#define spawnle _spawnle +#define spawnlp _spawnlp +#define spawnlpe _spawnlpe +#define spawnv _spawnv +#define spawnve _spawnve +#define spawnvp _spawnvp +#define spawnvpe _spawnvpe + +#else /* ndef _NTSDK */ + +#ifndef _MAC + +/* current declarations */ +_CRTIMP int __cdecl cwait(int *, int, int); +_CRTIMP int __cdecl execl(const char *, const char *, ...); +_CRTIMP int __cdecl execle(const char *, const char *, ...); +_CRTIMP int __cdecl execlp(const char *, const char *, ...); +_CRTIMP int __cdecl execlpe(const char *, const char *, ...); +_CRTIMP int __cdecl execv(const char *, const char * const *); +_CRTIMP int __cdecl execve(const char *, const char * const *, const char * const *); +_CRTIMP int __cdecl execvp(const char *, const char * const *); +_CRTIMP int __cdecl execvpe(const char *, const char * const *, const char * const *); +_CRTIMP int __cdecl spawnl(int, const char *, const char *, ...); +_CRTIMP int __cdecl spawnle(int, const char *, const char *, ...); +_CRTIMP int __cdecl spawnlp(int, const char *, const char *, ...); +_CRTIMP int __cdecl spawnlpe(int, const char *, const char *, ...); +_CRTIMP int __cdecl spawnv(int, const char *, const char * const *); +_CRTIMP int __cdecl spawnve(int, const char *, const char * const *, + const char * const *); +_CRTIMP int __cdecl spawnvp(int, const char *, const char * const *); +_CRTIMP int __cdecl spawnvpe(int, const char *, const char * const *, + const char * const *); + +#endif /* ndef _MAC */ + +_CRTIMP int __cdecl getpid(void); + +#endif /* _NTSDK */ + +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* _POSIX_ */ + +#endif /* _INC_PROCESS */ diff --git a/public/sdk/inc/crt/search.h b/public/sdk/inc/crt/search.h new file mode 100644 index 000000000..8e4478aec --- /dev/null +++ b/public/sdk/inc/crt/search.h @@ -0,0 +1,116 @@ +/*** +*search.h - declarations for searcing/sorting routines +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file contains the declarations for the sorting and +* searching routines. +* [System V] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_SEARCH +#define _INC_SEARCH + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#define _SIZE_T_DEFINED +#endif + + +/* Function prototypes */ + +_CRTIMP void * __cdecl bsearch(const void *, const void *, size_t, size_t, + int (__cdecl *)(const void *, const void *)); +_CRTIMP void * __cdecl _lfind(const void *, const void *, unsigned int *, unsigned int, + int (__cdecl *)(const void *, const void *)); +_CRTIMP void * __cdecl _lsearch(const void *, void *, unsigned int *, unsigned int, + int (__cdecl *)(const void *, const void *)); +_CRTIMP void __cdecl qsort(void *, size_t, size_t, int (__cdecl *)(const void *, + const void *)); + + +#if !__STDC__ +/* Non-ANSI names for compatibility */ +#ifdef _NTSDK +/* definitions compatible with NT SDK */ +#define lfind _lfind +#define lsearch _lsearch +#else /* ndef _NTSDK */ +/* current declarations */ +_CRTIMP void * __cdecl lfind(const void *, const void *, unsigned int *, unsigned int, + int (__cdecl *)(const void *, const void *)); +_CRTIMP void * __cdecl lsearch(const void *, void *, unsigned int *, unsigned int, + int (__cdecl *)(const void *, const void *)); +#endif /* _NTSDK */ +#endif /* __STDC__ */ + + +#ifdef __cplusplus +} +#endif + +#endif /* _INC_SEARCH */ diff --git a/public/sdk/inc/crt/setjmp.h b/public/sdk/inc/crt/setjmp.h new file mode 100644 index 000000000..26744e15c --- /dev/null +++ b/public/sdk/inc/crt/setjmp.h @@ -0,0 +1,356 @@ +/*** +*setjmp.h - definitions/declarations for setjmp/longjmp routines +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the machine-dependent buffer used by +* setjmp/longjmp to save and restore the program state, and +* declarations for those routines. +* [ANSI/System V] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_SETJMP +#define _INC_SETJMP + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +/* + * Currently, all MS C compilers for Win32 platforms default to 8 byte + * alignment. + */ +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +/* + * Definitions specific to particular setjmp implementations. + */ + +#if defined(_M_IX86) + +/* + * MS compiler for x86 + */ + +#ifndef _INC_SETJMPEX +#define setjmp _setjmp +#endif + +#define _JBLEN 16 +#define _JBTYPE int + +/* + * Define jump buffer layout for x86 setjmp/longjmp. + */ +typedef struct __JUMP_BUFFER { + unsigned long Ebp; + unsigned long Ebx; + unsigned long Edi; + unsigned long Esi; + unsigned long Esp; + unsigned long Eip; + unsigned long Registration; + unsigned long TryLevel; + unsigned long Cookie; + unsigned long UnwindFunc; + unsigned long UnwindData[6]; +} _JUMP_BUFFER; + + + +#elif defined(_M_MRX000) + +#ifndef _INC_SETJMPEX +#define setjmp _setjmp +#endif + +/* + * All MIPS implementations need _JBLEN of 16 + */ +#define _JBLEN 16 +#define _JBTYPE double + +/* + * Define jump buffer layout for MIPS setjmp/longjmp. + */ +typedef struct __JUMP_BUFFER { + unsigned long FltF20; + unsigned long FltF21; + unsigned long FltF22; + unsigned long FltF23; + unsigned long FltF24; + unsigned long FltF25; + unsigned long FltF26; + unsigned long FltF27; + unsigned long FltF28; + unsigned long FltF29; + unsigned long FltF30; + unsigned long FltF31; + unsigned long IntS0; + unsigned long IntS1; + unsigned long IntS2; + unsigned long IntS3; + unsigned long IntS4; + unsigned long IntS5; + unsigned long IntS6; + unsigned long IntS7; + unsigned long IntS8; + unsigned long IntSp; + unsigned long Type; + unsigned long Fir; +} _JUMP_BUFFER; + + +#elif defined(_M_ALPHA) + +/* + * The Alpha C8/GEM C compiler uses an intrinsic _setjmp. + * The Alpha acc compiler implements setjmp as a function. + */ +#ifdef _MSC_VER +#ifndef _INC_SETJMPEX +#define setjmp _setjmp +#endif +#endif + +/* + * Alpha implementations use a _JBLEN of 24 quadwords. + * A double is used only to obtain quadword size and alignment. + */ +#define _JBLEN 24 +#define _JBTYPE double + +/* + * Define jump buffer layout for Alpha setjmp/longjmp. + * A double is used only to obtain quadword size and alignment. + */ +typedef struct __JUMP_BUFFER { + unsigned long Fp; + unsigned long Pc; + unsigned long Seb; + unsigned long Type; + double FltF2; + double FltF3; + double FltF4; + double FltF5; + double FltF6; + double FltF7; + double FltF8; + double FltF9; + double IntS0; + double IntS1; + double IntS2; + double IntS3; + double IntS4; + double IntS5; + double IntS6; + double IntSp; + double Fir; + double Fill[5]; +} _JUMP_BUFFER; + +#elif defined(_M_PPC) +/* + * The Microsoft VC++ V4.0 compiler uses an intrinsic _setjmp. + * The Motorola C8.5 compiler implements setjmp as a function. + */ + +#if _MSC_VER > 850 +#ifndef _INC_SETJMPEX +#undef _setjmp +#define setjmp _setjmp +#endif +#endif + +/* + * Min length is 240 bytes; round to 256 bytes. + * Since this is allocated as an array of "double", the + * number of entries required is 32. + * + * All PPC implementations need _JBLEN of 32 + */ + +#define _JBLEN 32 +#define _JBTYPE double + +/* + * Define jump buffer layout for PowerPC setjmp/longjmp. + */ + +typedef struct __JUMP_BUFFER { + double Fpr14; + double Fpr15; + double Fpr16; + double Fpr17; + double Fpr18; + double Fpr19; + double Fpr20; + double Fpr21; + double Fpr22; + double Fpr23; + double Fpr24; + double Fpr25; + double Fpr26; + double Fpr27; + double Fpr28; + double Fpr29; + double Fpr30; + double Fpr31; + unsigned long Gpr1; + unsigned long Gpr2; + unsigned long Gpr13; + unsigned long Gpr14; + unsigned long Gpr15; + unsigned long Gpr16; + unsigned long Gpr17; + unsigned long Gpr18; + unsigned long Gpr19; + unsigned long Gpr20; + unsigned long Gpr21; + unsigned long Gpr22; + unsigned long Gpr23; + unsigned long Gpr24; + unsigned long Gpr25; + unsigned long Gpr26; + unsigned long Gpr27; + unsigned long Gpr28; + unsigned long Gpr29; + unsigned long Gpr30; + unsigned long Gpr31; + unsigned long Cr; + unsigned long Iar; + unsigned long Type; +} _JUMP_BUFFER; + +#elif defined(_M_M68K) + +#ifndef _INC_SETJMPEX +#define setjmp _setjmp +#endif + +/* internal only for version checking for compatibility */ +#define _SETJMP_VER 1.0 + +/* internal only, jump buffer layout definition */ +typedef struct __JUMP_BUFFER { + unsigned long d1; /* 0x00, saved */ + unsigned long d2; /* 0x04, saved */ + unsigned long d3; /* 0x08, saved */ + unsigned long d4; /* 0x0c, saved */ + unsigned long d5; /* 0x10, saved */ + unsigned long d6; /* 0x14, saved */ + unsigned long d7; /* 0x18, saved */ + unsigned long a1; /* 0x1c, non-swappable version: return address, + swappable version: swapper lib routine pointer for building return address */ + unsigned long a2; /* 0x20, saved */ + unsigned long a3; /* 0x24, saved */ + unsigned long a4; /* 0x28, saved */ + unsigned long a6; /* 0x2c, saved */ + unsigned long a7; /* 0x30, saved */ + unsigned long SwapChain; /* 0x34, without swapper: unused. with swapper: link swappable frames */ + unsigned short reserved; /* 0x38, unused */ + unsigned short SN; /* 0x3a, swappable version: segment number */ + unsigned long BPC; /* 0x3c, swappable version: offset within segment */ +} _JUMP_BUFFER; + +#define _JBTYPE int +#define _JBLEN (sizeof(_JUMP_BUFFER)/sizeof(_JBTYPE)) + +#elif defined(_M_MPPC) + +#ifndef _INC_SETJMPEX +#define setjmp _setjmp +#endif + +#define _JBTYPE int + +/* define the buffer type for building the state information */ + +#define _JBLEN 64 /* return address, R1, R2, R13-R31, FPR14-FPR31, CR 2-5 */ +#endif + + +/* Define the buffer type for holding the state information */ + +#ifndef _JMP_BUF_DEFINED +typedef _JBTYPE jmp_buf[_JBLEN]; +#define _JMP_BUF_DEFINED +#endif + + +/* Function prototypes */ + +int __cdecl setjmp(jmp_buf); +_CRTIMP void __cdecl longjmp(jmp_buf, int); + +#ifdef __cplusplus +} +#endif + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_SETJMP */ diff --git a/public/sdk/inc/crt/setjmpex.h b/public/sdk/inc/crt/setjmpex.h new file mode 100644 index 000000000..7302c731d --- /dev/null +++ b/public/sdk/inc/crt/setjmpex.h @@ -0,0 +1,47 @@ +/*** +*setjmpex.h - definitions/declarations for extended setjmp/longjmp routines +* +* Copyright (c) 1993-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file causes _setjmpex to be called which will enable safe +* setjmp/longjmp that work correctly with try/except/finally. +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_SETJMPEX +#define _INC_SETJMPEX + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +/* + * Definitions specific to particular setjmp implementations. + */ + +#if defined(_M_IX86) + +/* + * MS compiler for x86 + */ + +#define setjmp _setjmp +#define longjmp _longjmpex + +#else + +#define setjmp _setjmpex + +#endif + +#include <setjmp.h> + +#endif /* _INC_SETJMPEX */ diff --git a/public/sdk/inc/crt/share.h b/public/sdk/inc/crt/share.h new file mode 100644 index 000000000..87e2fe16d --- /dev/null +++ b/public/sdk/inc/crt/share.h @@ -0,0 +1,38 @@ +/*** +*share.h - defines file sharing modes for sopen +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the file sharing modes for sopen(). +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_SHARE +#define _INC_SHARE + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#define _SH_DENYRW 0x10 /* deny read/write mode */ +#define _SH_DENYWR 0x20 /* deny write mode */ +#define _SH_DENYRD 0x30 /* deny read mode */ +#define _SH_DENYNO 0x40 /* deny none mode */ + +#if !__STDC__ +/* Non-ANSI names for compatibility */ +#define SH_DENYRW _SH_DENYRW +#define SH_DENYWR _SH_DENYWR +#define SH_DENYRD _SH_DENYRD +#define SH_DENYNO _SH_DENYNO +#endif + +#endif /* _INC_SHARE */ diff --git a/public/sdk/inc/crt/signal.h b/public/sdk/inc/crt/signal.h new file mode 100644 index 000000000..228ffc9a9 --- /dev/null +++ b/public/sdk/inc/crt/signal.h @@ -0,0 +1,130 @@ +/*** +*signal.h - defines signal values and routines +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the signal values and declares the signal functions. +* [ANSI/System V] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_SIGNAL +#define _INC_SIGNAL + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +#ifndef _SIG_ATOMIC_T_DEFINED +typedef int sig_atomic_t; +#define _SIG_ATOMIC_T_DEFINED +#endif + + +#define NSIG 23 /* maximum signal number + 1 */ + + +/* Signal types */ + +#define SIGINT 2 /* interrupt */ +#define SIGILL 4 /* illegal instruction - invalid function image */ +#define SIGFPE 8 /* floating point exception */ +#define SIGSEGV 11 /* segment violation */ +#define SIGTERM 15 /* Software termination signal from kill */ +#define SIGBREAK 21 /* Ctrl-Break sequence */ +#define SIGABRT 22 /* abnormal termination triggered by abort call */ + + +/* signal action codes */ + +#define SIG_DFL (void (__cdecl *)(int))0 /* default signal action */ +#define SIG_IGN (void (__cdecl *)(int))1 /* ignore signal */ +#define SIG_SGE (void (__cdecl *)(int))3 /* signal gets error */ +#define SIG_ACK (void (__cdecl *)(int))4 /* acknowledge */ + + +/* signal error value (returned by signal call on error) */ + +#define SIG_ERR (void (__cdecl *)(int))-1 /* signal error value */ + + +/* pointer to exception information pointers structure */ + +#if defined(_MT) || defined(_DLL) +extern void * * __cdecl __pxcptinfoptrs(void); +#define _pxcptinfoptrs (*__pxcptinfoptrs()) +#else /* ndef _MT && ndef _DLL */ +extern void * _pxcptinfoptrs; +#endif /* _MT || _DLL */ + + +/* Function prototypes */ + +_CRTIMP void (__cdecl * __cdecl signal(int, void (__cdecl *)(int)))(int); +_CRTIMP int __cdecl raise(int); + + +#ifdef __cplusplus +} +#endif + +#endif /* _INC_SIGNAL */ diff --git a/public/sdk/inc/crt/stdarg.h b/public/sdk/inc/crt/stdarg.h new file mode 100644 index 000000000..6ac66e4da --- /dev/null +++ b/public/sdk/inc/crt/stdarg.h @@ -0,0 +1,163 @@ +/*** +*stdarg.h - defines ANSI-style macros for variable argument functions +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines ANSI-style macros for accessing arguments +* of functions which take a variable number of arguments. +* [ANSI] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_STDARG +#define _INC_STDARG + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +/* + * Currently, all MS C compilers for Win32 platforms default to 8 byte + * alignment. + */ +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + + + +#ifndef _VA_LIST_DEFINED +#ifdef _M_ALPHA +typedef struct { + char *a0; /* pointer to first homed integer argument */ + int offset; /* byte offset of next parameter */ +} va_list; +#else +typedef char * va_list; +#endif +#define _VA_LIST_DEFINED +#endif + +#ifdef _M_IX86 + + +#define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) ) + +#define va_start(ap,v) ( ap = (va_list)&v + _INTSIZEOF(v) ) +#define va_arg(ap,t) ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) ) +#define va_end(ap) ( ap = (va_list)0 ) + +#elif defined(_M_MRX000) + + +/* Use these types and definitions if generating code for MIPS */ + +#define va_start(ap,v) ap = (va_list)&v + sizeof(v) +#define va_end(list) +#define va_arg(list, mode) ((mode *)(list =\ + (char *) ((((int)list + (__builtin_alignof(mode)<=4?3:7)) &\ + (__builtin_alignof(mode)<=4?-4:-8))+sizeof(mode))))[-1] + +/* +++++++++++++++++++++++++++++++++++++++++++ + Because of parameter passing conventions in C: + use mode=int for char, and short types + use mode=double for float types + use a pointer for array types + +++++++++++++++++++++++++++++++++++++++++++ */ + + +#elif defined(_M_ALPHA) + + +/* Use these types and definitions if generating code for ALPHA */ + +/* + * The Alpha compiler supports two builtin functions that are used to + * implement stdarg/varargs. The __builtin_va_start function is used + * by va_start to initialize the data structure that locates the next + * argument. The __builtin_isfloat function is used by va_arg to pick + * which part of the home area a given register argument is stored in. + * The home area is where up to six integer and/or six floating point + * register arguments are stored down (so they can also be referenced + * by a pointer like any arguments passed on the stack). + */ + +extern void * __builtin_va_start(va_list, ...); + +#ifdef _CFRONT +#define __builtin_isfloat(a) __builtin_alignof(a) +#endif + +#define va_start(list, v) __builtin_va_start(list, v, 1) +#define va_end(list) +#define va_arg(list, mode) \ + ( *( ((list).offset += ((int)sizeof(mode) + 7) & -8) , \ + (mode *)((list).a0 + (list).offset - \ + ((__builtin_isfloat(mode) && (list).offset <= (6 * 8)) ? \ + (6 * 8) + 8 : ((int)sizeof(mode) + 7) & -8) \ + ) \ + ) \ + ) + +#elif defined(_M_PPC) + +/* Microsoft C8 front end (used in Motorola Merged compiler) */ +/* bytes that a type occupies in the argument list */ +#define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) ) +/* return 'ap' adjusted for type 't' in arglist */ +#define _ALIGNIT(ap,t) \ + ((((int)(ap))+(sizeof(t)<8?3:7)) & (sizeof(t)<8?~3:~7)) + +#define va_start(ap,v) ( ap = (va_list)&v + _INTSIZEOF(v) ) +#define va_arg(ap,t) ( *(t *)((ap = (char *) (_ALIGNIT(ap, t) + _INTSIZEOF(t))) - _INTSIZEOF(t)) ) +#define va_end(ap) ( ap = (va_list)0 ) + +#elif defined(_M_M68K) +#define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) ) + +#define va_start(ap,v) ( ap = (va_list)&v + (sizeof(v) < sizeof(int) ? sizeof(v) : _INTSIZEOF(v)) ) +#define va_arg(ap,t) ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) ) +#define va_end(ap) ( ap = (va_list)0 ) + +#elif defined(_M_MPPC) +#define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) ) + +#define va_start(ap,v) ( ap = (va_list)&v + _INTSIZEOF(v) ) +#define va_arg(ap,t) ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) ) +#define va_end(ap) ( ap = (va_list)0 ) + +#else + +/* A guess at the proper definitions for other platforms */ + +#define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) ) + +#define va_start(ap,v) ( ap = (va_list)&v + _INTSIZEOF(v) ) +#define va_arg(ap,t) ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) ) +#define va_end(ap) ( ap = (va_list)0 ) + + +#endif + + +#ifdef __cplusplus +} +#endif + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_STDARG */ diff --git a/public/sdk/inc/crt/stddef.h b/public/sdk/inc/crt/stddef.h new file mode 100644 index 000000000..2bdc4e956 --- /dev/null +++ b/public/sdk/inc/crt/stddef.h @@ -0,0 +1,133 @@ +/*** +*stddef.h - definitions/declarations for common constants, types, variables +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file contains definitions and declarations for some commonly +* used constants, types, and variables. +* [ANSI] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_STDDEF +#define _INC_STDDEF + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +/* Define NULL pointer value and the offset() macro */ + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + + +#define offsetof(s,m) (size_t)&(((s *)0)->m) + + +/* Declare reference to errno */ + +#if (defined(_MT) || defined(_DLL)) && (!defined(_M_MPPC) && !defined(_M_M68K)) +_CRTIMP extern int * __cdecl _errno(void); +#define errno (*_errno()) +#else /* ndef _MT && ndef _DLL */ +_CRTIMP extern int errno; +#endif /* _MT || _DLL */ + + +/* define the implementation dependent size types */ + +#ifndef _PTRDIFF_T_DEFINED +typedef int ptrdiff_t; +#define _PTRDIFF_T_DEFINED +#endif + + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#define _SIZE_T_DEFINED +#endif + + +#ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif + + +#ifdef _MT +_CRTIMP extern unsigned long __cdecl __threadid(void); +#define _threadid (__threadid()) +_CRTIMP extern unsigned long __cdecl __threadhandle(void); +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _INC_STDDEF */ diff --git a/public/sdk/inc/crt/stdexcpt.h b/public/sdk/inc/crt/stdexcpt.h new file mode 100644 index 000000000..4817c0adb --- /dev/null +++ b/public/sdk/inc/crt/stdexcpt.h @@ -0,0 +1,90 @@ +/*** +*stdexcpt.h - User include file for standard exception classes +* +* Copyright (c) 1994-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file presents an interface to the standard exception classes, +* as specified by the ANSI X3J16/ISO SC22/WG21 Working Paper for +* Draft C++, May 1994. +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_STDEXCPT +#define _INC_STDEXCPT + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#define _SIZE_T_DEFINED +#endif + + +// +// Standard exception class heirarchy (ref. 1/94 WP 17.3.2.1, as ammended 3/94). +// +// exception (formerly xmsg) +// logic +// domain +// runtime +// range +// alloc +// xalloc +// +// Updated as per May'94 Working Paper + +typedef const char *__exString; + +class _CRTIMP exception +{ +public: + exception(); + exception(const __exString&); + exception(const exception&); + exception& operator= (const exception&); + virtual ~exception(); + virtual __exString what() const; +private: + __exString _m_what; + int _m_doFree; +}; + +#ifdef __RTTI_OLDNAMES +typedef exception xmsg; // A synonym for folks using older standard +#endif + +// +// logic_error +// +class _CRTIMP logic_error: public exception +{ +public: + logic_error (const __exString& _what_arg) : exception(_what_arg) {} +}; + +#endif /* _INC_STDEXCPT */ + diff --git a/public/sdk/inc/crt/stdio.h b/public/sdk/inc/crt/stdio.h new file mode 100644 index 000000000..36c2db9ac --- /dev/null +++ b/public/sdk/inc/crt/stdio.h @@ -0,0 +1,528 @@ +/*** +*stdio.h - definitions/declarations for standard I/O routines +* +* Copyright (c) 1985-1996, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the structures, values, macros, and functions +* used by the level 2 I/O ("standard I/O") routines. +* [ANSI/System V] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_STDIO +#define _INC_STDIO + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +/* + * Currently, all MS C compilers for Win32 platforms default to 8 byte + * alignment. + */ +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#define _SIZE_T_DEFINED +#endif + + +#ifndef _MAC +#ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif + + +#ifndef _WCTYPE_T_DEFINED +typedef wchar_t wint_t; +typedef wchar_t wctype_t; +#define _WCTYPE_T_DEFINED +#endif +#endif /* ndef _MAC */ + + +#ifndef _VA_LIST_DEFINED +#ifdef _M_ALPHA +typedef struct { + char *a0; /* pointer to first homed integer argument */ + int offset; /* byte offset of next parameter */ +} va_list; +#else +typedef char * va_list; +#endif +#define _VA_LIST_DEFINED +#endif + + +/* Buffered I/O macros */ + +#if defined(_M_MPPC) +#define BUFSIZ 4096 +#else /* defined (_M_MPPC) */ +#define BUFSIZ 512 +#endif /* defined (_M_MPPC) */ + + +/* + * Default number of supported streams. _NFILE is confusing and obsolete, but + * supported anyway for backwards compatibility. + */ +#define _NFILE _NSTREAM_ + +#ifdef _WIN32 + +#define _NSTREAM_ 512 + +/* + * Number of entries in _iob[] (declared below). Note that _NSTREAM_ must be + * greater than or equal to _IOB_ENTRIES. + */ +#define _IOB_ENTRIES 20 + +#else /* ndef _WIN32 */ + +#ifdef _DLL +#define _NSTREAM_ 128 +#else +#ifdef _MT +#define _NSTREAM_ 40 +#else +#define _NSTREAM_ 20 +#endif +#endif /* _DLL */ + +#endif /* ndef _MAC */ + +#define EOF (-1) + + +#ifndef _FILE_DEFINED +struct _iobuf { + char *_ptr; + int _cnt; + char *_base; + int _flag; + int _file; + int _charbuf; + int _bufsiz; + char *_tmpfname; + }; +typedef struct _iobuf FILE; +#define _FILE_DEFINED +#endif + +#if !defined(_M_MPPC) && !defined(_M_M68K) + +/* Directory where temporary files may be created. */ + +#ifdef _POSIX_ +#define _P_tmpdir "/" +#define _wP_tmpdir L"/" +#else +#define _P_tmpdir "\\" +#define _wP_tmpdir L"\\" +#endif + + +/* L_tmpnam = size of P_tmpdir + * + 1 (in case P_tmpdir does not end in "/") + * + 12 (for the filename string) + * + 1 (for the null terminator) + */ +#define L_tmpnam sizeof(_P_tmpdir)+12 +#else /* defined(_M_M68K) || defined(_M_MPPC) */ +#define L_tmpnam 255 +#endif /* !defined(_M_M68K) && defined(_M_MPPC) */ + + +#ifdef _POSIX_ +#define L_ctermid 9 +#define L_cuserid 32 +#endif + + +/* Seek method constants */ + +#define SEEK_CUR 1 +#define SEEK_END 2 +#define SEEK_SET 0 + + +#define FILENAME_MAX 260 +#define FOPEN_MAX 20 +#define _SYS_OPEN 20 +#define TMP_MAX 32767 + + +/* Define NULL pointer value */ + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + + +/* Declare _iob[] array */ + +#ifndef _STDIO_DEFINED + +#ifdef _NTSDK + +#ifdef _DLL +extern FILE * _iob; +#else +extern FILE _iob[]; +#endif + +#else /* ndef _NTSDK */ + +#if defined(_DLL) && defined(_M_IX86) + +#define _iob (__p__iob()) +_CRTIMP extern FILE * __cdecl __p__iob(void); + +#else /* !(defined(_DLL) && defined(_M_IX86)) */ + +_CRTIMP extern FILE _iob[]; + +#endif /* defined(_DLL) && defined(_M_IX86) */ + +#endif /* _NTSDK */ + +#endif /* _STDIO_DEFINED */ + + +/* Define file position type */ + +#ifndef _FPOS_T_DEFINED + +#if defined(_M_MPPC) || defined(_M_M68K) || defined(_POSIX_) + +typedef long fpos_t; + +#else /* !defined(_M_MPPC) && !defined(_M_M68K) */ + +#if !__STDC__ && _INTEGRAL_MAX_BITS >= 64 +typedef __int64 fpos_t; +#else +typedef struct fpos_t { + unsigned int lopart; + int hipart; + } fpos_t; +#endif + +#endif /* defined(_M_MPPC) || defined(_M_68K) */ + +#define _FPOS_T_DEFINED +#endif + + +#define stdin (&_iob[0]) +#define stdout (&_iob[1]) +#define stderr (&_iob[2]) + + +#define _IOREAD 0x0001 +#define _IOWRT 0x0002 + +#define _IOFBF 0x0000 +#define _IOLBF 0x0040 +#define _IONBF 0x0004 + +#define _IOMYBUF 0x0008 +#define _IOEOF 0x0010 +#define _IOERR 0x0020 +#define _IOSTRG 0x0040 +#define _IORW 0x0080 +#ifdef _POSIX_ +#define _IOAPPEND 0x0200 +#endif + + +/* Function prototypes */ + +#ifndef _STDIO_DEFINED + +_CRTIMP int __cdecl _filbuf(FILE *); +_CRTIMP int __cdecl _flsbuf(int, FILE *); + +#ifdef _POSIX_ +_CRTIMP FILE * __cdecl _fsopen(const char *, const char *); +#else +_CRTIMP FILE * __cdecl _fsopen(const char *, const char *, int); +#endif + +_CRTIMP void __cdecl clearerr(FILE *); +_CRTIMP int __cdecl fclose(FILE *); +_CRTIMP int __cdecl _fcloseall(void); + +#ifdef _POSIX_ +_CRTIMP FILE * __cdecl fdopen(int, const char *); +#else +_CRTIMP FILE * __cdecl _fdopen(int, const char *); +#endif + +_CRTIMP int __cdecl feof(FILE *); +_CRTIMP int __cdecl ferror(FILE *); +_CRTIMP int __cdecl fflush(FILE *); +_CRTIMP int __cdecl fgetc(FILE *); +_CRTIMP int __cdecl _fgetchar(void); +_CRTIMP int __cdecl fgetpos(FILE *, fpos_t *); +_CRTIMP char * __cdecl fgets(char *, int, FILE *); + +#ifdef _POSIX_ +_CRTIMP int __cdecl fileno(FILE *); +#else +_CRTIMP int __cdecl _fileno(FILE *); +#endif + +_CRTIMP int __cdecl _flushall(void); +_CRTIMP FILE * __cdecl fopen(const char *, const char *); +_CRTIMP int __cdecl fprintf(FILE *, const char *, ...); +_CRTIMP int __cdecl fputc(int, FILE *); +_CRTIMP int __cdecl _fputchar(int); +_CRTIMP int __cdecl fputs(const char *, FILE *); +_CRTIMP size_t __cdecl fread(void *, size_t, size_t, FILE *); +_CRTIMP FILE * __cdecl freopen(const char *, const char *, FILE *); +_CRTIMP int __cdecl fscanf(FILE *, const char *, ...); +_CRTIMP int __cdecl fsetpos(FILE *, const fpos_t *); +_CRTIMP int __cdecl fseek(FILE *, long, int); +_CRTIMP long __cdecl ftell(FILE *); +_CRTIMP size_t __cdecl fwrite(const void *, size_t, size_t, FILE *); +_CRTIMP int __cdecl getc(FILE *); +_CRTIMP int __cdecl getchar(void); +_CRTIMP int __cdecl _getmaxstdio(void); +_CRTIMP char * __cdecl gets(char *); +_CRTIMP int __cdecl _getw(FILE *); +_CRTIMP void __cdecl perror(const char *); +_CRTIMP int __cdecl _pclose(FILE *); +_CRTIMP FILE * __cdecl _popen(const char *, const char *); +_CRTIMP int __cdecl printf(const char *, ...); +_CRTIMP int __cdecl putc(int, FILE *); +_CRTIMP int __cdecl putchar(int); +_CRTIMP int __cdecl puts(const char *); +_CRTIMP int __cdecl _putw(int, FILE *); +_CRTIMP int __cdecl remove(const char *); +_CRTIMP int __cdecl rename(const char *, const char *); +_CRTIMP void __cdecl rewind(FILE *); +_CRTIMP int __cdecl _rmtmp(void); +_CRTIMP int __cdecl scanf(const char *, ...); +_CRTIMP void __cdecl setbuf(FILE *, char *); +_CRTIMP int __cdecl _setmaxstdio(int); +_CRTIMP int __cdecl setvbuf(FILE *, char *, int, size_t); +_CRTIMP int __cdecl _snprintf(char *, size_t, const char *, ...); +_CRTIMP int __cdecl sprintf(char *, const char *, ...); +_CRTIMP int __cdecl sscanf(const char *, const char *, ...); +_CRTIMP char * __cdecl _tempnam(const char *, const char *); +_CRTIMP FILE * __cdecl tmpfile(void); +_CRTIMP char * __cdecl tmpnam(char *); +_CRTIMP int __cdecl ungetc(int, FILE *); +_CRTIMP int __cdecl _unlink(const char *); +_CRTIMP int __cdecl vfprintf(FILE *, const char *, va_list); +_CRTIMP int __cdecl vprintf(const char *, va_list); +_CRTIMP int __cdecl _vsnprintf(char *, size_t, const char *, va_list); +_CRTIMP int __cdecl vsprintf(char *, const char *, va_list); + +#ifndef _MAC +#ifndef _WSTDIO_DEFINED + +/* wide function prototypes, also declared in wchar.h */ + +#ifndef WEOF +#define WEOF (wint_t)(0xFFFF) +#endif + +#ifdef _POSIX_ +_CRTIMP FILE * __cdecl _wfsopen(const wchar_t *, const wchar_t *); +#else +_CRTIMP FILE * __cdecl _wfsopen(const wchar_t *, const wchar_t *, int); +#endif + +_CRTIMP wint_t __cdecl fgetwc(FILE *); +_CRTIMP wint_t __cdecl _fgetwchar(void); +_CRTIMP wint_t __cdecl fputwc(wint_t, FILE *); +_CRTIMP wint_t __cdecl _fputwchar(wint_t); +_CRTIMP wint_t __cdecl getwc(FILE *); +_CRTIMP wint_t __cdecl getwchar(void); +_CRTIMP wint_t __cdecl putwc(wint_t, FILE *); +_CRTIMP wint_t __cdecl putwchar(wint_t); +_CRTIMP wint_t __cdecl ungetwc(wint_t, FILE *); + +_CRTIMP wchar_t * __cdecl fgetws(wchar_t *, int, FILE *); +_CRTIMP int __cdecl fputws(const wchar_t *, FILE *); +_CRTIMP wchar_t * __cdecl _getws(wchar_t *); +_CRTIMP int __cdecl _putws(const wchar_t *); + +_CRTIMP int __cdecl fwprintf(FILE *, const wchar_t *, ...); +_CRTIMP int __cdecl wprintf(const wchar_t *, ...); +_CRTIMP int __cdecl _snwprintf(wchar_t *, size_t, const wchar_t *, ...); +_CRTIMP int __cdecl swprintf(wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl vfwprintf(FILE *, const wchar_t *, va_list); +_CRTIMP int __cdecl vwprintf(const wchar_t *, va_list); +_CRTIMP int __cdecl _vsnwprintf(wchar_t *, size_t, const wchar_t *, va_list); +_CRTIMP int __cdecl vswprintf(wchar_t *, const wchar_t *, va_list); +_CRTIMP int __cdecl fwscanf(FILE *, const wchar_t *, ...); +_CRTIMP int __cdecl swscanf(const wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl wscanf(const wchar_t *, ...); + +#define getwchar() fgetwc(stdin) +#define putwchar(_c) fputwc((_c),stdout) +#define getwc(_stm) fgetwc(_stm) +#define putwc(_c,_stm) fputwc(_c,_stm) + +_CRTIMP FILE * __cdecl _wfdopen(int, const wchar_t *); +_CRTIMP FILE * __cdecl _wfopen(const wchar_t *, const wchar_t *); +_CRTIMP FILE * __cdecl _wfreopen(const wchar_t *, const wchar_t *, FILE *); +_CRTIMP void __cdecl _wperror(const wchar_t *); +_CRTIMP FILE * __cdecl _wpopen(const wchar_t *, const wchar_t *); +_CRTIMP int __cdecl _wremove(const wchar_t *); +_CRTIMP wchar_t * __cdecl _wtempnam(const wchar_t *, const wchar_t *); +_CRTIMP wchar_t * __cdecl _wtmpnam(wchar_t *); + + +#define _WSTDIO_DEFINED +#endif /* _WSTDIO_DEFINED */ +#endif /* ndef _MAC */ + +#define _STDIO_DEFINED +#endif /* _STDIO_DEFINED */ + + +/* Macro definitions */ + +#define feof(_stream) ((_stream)->_flag & _IOEOF) +#define ferror(_stream) ((_stream)->_flag & _IOERR) +#define _fileno(_stream) ((_stream)->_file) +#define getc(_stream) (--(_stream)->_cnt >= 0 \ + ? 0xff & *(_stream)->_ptr++ : _filbuf(_stream)) +#define putc(_c,_stream) (--(_stream)->_cnt >= 0 \ + ? 0xff & (*(_stream)->_ptr++ = (char)(_c)) : _flsbuf((_c),(_stream))) +#define getchar() getc(stdin) +#define putchar(_c) putc((_c),stdout) + + + +#ifdef _MT +#undef getc +#undef putc +#undef getchar +#undef putchar +#endif + + + +#if !__STDC__ && !defined(_POSIX_) + +/* Non-ANSI names for compatibility */ + +#define P_tmpdir _P_tmpdir +#define SYS_OPEN _SYS_OPEN + +#ifdef _NTSDK + +#define fcloseall _fcloseall +#define fdopen _fdopen +#define fgetchar _fgetchar +#define fileno _fileno +#define flushall _flushall +#define fputchar _fputchar +#define getw _getw +#define putw _putw +#define rmtmp _rmtmp +#define tempnam _tempnam +#define unlink _unlink + +#else /* ndef _NTSDK */ + +_CRTIMP int __cdecl fcloseall(void); +_CRTIMP FILE * __cdecl fdopen(int, const char *); +_CRTIMP int __cdecl fgetchar(void); +_CRTIMP int __cdecl fileno(FILE *); +_CRTIMP int __cdecl flushall(void); +_CRTIMP int __cdecl fputchar(int); +_CRTIMP int __cdecl getw(FILE *); +_CRTIMP int __cdecl putw(int, FILE *); +_CRTIMP int __cdecl rmtmp(void); +_CRTIMP char * __cdecl tempnam(const char *, const char *); +_CRTIMP int __cdecl unlink(const char *); + +#endif /* _NTSDK */ + +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_STDIO */ diff --git a/public/sdk/inc/crt/stdiostr.h b/public/sdk/inc/crt/stdiostr.h new file mode 100644 index 000000000..05d5bced6 --- /dev/null +++ b/public/sdk/inc/crt/stdiostr.h @@ -0,0 +1,94 @@ +/*** +*stdiostr.h - definitions/declarations for stdiobuf, stdiostream +* +* Copyright (c) 1991-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the classes, values, macros, and functions +* used by the stdiostream and stdiobuf classes. +* [AT&T C++] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifdef __cplusplus + +#ifndef _INC_STDIOSTREAM +#define _INC_STDIOSTREAM + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +// Currently, all MS C compilers for Win32 platforms default to 8 byte +// alignment. +#pragma pack(push,8) +#endif // _MSC_VER + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + +#include <iostream.h> +#include <stdio.h> + +#ifdef _MSC_VER +#pragma warning(disable:4514) // disable unwanted /W4 warning +// #pragma warning(default:4514) // use this to reenable, if necessary +#endif // _MSC_VER + +class _CRTIMP stdiobuf : public streambuf { +public: + stdiobuf(FILE* f); +FILE * stdiofile() { return _str; } + +virtual int pbackfail(int c); +virtual int overflow(int c = EOF); +virtual int underflow(); +virtual streampos seekoff( streamoff, ios::seek_dir, int =ios::in|ios::out); +virtual int sync(); + ~stdiobuf(); + int setrwbuf(int _rsize, int _wsize); +// protected: +// virtual int doallocate(); +private: + FILE * _str; +}; + +// obsolescent +class _CRTIMP stdiostream : public iostream { // note: spec.'d as : public IOS... +public: + stdiostream(FILE *); + ~stdiostream(); + stdiobuf* rdbuf() const { return (stdiobuf*) ostream::rdbuf(); } + +private: +}; + +#ifdef _MSC_VER +// Restore default packing +#pragma pack(pop) +#endif // _MSC_VER + +#endif // _INC_STDIOSTREAM + +#endif /* __cplusplus */ diff --git a/public/sdk/inc/crt/stdlib.h b/public/sdk/inc/crt/stdlib.h new file mode 100644 index 000000000..64da4306e --- /dev/null +++ b/public/sdk/inc/crt/stdlib.h @@ -0,0 +1,600 @@ +/*** +*stdlib.h - declarations/definitions for commonly used library functions +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This include file contains the function declarations for commonly +* used library functions which either don't fit somewhere else, or, +* cannot be declared in the normal place for other reasons. +* [ANSI] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_STDLIB +#define _INC_STDLIB + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +/* + * Currently, all MS C compilers for Win32 platforms default to 8 byte + * alignment. + */ +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#define _SIZE_T_DEFINED +#endif + + +#ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif + + +/* Define NULL pointer value */ + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + + +/* Definition of the argument values for the exit() function */ + +#define EXIT_SUCCESS 0 +#define EXIT_FAILURE 1 + + +#ifndef _ONEXIT_T_DEFINED +typedef int (__cdecl * _onexit_t)(void); +#if !__STDC__ +/* Non-ANSI name for compatibility */ +#define onexit_t _onexit_t +#endif +#define _ONEXIT_T_DEFINED +#endif + + +/* Data structure definitions for div and ldiv runtimes. */ + +#ifndef _DIV_T_DEFINED + +typedef struct _div_t { + int quot; + int rem; +} div_t; + +typedef struct _ldiv_t { + long quot; + long rem; +} ldiv_t; + +#define _DIV_T_DEFINED +#endif + +/* Maximum value that can be returned by the rand function. */ + +#define RAND_MAX 0x7fff + +/* + * Maximum number of bytes in multi-byte character in the current locale + * (also defined in ctype.h). + */ +#ifndef MB_CUR_MAX + +#ifdef _NTSDK + +/* definition compatible with NT SDK */ +#ifdef _DLL +#define __mb_cur_max (*__mb_cur_max_dll) +#define MB_CUR_MAX (*__mb_cur_max_dll) +extern int *__mb_cur_max_dll; +#else /* ndef _DLL */ +#define MB_CUR_MAX __mb_cur_max +extern int __mb_cur_max; +#endif /* _DLL */ + +#else /* ndef _NTSDK */ + +/* current definition */ +#if defined(_DLL) && defined(_M_IX86) +#define MB_CUR_MAX (*__p___mb_cur_max()) +_CRTIMP int * __cdecl __p___mb_cur_max(void); +#else /* !(defined(_DLL) && defined(_M_IX86)) */ +#define MB_CUR_MAX __mb_cur_max +_CRTIMP extern int __mb_cur_max; +#endif /* defined(_DLL) && defined(_M_IX86) */ + +#endif /* _NTSDK */ + +#endif /* MB_CUR_MAX */ + + +/* Minimum and maximum macros */ + +#define __max(a,b) (((a) > (b)) ? (a) : (b)) +#define __min(a,b) (((a) < (b)) ? (a) : (b)) + +/* + * Sizes for buffers used by the _makepath() and _splitpath() functions. + * note that the sizes include space for 0-terminator + */ +#if !defined(_M_MPPC) && !defined(_M_M68K) +#define _MAX_PATH 260 /* max. length of full pathname */ +#define _MAX_DRIVE 3 /* max. length of drive component */ +#define _MAX_DIR 256 /* max. length of path component */ +#define _MAX_FNAME 256 /* max. length of file name component */ +#define _MAX_EXT 256 /* max. length of extension component */ +#else /* defined(_M_M68K) || defined(_M_MPPC) */ +#define _MAX_PATH 256 /* max. length of full pathname */ +#define _MAX_DIR 32 /* max. length of path component */ +#define _MAX_FNAME 64 /* max. length of file name component */ +#endif /* defined(_M_M68K) || defined(_M_MPPC) */ + +/* + * Argument values for _set_error_mode(). + */ +#define _OUT_TO_DEFAULT 0 +#define _OUT_TO_STDERR 1 +#define _OUT_TO_MSGBOX 2 +#define _REPORT_ERRMODE 3 + +/* External variable declarations */ + +#if (defined(_MT) || defined(_DLL)) && (!defined(_M_MPPC) && !defined(_M_M68K)) +_CRTIMP int * __cdecl _errno(void); +_CRTIMP unsigned long * __cdecl __doserrno(void); +#define errno (*_errno()) +#define _doserrno (*__doserrno()) +#else /* ndef _MT && ndef _DLL */ +_CRTIMP extern int errno; /* XENIX style error number */ +_CRTIMP extern unsigned long _doserrno; /* OS system error value */ +#endif /* _MT || _DLL */ + +#if defined(_M_MPPC) || defined(_M_M68K) +_CRTIMP extern int _macerrno; /* OS system error value */ +#endif + +#ifdef _NTSDK + +/* Definitions and declarations compatible with the NT SDK */ + +#ifdef _DLL + +extern char ** _sys_errlist; /* perror error message table */ + +#define _sys_nerr (*_sys_nerr_dll) +#define __argc (*__argc_dll) +#define __argv (*__argv_dll) +#ifndef _MAC +#define __wargv (*__wargv_dll) +#endif /* ndef _MAC */ +#define _environ (*_environ_dll) +#ifndef _MAC +#define _wenviron (*_wenviron_dll) +#endif /* ndef _MAC */ +#define _fmode (*_fmode_dll) +#define _fileinfo (*_fileinfo_dll) + +extern int * _sys_nerr_dll; /* # of entries in sys_errlist table */ +extern int * __argc_dll; /* count of cmd line args */ +extern char *** __argv_dll; /* pointer to table of cmd line args */ +#ifndef _MAC +extern wchar_t *** __wargv_dll; /* pointer to table of wide cmd line args */ +#endif /* ndef _MAC */ +extern char *** _environ_dll; /* pointer to environment table */ +#ifndef _MAC +extern wchar_t *** _wenviron_dll; /* pointer to wide environment table */ +#endif /* ndef _MAC */ +extern int * _fmode_dll; /* default file translation mode */ +extern int * _fileinfo_dll; /* open file info mode (for spawn) */ + +#define _pgmptr (*_pgmptr_dll) +#ifndef _MAC +#define _wpgmptr (*_wpgmptr_dll) +#endif /* ndef _MAC */ + +#define _osver (*_osver_dll) +#define _winver (*_winver_dll) +#define _winmajor (*_winmajor_dll) +#define _winminor (*_winminor_dll) + +extern char ** _pgmptr_dll; +#ifndef _MAC +extern wchar_t ** _wpgmptr_dll; +#endif /* ndef _MAC */ + +extern unsigned int * _osver_dll; +extern unsigned int * _winver_dll; +extern unsigned int * _winmajor_dll; +extern unsigned int * _winminor_dll; + +#else /* ndef _DLL */ + + +extern char * _sys_errlist[]; /* perror error message table */ +extern int _sys_nerr; /* # of entries in sys_errlist table */ + +extern int __argc; /* count of cmd line args */ +extern char ** __argv; /* pointer to table of cmd line args */ +#ifndef _MAC +extern wchar_t ** __wargv; /* pointer to table of wide cmd line args */ +#endif /* ndef _MAC */ + +#ifdef _POSIX_ +extern char ** environ; /* pointer to environment table */ +#else +extern char ** _environ; /* pointer to environment table */ +#ifndef _MAC +extern wchar_t ** _wenviron; /* pointer to wide environment table */ +#endif /* ndef _MAC */ +#endif + +extern int _fmode; /* default file translation mode */ +extern int _fileinfo; /* open file info mode (for spawn) */ + +extern char * _pgmptr; /* points to the module (EXE) name */ +#ifndef _MAC +extern wchar_t * _wpgmptr; /* points to the module (EXE) wide name */ +#endif /* ndef _MAC */ + +/* Windows major/minor and O.S. version numbers */ + +extern unsigned int _osver; +extern unsigned int _winver; +extern unsigned int _winmajor; +extern unsigned int _winminor; + +#endif /* _DLL */ + +#else /* ndef _NTSDK */ + +/* Current definitions and declarations */ + +_CRTIMP extern char * _sys_errlist[]; /* perror error message table */ +_CRTIMP extern int _sys_nerr; /* # of entries in sys_errlist table */ + +#if defined(_DLL) && defined(_M_IX86) + +#define __argc (*__p___argc()) /* count of cmd line args */ +#define __argv (*__p___argv()) /* pointer to table of cmd line args */ +#define __wargv (*__p___wargv()) /* pointer to table of wide cmd line args */ +#define _environ (*__p__environ()) /* pointer to environment table */ +#ifndef _MAC +#define _wenviron (*__p__wenviron()) /* pointer to wide environment table */ +#endif /* ndef _MAC */ +#define _fmode (*__p__fmode()) +#define _osver (*__p__osver()) +#define _pgmptr (*__p__pgmptr()) /* points to the module (EXE) name */ +#ifndef _MAC +#define _wpgmptr (*__p__wpgmptr()) /* points to the module (EXE) wide name */ +#endif /* ndef _MAC */ +#define _winver (*__p__winver()) +#define _winmajor (*__p__winmajor()) +#define _winminor (*__p__winminor()) + +_CRTIMP int * __cdecl __p___argc(void); +_CRTIMP char *** __cdecl __p___argv(void); +#ifndef _MAC +_CRTIMP wchar_t *** __cdecl __p___wargv(void); +#endif /* ndef _MAC */ +_CRTIMP char *** __cdecl __p__environ(void); +#ifndef _MAC +_CRTIMP wchar_t *** __cdecl __p__wenviron(void); +#endif /* ndef _MAC */ +_CRTIMP int * __cdecl __p__fmode(void); +_CRTIMP unsigned int * __cdecl __p__osver(void); +_CRTIMP char ** __cdecl __p__pgmptr(void); +#ifndef _MAC +_CRTIMP wchar_t ** __cdecl __p__wpgmptr(void); +#endif /* ndef _MAC */ +_CRTIMP unsigned int * __cdecl __p__winver(void); +_CRTIMP unsigned int * __cdecl __p__winmajor(void); +_CRTIMP unsigned int * __cdecl __p__winminor(void); + +#else /* !(defined(_DLL) && defined(_M_IX86)) */ +_CRTIMP extern int __argc; /* count of cmd line args */ +_CRTIMP extern char ** __argv; /* pointer to table of cmd line args */ +#ifndef _MAC +_CRTIMP extern wchar_t ** __wargv; /* pointer to table of wide cmd line args */ +#endif /* ndef _MAC */ + +_CRTIMP extern char ** _environ; /* pointer to environment table */ +#ifndef _MAC +_CRTIMP extern wchar_t ** _wenviron; /* pointer to wide environment table */ +#endif /* ndef _MAC */ + +_CRTIMP extern int _fmode; /* default file translation mode */ +_CRTIMP extern int _fileinfo; /* open file info mode (for spawn) */ + +_CRTIMP extern char * _pgmptr; /* points to the module (EXE) name */ +#ifndef _MAC +_CRTIMP extern wchar_t * _wpgmptr; /* points to the module (EXE) wide name */ +#endif /* ndef _MAC */ + +/* Windows major/minor and O.S. version numbers */ + +_CRTIMP extern unsigned int _osver; +_CRTIMP extern unsigned int _winver; +_CRTIMP extern unsigned int _winmajor; +_CRTIMP extern unsigned int _winminor; +#endif /* defined(_DLL) && defined(_M_IX86) */ + +#endif /* _NTSDK */ + +/* function prototypes */ + +_CRTIMP void __cdecl abort(void); +#if defined(_M_MRX000) +_CRTIMP int __cdecl abs(int); + +#else + int __cdecl abs(int); +#endif + int __cdecl atexit(void (__cdecl *)(void)); +_CRTIMP double __cdecl atof(const char *); +_CRTIMP int __cdecl atoi(const char *); +_CRTIMP long __cdecl atol(const char *); +#ifdef _M_M68K +_CRTIMP long double __cdecl _atold(const char *); +#endif +_CRTIMP void * __cdecl bsearch(const void *, const void *, size_t, size_t, + int (__cdecl *)(const void *, const void *)); +_CRTIMP void * __cdecl calloc(size_t, size_t); +_CRTIMP div_t __cdecl div(int, int); +_CRTIMP void __cdecl exit(int); +_CRTIMP void __cdecl free(void *); +_CRTIMP char * __cdecl getenv(const char *); +_CRTIMP char * __cdecl _itoa(int, char *, int); +#if defined(_M_MRX000) +_CRTIMP long __cdecl labs(long); +#else + long __cdecl labs(long); +#endif +_CRTIMP ldiv_t __cdecl ldiv(long, long); +_CRTIMP char * __cdecl _ltoa(long, char *, int); +_CRTIMP void * __cdecl malloc(size_t); +_CRTIMP int __cdecl mblen(const char *, size_t); +_CRTIMP size_t __cdecl _mbstrlen(const char *s); +_CRTIMP int __cdecl mbtowc(wchar_t *, const char *, size_t); +_CRTIMP size_t __cdecl mbstowcs(wchar_t *, const char *, size_t); +_CRTIMP void __cdecl qsort(void *, size_t, size_t, int (__cdecl *) + (const void *, const void *)); +_CRTIMP int __cdecl rand(void); +_CRTIMP void * __cdecl realloc(void *, size_t); +_CRTIMP int __cdecl _set_error_mode(int); +_CRTIMP void __cdecl srand(unsigned int); +_CRTIMP double __cdecl strtod(const char *, char **); +_CRTIMP long __cdecl strtol(const char *, char **, int); +#ifdef _M_M68K +_CRTIMP long double __cdecl _strtold(const char *, char **); +#endif +_CRTIMP unsigned long __cdecl strtoul(const char *, char **, int); +#if !defined(_M_MPPC) && !defined(_M_M68K) +_CRTIMP int __cdecl system(const char *); +#endif +_CRTIMP char * __cdecl _ultoa(unsigned long, char *, int); +_CRTIMP int __cdecl wctomb(char *, wchar_t); +_CRTIMP size_t __cdecl wcstombs(char *, const wchar_t *, size_t); + +#ifndef _MAC +#ifndef _WSTDLIB_DEFINED + +/* wide function prototypes, also declared in wchar.h */ + +_CRTIMP wchar_t * __cdecl _itow (int, wchar_t *, int); +_CRTIMP wchar_t * __cdecl _ltow (long, wchar_t *, int); +_CRTIMP wchar_t * __cdecl _ultow (unsigned long, wchar_t *, int); +_CRTIMP double __cdecl wcstod(const wchar_t *, wchar_t **); +_CRTIMP long __cdecl wcstol(const wchar_t *, wchar_t **, int); +_CRTIMP unsigned long __cdecl wcstoul(const wchar_t *, wchar_t **, int); +_CRTIMP wchar_t * __cdecl _wgetenv(const wchar_t *); +_CRTIMP int __cdecl _wsystem(const wchar_t *); +_CRTIMP int __cdecl _wtoi(const wchar_t *); +_CRTIMP long __cdecl _wtol(const wchar_t *); + +#define _WSTDLIB_DEFINED +#endif +#endif /* ndef _MAC */ + +#ifndef _POSIX_ + +_CRTIMP char * __cdecl _ecvt(double, int, int *, int *); +_CRTIMP void __cdecl _exit(int); +_CRTIMP char * __cdecl _fcvt(double, int, int *, int *); +_CRTIMP char * __cdecl _fullpath(char *, const char *, size_t); +_CRTIMP char * __cdecl _gcvt(double, int, char *); + unsigned long __cdecl _lrotl(unsigned long, int); + unsigned long __cdecl _lrotr(unsigned long, int); +#if !defined(_M_MPPC) && !defined(_M_M68K) +_CRTIMP void __cdecl _makepath(char *, const char *, const char *, const char *, + const char *); +#endif + _onexit_t __cdecl _onexit(_onexit_t); +_CRTIMP void __cdecl perror(const char *); +_CRTIMP int __cdecl _putenv(const char *); + unsigned int __cdecl _rotl(unsigned int, int); + unsigned int __cdecl _rotr(unsigned int, int); +_CRTIMP void __cdecl _searchenv(const char *, const char *, char *); +#if !defined(_M_MPPC) && !defined(_M_M68K) +_CRTIMP void __cdecl _splitpath(const char *, char *, char *, char *, char *); +#endif +_CRTIMP void __cdecl _swab(char *, char *, int); + +#ifndef _MAC +#ifndef _WSTDLIBP_DEFINED + +/* wide function prototypes, also declared in wchar.h */ + +_CRTIMP wchar_t * __cdecl _wfullpath(wchar_t *, const wchar_t *, size_t); +_CRTIMP void __cdecl _wmakepath(wchar_t *, const wchar_t *, const wchar_t *, const wchar_t *, + const wchar_t *); +_CRTIMP void __cdecl _wperror(const wchar_t *); +_CRTIMP int __cdecl _wputenv(const wchar_t *); +_CRTIMP void __cdecl _wsearchenv(const wchar_t *, const wchar_t *, wchar_t *); +_CRTIMP void __cdecl _wsplitpath(const wchar_t *, wchar_t *, wchar_t *, wchar_t *, wchar_t *); + +#define _WSTDLIBP_DEFINED +#endif +#endif /* ndef _MAC */ + +/* --------- The following functions are OBSOLETE --------- */ +/* The Win32 API SetErrorMode, Beep and Sleep should be used instead. */ +#if !defined(_M_MPPC) && !defined(_M_M68K) +_CRTIMP void __cdecl _seterrormode(int); +_CRTIMP void __cdecl _beep(unsigned, unsigned); +_CRTIMP void __cdecl _sleep(unsigned long); +#endif /* ndef defined(_M_M68K) || defined(_M_MPPC) */ +/* --------- The preceding functions are OBSOLETE --------- */ + +#endif /* _POSIX_ */ + +#if !__STDC__ +/* --------- The declarations below should not be in stdlib.h --------- */ +/* --------- and will be removed in a future release. Include --------- */ +/* --------- ctype.h to obtain these declarations. --------- */ +#ifndef tolower /* tolower has been undefined - use function */ +_CRTIMP int __cdecl tolower(int); +#endif /* tolower */ +#ifndef toupper /* toupper has been undefined - use function */ +_CRTIMP int __cdecl toupper(int); +#endif /* toupper */ +/* --------- The declarations above will be removed. --------- */ +#endif + + +#if !__STDC__ + +/* Non-ANSI names for compatibility */ + +#ifdef _NTSDK + +#ifndef _POSIX_ + +#ifndef __cplusplus +#define max(a,b) (((a) > (b)) ? (a) : (b)) +#define min(a,b) (((a) < (b)) ? (a) : (b)) +#endif + +#define sys_errlist _sys_errlist +#define sys_nerr _sys_nerr +#define environ _environ + +#define DOS_MODE _DOS_MODE +#define OS2_MODE _OS2_MODE + +#define ecvt _ecvt +#define fcvt _fcvt +#define gcvt _gcvt +#define itoa _itoa +#define ltoa _ltoa +#define onexit _onexit +#define putenv _putenv +#define swab _swab +#define ultoa _ultoa + +#endif /* _POSIX_ */ + +#else /* ndef _NTSDK */ + +#ifndef __cplusplus +#define max(a,b) (((a) > (b)) ? (a) : (b)) +#define min(a,b) (((a) < (b)) ? (a) : (b)) +#endif + +#define sys_errlist _sys_errlist +#define sys_nerr _sys_nerr +#define environ _environ + +_CRTIMP char * __cdecl ecvt(double, int, int *, int *); +_CRTIMP char * __cdecl fcvt(double, int, int *, int *); +_CRTIMP char * __cdecl gcvt(double, int, char *); +_CRTIMP char * __cdecl itoa(int, char *, int); +_CRTIMP char * __cdecl ltoa(long, char *, int); + onexit_t __cdecl onexit(onexit_t); +_CRTIMP int __cdecl putenv(const char *); +_CRTIMP void __cdecl swab(char *, char *, int); +_CRTIMP char * __cdecl ultoa(unsigned long, char *, int); + +#endif /* _NTSDK */ + +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_STDLIB */ diff --git a/public/sdk/inc/crt/streamb.h b/public/sdk/inc/crt/streamb.h new file mode 100644 index 000000000..a25040ab9 --- /dev/null +++ b/public/sdk/inc/crt/streamb.h @@ -0,0 +1,194 @@ +/*** +*streamb.h - definitions/declarations for the streambuf class +* +* Copyright (c) 1990-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the classes, values, macros, and functions +* used by the streambuf class. +* [AT&T C++] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifdef __cplusplus + +#ifndef _INC_STREAMB +#define _INC_STREAMB + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +// Currently, all MS C compilers for Win32 platforms default to 8 byte +// alignment. +#pragma pack(push,8) +#endif // _MSC_VER + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +#include <ios.h> // need ios::seek_dir definition + +#ifndef NULL +#define NULL 0 +#endif + +#ifndef EOF +#define EOF (-1) +#endif + +#ifdef _MSC_VER +// C4514: "unreferenced inline function has been removed" +#pragma warning(disable:4514) // disable C4514 warning +// #pragma warning(default:4514) // use this to reenable, if desired +#endif // _MSC_VER + +typedef long streampos, streamoff; + +class _CRTIMP ios; + +class _CRTIMP streambuf { +public: + + virtual ~streambuf(); + + inline int in_avail() const; + inline int out_waiting() const; + int sgetc(); + int snextc(); + int sbumpc(); + void stossc(); + + inline int sputbackc(char); + + inline int sputc(int); + inline int sputn(const char *,int); + inline int sgetn(char *,int); + + virtual int sync(); + + virtual streambuf* setbuf(char *, int); + virtual streampos seekoff(streamoff,ios::seek_dir,int =ios::in|ios::out); + virtual streampos seekpos(streampos,int =ios::in|ios::out); + + virtual int xsputn(const char *,int); + virtual int xsgetn(char *,int); + + virtual int overflow(int =EOF) = 0; // pure virtual function + virtual int underflow() = 0; // pure virtual function + + virtual int pbackfail(int); + + void dbp(); + +#ifdef _MT + void setlock() { LockFlg--; } // <0 indicates lock required; + void clrlock() { if (LockFlg <= 0) LockFlg++; } + void lock() { if (LockFlg<0) _mtlock(lockptr()); }; + void unlock() { if (LockFlg<0) _mtunlock(lockptr()); } +#else + void lock() { } + void unlock() { } +#endif + +protected: + streambuf(); + streambuf(char *,int); + + inline char * base() const; + inline char * ebuf() const; + inline char * pbase() const; + inline char * pptr() const; + inline char * epptr() const; + inline char * eback() const; + inline char * gptr() const; + inline char * egptr() const; + inline int blen() const; + inline void setp(char *,char *); + inline void setg(char *,char *,char *); + inline void pbump(int); + inline void gbump(int); + + void setb(char *,char *,int =0); + inline int unbuffered() const; + inline void unbuffered(int); + int allocate(); + virtual int doallocate(); +#ifdef _MT + _PCRT_CRITICAL_SECTION lockptr() { return & x_lock; } +#endif + +private: + int _fAlloc; + int _fUnbuf; + int x_lastc; + char * _base; + char * _ebuf; + char * _pbase; + char * _pptr; + char * _epptr; + char * _eback; + char * _gptr; + char * _egptr; +#ifdef _MT + int LockFlg; // <0 indicates locking required + _CRT_CRITICAL_SECTION x_lock; // lock needed only for multi-thread operation +#endif +}; + +inline int streambuf::in_avail() const { return (gptr()<_egptr) ? (_egptr-gptr()) : 0; } +inline int streambuf::out_waiting() const { return (_pptr>=_pbase) ? (_pptr-_pbase) : 0; } + +inline int streambuf::sputbackc(char _c){ return (_eback<gptr()) ? *(--_gptr)=_c : pbackfail(_c); } + +inline int streambuf::sputc(int _i){ return (_pptr<_epptr) ? (unsigned char)(*(_pptr++)=(char)_i) : overflow(_i); } + +inline int streambuf::sputn(const char * _str,int _n) { return xsputn(_str, _n); } +inline int streambuf::sgetn(char * _str,int _n) { return xsgetn(_str, _n); } + +inline char * streambuf::base() const { return _base; } +inline char * streambuf::ebuf() const { return _ebuf; } +inline int streambuf::blen() const {return ((_ebuf > _base) ? (_ebuf-_base) : 0); } +inline char * streambuf::pbase() const { return _pbase; } +inline char * streambuf::pptr() const { return _pptr; } +inline char * streambuf::epptr() const { return _epptr; } +inline char * streambuf::eback() const { return _eback; } +inline char * streambuf::gptr() const { return _gptr; } +inline char * streambuf::egptr() const { return _egptr; } +inline void streambuf::gbump(int _n) { if (_egptr) _gptr += _n; } +inline void streambuf::pbump(int _n) { if (_epptr) _pptr += _n; } +inline void streambuf::setg(char * _eb, char * _g, char * _eg) {_eback=_eb; _gptr=_g; _egptr=_eg; x_lastc=EOF; } +inline void streambuf::setp(char * _p, char * _ep) {_pptr=_pbase=_p; _epptr=_ep; } +inline int streambuf::unbuffered() const { return _fUnbuf; } +inline void streambuf::unbuffered(int _f) { _fUnbuf = _f; } + +#ifdef _MSC_VER +// Restore previous packing +#pragma pack(pop) +#endif // _MSC_VER + +#endif // _INC_STREAMB + +#endif /* __cplusplus */ diff --git a/public/sdk/inc/crt/string.h b/public/sdk/inc/crt/string.h new file mode 100644 index 000000000..2b36de99c --- /dev/null +++ b/public/sdk/inc/crt/string.h @@ -0,0 +1,292 @@ +/*** +*string.h - declarations for string manipulation functions +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file contains the function declarations for the string +* manipulation functions. +* [ANSI/System V] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_STRING +#define _INC_STRING + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#define _SIZE_T_DEFINED +#endif + + +#ifndef _MAC +#ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif +#endif /* ndef _MAC */ + +#ifndef _NLSCMP_DEFINED +#define _NLSCMPERROR 2147483647 /* currently == INT_MAX */ +#define _NLSCMP_DEFINED +#endif + +/* Define NULL pointer value */ + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + + +/* Function prototypes */ + +#ifdef _M_MRX000 +_CRTIMP void * __cdecl memcpy(void *, const void *, size_t); +_CRTIMP int __cdecl memcmp(const void *, const void *, size_t); +_CRTIMP void * __cdecl memset(void *, int, size_t); +_CRTIMP char * __cdecl _strset(char *, int); +_CRTIMP char * __cdecl strcpy(char *, const char *); +_CRTIMP char * __cdecl strcat(char *, const char *); +_CRTIMP int __cdecl strcmp(const char *, const char *); +_CRTIMP size_t __cdecl strlen(const char *); +#else + void * __cdecl memcpy(void *, const void *, size_t); + int __cdecl memcmp(const void *, const void *, size_t); + void * __cdecl memset(void *, int, size_t); + char * __cdecl _strset(char *, int); + char * __cdecl strcpy(char *, const char *); + char * __cdecl strcat(char *, const char *); + int __cdecl strcmp(const char *, const char *); + size_t __cdecl strlen(const char *); +#endif +_CRTIMP void * __cdecl _memccpy(void *, const void *, int, unsigned int); +_CRTIMP void * __cdecl memchr(const void *, int, size_t); +_CRTIMP int __cdecl _memicmp(const void *, const void *, unsigned int); + +#ifdef _M_ALPHA + /* memmove is available as an intrinsic in the Alpha compiler */ + void * __cdecl memmove(void *, const void *, size_t); +#else +_CRTIMP void * __cdecl memmove(void *, const void *, size_t); +#endif + + +_CRTIMP char * __cdecl strchr(const char *, int); +_CRTIMP int __cdecl _strcmpi(const char *, const char *); +_CRTIMP int __cdecl _stricmp(const char *, const char *); +_CRTIMP int __cdecl strcoll(const char *, const char *); +_CRTIMP int __cdecl _stricoll(const char *, const char *); +_CRTIMP int __cdecl _strncoll(const char *, const char *, size_t); +_CRTIMP int __cdecl _strnicoll(const char *, const char *, size_t); +_CRTIMP size_t __cdecl strcspn(const char *, const char *); +_CRTIMP char * __cdecl _strdup(const char *); +_CRTIMP char * __cdecl _strerror(const char *); +_CRTIMP char * __cdecl strerror(int); +_CRTIMP char * __cdecl _strlwr(char *); +_CRTIMP char * __cdecl strncat(char *, const char *, size_t); +_CRTIMP int __cdecl strncmp(const char *, const char *, size_t); +_CRTIMP int __cdecl _strnicmp(const char *, const char *, size_t); +_CRTIMP char * __cdecl strncpy(char *, const char *, size_t); +_CRTIMP char * __cdecl _strnset(char *, int, size_t); +_CRTIMP char * __cdecl strpbrk(const char *, const char *); +_CRTIMP char * __cdecl strrchr(const char *, int); +_CRTIMP char * __cdecl _strrev(char *); +_CRTIMP size_t __cdecl strspn(const char *, const char *); +_CRTIMP char * __cdecl strstr(const char *, const char *); +_CRTIMP char * __cdecl strtok(char *, const char *); +_CRTIMP char * __cdecl _strupr(char *); +_CRTIMP size_t __cdecl strxfrm (char *, const char *, size_t); + +#if defined(_M_MPPC) || defined(_M_M68K) +unsigned char * __cdecl _c2pstr(char *); +char * __cdecl _p2cstr(unsigned char *); + +#if !__STDC__ +__inline unsigned char * __cdecl c2pstr(char *sz) { return _c2pstr(sz);}; +__inline char * __cdecl p2cstr(unsigned char *sz) { return _p2cstr(sz);}; +#endif +#endif + +#if !__STDC__ + +#ifdef _NTSDK + +/* Non-ANSI names for compatibility */ +#define memccpy _memccpy +#define memicmp _memicmp +#define strcmpi _strcmpi +#define stricmp _stricmp +#define strdup _strdup +#define strlwr _strlwr +#define strnicmp _strnicmp +#define strnset _strnset +#define strrev _strrev +#define strset _strset +#define strupr _strupr +#define stricoll _stricoll +#else /* ndef _NTSDK */ + +/* prototypes for oldnames.lib functions */ +_CRTIMP void * __cdecl memccpy(void *, const void *, int, unsigned int); +_CRTIMP int __cdecl memicmp(const void *, const void *, unsigned int); +_CRTIMP int __cdecl strcmpi(const char *, const char *); +_CRTIMP int __cdecl stricmp(const char *, const char *); +_CRTIMP char * __cdecl strdup(const char *); +_CRTIMP char * __cdecl strlwr(char *); +_CRTIMP int __cdecl strnicmp(const char *, const char *, size_t); +_CRTIMP char * __cdecl strnset(char *, int, size_t); +_CRTIMP char * __cdecl strrev(char *); + char * __cdecl strset(char *, int); +_CRTIMP char * __cdecl strupr(char *); + +#endif /* ndef _NTSDK */ + +#endif /* !__STDC__ */ + + +#ifndef _MAC +#ifndef _WSTRING_DEFINED + +/* wide function prototypes, also declared in wchar.h */ + +_CRTIMP wchar_t * __cdecl wcscat(wchar_t *, const wchar_t *); +_CRTIMP wchar_t * __cdecl wcschr(const wchar_t *, wchar_t); +_CRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *); +_CRTIMP wchar_t * __cdecl wcscpy(wchar_t *, const wchar_t *); +_CRTIMP size_t __cdecl wcscspn(const wchar_t *, const wchar_t *); +_CRTIMP size_t __cdecl wcslen(const wchar_t *); +_CRTIMP wchar_t * __cdecl wcsncat(wchar_t *, const wchar_t *, size_t); +_CRTIMP int __cdecl wcsncmp(const wchar_t *, const wchar_t *, size_t); +_CRTIMP wchar_t * __cdecl wcsncpy(wchar_t *, const wchar_t *, size_t); +_CRTIMP wchar_t * __cdecl wcspbrk(const wchar_t *, const wchar_t *); +_CRTIMP wchar_t * __cdecl wcsrchr(const wchar_t *, wchar_t); +_CRTIMP size_t __cdecl wcsspn(const wchar_t *, const wchar_t *); +_CRTIMP wchar_t * __cdecl wcsstr(const wchar_t *, const wchar_t *); +_CRTIMP wchar_t * __cdecl wcstok(wchar_t *, const wchar_t *); + +_CRTIMP wchar_t * __cdecl _wcsdup(const wchar_t *); +_CRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *); +_CRTIMP int __cdecl _wcsnicmp(const wchar_t *, const wchar_t *, size_t); +_CRTIMP wchar_t * __cdecl _wcsnset(wchar_t *, wchar_t, size_t); +_CRTIMP wchar_t * __cdecl _wcsrev(wchar_t *); +_CRTIMP wchar_t * __cdecl _wcsset(wchar_t *, wchar_t); + +_CRTIMP wchar_t * __cdecl _wcslwr(wchar_t *); +_CRTIMP wchar_t * __cdecl _wcsupr(wchar_t *); +_CRTIMP size_t __cdecl wcsxfrm(wchar_t *, const wchar_t *, size_t); +_CRTIMP int __cdecl wcscoll(const wchar_t *, const wchar_t *); +_CRTIMP int __cdecl _wcsicoll(const wchar_t *, const wchar_t *); +_CRTIMP int __cdecl _wcsncoll(const wchar_t *, const wchar_t *, size_t); +_CRTIMP int __cdecl _wcsnicoll(const wchar_t *, const wchar_t *, size_t); + +#if !__STDC__ + +/* old names */ +#define wcswcs wcsstr + +#ifdef _NTSDK + +/* Non-ANSI names for compatibility */ +#define wcsdup _wcsdup +#define wcsicmp _wcsicmp +#define wcsnicmp _wcsnicmp +#define wcsnset _wcsnset +#define wcsrev _wcsrev +#define wcsset _wcsset +#define wcslwr _wcslwr +#define wcsupr _wcsupr +#define wcsicoll _wcsicoll + +#else /* ndef _NTSDK */ + +/* prototypes for oldnames.lib functions */ +_CRTIMP wchar_t * __cdecl wcsdup(const wchar_t *); +_CRTIMP int __cdecl wcsicmp(const wchar_t *, const wchar_t *); +_CRTIMP int __cdecl wcsnicmp(const wchar_t *, const wchar_t *, size_t); +_CRTIMP wchar_t * __cdecl wcsnset(wchar_t *, wchar_t, size_t); +_CRTIMP wchar_t * __cdecl wcsrev(wchar_t *); +_CRTIMP wchar_t * __cdecl wcsset(wchar_t *, wchar_t); +_CRTIMP wchar_t * __cdecl wcslwr(wchar_t *); +_CRTIMP wchar_t * __cdecl wcsupr(wchar_t *); +_CRTIMP int __cdecl wcsicoll(const wchar_t *, const wchar_t *); + +#endif /* ndef _NTSDK */ + +#endif /* !__STDC__ */ + +#define _WSTRING_DEFINED +#endif + +#endif /* ndef _MAC */ + +#ifdef __cplusplus +} +#endif + +#endif /* _INC_STRING */ diff --git a/public/sdk/inc/crt/strstrea.h b/public/sdk/inc/crt/strstrea.h new file mode 100644 index 000000000..82cbabd83 --- /dev/null +++ b/public/sdk/inc/crt/strstrea.h @@ -0,0 +1,128 @@ +/*** +*strstream.h - definitions/declarations for strstreambuf, strstream +* +* Copyright (c) 1991-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the classes, values, macros, and functions +* used by the strstream and strstreambuf classes. +* [AT&T C++] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifdef __cplusplus + +#ifndef _INC_STRSTREAM +#define _INC_STRSTREAM + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +// Currently, all MS C compilers for Win32 platforms default to 8 byte +// alignment. +#pragma pack(push,8) +#endif // _MSC_VER + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +#include <iostream.h> + +#ifdef _MSC_VER +#pragma warning(disable:4514) // disable unwanted /W4 warning +// #pragma warning(default:4514) // use this to reenable, if necessary +#endif // _MSC_VER + +class _CRTIMP strstreambuf : public streambuf { +public: + strstreambuf(); + strstreambuf(int); + strstreambuf(char *, int, char * = 0); + strstreambuf(unsigned char *, int, unsigned char * = 0); + strstreambuf(signed char *, int, signed char * = 0); + strstreambuf(void * (*a)(long), void (*f) (void *)); + ~strstreambuf(); + + void freeze(int =1); + char * str(); + +virtual int overflow(int); +virtual int underflow(); +virtual streambuf* setbuf(char *, int); +virtual streampos seekoff(streamoff, ios::seek_dir, int); +virtual int sync(); // not in spec. + +protected: +virtual int doallocate(); +private: + int x_dynamic; + int x_bufmin; + int _fAlloc; + int x_static; + void * (* x_alloc)(long); + void (* x_free)(void *); +}; + +class _CRTIMP istrstream : public istream { +public: + istrstream(char *); + istrstream(char *, int); + ~istrstream(); + +inline strstreambuf* rdbuf() const { return (strstreambuf*) ios::rdbuf(); } +inline char * str() { return rdbuf()->str(); } +}; + +class _CRTIMP ostrstream : public ostream { +public: + ostrstream(); + ostrstream(char *, int, int = ios::out); + ~ostrstream(); + +inline int pcount() const { return rdbuf()->out_waiting(); } +inline strstreambuf* rdbuf() const { return (strstreambuf*) ios::rdbuf(); } +inline char * str() { return rdbuf()->str(); } +}; + +class _CRTIMP strstream : public iostream { // strstreambase ??? +public: + strstream(); + strstream(char *, int, int); + ~strstream(); + +inline int pcount() const { return rdbuf()->out_waiting(); } // not in spec. +inline strstreambuf* rdbuf() const { return (strstreambuf*) ostream::rdbuf(); } +inline char * str() { return rdbuf()->str(); } +}; + +#ifdef _MSC_VER +// Restore previous packing +#pragma pack(pop) +#endif // _MSC_VER + +#endif // _INC_STRSTREAM + +#endif /* __cplusplus */ diff --git a/public/sdk/inc/crt/sys/locking.h b/public/sdk/inc/crt/sys/locking.h new file mode 100644 index 000000000..14cd90bd1 --- /dev/null +++ b/public/sdk/inc/crt/sys/locking.h @@ -0,0 +1,49 @@ +/*** +*sys/locking.h - flags for locking() function +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the flags for the locking() function. +* [System V] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_LOCKING +#define _INC_LOCKING + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#define _LK_UNLCK 0 /* unlock the file region */ +#ifdef _WIN32 +#define _LK_LOCK 1 /* lock the file region */ +#endif +#define _LK_NBLCK 2 /* non-blocking lock */ +#ifdef _WIN32 +#define _LK_RLCK 3 /* lock for writing */ +#endif +#define _LK_NBRLCK 4 /* non-blocking lock for writing */ + +#if !__STDC__ +/* Non-ANSI names for compatibility */ +#define LK_UNLCK _LK_UNLCK +#ifdef _WIN32 +#define LK_LOCK _LK_LOCK +#endif +#define LK_NBLCK _LK_NBLCK +#ifdef _WIN32 +#define LK_RLCK _LK_RLCK +#endif +#define LK_NBRLCK _LK_NBRLCK +#endif + +#endif /* _INC_LOCKING */ diff --git a/public/sdk/inc/crt/sys/stat.h b/public/sdk/inc/crt/sys/stat.h new file mode 100644 index 000000000..3977b7fee --- /dev/null +++ b/public/sdk/inc/crt/sys/stat.h @@ -0,0 +1,226 @@ +/*** +*sys/stat.h - defines structure used by stat() and fstat() +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the structure used by the _stat() and _fstat() +* routines. +* [System V] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_STAT +#define _INC_STAT + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +#include <sys/types.h> + + +#ifndef _TIME_T_DEFINED +typedef long time_t; +#define _TIME_T_DEFINED +#endif + + +#ifdef _WIN32 +#ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif +#endif /* _WIN32 */ + + +/* define structure for returning status information */ + +#ifndef _STAT_DEFINED + +struct _stat { + _dev_t st_dev; + _ino_t st_ino; + unsigned short st_mode; + short st_nlink; + short st_uid; + short st_gid; + _dev_t st_rdev; + _off_t st_size; + time_t st_atime; + time_t st_mtime; + time_t st_ctime; + }; + +#if !__STDC__ && !defined(_NTSDK) + +/* Non-ANSI names for compatibility */ + +struct stat { + _dev_t st_dev; + _ino_t st_ino; + unsigned short st_mode; + short st_nlink; + short st_uid; + short st_gid; + _dev_t st_rdev; + _off_t st_size; + time_t st_atime; + time_t st_mtime; + time_t st_ctime; + }; + +#endif /* __STDC__ */ + +#if _INTEGRAL_MAX_BITS >= 64 +struct _stati64 { + _dev_t st_dev; + _ino_t st_ino; + unsigned short st_mode; + short st_nlink; + short st_uid; + short st_gid; + _dev_t st_rdev; + __int64 st_size; + time_t st_atime; + time_t st_mtime; + time_t st_ctime; + }; +#endif + +#define _STAT_DEFINED +#endif + + +#define _S_IFMT 0170000 /* file type mask */ +#define _S_IFDIR 0040000 /* directory */ +#define _S_IFCHR 0020000 /* character special */ +#define _S_IFIFO 0010000 /* pipe */ +#define _S_IFREG 0100000 /* regular */ +#define _S_IREAD 0000400 /* read permission, owner */ +#define _S_IWRITE 0000200 /* write permission, owner */ +#define _S_IEXEC 0000100 /* execute/search permission, owner */ + + +/* Function prototypes */ + +_CRTIMP int __cdecl _fstat(int, struct _stat *); +_CRTIMP int __cdecl _stat(const char *, struct _stat *); + +#if _INTEGRAL_MAX_BITS >= 64 +_CRTIMP int __cdecl _fstati64(int, struct _stati64 *); +_CRTIMP int __cdecl _stati64(const char *, struct _stati64 *); +#endif + +#ifdef _WIN32 +#ifndef _WSTAT_DEFINED + +/* wide function prototypes, also declared in wchar.h */ + +_CRTIMP int __cdecl _wstat(const wchar_t *, struct _stat *); + +#if _INTEGRAL_MAX_BITS >= 64 +_CRTIMP int __cdecl _wstati64(const wchar_t *, struct _stati64 *); +#endif + +#define _WSTAT_DEFINED +#endif +#endif /* _WIN32 */ + + +#if !__STDC__ + +/* Non-ANSI names for compatibility */ + +#define S_IFMT _S_IFMT +#define S_IFDIR _S_IFDIR +#define S_IFCHR _S_IFCHR +#define S_IFREG _S_IFREG +#define S_IREAD _S_IREAD +#define S_IWRITE _S_IWRITE +#define S_IEXEC _S_IEXEC + +#ifdef _NTSDK +/* definitions compatible with NT SDK */ +#define fstat _fstat +#define stat _stat +#else /* ndef _NTSDK */ +/* current declarations */ +_CRTIMP int __cdecl fstat(int, struct stat *); +_CRTIMP int __cdecl stat(const char *, struct stat *); +#endif /* _NTSDK */ + +#endif /* __STDC__ */ + + +#ifdef __cplusplus +} +#endif + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_STAT */ diff --git a/public/sdk/inc/crt/sys/timeb.h b/public/sdk/inc/crt/sys/timeb.h new file mode 100644 index 000000000..fe2158f20 --- /dev/null +++ b/public/sdk/inc/crt/sys/timeb.h @@ -0,0 +1,151 @@ +/*** +*sys/timeb.h - definition/declarations for _ftime() +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file define the _ftime() function and the types it uses. +* [System V] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_TIMEB +#define _INC_TIMEB + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +#ifndef _TIME_T_DEFINED +typedef long time_t; +#define _TIME_T_DEFINED +#endif + + +/* Structure returned by _ftime system call */ + +#ifndef _TIMEB_DEFINED +struct _timeb { + time_t time; + unsigned short millitm; + short timezone; + short dstflag; + }; + +#if !__STDC__ + +/* Non-ANSI name for compatibility */ + +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define timeb _timeb +#else /* ndef _NTSDK */ +/* current definition */ +struct timeb { + time_t time; + unsigned short millitm; + short timezone; + short dstflag; + }; +#endif /* _NTSDK */ + +#endif + +#define _TIMEB_DEFINED +#endif + + +/* Function prototypes */ + +_CRTIMP void __cdecl _ftime(struct _timeb *); + +#if !__STDC__ + +/* Non-ANSI name for compatibility */ + +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#ifdef _WIN32 +#define ftime _ftime +#else +__inline void __cdecl ftime(struct timeb *pst) { _ftime((struct _timeb *)pst);}; +#endif +#else /* ndef _NTSDK */ +/* current declaration */ +_CRTIMP void __cdecl ftime(struct timeb *); +#endif /* _NTSDK */ + +#endif + + +#ifdef __cplusplus +} +#endif + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_TIMEB */ diff --git a/public/sdk/inc/crt/sys/types.h b/public/sdk/inc/crt/sys/types.h new file mode 100644 index 000000000..765e852c0 --- /dev/null +++ b/public/sdk/inc/crt/sys/types.h @@ -0,0 +1,87 @@ +/*** +*sys/types.h - types returned by system level calls for file and time info +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines types used in defining values returned by system +* level calls for file status and time information. +* [System V] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_TYPES +#define _INC_TYPES + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifndef _TIME_T_DEFINED +typedef long time_t; +#define _TIME_T_DEFINED +#endif + + +#ifndef _INO_T_DEFINED + +typedef unsigned short _ino_t; /* i-node number (not used on DOS) */ + +#if !__STDC__ +/* Non-ANSI name for compatibility */ +#ifdef _NTSDK +#define ino_t _ino_t +#else /* ndef _NTSDK */ +typedef unsigned short ino_t; +#endif /* _NTSDK */ +#endif + +#define _INO_T_DEFINED +#endif + + +#ifndef _DEV_T_DEFINED + +#ifdef _NTSDK +typedef short _dev_t; /* device code */ +#else /* ndef _NTSDK */ +typedef unsigned int _dev_t; /* device code */ +#endif /* _NTSDK */ + +#if !__STDC__ +/* Non-ANSI name for compatibility */ +#ifdef _NTSDK +#define dev_t _dev_t +#else /* ndef _NTSDK */ +typedef unsigned int dev_t; +#endif /* _NTSDK */ +#endif + +#define _DEV_T_DEFINED +#endif + + +#ifndef _OFF_T_DEFINED + +typedef long _off_t; /* file offset value */ + +#if !__STDC__ +/* Non-ANSI name for compatibility */ +#ifdef _NTSDK +#define off_t _off_t +#else /* ndef _NTSDK */ +typedef long off_t; +#endif /* _NTSDK */ +#endif + +#define _OFF_T_DEFINED +#endif + +#endif /* _INC_TYPES */ diff --git a/public/sdk/inc/crt/sys/utime.h b/public/sdk/inc/crt/sys/utime.h new file mode 100644 index 000000000..c1d90d30d --- /dev/null +++ b/public/sdk/inc/crt/sys/utime.h @@ -0,0 +1,151 @@ +/*** +*sys/utime.h - definitions/declarations for utime() +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the structure used by the utime routine to set +* new file access and modification times. NOTE - MS-DOS +* does not recognize access time, so this field will +* always be ignored and the modification time field will be +* used to set the new time. +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_UTIME +#define _INC_UTIME + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + +#ifdef _WIN32 +#ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif +#endif /* _WIN32 */ + +#ifndef _TIME_T_DEFINED +typedef long time_t; +#define _TIME_T_DEFINED +#endif + +/* define struct used by _utime() function */ + +#ifndef _UTIMBUF_DEFINED + +struct _utimbuf { + time_t actime; /* access time */ + time_t modtime; /* modification time */ + }; + +#if !__STDC__ +/* Non-ANSI name for compatibility */ +#ifdef _NTSDK +#define utimbuf _utimbuf +#else /* ndef _NTSDK */ +struct utimbuf { + time_t actime; /* access time */ + time_t modtime; /* modification time */ + }; +#endif /* _NTSDK */ +#endif + +#define _UTIMBUF_DEFINED +#endif + + +/* Function Prototypes */ + +_CRTIMP int __cdecl _utime(const char *, struct _utimbuf *); +#ifdef _WIN32 +_CRTIMP int __cdecl _futime(int, struct _utimbuf *); + +/* Wide Function Prototypes */ +_CRTIMP int __cdecl _wutime(const wchar_t *, struct _utimbuf *); +#endif /* _WIN32 */ + +#if !__STDC__ +/* Non-ANSI name for compatibility */ +#ifdef _NTSDK +#ifdef _WIN32 +#define utime _utime +#else /* _WIN32 */ +__inline int __cdecl utime(const char *sz, struct utimbuf *pst){ return _utime(sz, (struct _utimbuf *)pst);}; +#endif /* ndef _WIN32 */ +#else /* ndef _NTSDK */ +_CRTIMP int __cdecl utime(const char *, struct utimbuf *); +#endif /* _NTSDK */ +#endif + +#ifdef __cplusplus +} +#endif + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_UTIME */ diff --git a/public/sdk/inc/crt/tchar.h b/public/sdk/inc/crt/tchar.h new file mode 100644 index 000000000..1cc2b12dc --- /dev/null +++ b/public/sdk/inc/crt/tchar.h @@ -0,0 +1,995 @@ +/*** +*tchar.h - definitions for generic international text functions +* +* Copyright (c) 1991-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* Definitions for generic international functions, mostly defines +* which map string/formatted-io/ctype functions to char, wchar_t, or +* MBCS versions. To be used for compatibility between single-byte, +* multi-byte and Unicode text models. +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 /*IFSTRIP=IGN*/ +#pragma once +#endif + +#ifndef _INC_TCHAR +#define _INC_TCHAR + +#ifdef _MSC_VER +#pragma warning(disable:4514) /* disable unwanted C++ /W4 warning */ +/* #pragma warning(default:4514) */ /* use this to reenable, if necessary */ +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef CRTDLL +#define _CRTIMP __declspec(dllexport) +#else /* ndef CRTDLL */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* CRTDLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +#define _ftcscat _tcscat +#define _ftcschr _tcschr +#define _ftcscpy _tcscpy +#define _ftcscspn _tcscspn +#define _ftcslen _tcslen +#define _ftcsncat _tcsncat +#define _ftcsncpy _tcsncpy +#define _ftcspbrk _tcspbrk +#define _ftcsrchr _tcsrchr +#define _ftcsspn _tcsspn +#define _ftcsstr _tcsstr +#define _ftcstok _tcstok + +#define _ftcsdup _tcsdup +#define _ftcsnset _tcsnset +#define _ftcsrev _tcsrev +#define _ftcsset _tcsset + +#define _ftcscmp _tcscmp +#define _ftcsicmp _tcsicmp +#define _ftcsnccmp _tcsnccmp +#define _ftcsncmp _tcsncmp +#define _ftcsncicmp _tcsncicmp +#define _ftcsnicmp _tcsnicmp + +#define _ftcscoll _tcscoll +#define _ftcsicoll _tcsicoll +#define _ftcsnccoll _tcsnccoll +#define _ftcsncoll _tcsncoll +#define _ftcsncicoll _tcsncicoll +#define _ftcsnicoll _tcsnicoll + +/* Redundant "logical-character" mappings */ + +#define _ftcsclen _tcsclen +#define _ftcsnccat _tcsnccat +#define _ftcsnccpy _tcsnccpy +#define _ftcsncset _tcsncset + +#define _ftcsdec _tcsdec +#define _ftcsinc _tcsinc +#define _ftcsnbcnt _tcsnbcnt +#define _ftcsnccnt _tcsnccnt +#define _ftcsnextc _tcsnextc +#define _ftcsninc _tcsninc +#define _ftcsspnp _tcsspnp + +#define _ftcslwr _tcslwr +#define _ftcsupr _tcsupr + +#define _ftclen _tclen +#define _ftccpy _tccpy +#define _ftccmp _tccmp + + +#ifdef _UNICODE + +/* ++++++++++++++++++++ UNICODE ++++++++++++++++++++ */ + +#include <wchar.h> + + +#ifndef _WCTYPE_T_DEFINED +typedef wchar_t wint_t; +typedef wchar_t wctype_t; +#define _WCTYPE_T_DEFINED +#endif + +#ifndef __TCHAR_DEFINED +typedef wchar_t _TCHAR; +typedef wchar_t _TSCHAR; +typedef wchar_t _TUCHAR; +typedef wchar_t _TXCHAR; +typedef wint_t _TINT; +#define __TCHAR_DEFINED +#endif + +#ifndef _TCHAR_DEFINED +#if !__STDC__ +typedef wchar_t TCHAR; +#endif +#define _TCHAR_DEFINED +#endif + +#define _TEOF WEOF + +#define __T(x) L ## x + + +/* Program */ + +#define _tmain wmain +#define _tWinMain wWinMain +#define _tenviron _wenviron +#define __targv __wargv + +/* Formatted i/o */ + +#define _tprintf wprintf +#define _ftprintf fwprintf +#define _stprintf swprintf +#define _sntprintf _snwprintf +#define _vtprintf vwprintf +#define _vftprintf vfwprintf +#define _vstprintf vswprintf +#define _vsntprintf _vsnwprintf +#define _tscanf wscanf +#define _ftscanf fwscanf +#define _stscanf swscanf + + +/* Unformatted i/o */ + +#define _fgettc fgetwc +#define _fgettchar _fgetwchar +#define _fgetts fgetws +#define _fputtc fputwc +#define _fputtchar _fputwchar +#define _fputts fputws +#define _gettc getwc +#define _gettchar getwchar +#define _getts _getws +#define _puttc putwc +#define _puttchar putwchar +#define _putts _putws +#define _ungettc ungetwc + + +/* String conversion functions */ + +#define _tcstod wcstod +#define _tcstol wcstol +#define _tcstoul wcstoul + +#define _itot _itow +#define _ltot _ltow +#define _ultot _ultow +#define _ttoi _wtoi +#define _ttol _wtol + + +/* String functions */ + +#define _tcscat wcscat +#define _tcschr wcschr +#define _tcscpy wcscpy +#define _tcscspn wcscspn +#define _tcslen wcslen +#define _tcsncat wcsncat +#define _tcsncpy wcsncpy +#define _tcspbrk wcspbrk +#define _tcsrchr wcsrchr +#define _tcsspn wcsspn +#define _tcsstr wcsstr +#define _tcstok wcstok + +#define _tcsdup _wcsdup +#define _tcsnset _wcsnset +#define _tcsrev _wcsrev +#define _tcsset _wcsset + +#define _tcscmp wcscmp +#define _tcsicmp _wcsicmp +#define _tcsnccmp wcsncmp +#define _tcsncmp wcsncmp +#define _tcsncicmp _wcsnicmp +#define _tcsnicmp _wcsnicmp + +#define _tcscoll wcscoll +#define _tcsicoll _wcsicoll +#define _tcsnccoll _wcsncoll +#define _tcsncoll _wcsncoll +#define _tcsncicoll _wcsnicoll +#define _tcsnicoll _wcsnicoll + + +/* Execute functions */ + +#define _texecl _wexecl +#define _texecle _wexecle +#define _texeclp _wexeclp +#define _texeclpe _wexeclpe +#define _texecv _wexecv +#define _texecve _wexecve +#define _texecvp _wexecvp +#define _texecvpe _wexecvpe + +#define _tspawnl _wspawnl +#define _tspawnle _wspawnle +#define _tspawnlp _wspawnlp +#define _tspawnlpe _wspawnlpe +#define _tspawnv _wspawnv +#define _tspawnve _wspawnve +#define _tspawnvp _wspawnvp +#define _tspawnvp _wspawnvp +#define _tspawnvpe _wspawnvpe + +#define _tsystem _wsystem + + +/* Time functions */ + +#define _tasctime _wasctime +#define _tctime _wctime +#define _tstrdate _wstrdate +#define _tstrtime _wstrtime +#define _tutime _wutime +#define _tcsftime wcsftime + + +/* Directory functions */ + +#define _tchdir _wchdir +#define _tgetcwd _wgetcwd +#define _tgetdcwd _wgetdcwd +#define _tmkdir _wmkdir +#define _trmdir _wrmdir + + +/* Environment/Path functions */ + +#define _tfullpath _wfullpath +#define _tgetenv _wgetenv +#define _tmakepath _wmakepath +#define _tputenv _wputenv +#define _tsearchenv _wsearchenv +#define _tsplitpath _wsplitpath + + +/* Stdio functions */ + +#define _tfdopen _wfdopen +#define _tfsopen _wfsopen +#define _tfopen _wfopen +#define _tfreopen _wfreopen +#define _tperror _wperror +#define _tpopen _wpopen +#define _ttempnam _wtempnam +#define _ttmpnam _wtmpnam + + +/* Io functions */ + +#define _taccess _waccess +#define _tchmod _wchmod +#define _tcreat _wcreat +#define _tfindfirst _wfindfirst +#define _tfindfirsti64 _wfindfirsti64 +#define _tfindnext _wfindnext +#define _tfindnexti64 _wfindnexti64 +#define _tmktemp _wmktemp +#define _topen _wopen +#define _tremove _wremove +#define _trename _wrename +#define _tsopen _wsopen +#define _tunlink _wunlink + +#define _tfinddata_t _wfinddata_t +#define _tfinddatai64_t _wfinddatai64_t + + +/* Stat functions */ + +#define _tstat _wstat +#define _tstati64 _wstati64 + + +/* Setlocale functions */ + +#define _tsetlocale _wsetlocale + + +/* Redundant "logical-character" mappings */ + +#define _tcsclen wcslen +#define _tcsnccat wcsncat +#define _tcsnccpy wcsncpy +#define _tcsncset _wcsnset + +#define _tcsdec _wcsdec +#define _tcsinc _wcsinc +#define _tcsnbcnt _wcsncnt +#define _tcsnccnt _wcsncnt +#define _tcsnextc _wcsnextc +#define _tcsninc _wcsninc +#define _tcsspnp _wcsspnp + +#define _tcslwr _wcslwr +#define _tcsupr _wcsupr +#define _tcsxfrm wcsxfrm + + +#if (__STDC__ || defined(_NO_INLINING)) && !defined(_M_M68K) +#define _tclen(_pc) (1) +#define _tccpy(_pc1,_cpc2) ((*(_pc1) = *(_cpc2))) +#define _tccmp(_cpc1,_cpc2) ((*(_cpc1))-(*(_cpc2))) +#else /* __STDC__ */ +__inline size_t __cdecl _tclen(const wchar_t *_cpc) { return (_cpc,1); } +__inline void __cdecl _tccpy(wchar_t *_pc1, const wchar_t *_cpc2) { *_pc1 = (wchar_t)*_cpc2; } +__inline int __cdecl _tccmp(const wchar_t *_cpc1, const wchar_t *_cpc2) { return (int) ((*_cpc1)-(*_cpc2)); } +#endif /* __STDC__ */ + + +/* ctype functions */ + +#define _istalnum iswalnum +#define _istalpha iswalpha +#define _istascii iswascii +#define _istcntrl iswcntrl +#define _istdigit iswdigit +#define _istgraph iswgraph +#define _istlower iswlower +#define _istprint iswprint +#define _istpunct iswpunct +#define _istspace iswspace +#define _istupper iswupper +#define _istxdigit iswxdigit + +#define _totupper towupper +#define _totlower towlower + +#define _istlegal(_c) (1) +#define _istlead(_c) (0) +#define _istleadbyte(_c) (0) + + +#if (__STDC__ || defined(_NO_INLINING)) && !defined(_M_M68K) +#define _wcsdec(_cpc1, _cpc2) ((_cpc2)-1) +#define _wcsinc(_pc) ((_pc)+1) +#define _wcsnextc(_cpc) ((unsigned int) *(_cpc)) +#define _wcsninc(_pc, _sz) (((_pc)+(_sz))) +#define _wcsncnt(_cpc, _sz) ((wcslen(_cpc)>_sz) ? _sz : wcslen(_cpc)) +#define _wcsspnp(_cpc1, _cpc2) ((*((_cpc1)+wcsspn(_cpc1,_cpc2))) ? ((_cpc1)+wcsspn(_cpc1,_cpc2)) : NULL) +#else /* __STDC__ */ +__inline wchar_t * __cdecl _wcsdec(const wchar_t * _cpc1, const wchar_t * _cpc2) { return (wchar_t *)(_cpc1,(_cpc2-1)); } +__inline wchar_t * __cdecl _wcsinc(const wchar_t * _pc) { return (wchar_t *)(_pc+1); } +__inline unsigned int __cdecl _wcsnextc(const wchar_t * _cpc) { return (unsigned int)*_cpc; } +__inline wchar_t * __cdecl _wcsninc(const wchar_t * _pc, size_t _sz) { return (wchar_t *)(_pc+_sz); } +__inline size_t __cdecl _wcsncnt( const wchar_t * _cpc, size_t _sz) { size_t len; len = wcslen(_cpc); return (len>_sz) ? _sz : len; } +__inline wchar_t * __cdecl _wcsspnp( const wchar_t * _cpc1, const wchar_t * _cpc2) { return (*(_cpc1 += wcsspn(_cpc1,_cpc2))!='\0') ? (wchar_t*)_cpc1 : NULL; } +#endif /* __STDC__ */ + + +#else /* ndef _UNICODE */ + +/* ++++++++++++++++++++ SBCS and MBCS ++++++++++++++++++++ */ + +#include <string.h> + + +#define _TEOF EOF + +#define __T(x) x + + +/* Program */ + +#define _tmain main +#define _tWinMain WinMain +#ifdef _POSIX_ +#define _tenviron environ +#else +#define _tenviron _environ +#endif +#define __targv __argv + + +/* Formatted i/o */ + +#define _tprintf printf +#define _ftprintf fprintf +#define _stprintf sprintf +#define _sntprintf _snprintf +#define _vtprintf vprintf +#define _vftprintf vfprintf +#define _vstprintf vsprintf +#define _vsntprintf _vsnprintf +#define _tscanf scanf +#define _ftscanf fscanf +#define _stscanf sscanf + + +/* Unformatted i/o */ + +#define _fgettc fgetc +#define _fgettchar _fgetchar +#define _fgetts fgets +#define _fputtc fputc +#define _fputtchar _fputchar +#define _fputts fputs +#define _gettc getc +#define _gettchar getchar +#define _getts gets +#define _puttc putc +#define _puttchar putchar +#define _putts puts +#define _ungettc ungetc + + +/* String conversion functions */ + +#define _tcstod strtod +#define _tcstol strtol +#define _tcstoul strtoul + +#define _itot _itoa +#define _ltot _ltoa +#define _ultot _ultoa +#define _ttoi atoi +#define _ttol atol + + +/* String functions */ + +#define _tcscat strcat +#define _tcscpy strcpy +#define _tcslen strlen +#define _tcsxfrm strxfrm +#define _tcsdup _strdup + + +/* Execute functions */ + +#define _texecl _execl +#define _texecle _execle +#define _texeclp _execlp +#define _texeclpe _execlpe +#define _texecv _execv +#define _texecve _execve +#define _texecvp _execvp +#define _texecvpe _execvpe + +#define _tspawnl _spawnl +#define _tspawnle _spawnle +#define _tspawnlp _spawnlp +#define _tspawnlpe _spawnlpe +#define _tspawnv _spawnv +#define _tspawnve _spawnve +#define _tspawnvp _spawnvp +#define _tspawnvpe _spawnvpe + +#define _tsystem system + + +/* Time functions */ + +#define _tasctime asctime +#define _tctime ctime +#define _tstrdate _strdate +#define _tstrtime _strtime +#define _tutime _utime +#define _tcsftime strftime + + +/* Directory functions */ + +#define _tchdir _chdir +#define _tgetcwd _getcwd +#define _tgetdcwd _getdcwd +#define _tmkdir _mkdir +#define _trmdir _rmdir + + +/* Environment/Path functions */ + +#define _tfullpath _fullpath +#define _tgetenv getenv +#define _tmakepath _makepath +#define _tputenv _putenv +#define _tsearchenv _searchenv +#define _tsplitpath _splitpath + + +/* Stdio functions */ + +#ifdef _POSIX_ +#define _tfdopen fdopen +#else +#define _tfdopen _fdopen +#endif +#define _tfsopen _fsopen +#define _tfopen fopen +#define _tfreopen freopen +#define _tperror perror +#define _tpopen _popen +#define _ttempnam _tempnam +#define _ttmpnam tmpnam + + +/* Io functions */ + +#define _tchmod _chmod +#define _tcreat _creat +#define _tfindfirst _findfirst +#define _tfindfirsti64 _findfirsti64 +#define _tfindnext _findnext +#define _tfindnexti64 _findnexti64 +#define _tmktemp _mktemp + +#ifdef _POSIX_ +#define _topen open +#define _taccess access +#else +#define _topen _open +#define _taccess _access +#endif + +#define _tremove remove +#define _trename rename +#define _tsopen _sopen +#define _tunlink _unlink + +#define _tfinddata_t _finddata_t +#define _tfinddatai64_t _finddatai64_t + + +/* ctype functions */ + +#define _istascii isascii +#define _istcntrl iscntrl +#define _istxdigit isxdigit + + +/* Stat functions */ + +#define _tstat _stat +#define _tstati64 _stati64 + + +/* Setlocale functions */ + +#define _tsetlocale setlocale + + +#ifdef _MBCS + +/* ++++++++++++++++++++ MBCS ++++++++++++++++++++ */ + + +#include <mbstring.h> + + +#ifndef __TCHAR_DEFINED +typedef char _TCHAR; +typedef signed char _TSCHAR; +typedef unsigned char _TUCHAR; +typedef unsigned char _TXCHAR; +typedef unsigned int _TINT; +#define __TCHAR_DEFINED +#endif + +#ifndef _TCHAR_DEFINED +#if !__STDC__ +typedef char TCHAR; +#endif +#define _TCHAR_DEFINED +#endif + + +#ifdef _MB_MAP_DIRECT + +/* use mb functions directly - types must match */ + +/* String functions */ + +#define _tcschr _mbschr +#define _tcscspn _mbscspn +#define _tcsncat _mbsnbcat +#define _tcsncpy _mbsnbcpy +#define _tcspbrk _mbspbrk +#define _tcsrchr _mbsrchr +#define _tcsspn _mbsspn +#define _tcsstr _mbsstr +#define _tcstok _mbstok + +#define _tcsnset _mbsnbset +#define _tcsrev _mbsrev +#define _tcsset _mbsset + +#define _tcscmp _mbscmp +#define _tcsicmp _mbsicmp +#define _tcsnccmp _mbsncmp +#define _tcsncmp _mbsnbcmp +#define _tcsncicmp _mbsnicmp +#define _tcsnicmp _mbsnbicmp + +#define _tcscoll _mbscoll +#define _tcsicoll _mbsicoll +#define _tcsnccoll _mbsncoll +#define _tcsncoll _mbsnbcoll +#define _tcsncicoll _mbsnicoll +#define _tcsnicoll _mbsnbicoll + + +/* "logical-character" mappings */ + +#define _tcsclen _mbslen +#define _tcsnccat _mbsncat +#define _tcsnccpy _mbsncpy +#define _tcsncset _mbsnset + + +/* MBCS-specific mappings */ + +#define _tcsdec _mbsdec +#define _tcsinc _mbsinc +#define _tcsnbcnt _mbsnbcnt +#define _tcsnccnt _mbsnccnt +#define _tcsnextc _mbsnextc +#define _tcsninc _mbsninc +#define _tcsspnp _mbsspnp + +#define _tcslwr _mbslwr +#define _tcsupr _mbsupr + +#define _tclen _mbclen +#define _tccpy _mbccpy + +#define _tccmp(_cpuc1,_cpuc2) _tcsnccmp(_cpuc1,_cpuc2,1) + + +#else /* _MB_MAP_DIRECT */ + +#if (__STDC__ || defined(_NO_INLINING)) && !defined(_M_M68K) + +/* use type-safe linked-in function thunks */ + +/* String functions */ + +_CRTIMP char * __cdecl _tcschr(const char *, unsigned int); +_CRTIMP size_t __cdecl _tcscspn(const char *, const char *); +_CRTIMP char * __cdecl _tcsncat(char *, const char *, size_t); +_CRTIMP char * __cdecl _tcsncpy(char *, const char *, size_t); +_CRTIMP char * __cdecl _tcspbrk(const char *, const char *); +_CRTIMP char * __cdecl _tcsrchr(const char *, int); +_CRTIMP size_t __cdecl _tcsspn(const char *, const char *); +_CRTIMP char * __cdecl _tcsstr(const char *, const char *); +_CRTIMP char * __cdecl _tcstok(char *, const char *); + +_CRTIMP char * __cdecl _tcsnset(char *, unsigned int, size_t); +_CRTIMP char * __cdecl _tcsrev(char *); +_CRTIMP char * __cdecl _tcsset(char *, unsigned int); + +_CRTIMP int __cdecl _tcscmp(const char *, const char *); +_CRTIMP int __cdecl _tcsicmp(const char *, const char *); +_CRTIMP int __cdecl _tcsnccmp(const char *, const char *, size_t); +_CRTIMP int __cdecl _tcsncmp(const char *, const char *, size_t); +_CRTIMP int __cdecl _tcsncicmp(const char *, const char *, size_t); +_CRTIMP int __cdecl _tcsnicmp(const char *, const char *, size_t); + +_CRTIMP int __cdecl _tcscoll(const char *, const char *); +_CRTIMP int __cdecl _tcsicoll(const char *, const char *); +_CRTIMP int __cdecl _tcsnccoll(const char *, const char *, size_t); +_CRTIMP int __cdecl _tcsncoll(const char *, const char *, size_t); +_CRTIMP int __cdecl _tcsncicoll(const char *, const char *, size_t); +_CRTIMP int __cdecl _tcsnicoll(const char *, const char *, size_t); + + +/* "logical-character" mappings */ + +_CRTIMP size_t __cdecl _tcsclen(const char *); +_CRTIMP char * __cdecl _tcsnccat(char *, const char *, size_t); +_CRTIMP char * __cdecl _tcsnccpy(char *, const char *, size_t); +_CRTIMP char * __cdecl _tcsncset(char *, unsigned int, size_t); + + +/* MBCS-specific mappings */ + +_CRTIMP char * __cdecl _tcsdec(const char *, const char *); +_CRTIMP char * __cdecl _tcsinc(const char *); +_CRTIMP size_t __cdecl _tcsnbcnt(const char *, size_t); +_CRTIMP size_t __cdecl _tcsnccnt(const char *, size_t); +_CRTIMP unsigned int __cdecl _tcsnextc (const char *); +_CRTIMP char * __cdecl _tcsninc(const char *, size_t); +_CRTIMP char * __cdecl _tcsspnp(const char *, const char *); + +_CRTIMP char * __cdecl _tcslwr(char *); +_CRTIMP char * __cdecl _tcsupr(char *); + +_CRTIMP size_t __cdecl _tclen(const char *); +_CRTIMP void __cdecl _tccpy(char *, const char *); + + +#else /* __STDC__ */ + +/* the default: use type-safe inline function thunks */ + +#define _PUC unsigned char * +#define _CPUC const unsigned char * +#define _PC char * +#define _CPC const char * +#define _UI unsigned int + + +/* String functions */ + +__inline _PC _tcschr(_CPC _s1,_UI _c) {return (_PC)_mbschr((_CPUC)_s1,_c);} +__inline size_t _tcscspn(_CPC _s1,_CPC _s2) {return _mbscspn((_CPUC)_s1,(_CPUC)_s2);} +__inline _PC _tcsncat(_PC _s1,_CPC _s2,size_t _n) {return (_PC)_mbsnbcat((_PUC)_s1,(_CPUC)_s2,_n);} +__inline _PC _tcsncpy(_PC _s1,_CPC _s2,size_t _n) {return (_PC)_mbsnbcpy((_PUC)_s1,(_CPUC)_s2,_n);} +__inline _PC _tcspbrk(_CPC _s1,_CPC _s2) {return (_PC)_mbspbrk((_CPUC)_s1,(_CPUC)_s2);} +__inline _PC _tcsrchr(_CPC _s1,_UI _c) {return (_PC)_mbsrchr((_CPUC)_s1,_c);} +__inline size_t _tcsspn(_CPC _s1,_CPC _s2) {return _mbsspn((_CPUC)_s1,(_CPUC)_s2);} +__inline _PC _tcsstr(_CPC _s1,_CPC _s2) {return (_PC)_mbsstr((_CPUC)_s1,(_CPUC)_s2);} +__inline _PC _tcstok(_PC _s1,_CPC _s2) {return (_PC)_mbstok((_PUC)_s1,(_CPUC)_s2);} + +__inline _PC _tcsnset(_PC _s1,_UI _c,size_t _n) {return (_PC)_mbsnbset((_PUC)_s1,_c,_n);} +__inline _PC _tcsrev(_PC _s1) {return (_PC)_mbsrev((_PUC)_s1);} +__inline _PC _tcsset(_PC _s1,_UI _c) {return (_PC)_mbsset((_PUC)_s1,_c);} + +__inline int _tcscmp(_CPC _s1,_CPC _s2) {return _mbscmp((_CPUC)_s1,(_CPUC)_s2);} +__inline int _tcsicmp(_CPC _s1,_CPC _s2) {return _mbsicmp((_CPUC)_s1,(_CPUC)_s2);} +__inline int _tcsnccmp(_CPC _s1,_CPC _s2,size_t _n) {return _mbsncmp((_CPUC)_s1,(_CPUC)_s2,_n);} +__inline int _tcsncmp(_CPC _s1,_CPC _s2,size_t _n) {return _mbsnbcmp((_CPUC)_s1,(_CPUC)_s2,_n);} +__inline int _tcsncicmp(_CPC _s1,_CPC _s2,size_t _n) {return _mbsnicmp((_CPUC)_s1,(_CPUC)_s2,_n);} +__inline int _tcsnicmp(_CPC _s1,_CPC _s2,size_t _n) {return _mbsnbicmp((_CPUC)_s1,(_CPUC)_s2,_n);} + +__inline int _tcscoll(_CPC _s1,_CPC _s2) {return _mbscoll((_CPUC)_s1,(_CPUC)_s2);} +__inline int _tcsicoll(_CPC _s1,_CPC _s2) {return _mbsicoll((_CPUC)_s1,(_CPUC)_s2);} +__inline int _tcsnccoll(_CPC _s1,_CPC _s2,size_t _n) {return _mbsncoll((_CPUC)_s1,(_CPUC)_s2,_n);} +__inline int _tcsncoll(_CPC _s1,_CPC _s2,size_t _n) {return _mbsnbcoll((_CPUC)_s1,(_CPUC)_s2,_n);} +__inline int _tcsncicoll(_CPC _s1,_CPC _s2,size_t _n) {return _mbsnicoll((_CPUC)_s1,(_CPUC)_s2,_n);} +__inline int _tcsnicoll(_CPC _s1,_CPC _s2,size_t _n) {return _mbsnbicoll((_CPUC)_s1,(_CPUC)_s2,_n);} + + +/* "logical-character" mappings */ + +__inline size_t _tcsclen(_CPC _s1) {return _mbslen((_CPUC)_s1);} +__inline _PC _tcsnccat(_PC _s1,_CPC _s2,size_t _n) {return (_PC)_mbsncat((_PUC)_s1,(_CPUC)_s2,_n);} +__inline _PC _tcsnccpy(_PC _s1,_CPC _s2,size_t _n) {return (_PC)_mbsncpy((_PUC)_s1,(_CPUC)_s2,_n);} +__inline _PC _tcsncset(_PC _s1,_UI _c,size_t _n) {return (_PC)_mbsnset((_PUC)_s1,_c,_n);} + + +/* MBCS-specific mappings */ + +__inline _PC _tcsdec(_CPC _s1,_CPC _s2) {return (_PC)_mbsdec((_CPUC)_s1,(_CPUC)_s2);} +__inline _PC _tcsinc(_CPC _s1) {return (_PC)_mbsinc((_CPUC)_s1);} +__inline size_t _tcsnbcnt(_CPC _s1,size_t _n) {return _mbsnbcnt((_CPUC)_s1,_n);} +__inline size_t _tcsnccnt(_CPC _s1,size_t _n) {return _mbsnccnt((_CPUC)_s1,_n);} +__inline _PC _tcsninc(_CPC _s1,size_t _n) {return (_PC)_mbsninc((_CPUC)_s1,_n);} +__inline _PC _tcsspnp(_CPC _s1,_CPC _s2) {return (_PC)_mbsspnp((_CPUC)_s1,(_CPUC)_s2);} +__inline _PC _tcslwr(_PC _s1) {return (_PC)_mbslwr((_PUC)_s1);} +__inline _PC _tcsupr(_PC _s1) {return (_PC)_mbsupr((_PUC)_s1);} + +__inline size_t _tclen(_CPC _s1) {return _mbclen((_CPUC)_s1);} +__inline void _tccpy(_PC _s1,_CPC _s2) {_mbccpy((_PUC)_s1,(_CPUC)_s2); return;} + + +/* inline helper */ +__inline _UI _tcsnextc(_CPC _s1) {_UI _n=0; if (_ismbblead((_UI)*(_PUC)_s1)) _n=((_UI)*_s1++)<<8; _n+=(_UI)*_s1; return(_n);} + + +#endif /* __STDC__ */ + +#endif /* _MB_MAP_DIRECT */ + + +/* MBCS-specific mappings */ + +#define _tccmp(_cp1,_cp2) _tcsnccmp(_cp1,_cp2,1) + + +/* ctype functions */ + +#define _istalnum _ismbcalnum +#define _istalpha _ismbcalpha +#define _istdigit _ismbcdigit +#define _istgraph _ismbcgraph +#define _istlegal _ismbclegal +#define _istlower _ismbclower +#define _istprint _ismbcprint +#define _istpunct _ismbcpunct +#define _istspace _ismbcspace +#define _istupper _ismbcupper + +#define _totupper _mbctoupper +#define _totlower _mbctolower + +#define _istlead _ismbblead +#define _istleadbyte isleadbyte + +#else /* !_MBCS */ + +/* ++++++++++++++++++++ SBCS ++++++++++++++++++++ */ + + +#ifndef __TCHAR_DEFINED +typedef char _TCHAR; +typedef signed char _TSCHAR; +typedef unsigned char _TUCHAR; +typedef char _TXCHAR; +typedef int _TINT; +#define __TCHAR_DEFINED +#endif + +#ifndef _TCHAR_DEFINED +#if !__STDC__ +typedef char TCHAR; +#endif +#define _TCHAR_DEFINED +#endif + + +/* String functions */ + +#define _tcschr strchr +#define _tcscspn strcspn +#define _tcsncat strncat +#define _tcsncpy strncpy +#define _tcspbrk strpbrk +#define _tcsrchr strrchr +#define _tcsspn strspn +#define _tcsstr strstr +#define _tcstok strtok + +#define _tcsnset _strnset +#define _tcsrev _strrev +#define _tcsset _strset + +#define _tcscmp strcmp +#define _tcsicmp _stricmp +#define _tcsnccmp strncmp +#define _tcsncmp strncmp +#define _tcsncicmp _strnicmp +#define _tcsnicmp _strnicmp + +#define _tcscoll strcoll +#define _tcsicoll _stricoll +#define _tcsnccoll _strncoll +#define _tcsncoll _strncoll +#define _tcsncicoll _strnicoll +#define _tcsnicoll _strnicoll + + +/* "logical-character" mappings */ + +#define _tcsclen strlen +#define _tcsnccat strncat +#define _tcsnccpy strncpy +#define _tcsncset _strnset + + +/* MBCS-specific functions */ + +#define _tcsdec _strdec +#define _tcsinc _strinc +#define _tcsnbcnt _strncnt +#define _tcsnccnt _strncnt +#define _tcsnextc _strnextc +#define _tcsninc _strninc +#define _tcsspnp _strspnp + +#define _tcslwr _strlwr +#define _tcsupr _strupr +#define _tcsxfrm strxfrm + +#define _istlead(_c) (0) +#define _istleadbyte(_c) (0) + +#if (__STDC__ || defined(_NO_INLINING)) && !defined(_M_M68K) +#define _tclen(_pc) (1) +#define _tccpy(_pc1,_cpc2) (*(_pc1) = *(_cpc2)) +#define _tccmp(_cpc1,_cpc2) (((unsigned char)*(_cpc1))-((unsigned char)*(_cpc2))) +#else /* __STDC__ */ +__inline size_t __cdecl _tclen(const char *_cpc) { return (_cpc,1); } +__inline void __cdecl _tccpy(char *_pc1, const char *_cpc2) { *_pc1 = *_cpc2; } +__inline int __cdecl _tccmp(const char *_cpc1, const char *_cpc2) { return (int) (((unsigned char)*_cpc1)-((unsigned char)*_cpc2)); } +#endif /* __STDC__ */ + + +/* ctype-functions */ + +#define _istalnum isalnum +#define _istalpha isalpha +#define _istdigit isdigit +#define _istgraph isgraph +#define _istlower islower +#define _istprint isprint +#define _istpunct ispunct +#define _istspace isspace +#define _istupper isupper + +#define _totupper toupper +#define _totlower tolower + +#define _istlegal(_c) (1) + + +/* the following is optional if functional versions are available */ + +/* define NULL pointer value */ + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + + +#if (__STDC__ || defined(_NO_INLINING)) && !defined(_M_M68K) +#define _strdec(_cpc1, _cpc2) ((_cpc2)-1) +#define _strinc(_pc) ((_pc)+1) +#define _strnextc(_cpc) ((unsigned int) *(_cpc)) +#define _strninc(_pc, _sz) (((_pc)+(_sz))) +#define _strncnt(_cpc, _sz) ((strlen(_cpc)>_sz) ? _sz : strlen(_cpc)) +#define _strspnp(_cpc1, _cpc2) ((*((_cpc1)+strspn(_cpc1,_cpc2))) ? ((_cpc1)+strspn(_cpc1,_cpc2)) : NULL) +#else /* __STDC__ */ +__inline char * __cdecl _strdec(const char * _cpc1, const char * _cpc2) { return (char *)(_cpc1,(_cpc2-1)); } +__inline char * __cdecl _strinc(const char * _pc) { return (char *)(_pc+1); } +__inline unsigned int __cdecl _strnextc(const char * _cpc) { return (unsigned int)*_cpc; } +__inline char * __cdecl _strninc(const char * _pc, size_t _sz) { return (char *)(_pc+_sz); } +__inline size_t __cdecl _strncnt( const char * _cpc, size_t _sz) { size_t len; len = strlen(_cpc); return (len>_sz) ? _sz : len; } +__inline char * __cdecl _strspnp( const char * _cpc1, const char * _cpc2) { return (*(_cpc1 += strspn(_cpc1,_cpc2))!='\0') ? (char*)_cpc1 : NULL; } +#endif /* __STDC__ */ + + +#endif /* _MBCS */ + +#endif /* _UNICODE */ + + +/* Generic text macros to be used with string literals and character constants. + Will also allow symbolic constants that resolve to same. */ + +#define _T(x) __T(x) +#define _TEXT(x) __T(x) + + +#ifdef __cplusplus +} +#endif + +#endif /* _INC_TCHAR */ diff --git a/public/sdk/inc/crt/time.h b/public/sdk/inc/crt/time.h new file mode 100644 index 000000000..c9cba37ab --- /dev/null +++ b/public/sdk/inc/crt/time.h @@ -0,0 +1,326 @@ +/*** +*time.h - definitions/declarations for time routines +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file has declarations of time routines and defines +* the structure returned by the localtime and gmtime routines and +* used by asctime. +* [ANSI/System V] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_TIME +#define _INC_TIME + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +/* + * Currently, all MS C compilers for Win32 platforms default to 8 byte + * alignment. + */ +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + +#ifndef _MAC +#ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif +#endif /* ndef _MAC */ + +/* Define the implementation defined time type */ + +#ifndef _TIME_T_DEFINED +typedef long time_t; /* time value */ +#define _TIME_T_DEFINED /* avoid multiple def's of time_t */ +#endif + +#ifndef _CLOCK_T_DEFINED +typedef long clock_t; +#define _CLOCK_T_DEFINED +#endif + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#define _SIZE_T_DEFINED +#endif + + +/* Define NULL pointer value */ + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + + +#ifndef _TM_DEFINED +struct tm { + int tm_sec; /* seconds after the minute - [0,59] */ + int tm_min; /* minutes after the hour - [0,59] */ + int tm_hour; /* hours since midnight - [0,23] */ + int tm_mday; /* day of the month - [1,31] */ + int tm_mon; /* months since January - [0,11] */ + int tm_year; /* years since 1900 */ + int tm_wday; /* days since Sunday - [0,6] */ + int tm_yday; /* days since January 1 - [0,365] */ + int tm_isdst; /* daylight savings time flag */ + }; +#define _TM_DEFINED +#endif + + +/* Clock ticks macro - ANSI version */ + +#define CLOCKS_PER_SEC 1000 + + +/* Extern declarations for the global variables used by the ctime family of + * routines. + */ + +#ifdef _NTSDK + +#ifdef _DLL + +/* Declarations and definitions compatible with the NT SDK */ + +#define _daylight (*_daylight_dll) +#define _timezone (*_timezone_dll) + +/* non-zero if daylight savings time is used */ +extern int * _daylight_dll; + +/* difference in seconds between GMT and local time */ +extern long * _timezone_dll; + +/* standard/daylight savings time zone names */ +extern char ** _tzname; + +#else /* ndef _DLL */ + + +#ifdef _POSIX_ +extern char * _rule; +#endif /* _POSIX_ */ + +/* non-zero if daylight savings time is used */ +extern int _daylight; + +/* difference in seconds between GMT and local time */ +extern long _timezone; + +/* standard/daylight savings time zone names */ +#ifdef _POSIX_ +extern char * tzname[2]; +#else /* ndef _POSIX_ */ +extern char * _tzname[2]; +#endif /* _POSIX_ */ + +#endif /* _DLL */ + +#else /* ndef _NTSDK */ + +/* Current declarations and definitions */ + +#if defined(_DLL) && defined(_M_IX86) + +#define _daylight (*__p__daylight()) +_CRTIMP int * __cdecl __p__daylight(void); + +#define _dstbias (*__p__dstbias()) +_CRTIMP long * __cdecl __p__dstbias(void); + +#define _timezone (*__p__timezone()) +_CRTIMP long * __cdecl __p__timezone(void); + +#define _tzname (__p__tzname()) +_CRTIMP char ** __cdecl __p__tzname(void); + +#else /* !(defined(_DLL) && defined(_M_IX86)) */ + +/* non-zero if daylight savings time is used */ +_CRTIMP extern int _daylight; + +/* offset for Daylight Saving Time */ +_CRTIMP extern long _dstbias; + +/* difference in seconds between GMT and local time */ +_CRTIMP extern long _timezone; + +/* standard/daylight savings time zone names */ +_CRTIMP extern char * _tzname[2]; + +#endif /* defined(_DLL) && defined(_M_IX86) */ + +#endif /* _NTSDK */ + + +/* Function prototypes */ + +_CRTIMP char * __cdecl asctime(const struct tm *); +_CRTIMP char * __cdecl ctime(const time_t *); +_CRTIMP clock_t __cdecl clock(void); +_CRTIMP double __cdecl difftime(time_t, time_t); +_CRTIMP struct tm * __cdecl gmtime(const time_t *); +_CRTIMP struct tm * __cdecl localtime(const time_t *); +_CRTIMP time_t __cdecl mktime(struct tm *); +_CRTIMP size_t __cdecl strftime(char *, size_t, const char *, + const struct tm *); +_CRTIMP char * __cdecl _strdate(char *); +_CRTIMP char * __cdecl _strtime(char *); +_CRTIMP time_t __cdecl time(time_t *); + +#ifdef _POSIX_ +_CRTIMP void __cdecl tzset(void); +#else +_CRTIMP void __cdecl _tzset(void); +#endif + +/* --------- The following functions are OBSOLETE --------- */ +/* The Win32 API GetLocalTime and SetLocalTime should be used instead. */ +unsigned __cdecl _getsystime(struct tm *); +unsigned __cdecl _setsystime(struct tm *, unsigned); +/* --------- The preceding functions are OBSOLETE --------- */ + + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#define _SIZE_T_DEFINED +#endif + +#ifndef _MAC +#ifndef _WTIME_DEFINED + +/* wide function prototypes, also declared in wchar.h */ + +_CRTIMP wchar_t * __cdecl _wasctime(const struct tm *); +_CRTIMP wchar_t * __cdecl _wctime(const time_t *); +_CRTIMP size_t __cdecl wcsftime(wchar_t *, size_t, const wchar_t *, + const struct tm *); +_CRTIMP wchar_t * __cdecl _wstrdate(wchar_t *); +_CRTIMP wchar_t * __cdecl _wstrtime(wchar_t *); + +#define _WTIME_DEFINED +#endif +#endif /* ndef _MAC */ + + +#if !__STDC__ || defined(_POSIX_) + +/* Non-ANSI names for compatibility */ + +#define CLK_TCK CLOCKS_PER_SEC + +#ifdef _NTSDK + +/* Declarations and definitions compatible with the NT SDK */ + +#define daylight _daylight +/* timezone cannot be #defined because of <sys/timeb.h> */ + +#ifndef _POSIX_ +#define tzname _tzname +#define tzset _tzset +#endif /* _POSIX_ */ + +#else /* ndef _NTSDK */ + +#if defined(_DLL) && defined(_M_IX86) + +#define daylight (*__p__daylight()) +/* timezone cannot be #defined because of <sys/timeb.h> + so CRT DLL for win32s will not have timezone */ +_CRTIMP extern long timezone; +#define tzname (__p__tzname()) + +#else /* !(defined(_DLL) && defined(_M_IX86)) */ + +_CRTIMP extern int daylight; +_CRTIMP extern long timezone; +_CRTIMP extern char * tzname[2]; + +#endif /* !(defined(_DLL) && defined(_M_IX86)) */ + +_CRTIMP void __cdecl tzset(void); + +#endif /* _NTSDK */ + +#endif /* __STDC__ */ + + +#ifdef __cplusplus +} +#endif + + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_TIME */ diff --git a/public/sdk/inc/crt/typeinfo.h b/public/sdk/inc/crt/typeinfo.h new file mode 100644 index 000000000..55245e14f --- /dev/null +++ b/public/sdk/inc/crt/typeinfo.h @@ -0,0 +1,88 @@ +/*** +*typeinfo.h - Defines the type_info structure and exceptions used for RTTI +* +* Copyright (c) 1994-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* Defines the type_info structure and exceptions used for +* Runtime Type Identification. +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef __cplusplus +#error This header requires a C++ compiler ... +#endif + +#ifndef _INC_TYPEINFO +#define _INC_TYPEINFO + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + +class type_info { +public: + _CRTIMP virtual ~type_info(); + _CRTIMP int operator==(const type_info& rhs) const; + _CRTIMP int operator!=(const type_info& rhs) const; + _CRTIMP int before(const type_info& rhs) const; + _CRTIMP const char* name() const; + _CRTIMP const char* raw_name() const; +private: + void *_m_data; + char _m_d_name[1]; + type_info(const type_info& rhs); + type_info& operator=(const type_info& rhs); +}; + + +// This include must occur below the definition of class type_info +#include <stdexcpt.h> + +class _CRTIMP bad_cast : public exception { +public: + bad_cast(const __exString& what_arg) : exception (what_arg) {} +}; + +class _CRTIMP bad_typeid : public exception { +public: + bad_typeid(const char * what_arg) : exception (what_arg) {} +}; + +class _CRTIMP __non_rtti_object : public bad_typeid { +public: + __non_rtti_object(const char * what_arg) : bad_typeid(what_arg) {} +}; + +#ifdef __RTTI_OLDNAMES +// Some synonyms for folks using older standard +typedef type_info Type_info; +typedef bad_cast Bad_cast; +typedef bad_typeid Bad_typeid; +#endif // __RTTI_OLDNAMES + + +#endif // _INC_TYPEINFO diff --git a/public/sdk/inc/crt/varargs.h b/public/sdk/inc/crt/varargs.h new file mode 100644 index 000000000..e2bb22d07 --- /dev/null +++ b/public/sdk/inc/crt/varargs.h @@ -0,0 +1,163 @@ +/*** +*varargs.h - XENIX style macros for variable argument functions +* +* Copyright (c) 1985-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines XENIX style macros for accessing arguments of a +* function which takes a variable number of arguments. +* [System V] +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef _INC_VARARGS +#define _INC_VARARGS + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +/* + * Currently, all MS C compilers for Win32 platforms default to 8 byte + * alignment. + */ +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + +#if __STDC__ +#error varargs.h incompatible with ANSI (use stdarg.h) +#endif + + +#ifndef _VA_LIST_DEFINED + +#ifdef _M_ALPHA +typedef struct { + char *a0; /* pointer to first homed integer argument */ + int offset; /* byte offset of next parameter */ +} va_list; +#else +typedef char *va_list; +#endif + +#define _VA_LIST_DEFINED +#endif + + +#if defined(_M_IX86) + +/* + * define a macro to compute the size of a type, variable or expression, + * rounded up to the nearest multiple of sizeof(int). This number is its + * size as function argument (Intel architecture). Note that the macro + * depends on sizeof(int) being a power of 2! + */ +#define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) ) + +#define va_dcl va_list va_alist; +#define va_start(ap) ap = (va_list)&va_alist +#define va_arg(ap,t) ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) ) +#define va_end(ap) ap = (va_list)0 + + +#elif defined(_M_MRX000) /* _MIPS_ */ + + +#define va_dcl int va_alist; +#define va_start(list) list = (char *) &va_alist +#define va_end(list) +#define va_arg(list, mode) ((mode *)(list =\ + (char *) ((((int)list + (__builtin_alignof(mode)<=4?3:7)) &\ + (__builtin_alignof(mode)<=4?-4:-8))+sizeof(mode))))[-1] +/* +++++++++++++++++++++++++++++++++++++++++++ + Because of parameter passing conventions in C: + use mode=int for char, and short types + use mode=double for float types + use a pointer for array types + +++++++++++++++++++++++++++++++++++++++++++ */ + + +#elif defined(_M_ALPHA) + +/* + * The Alpha compiler supports two builtin functions that are used to + * implement stdarg/varargs. The __builtin_va_start function is used + * by va_start to initialize the data structure that locates the next + * argument. The __builtin_isfloat function is used by va_arg to pick + * which part of the home area a given register argument is stored in. + * The home area is where up to six integer and/or six floating point + * register arguments are stored down (so they can also be referenced + * by a pointer like any arguments passed on the stack). + */ +extern void * __builtin_va_start(va_list, ...); + +#define va_dcl long va_alist; +#define va_start(list) __builtin_va_start(list, va_alist, 0) +#define va_end(list) +#define va_arg(list, mode) \ + ( *( ((list).offset += ((int)sizeof(mode) + 7) & -8) , \ + (mode *)((list).a0 + (list).offset - \ + ((__builtin_isfloat(mode) && (list).offset <= (6 * 8)) ? \ + (6 * 8) + 8 : ((int)sizeof(mode) + 7) & -8) \ + ) \ + ) \ + ) + + +#elif defined(_M_PPC) + +/* + * define a macro to compute the size of a type, variable or expression, + * rounded up to the nearest multiple of sizeof(int). This number is its + * size as function argument (PPC architecture). Note that the macro + * depends on sizeof(int) being a power of 2! + */ +/* this is for LITTLE-ENDIAN PowerPC */ + +/* bytes that a type occupies in the argument list */ +#define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) ) +/* return 'ap' adjusted for type 't' in arglist */ +#define _ALIGNIT(ap,t) \ + ((((int)(ap))+(sizeof(t)<8?3:7)) & (sizeof(t)<8?~3:~7)) + +#define va_dcl va_list va_alist; +#define va_start(ap) ap = (va_list)&va_alist +#define va_arg(ap,t) ( *(t *)((ap = (char *) (_ALIGNIT(ap, t) + _INTSIZEOF(t))) - _INTSIZEOF(t)) ) +#define va_end(ap) ap = (va_list)0 + +#else + +/* A guess at the proper definitions for other platforms */ + +#define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) ) + +#define va_dcl va_list va_alist; +#define va_start(ap) ap = (va_list)&va_alist +#define va_arg(ap,t) ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) ) +#define va_end(ap) ap = (va_list)0 + + +#endif + + +#ifdef __cplusplus +} +#endif + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_VARARGS */ diff --git a/public/sdk/inc/crt/wchar.h b/public/sdk/inc/crt/wchar.h new file mode 100644 index 000000000..861d9c594 --- /dev/null +++ b/public/sdk/inc/crt/wchar.h @@ -0,0 +1,699 @@ +/*** +*wchar.h - declarations for wide character functions +* +* Copyright (c) 1992-1995, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file contains the types, macros and function declarations for +* all wide character-related functions. They may also be declared in +* individual header files on a functional basis. +* [ISO] +* +* Note: keep in sync with ctype.h, stdio.h, stdlib.h, string.h, time.h. +* +* [Public] +* +****/ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#if !defined(_M_MPPC) && !defined(_M_M68K) + +#ifndef _INC_WCHAR +#define _INC_WCHAR + +#if !defined(_WIN32) && !defined(_MAC) +#error ERROR: Only Mac or Win32 targets supported! +#endif + + +#ifdef _MSC_VER +#pragma pack(push,8) +#endif /* _MSC_VER */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define _CRTAPI1 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI1 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI1 __cdecl +#else +#define _CRTAPI1 +#endif +#endif + + +/* Define _CRTAPI2 (for compatibility with the NT SDK) */ + +#ifndef _CRTAPI2 +#if _MSC_VER >= 800 && _M_IX86 >= 300 +#define _CRTAPI2 __cdecl +#else +#define _CRTAPI2 +#endif +#endif + + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _NTSDK +/* definition compatible with NT SDK */ +#define _CRTIMP +#else /* ndef _NTSDK */ +/* current definition */ +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _NTSDK */ +#endif /* _CRTIMP */ + + +/* Define __cdecl for non-Microsoft compilers */ + +#if ( !defined(_MSC_VER) && !defined(__cdecl) ) +#define __cdecl +#endif + + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#define _SIZE_T_DEFINED +#endif + +#ifndef _TIME_T_DEFINED +typedef long time_t; +#define _TIME_T_DEFINED +#endif + +#ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif + + +#ifndef _WCTYPE_T_DEFINED +typedef wchar_t wint_t; +typedef wchar_t wctype_t; +#define _WCTYPE_T_DEFINED +#endif + + +#ifndef _VA_LIST_DEFINED +#ifdef _M_ALPHA +typedef struct { + char *a0; /* pointer to first homed integer argument */ + int offset; /* byte offset of next parameter */ +} va_list; +#else +typedef char * va_list; +#endif +#define _VA_LIST_DEFINED +#endif + +#ifndef WEOF +#define WEOF (wint_t)(0xFFFF) +#endif + +#ifndef _FILE_DEFINED +struct _iobuf { + char *_ptr; + int _cnt; + char *_base; + int _flag; + int _file; + int _charbuf; + int _bufsiz; + char *_tmpfname; + }; +typedef struct _iobuf FILE; +#define _FILE_DEFINED +#endif + +#ifndef _FSIZE_T_DEFINED +typedef unsigned long _fsize_t; /* Could be 64 bits for Win32 */ +#define _FSIZE_T_DEFINED +#endif + +#ifndef _WFINDDATA_T_DEFINED + +struct _wfinddata_t { + unsigned attrib; + time_t time_create; /* -1 for FAT file systems */ + time_t time_access; /* -1 for FAT file systems */ + time_t time_write; + _fsize_t size; + wchar_t name[260]; +}; + +#if !defined(_M_MPPC) && !defined(_M_M68K) +#if _INTEGRAL_MAX_BITS >= 64 +struct _wfinddatai64_t { + unsigned attrib; + time_t time_create; /* -1 for FAT file systems */ + time_t time_access; /* -1 for FAT file systems */ + time_t time_write; + __int64 size; + wchar_t name[260]; +}; +#endif +#endif + +#define _WFINDDATA_T_DEFINED +#endif + +/* define NULL pointer value */ + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +/* + * This declaration allows the user access to the ctype look-up + * array _ctype defined in ctype.obj by simply including ctype.h + */ + +#ifdef _NTSDK + +/* definitions and declarations compatible with NT SDK */ + +#ifdef _DLL +extern unsigned short * _ctype; +#define _pctype (*_pctype_dll) +extern unsigned short **_pctype_dll; +#define _pwctype (*_pwctype_dll) +extern unsigned short **_pwctype_dll; +#else /* ndef _DLL */ +extern unsigned short _ctype[]; +extern unsigned short *_pctype; +extern wctype_t *_pwctype; +#endif /* _DLL */ + +#else /* ndef _NTSDK */ + +/* current declarations */ + +_CRTIMP extern unsigned short _ctype[]; + +#if defined(_DLL) && defined(_M_IX86) + +#define _pctype (*__p__pctype()) +_CRTIMP unsigned short ** __cdecl __p__pctype(void); + +#define _pwctype (*__p__pwctype()) +_CRTIMP wctype_t ** __cdecl ___p__pwctype(void); + +#else /* !(defined(_DLL) && defined(_M_IX86)) */ + +_CRTIMP extern unsigned short *_pctype; +_CRTIMP extern wctype_t *_pwctype; + +#endif /* defined(_DLL) && defined(_M_IX86) */ + +#endif /* _NTSDK */ + + +/* set bit masks for the possible character types */ + +#define _UPPER 0x1 /* upper case letter */ +#define _LOWER 0x2 /* lower case letter */ +#define _DIGIT 0x4 /* digit[0-9] */ +#define _SPACE 0x8 /* tab, carriage return, newline, */ + /* vertical tab or form feed */ +#define _PUNCT 0x10 /* punctuation character */ +#define _CONTROL 0x20 /* control character */ +#define _BLANK 0x40 /* space char */ +#define _HEX 0x80 /* hexadecimal digit */ + +#define _LEADBYTE 0x8000 /* multibyte leadbyte */ +#define _ALPHA (0x0100|_UPPER|_LOWER) /* alphabetic character */ + + +/* Function prototypes */ + +#ifndef _WCTYPE_DEFINED + +/* Character classification function prototypes */ +/* also declared in ctype.h */ + +_CRTIMP int __cdecl iswalpha(wint_t); +_CRTIMP int __cdecl iswupper(wint_t); +_CRTIMP int __cdecl iswlower(wint_t); +_CRTIMP int __cdecl iswdigit(wint_t); +_CRTIMP int __cdecl iswxdigit(wint_t); +_CRTIMP int __cdecl iswspace(wint_t); +_CRTIMP int __cdecl iswpunct(wint_t); +_CRTIMP int __cdecl iswalnum(wint_t); +_CRTIMP int __cdecl iswprint(wint_t); +_CRTIMP int __cdecl iswgraph(wint_t); +_CRTIMP int __cdecl iswcntrl(wint_t); +_CRTIMP int __cdecl iswascii(wint_t); +_CRTIMP int __cdecl isleadbyte(int); + +_CRTIMP wchar_t __cdecl towupper(wchar_t); +_CRTIMP wchar_t __cdecl towlower(wchar_t); + +_CRTIMP int __cdecl iswctype(wint_t, wctype_t); + +/* --------- The following functions are OBSOLETE --------- */ +_CRTIMP int __cdecl is_wctype(wint_t, wctype_t); +/* --------- The preceding functions are OBSOLETE --------- */ + +#define _WCTYPE_DEFINED +#endif + +#ifndef _WDIRECT_DEFINED + +/* also declared in direct.h */ + +_CRTIMP int __cdecl _wchdir(const wchar_t *); +_CRTIMP wchar_t * __cdecl _wgetcwd(wchar_t *, int); +_CRTIMP wchar_t * __cdecl _wgetdcwd(int, wchar_t *, int); +_CRTIMP int __cdecl _wmkdir(const wchar_t *); +_CRTIMP int __cdecl _wrmdir(const wchar_t *); + +#define _WDIRECT_DEFINED +#endif + +#ifndef _WIO_DEFINED + +/* also declared in io.h */ + +_CRTIMP int __cdecl _waccess(const wchar_t *, int); +_CRTIMP int __cdecl _wchmod(const wchar_t *, int); +_CRTIMP int __cdecl _wcreat(const wchar_t *, int); +_CRTIMP long __cdecl _wfindfirst(const wchar_t *, struct _wfinddata_t *); +_CRTIMP int __cdecl _wfindnext(long, struct _wfinddata_t *); +_CRTIMP int __cdecl _wunlink(const wchar_t *); +_CRTIMP int __cdecl _wrename(const wchar_t *, const wchar_t *); +_CRTIMP int __cdecl _wopen(const wchar_t *, int, ...); +_CRTIMP int __cdecl _wsopen(const wchar_t *, int, int, ...); +_CRTIMP wchar_t * __cdecl _wmktemp(wchar_t *); + +#if _INTEGRAL_MAX_BITS >= 64 +_CRTIMP long __cdecl _wfindfirsti64(const wchar_t *, struct _wfinddatai64_t *); +_CRTIMP int __cdecl _wfindnexti64(long, struct _wfinddatai64_t *); +#endif + +#define _WIO_DEFINED +#endif + +#ifndef _WLOCALE_DEFINED + +/* wide function prototypes, also declared in wchar.h */ + +_CRTIMP wchar_t * __cdecl _wsetlocale(int, const wchar_t *); + +#define _WLOCALE_DEFINED +#endif + +#ifndef _WPROCESS_DEFINED + +/* also declared in process.h */ + +_CRTIMP int __cdecl _wexecl(const wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl _wexecle(const wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl _wexeclp(const wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl _wexeclpe(const wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl _wexecv(const wchar_t *, const wchar_t * const *); +_CRTIMP int __cdecl _wexecve(const wchar_t *, const wchar_t * const *, const wchar_t * const *); +_CRTIMP int __cdecl _wexecvp(const wchar_t *, const wchar_t * const *); +_CRTIMP int __cdecl _wexecvpe(const wchar_t *, const wchar_t * const *, const wchar_t * const *); +_CRTIMP int __cdecl _wspawnl(int, const wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl _wspawnle(int, const wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl _wspawnlp(int, const wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl _wspawnlpe(int, const wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl _wspawnv(int, const wchar_t *, const wchar_t * const *); +_CRTIMP int __cdecl _wspawnve(int, const wchar_t *, const wchar_t * const *, + const wchar_t * const *); +_CRTIMP int __cdecl _wspawnvp(int, const wchar_t *, const wchar_t * const *); +_CRTIMP int __cdecl _wspawnvpe(int, const wchar_t *, const wchar_t * const *, + const wchar_t * const *); +_CRTIMP int __cdecl _wsystem(const wchar_t *); + +#define _WPROCESS_DEFINED +#endif + +#define iswalpha(_c) ( iswctype(_c,_ALPHA) ) +#define iswupper(_c) ( iswctype(_c,_UPPER) ) +#define iswlower(_c) ( iswctype(_c,_LOWER) ) +#define iswdigit(_c) ( iswctype(_c,_DIGIT) ) +#define iswxdigit(_c) ( iswctype(_c,_HEX) ) +#define iswspace(_c) ( iswctype(_c,_SPACE) ) +#define iswpunct(_c) ( iswctype(_c,_PUNCT) ) +#define iswalnum(_c) ( iswctype(_c,_ALPHA|_DIGIT) ) +#define iswprint(_c) ( iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT) ) +#define iswgraph(_c) ( iswctype(_c,_PUNCT|_ALPHA|_DIGIT) ) +#define iswcntrl(_c) ( iswctype(_c,_CONTROL) ) +#define iswascii(_c) ( (unsigned)(_c) < 0x80 ) + +#define isleadbyte(_c) (_pctype[(unsigned char)(_c)] & _LEADBYTE) + +#if !defined(_POSIX_) + +/* define structure for returning status information */ + +#ifndef _INO_T_DEFINED + +typedef unsigned short _ino_t; /* i-node number (not used on DOS) */ + +#if !__STDC__ +/* Non-ANSI name for compatibility */ +#ifdef _NTSDK +#define ino_t _ino_t +#else /* ndef _NTSDK */ +typedef unsigned short ino_t; +#endif /* _NTSDK */ +#endif + +#define _INO_T_DEFINED +#endif + + +#ifndef _DEV_T_DEFINED + +#ifdef _NTSDK +typedef short _dev_t; /* device code */ +#else /* ndef _NTSDK */ +typedef unsigned int _dev_t; /* device code */ +#endif /* _NTSDK */ + +#if !__STDC__ +/* Non-ANSI name for compatibility */ +#ifdef _NTSDK +#define dev_t _dev_t +#else /* ndef _NTSDK */ +typedef unsigned int dev_t; +#endif /* _NTSDK */ +#endif + +#define _DEV_T_DEFINED +#endif + +#ifndef _OFF_T_DEFINED + +typedef long _off_t; /* file offset value */ + +#if !__STDC__ +/* Non-ANSI name for compatibility */ +#ifdef _NTSDK +#define off_t _off_t +#else /* ndef _NTSDK */ +typedef long off_t; +#endif /* _NTSDK */ +#endif + +#define _OFF_T_DEFINED +#endif + +#ifndef _STAT_DEFINED + +struct _stat { + _dev_t st_dev; + _ino_t st_ino; + unsigned short st_mode; + short st_nlink; + short st_uid; + short st_gid; + _dev_t st_rdev; + _off_t st_size; + time_t st_atime; + time_t st_mtime; + time_t st_ctime; + }; + +#if !__STDC__ && !defined(_NTSDK) + +/* Non-ANSI names for compatibility */ + +struct stat { + _dev_t st_dev; + _ino_t st_ino; + unsigned short st_mode; + short st_nlink; + short st_uid; + short st_gid; + _dev_t st_rdev; + _off_t st_size; + time_t st_atime; + time_t st_mtime; + time_t st_ctime; + }; + +#endif /* __STDC__ */ + +#if _INTEGRAL_MAX_BITS >= 64 +struct _stati64 { + _dev_t st_dev; + _ino_t st_ino; + unsigned short st_mode; + short st_nlink; + short st_uid; + short st_gid; + _dev_t st_rdev; + __int64 st_size; + time_t st_atime; + time_t st_mtime; + time_t st_ctime; + }; +#endif + +#define _STAT_DEFINED +#endif + + +#ifndef _WSTAT_DEFINED + +/* also declared in stat.h */ + +_CRTIMP int __cdecl _wstat(const wchar_t *, struct _stat *); + +#if _INTEGRAL_MAX_BITS >= 64 +_CRTIMP int __cdecl _wstati64(const wchar_t *, struct _stati64 *); +#endif + +#define _WSTAT_DEFINED +#endif + +#endif /* !_POSIX_ */ + + +#ifndef _WSTDIO_DEFINED + +/* also declared in stdio.h */ + +#ifdef _POSIX_ +_CRTIMP FILE * __cdecl _wfsopen(const wchar_t *, const wchar_t *); +#else +_CRTIMP FILE * __cdecl _wfsopen(const wchar_t *, const wchar_t *, int); +#endif + +_CRTIMP wint_t __cdecl fgetwc(FILE *); +_CRTIMP wint_t __cdecl _fgetwchar(void); +_CRTIMP wint_t __cdecl fputwc(wint_t, FILE *); +_CRTIMP wint_t __cdecl _fputwchar(wint_t); +_CRTIMP wint_t __cdecl getwc(FILE *); +_CRTIMP wint_t __cdecl getwchar(void); +_CRTIMP wint_t __cdecl putwc(wint_t, FILE *); +_CRTIMP wint_t __cdecl putwchar(wint_t); +_CRTIMP wint_t __cdecl ungetwc(wint_t, FILE *); + +_CRTIMP wchar_t * __cdecl fgetws(wchar_t *, int, FILE *); +_CRTIMP int __cdecl fputws(const wchar_t *, FILE *); +_CRTIMP wchar_t * __cdecl _getws(wchar_t *); +_CRTIMP int __cdecl _putws(const wchar_t *); + +_CRTIMP int __cdecl fwprintf(FILE *, const wchar_t *, ...); +_CRTIMP int __cdecl wprintf(const wchar_t *, ...); +_CRTIMP int __cdecl _snwprintf(wchar_t *, size_t, const wchar_t *, ...); +_CRTIMP int __cdecl swprintf(wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl vfwprintf(FILE *, const wchar_t *, va_list); +_CRTIMP int __cdecl vwprintf(const wchar_t *, va_list); +_CRTIMP int __cdecl _vsnwprintf(wchar_t *, size_t, const wchar_t *, va_list); +_CRTIMP int __cdecl vswprintf(wchar_t *, const wchar_t *, va_list); +_CRTIMP int __cdecl fwscanf(FILE *, const wchar_t *, ...); +_CRTIMP int __cdecl swscanf(const wchar_t *, const wchar_t *, ...); +_CRTIMP int __cdecl wscanf(const wchar_t *, ...); + +#define getwchar() fgetwc(stdin) +#define putwchar(_c) fputwc((_c),stdout) +#define getwc(_stm) fgetwc(_stm) +#define putwc(_c,_stm) fputwc(_c,_stm) + +_CRTIMP FILE * __cdecl _wfdopen(int, const wchar_t *); +_CRTIMP FILE * __cdecl _wfopen(const wchar_t *, const wchar_t *); +_CRTIMP FILE * __cdecl _wfreopen(const wchar_t *, const wchar_t *, FILE *); +_CRTIMP void __cdecl _wperror(const wchar_t *); +_CRTIMP FILE * __cdecl _wpopen(const wchar_t *, const wchar_t *); +_CRTIMP int __cdecl _wremove(const wchar_t *); +_CRTIMP wchar_t * __cdecl _wtempnam(const wchar_t *, const wchar_t *); +_CRTIMP wchar_t * __cdecl _wtmpnam(wchar_t *); + +#define _WSTDIO_DEFINED +#endif + + +#ifndef _WSTDLIB_DEFINED + +/* also declared in stdlib.h */ + +_CRTIMP wchar_t * __cdecl _itow (int, wchar_t *, int); +_CRTIMP wchar_t * __cdecl _ltow (long, wchar_t *, int); +_CRTIMP wchar_t * __cdecl _ultow (unsigned long, wchar_t *, int); +_CRTIMP double __cdecl wcstod(const wchar_t *, wchar_t **); +_CRTIMP long __cdecl wcstol(const wchar_t *, wchar_t **, int); +_CRTIMP unsigned long __cdecl wcstoul(const wchar_t *, wchar_t **, int); +_CRTIMP wchar_t * __cdecl _wgetenv(const wchar_t *); +_CRTIMP int __cdecl _wsystem(const wchar_t *); +_CRTIMP int __cdecl _wtoi(const wchar_t *); +_CRTIMP long __cdecl _wtol(const wchar_t *); + +#define _WSTDLIB_DEFINED +#endif + +#ifndef _POSIX_ + +#ifndef _WSTDLIBP_DEFINED + +/* also declared in stdlib.h */ + +_CRTIMP wchar_t * __cdecl _wfullpath(wchar_t *, const wchar_t *, size_t); +_CRTIMP void __cdecl _wmakepath(wchar_t *, const wchar_t *, const wchar_t *, const wchar_t *, + const wchar_t *); +_CRTIMP void __cdecl _wperror(const wchar_t *); +_CRTIMP int __cdecl _wputenv(const wchar_t *); +_CRTIMP void __cdecl _wsearchenv(const wchar_t *, const wchar_t *, wchar_t *); +_CRTIMP void __cdecl _wsplitpath(const wchar_t *, wchar_t *, wchar_t *, wchar_t *, wchar_t *); + +#define _WSTDLIBP_DEFINED +#endif + +#endif /* _POSIX_ */ + + +#ifndef _WSTRING_DEFINED + +/* also declared in string.h */ + +_CRTIMP wchar_t * __cdecl wcscat(wchar_t *, const wchar_t *); +_CRTIMP wchar_t * __cdecl wcschr(const wchar_t *, wchar_t); +_CRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *); +_CRTIMP wchar_t * __cdecl wcscpy(wchar_t *, const wchar_t *); +_CRTIMP size_t __cdecl wcscspn(const wchar_t *, const wchar_t *); +_CRTIMP size_t __cdecl wcslen(const wchar_t *); +_CRTIMP wchar_t * __cdecl wcsncat(wchar_t *, const wchar_t *, size_t); +_CRTIMP int __cdecl wcsncmp(const wchar_t *, const wchar_t *, size_t); +_CRTIMP wchar_t * __cdecl wcsncpy(wchar_t *, const wchar_t *, size_t); +_CRTIMP wchar_t * __cdecl wcspbrk(const wchar_t *, const wchar_t *); +_CRTIMP wchar_t * __cdecl wcsrchr(const wchar_t *, wchar_t); +_CRTIMP size_t __cdecl wcsspn(const wchar_t *, const wchar_t *); +_CRTIMP wchar_t * __cdecl wcsstr(const wchar_t *, const wchar_t *); +_CRTIMP wchar_t * __cdecl wcstok(wchar_t *, const wchar_t *); + +_CRTIMP wchar_t * __cdecl _wcsdup(const wchar_t *); +_CRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *); +_CRTIMP int __cdecl _wcsnicmp(const wchar_t *, const wchar_t *, size_t); +_CRTIMP wchar_t * __cdecl _wcsnset(wchar_t *, wchar_t, size_t); +_CRTIMP wchar_t * __cdecl _wcsrev(wchar_t *); +_CRTIMP wchar_t * __cdecl _wcsset(wchar_t *, wchar_t); + +_CRTIMP wchar_t * __cdecl _wcslwr(wchar_t *); +_CRTIMP wchar_t * __cdecl _wcsupr(wchar_t *); +_CRTIMP size_t __cdecl wcsxfrm(wchar_t *, const wchar_t *, size_t); +_CRTIMP int __cdecl wcscoll(const wchar_t *, const wchar_t *); +_CRTIMP int __cdecl _wcsicoll(const wchar_t *, const wchar_t *); +_CRTIMP int __cdecl _wcsncoll(const wchar_t *, const wchar_t *, size_t); +_CRTIMP int __cdecl _wcsnicoll(const wchar_t *, const wchar_t *, size_t); + +/* Old names */ +#define wcswcs wcsstr + +#if !__STDC__ + +#ifdef _NTSDK + +/* Non-ANSI names for compatibility */ +#define wcsdup _wcsdup +#define wcsicmp _wcsicmp +#define wcsnicmp _wcsnicmp +#define wcsnset _wcsnset +#define wcsrev _wcsrev +#define wcsset _wcsset +#define wcslwr _wcslwr +#define wcsupr _wcsupr +#define wcsicoll _wcsicoll + +#else /* ndef _NTSDK */ + +/* prototypes for oldnames.lib functions */ +_CRTIMP wchar_t * __cdecl wcsdup(const wchar_t *); +_CRTIMP int __cdecl wcsicmp(const wchar_t *, const wchar_t *); +_CRTIMP int __cdecl wcsnicmp(const wchar_t *, const wchar_t *, size_t); +_CRTIMP wchar_t * __cdecl wcsnset(wchar_t *, wchar_t, size_t); +_CRTIMP wchar_t * __cdecl wcsrev(wchar_t *); +_CRTIMP wchar_t * __cdecl wcsset(wchar_t *, wchar_t); +_CRTIMP wchar_t * __cdecl wcslwr(wchar_t *); +_CRTIMP wchar_t * __cdecl wcsupr(wchar_t *); +_CRTIMP int __cdecl wcsicoll(const wchar_t *, const wchar_t *); + +#endif /* ndef _NTSDK */ + +#endif /* !__STDC__ */ + +#define _WSTRING_DEFINED +#endif + +#ifndef _TM_DEFINED +struct tm { + int tm_sec; /* seconds after the minute - [0,59] */ + int tm_min; /* minutes after the hour - [0,59] */ + int tm_hour; /* hours since midnight - [0,23] */ + int tm_mday; /* day of the month - [1,31] */ + int tm_mon; /* months since January - [0,11] */ + int tm_year; /* years since 1900 */ + int tm_wday; /* days since Sunday - [0,6] */ + int tm_yday; /* days since January 1 - [0,365] */ + int tm_isdst; /* daylight savings time flag */ + }; +#define _TM_DEFINED +#endif + +#ifndef _WTIME_DEFINED + +/* also declared in time.h */ + +_CRTIMP wchar_t * __cdecl _wasctime(const struct tm *); +_CRTIMP wchar_t * __cdecl _wctime(const time_t *); +_CRTIMP size_t __cdecl wcsftime(wchar_t *, size_t, const wchar_t *, + const struct tm *); +_CRTIMP wchar_t * __cdecl _wstrdate(wchar_t *); +_CRTIMP wchar_t * __cdecl _wstrtime(wchar_t *); + +#define _WTIME_DEFINED +#endif + + +#ifdef __cplusplus +} +#endif + +#ifdef _MSC_VER +#pragma pack(pop) +#endif /* _MSC_VER */ + +#endif /* _INC_WCHAR */ + +#endif /* !defined(_M_MPPC) && !defined(_M_M68K) */ + diff --git a/public/sdk/inc/crt/wcstr.h b/public/sdk/inc/crt/wcstr.h new file mode 100644 index 000000000..41543e747 --- /dev/null +++ b/public/sdk/inc/crt/wcstr.h @@ -0,0 +1,32 @@ +/*** +* wcstr.h - declarations for wide character string manipulation functions +* +* Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file contains the function declarations for the string +* manipulation functions. +* [OBSOLETE][UNICODE/ISO] +* +* WARNING: OBSOLETE FILE: use wchar.h/stdlib.h instead!!! +* This file provided only for short-term compatibility. It will +* disappear in the near future after a brief transitional period. +* +****/ + +#ifndef _INC_WCSTR + +#include <wchar.h> +#define wcswcs wcsstr + +#define _wcscmpi _wcsicmp +#if !__STDC__ +#define wcscmpi _wcsicmp +#endif + +/* from stdlib.h */ +int _CRTAPI1 wctomb(char *, wchar_t); +size_t _CRTAPI1 wcstombs(char*, const wchar_t *, size_t); + +#define _INC_WCSTR +#endif /* _INC_WCSTR */ |