📄 ntdll_c.h
字号:
#ifndef CTQY_NTDLL_C_H
#define CTQY_NTDLL_C_H
// no CRT !!!
#define _INC_CTYPE
#define _INC_TCHAR
#define _INC_WCHAR
#define _INC_STRING
#define _INC_STDLIB
#define _INC_STDARG
#define _INC_MATH
#pragma comment(lib,"ntdll.lib")
typedef unsigned int size_t;
typedef unsigned short wchar_t;
typedef unsigned short wint_t;
typedef unsigned short wctype_t;
typedef char* va_list;
/* 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 */
#ifdef __cplusplus
#define _ADDRESSOF(v) ( &reinterpret_cast<const char &>(v) )
#else /* __cplusplus */
#define _ADDRESSOF(v) ( &(v) )
#endif /* __cplusplus */
#define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) )
#define va_start(ap,v) ( ap = (va_list)_ADDRESSOF(v) + _INTSIZEOF(v) )
#define va_arg(ap,t) ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) )
#define va_end(ap) ( ap = (va_list)0 )
#ifndef UNICODE
// ANSI
typedef char TCHAR;
#define _ttoi64 _atoi64
#define _i64tot _i64toa
#define _itot _itoa
#define _ltot _ltoa
#define _sntprintf _snprintf
#define _tcsicmp _stricmp
#define _tcslwr _strlwr
#define _tcsnicmp _strnicmp
#define _tcsupr _strupr
#define _ui64tot _ui64toa
#define _ultot _ultoa
#define _vsntprintf _vsnprintf
#define _ttoi atoi
#define _ttol atol
#define _istalpha isalpha
#define _istdigit isdigit
#define _istlower islower
#define _istspace isspace
#define _istxdigit isxdigit
#define _stprintf sprintf
#define _tcscat strcat
#define _tcschr strchr
#define _tcscmp strcmp
#define _tcscpy strcpy
#define _tcscspn strcspn
#define _tcslen strlen
#define _tcsncat strncat
#define _tcsncmp strncmp
#define _tcsncpy strncpy
#define _tcspbrk strpbrk
#define _tcsrchr strrchr
#define _tcsspn strspn
#define _tcsstr strstr
#define _tcstol strtol
#define _tcstoul strtoul
#define _totlower tolower
#define _totupper toupper
#else// UNICODE
typedef wchar_t TCHAR;
#define _ttoi64 _wtoi64
#define _i64tot _i64tow
#define _itot _itow
#define _ltot _ltow
#define _sntprintf _snwprintf
#define _tcsicmp _wcsicmp
#define _tcslwr _wcslwr
#define _tcsnicmp _wcsnicmp
#define _tcsupr _wcsupr
#define _ui64tot _ui64tow
#define _ultot _ultow
#define _vsntprintf _vsnwprintf
#define _ttoi _wtoi
#define _ttol _wtol
#define _istalpha iswalpha
#define _istdigit iswdigit
#define _istlower iswlower
#define _istspace iswspace
#define _istxdigit iswxdigit
#define _stprintf swprintf
#define _tcscat wcscat
#define _tcschr wcschr
#define _tcscmp wcscmp
#define _tcscpy wcscpy
#define _tcscspn wcscspn
#define _tcslen wcslen
#define _tcsncat wcsncat
#define _tcsncmp wcsncmp
#define _tcsncpy wcsncpy
#define _tcspbrk wcspbrk
#define _tcsrchr wcsrchr
#define _tcsspn wcsspn
#define _tcsstr wcsstr
#define _tcstol wcstol
#define _tcstoul wcstoul
#define _totlower towlower
#define _totupper towupper
#endif // UNICODE
#ifdef __cplusplus
extern "C"{
#endif // __cplusplus
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// string & char
__declspec(dllimport) int __cdecl __isascii(int c);
__declspec(dllimport) int __cdecl __iscsym(int c);
__declspec(dllimport) int __cdecl __iscsymf(int c);
__declspec(dllimport) int __cdecl __toascii(int c);
__declspec(dllimport) __int64 __cdecl _atoi64(const char* str);
__declspec(dllimport) __int64 __cdecl _wtoi64(const wchar_t* str);
__declspec(dllimport) char* __cdecl _i64toa(__int64 value, char* str, int radix);
__declspec(dllimport) wchar_t* __cdecl _i64tow(__int64 value, wchar_t* str, int radix);
__declspec(dllimport) char* __cdecl _itoa(int value, char* str, int radix);
__declspec(dllimport) wchar_t* __cdecl _itow(int value, wchar_t* str, int radix);
__declspec(dllimport) char* __cdecl _ltoa(long value, char* str, int radix);
__declspec(dllimport) wchar_t* __cdecl _ltow(long value, wchar_t* str,int radix);
__declspec(dllimport) int __cdecl _snprintf(char* buffer, size_t count, const char* format, ...);
__declspec(dllimport) int __cdecl _snwprintf(wchar_t* buffer, size_t count, const wchar_t* format, ...);
__declspec(dllimport) void __cdecl _splitpath(const char* path, char* drive, char* dir, char* fname, char* ext);
__declspec(dllimport) int __cdecl _stricmp(const char* string1, const char* string2);
__declspec(dllimport) int __cdecl _wcsicmp(const wchar_t* string1, const wchar_t* string2);
__declspec(dllimport) char* __cdecl _strlwr(char* str);
__declspec(dllimport) wchar_t* __cdecl _wcslwr(wchar_t* str);
__declspec(dllimport) int __cdecl _strnicmp(const char* string1, const char* string2, size_t count);
__declspec(dllimport) int __cdecl _wcsnicmp(const wchar_t* string1, const wchar_t* string2, size_t count);
__declspec(dllimport) char* __cdecl _strupr(char* str);
__declspec(dllimport) wchar_t* __cdecl _wcsupr(wchar_t* str);
__declspec(dllimport) int __cdecl _tolower(int c);
__declspec(dllimport) int __cdecl _toupper(int c);
__declspec(dllimport) char* __cdecl _ui64toa(unsigned __int64 value, char* str, int radix);
__declspec(dllimport) wchar_t* __cdecl _ui64tow(unsigned __int64 value, wchar_t* str, int radix);
__declspec(dllimport) char* __cdecl _ultoa(unsigned long value, char* str, int radix);
__declspec(dllimport) wchar_t* __cdecl _ultow(unsigned long value, wchar_t* str, int radix);
__declspec(dllimport) int __cdecl _vsnprintf(char* buffer, size_t count, const char* format, va_list argptr);
__declspec(dllimport) int __cdecl _vsnwprintf(wchar_t* buffer, size_t count, const wchar_t* format, va_list argptr);
__declspec(dllimport) int __cdecl atoi(const char* str);
__declspec(dllimport) int __cdecl _wtoi(const wchar_t* str);
__declspec(dllimport) long __cdecl atol(const char* str);
__declspec(dllimport) long __cdecl _wtol(const wchar_t* str);
__declspec(dllimport) int __cdecl isalnum(int c);
__declspec(dllimport) int __cdecl isalpha(int c);
__declspec(dllimport) int __cdecl iswalpha(wint_t c);
__declspec(dllimport) int __cdecl iscntrl(int c);
__declspec(dllimport) int __cdecl isdigit(int c);
__declspec(dllimport) int __cdecl iswdigit(wint_t c);
__declspec(dllimport) int __cdecl isgraph(int c);
__declspec(dllimport) int __cdecl islower(int c);
__declspec(dllimport) int __cdecl iswlower(wint_t c);
__declspec(dllimport) int __cdecl isprint(int c);
__declspec(dllimport) int __cdecl ispunct(int c);
__declspec(dllimport) int __cdecl isspace(int c);
__declspec(dllimport) int __cdecl iswspace(wint_t c);
__declspec(dllimport) int __cdecl isupper(int c);
__declspec(dllimport) int __cdecl iswctype(wint_t c, wctype_t desc);
__declspec(dllimport) int __cdecl isxdigit(int c);
__declspec(dllimport) int __cdecl iswxdigit(wint_t c);
__declspec(dllimport) size_t __cdecl mbstowcs(wchar_t* wcstr, const char* mbstr, size_t count);
__declspec(dllimport) size_t __cdecl wcstombs(char* mbstr, const wchar_t* wcstr, size_t count);
__declspec(dllimport) int __cdecl sprintf(char* buffer, const char* format, ...);
__declspec(dllimport) int __cdecl swprintf(wchar_t* buffer, const wchar_t* format, ...);
__declspec(dllimport) int __cdecl sscanf(const char* buffer, const char* format, ...);
__declspec(dllimport) char* __cdecl strcat(char* strDestination, const char* strSource);
__declspec(dllimport) wchar_t* __cdecl wcscat(wchar_t* strDestination, const wchar_t* strSource);
__declspec(dllimport) char* __cdecl strchr(const char* str, int c);
__declspec(dllimport) wchar_t* __cdecl wcschr(const wchar_t* str, wchar_t c);
__declspec(dllimport) int __cdecl strcmp(const char* string1, const char* string2);
__declspec(dllimport) int __cdecl wcscmp(const wchar_t* string1, const wchar_t* string2);
__declspec(dllimport) char* __cdecl strcpy(char* strDestination, const char* strSource);
__declspec(dllimport) wchar_t* __cdecl wcscpy(wchar_t* strDestination, const wchar_t* strSource);
__declspec(dllimport) size_t __cdecl strcspn(const char* str, const char* strCharSet);
__declspec(dllimport) size_t __cdecl wcscspn(const wchar_t* str, const wchar_t* strCharSet);
__declspec(dllimport) size_t __cdecl strlen(const char* str);
__declspec(dllimport) size_t __cdecl wcslen(const wchar_t* str);
__declspec(dllimport) char* __cdecl strncat(char* strDest, const char* strSource, size_t count);
__declspec(dllimport) wchar_t* __cdecl wcsncat(wchar_t* strDest, const wchar_t* strSource, size_t count);
__declspec(dllimport) int __cdecl strncmp(const char* string1, const char* string2, size_t count);
__declspec(dllimport) int __cdecl wcsncmp(const wchar_t* string1, const wchar_t* string2, size_t count);
__declspec(dllimport) char* __cdecl strncpy(char* strDest, const char* strSource, size_t count);
__declspec(dllimport) wchar_t* __cdecl wcsncpy(wchar_t* strDest, const wchar_t* strSource, size_t count);
__declspec(dllimport) char* __cdecl strpbrk(const char* str, const char* strCharSet);
__declspec(dllimport) wchar_t* __cdecl wcspbrk(const wchar_t* str, const wchar_t* strCharSet);
__declspec(dllimport) char* __cdecl strrchr(const char* str, int c);
__declspec(dllimport) wchar_t* __cdecl wcsrchr(const wchar_t* str, wchar_t c);
__declspec(dllimport) size_t __cdecl strspn(const char* str, const char* strCharSet);
__declspec(dllimport) size_t __cdecl wcsspn(const wchar_t* str, const wchar_t* strCharSet);
__declspec(dllimport) char* __cdecl strstr(const char* str, const char* strSearch);
__declspec(dllimport) wchar_t* __cdecl wcsstr(const wchar_t* str, const wchar_t* strSearch);
__declspec(dllimport) long __cdecl strtol(const char* nptr, char** endptr, int base);
__declspec(dllimport) long __cdecl wcstol(const wchar_t* nptr, wchar_t** endptr, int base);
__declspec(dllimport) unsigned long __cdecl strtoul(const char* nptr, char** endptr, int base);
__declspec(dllimport) unsigned long __cdecl wcstoul(const wchar_t* nptr, wchar_t** endptr, int base);
__declspec(dllimport) int __cdecl tolower(int c);
__declspec(dllimport) int __cdecl towlower(wint_t c);
__declspec(dllimport) int __cdecl toupper(int c);
__declspec(dllimport) int __cdecl towupper(wint_t c);
__declspec(dllimport) int __cdecl vsprintf(char* buffer, const char* format, va_list argptr);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// memory
__declspec(dllimport) void* __cdecl _memccpy(void* dest, const void* src, int c, size_t count);
__declspec(dllimport) int __cdecl _memicmp(const void* buf1, const void* buf2, size_t count);
__declspec(dllimport) void* __cdecl memchr(const void* buf, int c, size_t count);
__declspec(dllimport) int __cdecl memcmp(const void* buf1, const void* buf2, size_t count);
__declspec(dllimport) void* __cdecl memcpy(void* dest, const void* src, size_t count);
__declspec(dllimport) void* __cdecl memmove(void* dest, const void* src, size_t count);
__declspec(dllimport) void* __cdecl memset(void* dest, int c, size_t count);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// math
__declspec(dllimport) int __cdecl abs(int n);
__declspec(dllimport) double __cdecl atan(double x);
__declspec(dllimport) double __cdecl ceil(double x);
__declspec(dllimport) double __cdecl cos(double x);
__declspec(dllimport) double __cdecl fabs(double x);
__declspec(dllimport) double __cdecl floor(double x);
__declspec(dllimport) long __cdecl labs(long n);
__declspec(dllimport) double __cdecl log(double x);
__declspec(dllimport) double __cdecl pow(double x, double y);
__declspec(dllimport) double __cdecl sin(double x);
__declspec(dllimport) double __cdecl sqrt(double x);
__declspec(dllimport) double __cdecl tan(double x);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// algorithm
__declspec(dllimport) void* __cdecl _lfind(const void* key, const void* base, unsigned int* num, unsigned int width, int (__cdecl* compare)(const void*, const void*));
__declspec(dllimport) void* __cdecl bsearch(const void* key, const void* base, size_t num, size_t width, int (__cdecl* compare)(const void*, const void*));
__declspec(dllimport) void __cdecl qsort(void* base, size_t num, size_t width, int (__cdecl* compare)(const void*, const void*));
#ifdef __cplusplus
}//end extern "C"
#endif // __cplusplus
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef CTQY_MAX_SPEED // max run speed
// force intrinsic
#pragma intrinsic(abs, atan, cos, fabs, labs, log, pow, sin, sqrt, tan)
#pragma intrinsic(memcmp, memcpy, memset)
#pragma intrinsic(_tcscat, _tcscmp, _tcscpy, _tcslen)
#else // min code size
// force function
#pragma function(abs, atan, cos, fabs, labs, log, pow, sin, sqrt, tan)
#pragma function(memcmp, memcpy, memset)
#pragma function(_tcscat, _tcscmp, _tcscpy, _tcslen)
#endif
#endif // CTQY_NTDLL_C_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -