-- 作者:卷积内核
-- 发布时间:11/26/2007 9:50:00 AM
-- Win 32 等效对 C 运行时函数
察看本文应用于的产品 注意:这篇文章是由无人工介入的微软自动的机器翻译软件翻译完成。微软很高兴能同时提供给您由人工翻译的和由机器翻译的文章, 以使您能使用您的语言访问所有的知识库文章。然而由机器翻译的文章并不总是完美的。它可能存在词汇,语法或文法的问题,就像是一个外国人在说中文时总是可能犯这样的错误。虽然我们经常升级机器翻译软件以提高翻译质量,但是我们不保证机器翻译的正确度,也不对由于内容的误译或者客户对它的错误使用所引起的任何直接的, 或间接的可能的问题负责。如果您发现了错误并希望帮助我们提高机器翻译技术,请完成文章末尾的在线调查。 本页 概要 更多信息 缓冲区操作 字符分类 目录控制 文件处理 创建文本输出例程 流例程 低级 I/O 控制台和端口 I/O 例程 内存分配 过程和环境控制例程 字符串操作 MS-DOS 接口 时间 虚拟内存分配 32 位 C 运行时 概要 Win 32 应用程序编程接口 (API) 中有许多的 C 运行时函数直接等价。 按类别与其 Win 32 等效或单词 " none " 如果没有等效存在本文列出 C 运行时函数。 回到顶端 更多信息 注意: 函数, 跟一个星号 (*) 是 16 位 C 运行时只属于。 最后一节中列出分别是唯一到 32 位 C 运行时函数。 所有其他函数是对两个 C 运行时间。 回到顶端 缓冲区操作 _memccpy none memchr none memcmp none memcpy CopyMemory _memicmp none memmove MoveMemory memset FillMemory, ZeroMemory _swab none 回到顶端 字符分类 isalnum IsCharAlphaNumeric isalpha IsCharAlpha, GetStringTypeW (Unicode) __isascii none iscntrl none, GetStringTypeW (Unicode) __iscsym none __iscsymf none isdigit none, GetStringTypeW (Unicode) isgraph none islower IsCharLower, GetStringTypeW (Unicode) isprint none ispunct none, GetStringTypeW (Unicode) isspace none, GetStringTypeW (Unicode) isupper IsCharUpper, GetStringTypeW (Unicode) isxdigit none, GetStringTypeW (Unicode) __toascii none tolower CharLower _tolower none toupper CharUpper _toupper none 回到顶端 目录控制 _chdir SetCurrentDirectory _chdrive SetCurrentDirectory _getcwd GetCurrentDirectory _getdrive GetCurrentDirectory _mkdir CreateDirectory _rmdir RemoveDirectory _searchenv SearchPath 回到顶端 文件处理 _access none _chmod SetFileAttributes _chsize SetEndOfFile _filelength GetFileSize _fstat See Note 5 _fullpath GetFullPathName _get_osfhandle none _isatty GetFileType _locking LockFileEx _makepath none _mktemp GetTempFileName _open_osfhandle none remove DeleteFile rename MoveFile _setmode none _splitpath none _stat none _umask none _unlink DeleteFile 回到顶端 创建文本输出例程 _displaycursor* SetConsoleCursorInfo _gettextcolor* GetConsoleScreenBufferInfo _gettextcursor* GetConsoleCursorInfo _gettextposition* GetConsoleScreenBufferInfo _gettextwindow* GetConsoleWindowInfo _outtext* WriteConsole _scrolltextwindow* ScrollConsoleScreenBuffer _settextcolor* SetConsoleTextAttribute _settextcursor* SetConsoleCursorInfo _settextposition* SetConsoleCursorPosition _settextwindow* SetConsoleWindowInfo _wrapon* SetConsoleMode 回到顶端 流例程 clearerr none fclose CloseHandle _fcloseall none _fdopen none feof none ferror none fflush FlushFileBuffers fgetc none _fgetchar none fgetpos none fgets none _fileno none _flushall none fopen CreateFile fprintf none fputc none _fputchar none fputs none fread ReadFile freopen (std handles) SetStdHandle fscanf none fseek SetFilePointer fsetpos SetFilePointer _fsopen CreateFile ftell SetFilePointer (check return value) fwrite WriteFile getc none getchar none gets none _getw none printf none putc none putchar none puts none _putw none rewind SetFilePointer _rmtmp none scanf none setbuf none setvbuf none _snprintf none sprintf wsprintf sscanf none _tempnam GetTempFileName tmpfile none tmpnam GetTempFileName ungetc none vfprintf none vprintf none _vsnprintf none vsprintf wvsprintf 回到顶端 低级 I/O _close _lclose, CloseHandle _commit FlushFileBuffers _creat _lcreat, CreateFile _dup DuplicateHandle _dup2 none _eof none _lseek _llseek, SetFilePointer _open _lopen, CreateFile _read _lread, ReadFile _sopen CreateFile _tell SetFilePointer (check return value) _write _lread 回到顶端 控制台和端口 I/O 例程 _cgets none _cprintf none _cputs none _cscanf none _getch ReadConsoleInput _getche ReadConsoleInput _inp none _inpw none _kbhit PeekConsoleInput _outp none _outpw none _putch WriteConsoleInput _ungetch none 回到顶端 内存分配 _alloca none _bfreeseg* none _bheapseg* none calloc GlobalAlloc _expand none free GlobalFree _freect* GlobalMemoryStatus _halloc* GlobalAlloc _heapadd none _heapchk none _heapmin none _heapset none _heapwalk none _hfree* GlobalFree malloc GlobalAlloc _memavl GlobalMemoryStatus _memmax GlobalMemoryStatus _msize* GlobalSize realloc GlobalReAlloc _set_new_handler none _set_hnew_handler* none _stackavail* none 回到顶端 过程和环境控制例程 abort none assert none atexit none _cexit none _c_exit none _exec functions none exit ExitProcess _exit ExitProcess getenv GetEnvironmentVariable _getpid GetCurrentProcessId longjmp none _onexit none perror FormatMessage _putenv SetEnvironmentVariable raise RaiseException setjmp none signal (ctrl-c only) SetConsoleCtrlHandler _spawn functions CreateProcess system CreateProcess 回到顶端 字符串操作 strcat, wcscat lstrcat strchr, wcschr none strcmp, wcscmp lstrcmp strcpy, wcscpy lstrcpy strcspn, wcscspn none _strdup, _wcsdup none strerror FormatMessage _strerror FormatMessage _stricmp, _wcsicmp lstrcmpi strlen, wcslen lstrlen _strlwr, _wcslwr CharLower, CharLowerBuffer strncat, wcsncat none strncmp, wcsncmp none strncpy, wcsncpy none _strnicmp, _wcsnicmp none _strnset, _wcsnset FillMemory, ZeroMemory strpbrk, wcspbrk none strrchr, wcsrchr none _strrev, _wcsrev none _strset, _wcsset FillMemory, ZeroMemory strspn, wcsspn none strstr, wcsstr none strtok, wcstok none _strupr, _wcsupr CharUpper, CharUpperBuffer 回到顶端 MS-DOS 接口 _bdos* none _chain_intr* none _disable* none _dos_allocmem* GlobalAlloc _dos_close* CloseHandle _dos_commit* FlushFileBuffers _dos_creat* CreateFile _dos_creatnew* CreateFile _dos_findfirst* FindFirstFile _dos_findnext* FindNextFile _dos_freemem* GlobalFree _dos_getdate* GetSystemTime _dos_getdiskfree* GetDiskFreeSpace _dos_getdrive* GetCurrentDirectory _dos_getfileattr* GetFileAttributes _dos_getftime* GetFileTime _dos_gettime* GetSystemTime _dos_getvect* none _dos_keep* none _dos_open* OpenFile _dos_read* ReadFile _dos_setblock* GlobalReAlloc _dos_setdate* SetSystemTime _dos_setdrive* SetCurrentDirectory _dos_setfileattr* SetFileAttributes _dos_setftime* SetFileTime _dos_settime* SetSystemTime _dos_setvect* none _dos_write* WriteFile _dosexterr* GetLastError _enable* none _FP_OFF* none _FP_SEG* none _harderr* See Note 1 _hardresume* See Note 1 _hardretn* See Note 1 _int86* none _int86x* none _intdos* none _intdosx* none _segread* none 回到顶端 时间 asctime See Note 2 clock See Note 2 ctime See Note 2 difftime See Note 2 _ftime See Note 2 _getsystime GetLocalTime gmtime See Note 2 localtime See Note 2 mktime See Note 2 _strdate See Note 2 _strtime See Note 2 time See Note 2 _tzset See Note 2 _utime SetFileTime 回到顶端 虚拟内存分配 _vfree* See Note 3 _vheapinit* See Note 3 _vheapterm* See Note 3 _vload* See Note 3 _vlock* See Note 3 _vlockcnt* See Note 3 _vmalloc* See Note 3 _vmsize* See Note 3 _vrealloc* See Note 3 _vunlock* See Note 3 回到顶端 32 位 C 运行时 _beginthread CreateThread _cwait WaitForSingleObject w/ GetExitCodeProcess _endthread ExitThread _findclose FindClose _findfirst FindFirstFile _findnext FindNextFile _futime SetFileTime _get_osfhandle none _open_osfhandle none _pclose See Note 4 _pipe CreatePipe _popen See Note 4 备注 1:: _harderr 函数不存在 Win32API 中。 但是, 大量功能是可通过结构化异常处理。 注意 2:: 时间函数基于 Win 32 中不使用格式。 还有特定 Win 32 时间函数帮助文件中介绍。 备注 3: 本文档中列出: 虚拟内存函数特定于 MS-DOS 环境并被写入访问超出 640K 是 MS-DOS 中可用 RAM 内存。 由于 Win 32, 中不存在此限制应使用标准内存分配函数。 备注 4: While _pclose() 和 _popen() 没有直接 Win 32 等效, 您 (带有一些工作) 可以模拟它们: 与以下调用 _popen CreatePipe CreateProcess _pclose WaitForSingleObject CloseHandle 备注 5: GetFileInformationByHandle() 是 Win 32 等效对于 _fstat() C 运行时函数。 但是, GetFileInformationByHandle() 不支持由 Win32s 版本 1.1。 Win32s 1.2 中支持它。 通过 Win32s 1.1 和 1.2 支持 GetFileSize()、 GetFileAttributes()、 GetFileTime() 和 GetFileTitle()。 回到顶端
|