アークピットのホームページに戻る

WinAPIトピックのトップページに戻る

APIトピックの各章に移動する

ダウンロードのページに移動する
ダウンロードができ
ない場合の対処法
 

ページ移動

1-4-7. 標準関数とWIN32APIの対応表

メモリ操作
   _memccpy              ---
    memchr               ---
    memcmp               ---
    memcpy               CopyMemory
   _memicmp              ---
    memmove              MoveMemory
    memset               FillMemory, ZeroMemory
   _swab                 ---

文字操作
     isalnum             IsCharAlphaNumeric
     isalpha             IsCharAlpha, GetStringTypeW (Unicode)
   __isascii             ---
     iscntrl             ---, GetStringTypeW (Unicode)
   __iscsym              ---
   __iscsymf             ---
     isdigit             ---, GetStringTypeW (Unicode)
     isgraph             ---
     islower             IsCharLower, GetStringTypeW (Unicode)
     isprint             ---
     ispunct             ---, GetStringTypeW (Unicode)
     isspace             ---, GetStringTypeW (Unicode)
     isupper             IsCharUpper, GetStringTypeW (Unicode)
     isxdigit            ---, GetStringTypeW (Unicode)
   __toascii             ---
     tolower             CharLower
    _tolower             ---
     toupper             CharUpper
    _toupper             ---
 
ディレクトリ操作
   _chdir                SetCurrentDirectory
   _chdrive              SetCurrentDirectory
   _getcwd               GetCurrentDirectory
   _getdrive             GetCurrentDirectory
   _mkdir                CreateDirectory
   _rmdir                RemoveDirectory
   _searchenv            SearchPath

ファイル操作
   _access               ---
   _chmod                SetFileAttributes
   _chsize               SetEndOfFile
   _filelength           GetFileSize
   _fstat                See Note 5
   _fullpath             GetFullPathName
   _get_osfhandle        ---
   _isatty               GetFileType
   _locking              LockFileEx
   _makepath             ---
   _mktemp               GetTempFileName
   _open_osfhandle       ---
    remove               DeleteFile
    rename               MoveFile
   _setmode              ---
   _splitpath            ---
   _stat                 ---
   _umask                ---
   _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             ---
    fclose               CloseHandle
   _fcloseall            ---
   _fdopen               ---
    feof                 ---
    ferror               ---
    fflush               FlushFileBuffers
    fgetc                ---
   _fgetchar             ---
    fgetpos              ---
    fgets                ---
   _fileno               ---
   _flushall             ---
    fopen                CreateFile
    fprintf              ---
    fputc                ---
   _fputchar             ---
    fputs                ---
    fread                ReadFile
    freopen(std handles) SetStdHandle
    fscanf               ---
    fseek                SetFilePointer
    fsetpos              SetFilePointer
   _fsopen               CreateFile
    ftell                SetFilePointer (check return value)
    fwrite               WriteFile
    getc                 ---
    getchar              ---
    gets                 ---
   _getw                 ---
    printf               ---
    putc                 ---
    putchar              ---
    puts                 ---
   _putw                 ---
    rewind               SetFilePointer
   _rmtmp                ---
    scanf                ---
    setbuf               ---
    setvbuf              ---
   _snprintf             ---
    sprintf              wsprintf
    sscanf               ---
   _tempnam              GetTempFileName
    tmpfile              ---
    tmpnam               GetTempFileName
    ungetc               ---
    vfprintf             ---
    vprintf              ---
   _vsnprintf            ---
    vsprintf             wvsprintf

低レベルI/O
   _close                _lclose, CloseHandle
   _commit               FlushFileBuffers
   _creat                _lcreat, CreateFile
   _dup                  DuplicateHandle
   _dup2                 ---
   _eof                  ---
   _lseek                _llseek, SetFilePointer
   _open                 _lopen, CreateFile
   _read                 _lread, ReadFile
   _sopen                CreateFile
   _tell                 SetFilePointer (check return value)
   _write                _lread

コンソールとI/Oポート
   _cgets                ---
   _cprintf              ---
   _cputs                ---
   _cscanf               ---
   _getch                ReadConsoleInput
   _getche               ReadConsoleInput
   _inp                  ---
   _inpw                 ---
   _kbhit                PeekConsoleInput
   _outp                 ---
   _outpw                ---
   _putch                WriteConsoleInput
   _ungetch              ---

メモリ管理
   _alloca               ---
   _bfreeseg*            ---
   _bheapseg*            ---
    calloc               GlobalAlloc
   _expand               ---
    free                 GlobalFree
   _freect*              GlobalMemoryStatus
   _halloc*              GlobalAlloc
   _heapadd              ---
   _heapchk              ---
   _heapmin              ---
   _heapset              ---
   _heapwalk             ---
   _hfree*               GlobalFree
    malloc               GlobalAlloc
   _memavl               GlobalMemoryStatus
   _memmax               GlobalMemoryStatus
   _msize*               GlobalSize
    realloc              GlobalReAlloc
   _set_new_handler      ---
   _set_hnew_handler*    ---
   _stackavail*          ---

プロセスと環境変数の制御
    abort                ---
    assert               ---
    atexit               ---
   _cexit                ---
   _c_exit               ---
   _exec functions       ---
    exit                 ExitProcess
   _exit                 ExitProcess
    getenv               GetEnvironmentVariable
   _getpid               GetCurrentProcessId
    longjmp              ---
   _onexit               ---
    perror               FormatMessage
   _putenv               SetEnvironmentVariable
    raise                RaiseException
    setjmp               ---
    signal(ctrl-c only)  etConsoleCtrlHandler
   _spawn functions      CreateProcess
    system               CreateProcess

文字列操作
   strcat, wcscat        lstrcat
   strchr, wcschr        ---
   strcmp, wcscmp        lstrcmp
   strcpy, wcscpy        lstrcpy
   strcspn, wcscspn      ---
  _strdup, _wcsdup       ---
   strerror              FormatMessage
  _strerror              FormatMessage
  _stricmp, _wcsicmp     lstrcmpi
   strlen, wcslen        lstrlen
  _strlwr, _wcslwr       CharLower, CharLowerBuffer
   strncat, wcsncat      ---
   strncmp, wcsncmp      ---
   strncpy, wcsncpy      ---
  _strnicmp, _wcsnicmp   ---
  _strnset, _wcsnset     FillMemory, ZeroMemory
   strpbrk, wcspbrk      ---
   strrchr, wcsrchr      ---
  _strrev, _wcsrev       ---
  _strset, _wcsset       FillMemory, ZeroMemory
   strspn, wcsspn        ---
   strstr, wcsstr        ---
   strtok, wcstok        ---
  _strupr, _wcsupr       CharUpper, CharUpperBuffer

MS−DOSインターフェース
  _bdos*                 ---
  _chain_intr*           ---
  _disable*              ---
  _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*          ---
  _dos_keep*             ---
  _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*          ---
  _dos_write*            WriteFile
  _dosexterr*            GetLastError
  _enable*               ---
  _FP_OFF*               ---
  _FP_SEG*               ---
  _harderr*              See Note 1
  _hardresume*           See Note 1
  _hardretn*             See Note 1
  _int86*                ---
  _int86x*               ---
  _intdos*               ---
  _intdosx*              ---
  _segread*              ---

時間と日付
   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 GetExitCodeProcess
   _endthread            ExitThread
   _findclose            FindClose
   _findfirst            FindFirstFile
   _findnext             FindNextFile
   _futime               SetFileTime
   _get_osfhandle        ---
   _open_osfhandle       ---
   _pclose               See Note 4
   _pipe                 CreatePipe
   _popen                See Note 4
Note 1: _harderr関数はWin32には存在しない。しかし、構造化例外処理で多くを解決できる。
Note 2: 時間と日付に使われるデータ表現はWin32では使用しない。独自の構造体で処理する。
Note 3: The virtual memory functions listed in this document are specific to the MS-DOS environment and were written to access memory beyond the 640K of RAM available in MS-DOS. Because this limitation does not exist in Win32, the standard memory allocation functions should be used.
Note 4: While _pclose() and _popen() do not have direct Win32 equivalents,you can (with some work) simulate them with the following calls:
   _popen                CreatePipe
                         CreateProcess

   _pclose               WaitForSingleObject
                         CloseHandle
Note 5: GetFileInformationByHandle() is the Win32 equivalent for the _fstat() C Run-time function. However, GetFileInformationByHandle() is not supported by Win32s version 1.1. It is supported in Win32s 1.2. GetFileSize(), GetFileAttributes(), GetFileTime(), and GetFileTitle() are supported by Win32s 1.1 and 1.2.

ページ移動