"msvcrt" — MS VC++実行時システムの有用なルーチン群
**************************************************

このモジュールの関数は、 Windows プラットフォームの便利な機能のいくつ
かに対するアクセス機構を提供しています。高レベルモジュールのいくつかは
、提供するサービスを Windows で実装するために、これらの関数を使ってい
ます。例えば、 "getpass" モジュールは関数 "getpass()" を実装するために
このモジュールの関数を使います。

ここに挙げた関数の詳細なドキュメントについては、プラットフォーム API
ドキュメントで見つけることができます。

このモジュールは、通常版とワイド文字列版の両方のコンソールI/O APIを実
装しています。通常版の API は ASCII 文字列のためのもので、国際化アプリ
ケーションでは利用が制限されます。可能な限りワイド文字列版APIを利用す
るべきです。


ファイル操作関連
================

msvcrt.locking(fd, mode, nbytes)

   Lock part of a file based on file descriptor *fd* from the C
   runtime.  Raises "IOError" on failure.  The locked region of the
   file extends from the current file position for *nbytes* bytes, and
   may continue beyond the end of the file.  *mode* must be one of the
   "LK_*" constants listed below. Multiple regions in a file may be
   locked at the same time, but may not overlap.  Adjacent regions are
   not merged; they must be unlocked individually.

msvcrt.LK_LOCK
msvcrt.LK_RLCK

   Locks the specified bytes. If the bytes cannot be locked, the
   program immediately tries again after 1 second.  If, after 10
   attempts, the bytes cannot be locked, "IOError" is raised.

msvcrt.LK_NBLCK
msvcrt.LK_NBRLCK

   Locks the specified bytes. If the bytes cannot be locked, "IOError"
   is raised.

msvcrt.LK_UNLCK

   指定されたバイト列のロックを解除します。指定領域はあらかじめロック
   されていなければなりません。

msvcrt.setmode(fd, flags)

   ファイル記述子 *fd* に対して、行末文字の変換モードを設定します。テ
   キストモードに設定するには、 *flags* を "os.O_TEXT" にします; バイ
   ナリモードにするには "os.O_BINARY" にします。

msvcrt.open_osfhandle(handle, flags)

   C 言語による実行時システムにおけるファイル記述子をファイルハンドル
   *handle* から生成します。 *flags* パラメタは "os.O_APPEND" 、
   "os.O_RDONLY" 、および "os.O_TEXT" をビット単位で OR したものになり
   ます。返されるファイル記述子は "os.fdopen()" でファイルオブジェクト
   を生成するために使うことができます。

msvcrt.get_osfhandle(fd)

   Return the file handle for the file descriptor *fd*.  Raises
   "IOError" if *fd* is not recognized.


コンソール I/O 関連
===================

msvcrt.kbhit()

   読み出し待ちの打鍵イベントが存在する場合に真を返します。

msvcrt.getch()

   Read a keypress and return the resulting character.  Nothing is
   echoed to the console.  This call will block if a keypress is not
   already available, but will not wait for "Enter" to be pressed. If
   the pressed key was a special function key, this will return
   "'\000'" or "'\xe0'"; the next call will return the keycode.  The
   "Control-C" keypress cannot be read with this function.

msvcrt.getwch()

   "getch()" のワイド文字列版。Unicode の値を返します。

   バージョン 2.6 で追加.

msvcrt.getche()

   "getch()" に似ていますが、打鍵した字が印字可能な文字の場合エコーバ
   ックされます。

msvcrt.getwche()

   "getche()" のワイド文字列版。Unicode の値を返します。

   バージョン 2.6 で追加.

msvcrt.putch(char)

   Print the character *char* to the console without buffering.

msvcrt.putwch(unicode_char)

   "putch()" のワイド文字列版。Unicode の値を引数に取ります。

   バージョン 2.6 で追加.

msvcrt.ungetch(char)

   Cause the character *char* to be 「pushed back」 into the console
   buffer; it will be the next character read by "getch()" or
   "getche()".

msvcrt.ungetwch(unicode_char)

   "ungetch()" のワイド文字列版。Unicode の値を引数に取ります。

   バージョン 2.6 で追加.


その多の関数
============

msvcrt.heapmin()

   Force the "malloc()" heap to clean itself up and return unused
   blocks to the operating system.  On failure, this raises "IOError".
