argra****@users*****
argra****@users*****
2012年 9月 25日 (火) 21:53:21 JST
Index: docs/perl/5.10.0/perlapi.pod diff -u docs/perl/5.10.0/perlapi.pod:1.14 docs/perl/5.10.0/perlapi.pod:1.15 --- docs/perl/5.10.0/perlapi.pod:1.14 Thu Sep 20 04:31:22 2012 +++ docs/perl/5.10.0/perlapi.pod Tue Sep 25 21:53:20 2012 @@ -36,8 +36,8 @@ 一覧です。 ここに挙げられていないどの関数のインターフェースも予告なしに 変更されることがあります。 -この理由により、エクステンションを書くときに proto.h に挙げられている -関数を盲目的に使うことは避けるべきです。 +この理由により、エクステンションを書くときに proto.h に挙げられている関数を +盲目的に使うことは避けるべきです。 =begin original @@ -47,7 +47,7 @@ =end original -全ての Perl API グローバル変数は C<PL_> というプリフィックスをつけて +全ての Perl API グローバル変数は C<PL_> という接頭辞をつけて 参照しなければならないということに注意してください。 一部のマクロは以前のものとの互換性を確保していてはいますが、それは将来の リリースにおいては無効になるかもしれません。 @@ -62,6 +62,8 @@ =head1 "Gimme" Values +(値を「ちょうだい」) + =over 8 =item GIMME @@ -75,10 +77,9 @@ =end original -C<G_SCALAR> か C<G_ARRAY> しか返さないような C<GIMME_V> の、 -過去互換性のためのものです; 無効コンテキストでは、これは C<G_SCALAR> を -返します。 -非推奨です。 +C<G_SCALAR> か C<G_ARRAY> しか返さないような C<GIMME_V> の、過去互換性の +ためのものです; 無効コンテキストでは、これは C<G_SCALAR> を返します。 +廃止予定です。 代わりに C<GIMME_V> を使ってください。 U32 GIMME @@ -98,8 +99,7 @@ =end original XSUB 作成者のための、Perl の C<wantarray> に透過なものです。 -C<G_VOID>、 -C<G_SCALAR>、C<G_ARRAY> をそれぞれ、無効コンテキスト、スカラ +C<G_VOID>、C<G_SCALAR>、C<G_ARRAY> をそれぞれ、無効コンテキスト、スカラ コンテキスト、リストコンテキストのときに返します。 U32 GIMME_V @@ -206,6 +206,8 @@ =head1 Array Manipulation Functions +(配列操作関数) + =over 8 =item AvFILL @@ -218,7 +220,7 @@ =end original C<av_len()> と同様です。 -非推奨なので、代わりに C<av_len()> を使ってください。 +廃止予定なので、代わりに C<av_len()> を使ってください。 int AvFILL(AV* av) @@ -622,7 +624,7 @@ =end original -注意: この関数の perl_ の形は非推奨です。 +注意: この関数の perl_ の形は廃止予定です。 AV* get_av(const char* name, I32 create) @@ -695,6 +697,8 @@ =head1 Callback Functions +(コールバック関数) + =over 8 =item call_argv @@ -715,7 +719,7 @@ =end original -注意: この関数の perl_ の形は非推奨です。 +注意: この関数の perl_ の形は廃止予定です。 I32 call_argv(const char* sub_name, I32 flags, char** argv) @@ -742,7 +746,7 @@ =end original -注意: この関数の perl_ の形は非推奨です。 +注意: この関数の perl_ の形は廃止予定です。 I32 call_method(const char* methname, I32 flags) @@ -767,7 +771,7 @@ =end original -注意: この関数の perl_ の形は非推奨です。 +注意: この関数の perl_ の形は廃止予定です。 I32 call_pv(const char* sub_name, I32 flags) @@ -784,8 +788,7 @@ =end original -SV にある名前を持った -Perl サブルーチンに対するコールバックを呼び出します。 +SV にある名前を持った Perl サブルーチンに対するコールバックを呼び出します。 L<perlcall> を参照してください。 =begin original @@ -794,7 +797,7 @@ =end original -注意: この関数の perl_ の形は非推奨です。 +注意: この関数の perl_ の形は廃止予定です。 I32 call_sv(SV* sv, I32 flags) @@ -836,7 +839,7 @@ =end original -注意: この関数の perl_ の形は非推奨です。 +注意: この関数の perl_ の形は廃止予定です。 SV* eval_pv(const char* p, I32 croak_on_error) @@ -860,7 +863,7 @@ =end original -注意: この関数の perl_ の形は非推奨です。 +注意: この関数の perl_ の形は廃止予定です。 I32 eval_sv(SV* sv, I32 flags) @@ -924,6 +927,8 @@ =head1 Character classes +(文字クラス) + =over 8 =item isALNUM @@ -936,8 +941,8 @@ =end original -C<char> がアスキーのアルファベット文字(下線を含む)、もしくは数字で -あるかどうかを表わす真偽値を返します。 +C<char> が ASCII 英数字(下線を含む)、もしくは数字であるかどうかを表わす +真偽値を返します。 bool isALNUM(char ch) @@ -954,8 +959,7 @@ =end original -C<char> がアスキーのアルファベット文字であるかどうかを表わす -真偽値を返します。 +C<char> が ASCII 英数字であるかどうかを表わす真偽値を返します。 bool isALPHA(char ch) @@ -972,7 +976,7 @@ =end original -C<char> がアスキーの数字であるかどうかを表わす真偽値を返します。 +C<char> が ASCII 数字であるかどうかを表わす真偽値を返します。 bool isDIGIT(char ch) @@ -989,7 +993,7 @@ =end original -C<char> が小文字の文字であるかどうかを表わす真偽値を返します。 +C<char> が小文字であるかどうかを表わす真偽値を返します。 bool isLOWER(char ch) @@ -1022,7 +1026,7 @@ =end original -C<char> が大文字の文字であるかどうかを表わす真偽値を返します。 +C<char> が大文字であるかどうかを表わす真偽値を返します。 bool isUPPER(char ch) @@ -1065,6 +1069,8 @@ =head1 Cloning an interpreter +(インタプリタのクローン化) + =over 8 =item perl_clone @@ -1098,12 +1104,11 @@ =end original -CLONEf_COPY_STACKS - is used to, well, copy the stacks also, -without it we only clone the data and zero the stacks, -with it we copy the stacks and the new perl interpreter is -ready to run at the exact same point as the previous one. +CLONEf_COPY_STACKS - これは、つまり、スタックもコピーするために使います; +これがない場合、データのみをクローンし、スタックはしません; +これがある場合、スタックをコピーして、新しいインタプリタは以前のものと +まったく同じ位置から実行する準備が出来ています。 疑似 fork コードは COPY_STACKS を使いますが、threads->create は使いません。 -(TBT) =begin original @@ -1122,17 +1127,15 @@ =end original CLONEf_KEEP_PTR_TABLE -perl_clone keeps a ptr_table with the pointer of the old -variable as a key and the new variable as a value, -this allows it to check if something has been cloned and not -clone it again but rather just use the value and increase the -refcount. If KEEP_PTR_TABLE is not set then perl_clone will kill -the ptr_table using the function -C<ptr_table_free(PL_ptr_table); PL_ptr_table = NULL;>, -reason to keep it around is if you want to dup some of your own -variable who are outside the graph perl scans, example of this -code is in threads.xs create -(TBT) +perl_clone は、古い変数へのポインタをキーとして、新しい変数を値として +ptr_table を保持します; これにより、何かがクローンされて、再び +クローンされないけれども単に値を使って参照カウントを増やしているかを +チェックできるようにします。 +KEEP_PTR_TABLE がセットされていないと、perl_clone は +C<ptr_table_free(PL_ptr_table); PL_ptr_table = NULL;> を使って +ptr_table を削除します; これを保持し続ける理由は、図示する perl が +スキャンする外側の変数の一部を複製したい場合; このコードの例は +threads.xs create にあります。 =begin original @@ -1162,6 +1165,8 @@ =head1 CV Manipulation Functions +(CV 操作関数) + =over 8 =item CvSTASH @@ -1198,7 +1203,7 @@ =end original -注意: この関数の perl_ の形は非推奨です。 +注意: この関数の perl_ の形は廃止予定です。 CV* get_cv(const char* name, I32 flags) @@ -1220,8 +1225,8 @@ 指定された Perl サブルーチンの CV を返します。 C<flags> は C<gv_fetchpvn_flags> に渡されます。 -C<GV_ADD> がセットされ、Perl サブルーチンが存在しない場合は、 -これが宣言されます(これは C<sub name;> と同じ効果です)。 +C<GV_ADD> がセットされ、Perl サブルーチンが存在しない場合は、これが +宣言されます(これは C<sub name;> と同じ効果です)。 C<GV_ADD> がセットされず、Perl サブルーチンが存在しない場合は、NULL が 返されます。 @@ -1231,7 +1236,7 @@ =end original -注意: この関数の perl_ の形は非推奨です。 +注意: この関数の perl_ の形は廃止予定です。 CV* get_cvn_flags(const char* name, STRLEN len, I32 flags) @@ -1242,6 +1247,8 @@ =head1 Embedding Functions +(組み込み関数) + =over 8 =item cv_undef @@ -1291,8 +1298,7 @@ ver が指定されると、C<use Foo::Bar VERSION> と同様のバージョン意味論を 提供します。 オプションで引き続く SV* 引数は、C<use Foo::Bar VERSION LIST> と同様に、 -モジュールの import() メソッドへの引数を -指定するために使われます。 +モジュールの import() メソッドへの引数を指定するために使われます。 void load_module(U32 flags, SV* name, SV* ver, ...) @@ -1441,7 +1447,7 @@ =end original -注意: この関数の perl_ の形は非推奨です。 +注意: この関数の perl_ の形は廃止予定です。 void require_pv(const char* pv) @@ -1452,6 +1458,8 @@ =head1 Functions in file dump.c +(ファイル dump.c の関数) + =over 8 =item pv_display @@ -1574,13 +1582,12 @@ =end original -If PERL_PV_ESCAPE_FIRSTCHAR is set then only the first char of the -string will be escaped, regardles of max. If the string is utf8 and -the chars value is >255 then it will be returned as a plain hex -sequence. Thus the output will either be a single char, -an octal escape sequence, a special escape like C<\n> or a 3 or -more digit hex value. -(TBT) +PERL_PV_ESCAPE_FIRSTCHAR がセットされると、max に関わらず文字列の最初の +文字だけがエスケープされます。 +文字列が utf8 で文字の値が >255 なら、普通の 16 進シーケンスとして +返されます。 +従って出力は単一の文字、8 進エスケープシーケンス、C<\n> のような +特殊エスケープ、3 桁以上の 16 進数のいずれかです。 =begin original @@ -1609,7 +1616,7 @@ =end original -注意: この関数の perl_ の形は非推奨です。 +注意: この関数の perl_ の形は廃止予定です。 char* pv_escape(SV *dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags) @@ -1642,11 +1649,10 @@ =end original -If the PERL_PV_PRETTY_QUOTE flag is set then the result will be -double quoted with any double quotes in the string escaped. Otherwise -if the PERL_PV_PRETTY_LTGT flag is set then the result be wrapped in -angle brackets. -(TBT) +PERL_PV_PRETTY_QUOTE フラグがセットされると、文字列中のダブルクォートが +エスケープされて、全体がダブルクォートで囲まれます。 +さもなければ、PERL_PV_PRETTY_LTGT がセットされていれば結果は山かっこで +囲まれます。 =begin original @@ -1656,10 +1662,9 @@ =end original -If the PERL_PV_PRETTY_ELLIPSES flag is set and not all characters in -string were output then an ellipsis C<...> will be appended to the -string. Note that this happens AFTER it has been quoted. -(TBT) +PERL_PV_PRETTY_ELLIPSES がセットされて、文字列中の全ての文字が +出力されないときは、省略記号 C<...> が文字列に追加されます。 +これはクォートされた「後」に起きることに注意してください。 =begin original @@ -1670,11 +1675,10 @@ =end original -If start_color is non-null then it will be inserted after the opening -quote (if there is one) but before the escaped text. If end_color -is non-null then it will be inserted after the escaped text but before -any quotes or ellipses. -(TBT) +start_color が非 NULL なら、(もしあれば) 開きクォートの後、エスケープされた +テキストの前に挿入されます。 +end_color が非 NULL なら、エスケープされたテキストの後、クォートや +省略記号の前に挿入されます。 =begin original @@ -1690,7 +1694,7 @@ =end original -注意: この関数の perl_ の形は非推奨です。 +注意: この関数の perl_ の形は廃止予定です。 char* pv_pretty(SV *dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags) @@ -1701,6 +1705,8 @@ =head1 Functions in file mathoms.c +(ファイル mathoms.c の関数) + =over 8 =item gv_fetchmethod @@ -2113,9 +2119,9 @@ =end original -SV に対して、C<ptr> にある文字列を探し出すように指示します。 -C<flags> を 0 にして C<sv_usepvn_flags> を呼び出すことで -実装されているので、'set' magic をハンドルしません。 +自身の文字列値を得るのに C<ptr> を使うように SV に指示します。 +C<flags> を 0 にして C<sv_usepvn_flags> を呼び出すことで実装されているので、 +'set' magic をハンドルしません。 C<sv_usepvn_mg> を参照してください。 void sv_usepvn(SV* sv, char* ptr, STRLEN len) @@ -2170,7 +2176,8 @@ Perl 関数 unpack() を実装しているエンジンです。 注意: 引数 strbeg, new_s, ocnt は使われません。 -この呼び出しは使うべきではなりません; 代わりに unpackstring を使ってください。 +この呼び出しは使うべきではなりません; 代わりに unpackstring を +使ってください。 I32 unpack_str(const char *pat, const char *patend, const char *s, const char *strbeg, const char *strend, char **new_s, I32 ocnt, U32 flags) @@ -2181,6 +2188,8 @@ =head1 Functions in file pp_ctl.c +(ファイル pp_ctl.c の関数) + =over 8 =item find_runcv @@ -2211,6 +2220,8 @@ =head1 Functions in file pp_pack.c +(ファイル pp_pack.c の関数) + =over 8 =item packlist @@ -2255,6 +2266,8 @@ =head1 GV Functions +(GV 関数) + =over 8 =item GvSV @@ -2306,10 +2319,10 @@ =end original -与えられた C<name> と、定義されたサブルーチンか C<NULL> を使った -glob を返します。 -このglobは、与えられた C<stash> か、 - @ ISA や UNIVERSAL:: を通じてアクセスできるスタッシュにあります。 +与えられた C<name> と、定義されたサブルーチンか C<NULL> を使ったグロブを +返します。 +このグロブは、与えられた C<stash> か、@ISA や UNIVERSAL:: を通じて +アクセスできるスタッシュにあります。 =begin original @@ -2336,11 +2349,10 @@ =end original -この関数はスタッシュ名のポストフィックスとして、 -トークン C<"SUPER"> を受け付けます。 +この関数はスタッシュ名のポストフィックスとして、トークン C<"SUPER"> を +受け付けます。 C<gv_fetchmeth> から返された GV は、Perl プログラムからは参照することの -できないような、メソッドキャッシュのエントリーである可能性が -あります。 +できないような、メソッドキャッシュのエントリである可能性があります。 このため、C<perl_call_sv> を呼び出したとき、GV を直接 使うべきではありません; その代わりに、GV に対して C<GvCV> マクロを使って 得ることのできる、メソッドの CV を使うべきです。 @@ -2362,9 +2374,9 @@ =end original -C<stash> にあるメソッドを起動するために呼び出すサブルーチンを含む -glob を返します。 -事実、オートローディングの直前でこれは "AUTOLOAD" に対する glob となる +C<stash> にあるメソッドを起動するために呼び出すサブルーチンを含むグロブを +返します。 +事実、オートローディングの直前でこれは "AUTOLOAD" に対するグロブとなる 可能性があります。 その場合、$AUTOLOAD に対応する変数が既にセットアップされています。 @@ -2379,9 +2391,8 @@ =end original C<gv_fetchmethod_autoload> の第三引数は、与えられたメソッドが -存在していなかった場合に AUTLOAD のルックアップをするかしないかを -決定します; ゼロでないときは AUTOLOAD の検索を行い、ゼロのときには -行いません。 +存在していなかった場合に AUTLOAD のルックアップをするかしないかを決定します; +ゼロでないときは AUTOLOAD の検索を行い、ゼロのときには行いません。 C<gv_fetchmethod> の呼び出しは C<gv_fetchmethod_autoload> に ゼロでない C<autoload> パラメーターを渡したときと等価です。 @@ -2395,8 +2406,7 @@ =end original -これらの関数は、トークン C<"SUPER"> をメソッド名のプリフィックスとして -許します。 +これらの関数は、トークン C<"SUPER"> をメソッド名の接頭辞として許します。 返された glob を長い間保存しておきたいのなら、"AUTOLOAD" の存在を チェックする必要があるということに注意してください。 これは、後での呼び出しが $AUTOALOD の値が変化したことによって、異なる @@ -2411,8 +2421,8 @@ =end original -これらの関数は、C<gv_fetchmeth> に C<level==0> を渡したときと同じ -副作用を持っています。 +これらの関数は、C<gv_fetchmeth> に C<level==0> を渡したときと同じ副作用を +持っています。 C<name> は、その内容に C<':'> か C<'\''> が含まれている場合には書き込み 可能であるべきです。 C<gv_fetchmeth> から返された GV を C<call_sv> に渡したことに対する警告は、 @@ -2444,8 +2454,8 @@ =end original -GV なしのオートロードされたサブルーチンのために、C<level < 0> でも -GV を作成します。 +GV なしのオートロードされたサブルーチンのために、C<level < 0> でも GV を +作成します。 スタブのないオートロードされたサブルーチンのために、結果の GvCV() は ゼロかもしれません。 @@ -2537,6 +2547,8 @@ =head1 Handy Values +(便利な値) + =over 8 =item Nullav @@ -2613,6 +2625,8 @@ =head1 Hash Manipulation Functions +(ハッシュ操作関数) + =over 8 =item get_hv @@ -2627,8 +2641,8 @@ =end original 指定された Perl ハッシュの HV を返します。 -C<create> がセットされていて、指定された変数が存在していなければ、 -新たに生成されます。 +C<create> がセットされていて、指定された変数が存在していなければ、新たに +生成されます。 C<create> がセットされておらず、かつ、指定された変数がなかった場合には NULL が返されます。 @@ -2638,7 +2652,7 @@ =end original -注意: この関数の perl_ の形は非推奨です。 +注意: この関数の perl_ の形は廃止予定です。 HV* get_hv(const char* name, I32 create) @@ -2656,9 +2670,9 @@ =end original -このフラグは、ハッシュエントリーの length slot や magic structures で -使われ、C<char*> ポインタであることを期待されている C<SV*> ポインタを -含む構造体を指定します。 +このフラグは、ハッシュエントリの length slot や magic structures で使われ、 +C<char*> ポインタであることを期待されている C<SV*> ポインタを含む構造体を +指定します。 (情報のみ -- 使われません)。 =for hackers @@ -2673,7 +2687,7 @@ =end original -ハッシュエントリーに格納されている計算済みハッシュを返します。 +ハッシュエントリに格納されている計算済みハッシュを返します。 U32 HeHASH(HE* he) @@ -2692,7 +2706,7 @@ =end original -ハッシュエントリーのキー スロットにあるポインタを返します。 +ハッシュエントリのキー スロットにあるポインタを返します。 このポインタは C<char*> か C<SV*> のいずれかで、これは C<HeKLEN()> の 値に依存します。 これは代入することができます。 @@ -2716,7 +2730,7 @@ =end original -これが負であり、かつ C<HEf_SVKEY> に等しければ、エントリーが C<SV*> キーを +これが負であり、かつ C<HEf_SVKEY> に等しければ、エントリが C<SV*> キーを 保持していることを示します。 そうでなければ、これはキーの実際の長さを保持しています。 これは代入することができます。 @@ -2744,16 +2758,15 @@ =end original -C<char *> としてのハッシュエントリーのキースロットを返し、C<SV*> -キーで必要となるような参照外しなどを行います。 +C<char *> としてのハッシュエントリのキースロットを返し、C<SV*> キーで +必要となるような参照外しなどを行います。 文字列の長さは C<len> に置かれます(これはマクロなので、C<&len> を 使ってはいけません)。 キーの長さがどうなのかを気にしないのであれば、グローバル変数 C<PL_na> を 使うことができますが、これはローカル変数を使うよりも非効率的です。 -しかし忘れないで欲しいのは、そういった perl に -おけるハッシュのキーは埋め込まれているヌル文字に対して -自由であり、そのため C<strlen()> などを使ってハッシュキーの長さを -調べるのは良い方法ではないということです。 +しかし忘れないで欲しいのは、そういった perl におけるハッシュのキーは +埋め込まれているヌル文字に対して自由であり、そのため C<strlen()> などを使って +ハッシュキーの長さを調べるのは良い方法ではないということです。 これは他の場所で説明している C<SvPV()> マクロについても同様です。 char* HePV(HE* he, STRLEN len) @@ -2771,8 +2784,8 @@ =end original -C<SV*> としてのキー、もしくはハッシュエントリーに -C<SV*> キーがない場合には C<NULL> を返します。 +C<SV*> としてのキー、もしくはハッシュエントリに C<SV*> キーがない場合には +C<NULL> を返します。 SV* HeSVKEY(HE* he) @@ -2790,8 +2803,8 @@ =end original C<SV*> としてのキーを返します。 -ハッシュエントリーに C<char*> キーしかない場合には、一時的な揮発性 -C<SV*> が生成されて返されます。 +ハッシュエントリに C<char*> キーしかない場合には、一時的な揮発性 C<SV*> が +生成されて返されます。 SV* HeSVKEY_force(HE* he) @@ -2826,7 +2839,7 @@ =end original -ハッシュエントリーに格納されている(型 C<SV*> の)値スロットを返します。 +ハッシュエントリに格納されている(型 C<SV*> の)値スロットを返します。 SV* HeVAL(HE* he) @@ -2877,7 +2890,7 @@ =end original -ハッシュをクリアーし、空にします。 +ハッシュをクリアし、空にします。 void hv_clear(HV* tb) @@ -2900,15 +2913,13 @@ =end original ハッシュからのプレースホルダをクリアします。 -If a restricted hash has any of its keys -marked as readonly and the key is subsequently deleted, the key is not actually -deleted but is marked by assigning it a value of &PL_sv_placeholder. This tags -it so it will be ignored by future operations such as iterating over the hash, -but will still allow the hash to have a value reassigned to the key at some -future point. +制限ハッシュに読み込み専用とマークされたキーがあって、その後キーが +削除されると、キーは実際には削除されず、&PL_sv_placeholder の値を +代入することでマークされます。 +これはハッシュの反復のようなその後の操作では無視されるようになりますが、 +将来の時点でキーに再代入されることで値を持てるようになっています。 この関数はこのようなハッシュからのプレースホルダキーをクリアします。 この使用例は Hash::Util::lock_keys() を参照してください。 -(TBT) void hv_clear_placeholders(HV* hb) @@ -3066,12 +3077,12 @@ =end original -指定されたキーに対応する、ハッシュ中のハッシュエントリーを返します。 +指定されたキーに対応する、ハッシュ中のハッシュエントリを返します。 C<hash> は、C<key> に対する正当な計算済みハッシュ値でなければなりません; もしくは、この関数にハッシュ値を計算させたいのであればここに 0 を置きます。 C<lval> がセットされていると、フェッチはストアの一部分となります。 -C<tb> が tie されているハッシュの場合の戻り値は静的な -位置 (static location)へのポインタです。 +C<tb> が tie されているハッシュの場合の戻り値は静的な位置 +(static location)へのポインタです。 したがって、何かを格納する必要があるのなら、その構造体のコピーを 取るようにしてください。 @@ -3114,8 +3125,8 @@ =end original -注意: 5.004_65 より前のバージョンでは、C<hv_iterinit> は -使用中のハッシュバケツの数を返すのに使われていました。 +注意: 5.004_65 より前のバージョンでは、C<hv_iterinit> は使用中の +ハッシュバケツの数を返すのに使われていました。 もしあなたがそのような値を必要としているのなら、C<HvFILL(tb)> という マクロを使って得ることができます。 @@ -3171,7 +3182,7 @@ =end original -ハッシュ反復子からエントリーを返します。 +ハッシュ反復子からエントリを返します。 C<hv_iterinit> を参照してください。 =begin original @@ -3186,14 +3197,15 @@ =end original -You may call C<hv_delete> or C<hv_delete_ent> on the hash entry that the -iterator currently points to, without losing your place or invalidating your -iterator. Note that in this case the current entry is deleted from the hash -with your iterator holding the last reference to it. Your iterator is flagged -to free the entry on the next call to C<hv_iternext>, so you must not discard -your iterator immediately else the entry will leak - call C<hv_iternext> to -trigger the resource deallocation. -(TBT) +反復子が位置を失ったり無効になったりすることなく、反復子が現在指している +ハッシュエントリに対して C<hv_delete> または C<hv_delete_ent> を +呼び出すことができます。 +この場合現在のエントリは、これへの最後の参照を保持している反復子の +ハッシュから削除されることに注意してください。 +反復子は次の C<hv_iternext> の呼び出しでエントリが解放されるようにマークが +付けられるので、すぐに反復子を捨ててはいけません; さもなければエントリは +リークします; リソースの割り当て解除を引き起こすには C<hv_iternext> を +呼び出してください。 HE* hv_iternext(HV* tb) @@ -3234,7 +3246,7 @@ =end original -ハッシュ反復子からエントリーを返します。 +ハッシュ反復子からエントリを返します。 C<hv_iterinit> と C<hv_iternext> を参照してください。 C<flags> の値は普通はゼロです; HV_ITERNEXT_WANTPLACEHOLDERS が セットされていると、(制限ハッシュのための) プレースホルダキーは通常のキーに @@ -3419,7 +3431,7 @@ ハッシュキーは C<key> で指定します。 C<hash> パラメーターはあらかじめ計算したハッシュ値です; 0 にすると Perl がこれを計算します。 -戻り値は生成された新しいハッシュエントリーです。 +戻り値は生成された新しいハッシュエントリです。 操作が失敗したり、(tie されているハッシュのように)ハッシュに実際に値を 格納する必要のない場合には NULL になります。 そうでない場合には、戻り値の内容に C<He?> マクロを使ってアクセスすることが @@ -3492,6 +3504,8 @@ =head1 Magical Functions +(マジカル関数) + =over 8 =item mg_clear @@ -3503,7 +3517,7 @@ =end original -SV が表わしている magical をクリアーします。 +SV が表わしている magical をクリアします。 C<sv_magic> を参照してください。 int mg_clear(SV* sv) @@ -3793,6 +3807,8 @@ =head1 Memory Management +(メモリ管理) + =over 8 =item Copy @@ -4239,6 +4255,8 @@ =head1 Miscellaneous Functions +(その他の関数) + =over 8 =item fbm_compile @@ -4474,13 +4492,11 @@ =end original -Performs some preprocessing to the string to ensure that -it has the correct characteristics of a version. Flags the -object if it contains an underscore (which denotes this -is an alpha version). The boolean qv denotes that the version -should be interpreted as if it had multiple decimals, even if -it doesn't. -(TBT) +バージョンとして正しい特性を持つように文字列に前処理を行います。 +下線が含まれている(これがαバージョンであることを示します)なら、 +オブジェクトにマークを付けます。 +真偽値 qv は、たとえそうではなくても、バージョンに複数の小数点が +含まれているかのように解釈するべきであることを示します。 const char* scan_version(const char *vstr, SV *sv, bool qv) @@ -4673,7 +4689,7 @@ =end original -share モジュールがないときに SV を「share する」ダミールーチンです。 +共有モジュールがないときに SV を「共有する」ダミールーチンです。 あるいは「ロックします」。 あるいは「アンロックします」。 言い換えると、単一の SV 引数を無視します。 @@ -4845,6 +4861,8 @@ =head1 MRO Functions +(MRO 関数) + =over 8 =item mro_get_linear_isa @@ -4875,12 +4893,9 @@ =end original -You are responsible for C<SvREFCNT_inc()> on the -return value if you plan to store it anywhere -semi-permanently (otherwise it might be deleted -out from under you the next time the cache is -invalidated). -(TBT) +半永久的にどこかにこれを保管する計画がある場合、返り値に対する +C<SvREFCNT_inc()> に対して責任があります。 +(さもなければ、次回キャッシュが無効化されるときに削除されるかもしれません)。 AV* mro_get_linear_isa(HV* stash) @@ -4967,6 +4982,8 @@ =head1 Multicall Functions +(多重呼び出し関数) + =over 8 =item dMULTICALL @@ -5043,6 +5060,8 @@ =head1 Numeric functions +(数値関数) + =over 8 =item grok_bin @@ -5068,14 +5087,13 @@ =end original -On entry I<start> and I<*len> give the string to scan, I<*flags> gives -conversion flags, and I<result> should be NULL or a pointer to an NV. -The scan stops at the end of the string, or the first invalid character. +エントリ I<start> と I<*len> はスキャンする文字列を指定し、I<*flags> は +変換フラグ、I<result> は NULL か NV へのポインタです。 +スキャンは文字列の末尾か、最初の不正な文字で停止します。 I<*flags> に C<PERL_SCAN_SILENT_ILLDIGIT> がセットされていなければ、不正な 文字に遭遇すると警告も引き起こされます。 返るときに、I<*len> はスキャンした文字列の長さにセットされ、 I<*flags> は出力フラグになります。 -(TBT) =begin original @@ -5136,14 +5154,13 @@ =end original -On entry I<start> and I<*len> give the string to scan, I<*flags> gives -conversion flags, and I<result> should be NULL or a pointer to an NV. -The scan stops at the end of the string, or the first invalid character. +エントリ I<start> と I<*len> はスキャンする文字列を指定し、I<*flags> は +変換フラグ、I<result> は NULL か NV へのポインタです。 +スキャンは文字列の末尾か、最初の不正な文字で停止します。 I<*flags> に C<PERL_SCAN_SILENT_ILLDIGIT> がセットされていなければ、不正な 文字に遭遇すると警告も引き起こされます。 返るときに、I<*len> はスキャンした文字列の長さにセットされ、 I<*flags> は出力フラグになります。 -(TBT) =begin original @@ -5210,13 +5227,13 @@ =end original -If the value of the number can fit an in UV, it is returned in the *valuep -IS_NUMBER_IN_UV will be set to indicate that *valuep is valid, IS_NUMBER_IN_UV -will never be set unless *valuep is valid, but *valuep may have been assigned -to during processing even though IS_NUMBER_IN_UV is not set on return. -If valuep is NULL, IS_NUMBER_IN_UV will be set for the same cases as when -valuep is non-NULL, but no actual assignment (or SEGV) will occur. -(TBT) +数値の値が UV に収まるなら、*valuep に返され、*valuep が有効であることを +示すために IS_NUMBER_IN_UV がセットされます; *valuep が有効でなければ +IS_NUMBER_IN_UV がセットされることはありませんが、返る時点で +IS_NUMBER_IN_UV がセットされていないとしても、処理中に *valuep に値が +代入されるかもしれません。 +valuep が NULL なら、valuep が非 NULL の場合と同様に IS_NUMBER_IN_UV が +セットされますが、実際の代入(または SEGV)は起こりません。 =begin original @@ -5228,13 +5245,12 @@ =end original -IS_NUMBER_NOT_INT will be set with IS_NUMBER_IN_UV if trailing decimals were -seen (in which case *valuep gives the true value truncated to an integer), and -IS_NUMBER_NEG if the number is negative (in which case *valuep holds the -absolute value). +引き続く数字がある(この場合 *valuep には整数に切り詰められた真の値が入ります) +の場合、IS_NUMBER_NOT_INT が IS_NUMBER_IN_UV と共にセットされ、値が負数 +(この場合 *value には絶対値が入ります)の場合、IS_NUMBER_NEG が +セットされます。 e 記法が使われたり数値が UV よりも大きいなら、IS_NUMBER_IN_UV は セットされません。 -(TBT) int grok_number(const char *pv, STRLEN len, UV *valuep) @@ -5280,14 +5296,13 @@ =end original -On entry I<start> and I<*len> give the string to scan, I<*flags> gives -conversion flags, and I<result> should be NULL or a pointer to an NV. +エントリ I<start> と I<*len> はスキャンする文字列を指定し、I<*flags> は +変換フラグ、I<result> は NULL か NV へのポインタです。 スキャンは文字列の末尾か、最初の不正な文字で停止します。 I<*flags> に C<PERL_SCAN_SILENT_ILLDIGIT> がセットされていなければ、不正な 文字に遭遇すると警告も引き起こされます。 返るときに、I<*len> はスキャンした文字列の長さにセットされ、 I<*flags> は出力フラグになります。 -(TBT) =begin original @@ -5344,13 +5359,14 @@ =end original -If Configure detects this system has a signbit() that will work with -our NVs, then we just use it via the #define in perl.h. Otherwise, -fall back on this implementation. As a first pass, this gets everything -right except -0.0. Alas, catching -0.0 is the main use for this function, -so this is not too helpful yet. Still, at least we have the scaffolding -in place to support other systems, should that prove useful. -(TBT) +Configure は、このシステムの NV に動作する signbit() が持っていることを +検出します。 +それから単にこれを perl.h の #define 経由で使います。 +さもなければ、この実装にフォールバックします。 +第 1 パスとして、これは -0.0 以外の全てを取ります。 +悲しいかな、-0.0 の捕捉はこの関数の主な使用法なので、これはまだあまり +役には立ちません。 +それでも、少なくとも便利であるとわかる他のシステムに対応する足場になります。 =begin original @@ -5365,15 +5381,16 @@ =end original -Configure notes: This function is called 'Perl_signbit' instead of a -plain 'signbit' because it is easy to imagine a system having a signbit() -function or macro that doesn't happen to work with our particular choice -of NVs. We shouldn't just re-#define signbit as Perl_signbit and expect -the standard system headers to be happy. Also, this is a no-context -function (no pTHX_) because Perl_signbit() is usually re-#defined in -perl.h as a simple macro call to the system's signbit(). -Users should just always call Perl_signbit(). -(TBT) +Configure の注意: この関数は、単なる 'signbit' ではなく 'Perl_signbit' と +呼ばれます; なぜなら +たまたま NV の特定の選択で動作しない signbit() 関数やマクロを持つシステムを +想像するのは容易だからです。 +単に signbit を Perl_signbit と再 #define して、標準システムヘッダがうまく +動くことを想定するべきではありません。 +また、これは(pTHX_ なしの)コンテキストなし関数はありません; なぜなら +Perl_signbit() は通常 perl.h でシステムの signbit() への単純なマクロ +呼び出しに再 #defined されるからです。 +ユーザーは単に常に Perl_signbit() を呼び出してください。 =begin original @@ -5444,6 +5461,8 @@ =head1 Optree Manipulation Functions +(演算木操作関数) + =over 8 =item cv_const_sv @@ -5513,6 +5532,8 @@ =head1 Pad Data Structures +(パッドデータ構造体) + =over 8 =item pad_sv @@ -5537,6 +5558,8 @@ =head1 Per-Interpreter Variables +(インタプリタ単位変数) + =over 8 =item PL_modglobal @@ -5557,8 +5580,8 @@ エクステンションによって使われるものです。 場合によっては、データの共有をおこなうために エクステンションのシンボルテーブルとして使うことも可能です。 -エクステンションのパッケージ名を、エクステンション固有のデータの -名前のプリフィックスとして使うのは良い考えです。 +エクステンションのパッケージ名を、エクステンション固有のデータの名前の +接頭辞として使うのは良い考えです。 HV* PL_modglobal @@ -5646,6 +5669,8 @@ =head1 REGEXP Functions +(正規表現関数) + =over 8 =item SvRX @@ -5715,6 +5740,8 @@ =head1 Simple Exception Handling Macros +(単純な例外処理マクロ) + =over 8 =item dXCPT @@ -5801,6 +5828,8 @@ =head1 Stack Manipulation Macros +(スタック操作マクロ) + =over 8 =item dMARK @@ -6139,7 +6168,7 @@ =end original スタックから文字列をポップします。 -非推奨です。 +廃止予定です。 新しいコードは POPpx を使うべきです。 char* POPp @@ -6828,6 +6857,8 @@ =head1 SV Flags +(SV フラグ) + =over 8 =item svtype @@ -6956,6 +6987,8 @@ =head1 SV Manipulation Functions +(SV 操作関数) + =over 8 =item get_sv @@ -6981,7 +7014,7 @@ =end original -注意: この関数の perl_ の形は非推奨です。 +注意: この関数の perl_ の形は廃止予定です。 SV* get_sv(const char* name, I32 create) @@ -7365,11 +7398,9 @@ =end original sv の IV ポインタの値を val にセットします。 -It is possible to perform -the same function of this macro with an lvalue assignment to C<SvIVX>. -With future Perls, however, it will be more efficient to use -C<SvIV_set> instead of the lvalue assignment to C<SvIVX>. -(TBT) +C<SvIVX> への左辺値代入によってこのマクロと同じ機能を行うことが可能です。 +しかし、将来の Perl では、C<SvIVX> への左辺値代入の代わりに、C<SvIV_set> を +使う方がより効率的になります。 void SvIV_set(SV* sv, IV val) @@ -8849,6 +8880,8 @@ =head1 SV-Body Allocation +(SV ボディ割り当て) + =over 8 =item looks_like_number @@ -9063,14 +9096,15 @@ =end original -Creates a new SV with its SvPVX_const pointing to a shared string in the string -table. If the string does not already exist in the table, it is created -first. Turns on READONLY and FAKE. If the C<hash> parameter is non-zero, that -value is used; otherwise the hash is computed. The string's hash can be later -be retrieved from the SV with the C<SvSHARED_HASH()> macro. The idea here is -that as the string table is used for shared hash keys these strings will have -SvPVX_const == HeKEY and hash lookup will avoid string compare. -(TBT) +SvPVX_const が文字列テーブルの共有文字列を指している新しい SV を作成します。 +文字列がまだテーブルに存在していないなら、まず作成されます。 +READONLY と FAKE を有効にします。 +C<hash> 引数が非ゼロなら、その値が使われます; さもなければハッシュは +計算されます。 +文字列のハッシュは、後で C<SvSHARED_HASH()> マクロで SV から取得できます。 +ここでの考え方は、文字列テーブルは共有ハッシュキーのために使われるので、 +これらの文字列は SvPVX_const == HeKEY であって、ハッシュの検索は +文字列比較を防ぐと言うことです。 SV* newSVpvn_share(const char* s, I32 len, U32 hash) @@ -9768,11 +9802,10 @@ =end original -Any scalar variable may carry PERL_MAGIC_collxfrm magic that contains the -scalar data of the variable, but transformed to such a format that a normal -memory comparison can be used to compare the data according to the locale -settings. -(TBT) + +任意のスカラ値は変数のスカラデータを含む PERL_MAGIC_collxfrm magic を +保持しているかもしれませんが、ロケール設定に従った比較に通常のメモリ比較が +使えるようなフォーマットに変換されます。 char* sv_collxfrm(SV* sv, STRLEN* nxp) @@ -9865,16 +9898,17 @@ =end original -Undo various types of fakery on an SV: if the PV is a shared string, make -a private copy; if we're a ref, stop refing; if we're a glob, downgrade to -an xpvmg; if we're a copy-on-write scalar, this is the on-write time when -we do the copy, and is also used locally. If C<SV_COW_DROP_PV> is set -then a copy-on-write scalar drops its PV buffer (if any) and becomes -SvPOK_off rather than making a copy. (Used where this scalar is about to be -set to some other value.) In addition, the C<flags> parameter gets passed to -C<sv_unref_flags()> when unrefing. C<sv_force_normal> calls this function -with flags set to 0. -(TBT) +SV に対する様々な種類のごまかしを元に戻します: +PV が共有文字列なら、プライベートなコピーを作ります; 参照しているなら +参照を止めます; グロブなら、xpvmg に降格します; コピーオンライト +スカラなら、コピーは書き込み時に行われ、ローカルに使われます。 +C<SV_COW_DROP_PV> がセットされているなら、コピーオンライトスカラは +(もしあれば)PV バッファを落として、コピーを作る代わりに SvPOK_off に +なります。 +(このスカラが何か他の値にセットされようとした場所で使われます。) +さらに、参照を止めるときに C<sv_unref_flags()> に C<flags> 引数が +渡されます。 +C<sv_force_normal> は flags に 0 をセットしてこの関数を呼び出します。 void sv_force_normal_flags(SV *sv, U32 flags) @@ -9893,11 +9927,10 @@ =end original -Decrement an SV's reference count, and if it drops to zero, call -C<sv_clear> to invoke destructors and free up any memory used by -the body; finally, deallocate the SV's head itself. -Normally called via a wrapper macro C<SvREFCNT_dec>. -(TBT) +SV の参照カウントをデクリメントして、ゼロになったら、デストラクタを起動して +ボディによって使われているメモリを解放するために C<sv_clear> を呼び出します; +最後に、SV のヘッド地震を割り当て解除します。 +通常はラッパーマクロ C<SvREFCNT_dec> 経由で呼び出されます。 void sv_free(SV* sv) @@ -10120,7 +10153,7 @@ =end original -C<sv_magicext> は、C<sv_magic> が出来ないことが出来るっと言うことに +C<sv_magicext> は、C<sv_magic> が出来ないことが出来ると言うことに 注意してください。 特に、SvREADONLY SV に magic を追加したり、同じ 'how' の複数の実体を 追加したりできます。 @@ -10134,11 +10167,11 @@ =end original -If C<namlen> is greater than zero then a C<savepvn> I<copy> of C<name> is -stored, if C<namlen> is zero then C<name> is stored as-is and - as another -special case - if C<(name && namlen == HEf_SVKEY)> then C<name> is assumed -to contain an C<SV*> and is stored as-is with its REFCNT incremented. -(TBT) +C<namlen> がゼロ以上なら、C<savepvn> に C<name> の I<コピー> が保管されます; +C<namlen> がゼロなら C<name> はそのまま保管されて - もう一つの特殊な +場合として - C<(name && namlen == HEf_SVKEY)> なら C<name> は C<SV*> を +含んでいるものと仮定されて、その REFCNT をインクリメントして、そのまま +保管されます。 =begin original @@ -10228,10 +10261,9 @@ =end original -Converts the value pointed to by offsetp from a count of bytes from the -start of the string, to a count of the equivalent number of UTF-8 chars. +文字列の先頭からバイト数で offsetp 離れたところから、UTF-8 文字として等価な +数の分だけ変換します。 magic と型強制をハンドルします。 -(TBT) void sv_pos_b2u(SV* sv, I32* offsetp) @@ -10251,12 +10283,11 @@ =end original -Converts the value pointed to by offsetp from a count of UTF-8 chars from -the start of the string, to a count of the equivalent number of bytes; +文字列の先頭から UTF-8 の文字数で offsetp 離れたところから、 +等価なバイト数の分だけのところまでの値を変換します; lenp が非ゼロなら、これは lenp と同じですが、この場合は文字列の 先頭からではなく offset から始めます。 magic と型強制をハンドルします。 -(TBT) void sv_pos_u2b(SV* sv, I32* offsetp, I32* lenp) @@ -10374,13 +10405,12 @@ =end original -Make the first argument a copy of the second, then delete the original. -The target SV physically takes over ownership of the body of the source SV -and inherits its flags; however, the target keeps any magic it owns, -and any magic in the source is discarded. -Note that this is a rather specialist SV copying operation; most of the -time you'll want to use C<sv_setsv> or one of its many macro front-ends. -(TBT) +最初の引数を二つ目の引数のコピーにして、元のデータを削除します。 +ターゲット SV は物理的にソース SV のボディの所有権を受け取って、フラグを +継承します; しかし、ターゲットは magic を保持したままで、ソースの magic は +捨てられます。 +これは特殊な SV コピー操作であることに注意してください; ほとんどの場合 +C<sv_setsv> か多くのこれのマクロフロントエンドを使いたいでしょう。 void sv_replace(SV* sv, SV* nsv) @@ -10418,12 +10448,11 @@ =end original -Weaken a reference: set the C<SvWEAKREF> flag on this RV; give the -referred-to SV C<PERL_MAGIC_backref> magic if it hasn't already; and -push a back-reference to this RV onto the array of backreferences -associated with that magic. +参照を弱めます: この RV の C<SvWEAKREF> フラグをセットします; まだなければ +参照されている SB に C<PERL_MAGIC_backref> magic を与えます; +そしてこの RV への後方参照を magic と関連づけられた後方参照の配列に +プッシュします。 RV がマジカルなら、set magic は RV がクリアした後呼び出されます。 -(TBT) SV* sv_rvweaken(SV *sv) @@ -10849,7 +10878,7 @@ =end original -C<SvSetSV>, C<SvSetSV_nosteal>, C<SvSetMagicSV>, +おそらく C<SvSetSV>, C<SvSetSV_nosteal>, C<SvSetMagicSV>, C<SvSetMagicSV_nosteal> のようなラッパーの一つを使いたいでしょう。 void sv_setsv(SV* dsv, SV* ssv) @@ -11033,12 +11062,11 @@ SV の RV ステータスをアンセットし、RV によって参照されているものの 参照カウントを減じます。 これは C<newSVrv> の反転したものであると考えられます。 -The C<cflags> argument can contain -C<SV_IMMEDIATE_UNREF> to force the reference count to be decremented -(otherwise the decrementing is conditional on the reference count being -different from one or the reference being a readonly SV). +C<cflags> 引数は、参照カウントをデクリメントすることを強制するために +C<SV_IMMEDIATE_UNREF> を含むことができます +(さもなければデクリメントは参照カウントが 1 ではないか、読み込み専用 SV を +参照しているという条件で行われます)。 C<SvROK_off> を参照してください。 -(TBT) void sv_unref_flags(SV* sv, U32 flags) @@ -11066,11 +11094,10 @@ =end original SV をより複雑な形式へと昇格させます。 -Generally adds a new body type to the -SV, then copies across as much information as possible from the old body. -You generally want to use the C<SvUPGRADE> macro wrapper. +一般的に新しいボディ型を SV に追加して、古いボディから出来るだけ多くの情報を +コピーします。 +一般的には C<SvUPGRADE> マクロラッパーを使いたいでしょう。 C<svtype> も参照してください。 -(TBT) void sv_upgrade(SV* sv, svtype new_type) @@ -11093,15 +11120,15 @@ =end original -Tells an SV to use C<ptr> to find its string value. Normally the -string is stored inside the SV but sv_usepvn allows the SV to use an -outside string. The C<ptr> should point to memory that was allocated -by C<malloc>. The string length, C<len>, must be supplied. By default -this function will realloc (i.e. move) the memory pointed to by C<ptr>, -so that pointer should not be freed or used by the programmer after -giving it to sv_usepvn, and neither should any pointers from "behind" -that pointer (e.g. ptr + 1) be used. -(TBT) +自身の文字列値を得るのに C<ptr> を使うように SV に指示します。 +通常文字列は SV の内側に保管されますが、sv_usepvn によって SV が外側の +文字列を使えるようにできます。 +C<ptr> は C<malloc> によって割り当てられたメモリを指しているべきです。 +文字列の長さ C<len> を指定しなければなりません。 +デフォルトではこの関数は C<ptr> で指されているメモリを realloc (つまり移動) +するので、ポインタは sv_usepvn に与えられた後で解放されたりプログラマによって +使われたりするべきではありませんし、このポインタの「背後」(例えば ptr + 1) +からのポインタを使うべきではありません。 =begin original @@ -11112,11 +11139,11 @@ =end original -If C<flags> & SV_SMAGIC is true, will call SvSETMAGIC. If C<flags> & -SV_HAS_TRAILING_NUL is true, then C<ptr[len]> must be NUL, and the realloc -will be skipped. (i.e. the buffer is actually at least 1 byte longer than -C<len>, and already meets the requirements for storing in C<SvPVX>) -(TBT) +C<flags> & SV_SMAGIC が真なら、SvSETMAGIC を呼び出します。 +C<flags> & SV_HAS_TRAILING_NUL が真なら、C<ptr[len]> は NUL で +なければならず、realloc はスキップされます。 +(つまりバッファは実際には少なくとも C<len> より 1 バイト長く、既に +C<SvPVX> を保管する条件を満たしています。) void sv_usepvn_flags(SV* sv, char* ptr, STRLEN len, U32 flags) @@ -11136,12 +11163,10 @@ =end original -If the PV of the SV is an octet sequence in UTF-8 -and contains a multiple-byte character, the C<SvUTF8> flag is turned on -so that it looks like a character. If the PV contains only single-byte -characters, the C<SvUTF8> flag stays being off. -Scans PV for validity and returns false if the PV is invalid UTF-8. -(TBT) +SV の PV が UTF-8 のオクテット並びで複数バイト文字を含んでいるなら、 +文字のように見えるように C<SvUTF8> フラグがオンになります。 +PV が単一バイト文字だけを含んでいるなら、C<SvUTF8> フラグはオフのママです。 +PV の妥当性をスキャンして、PV が妥当な UTF-8 ではないなら偽を返します。 =begin original @@ -11169,11 +11194,9 @@ =end original -Attempts to convert the PV of an SV from characters to bytes. -If the PV contains a character beyond byte, this conversion will fail; -in this case, either returns false or, if C<fail_ok> is not -true, croaks. -(TBT) +SV の PV を文字からバイトに変換しようとします。 +PV にバイトを超える文字が含まれているなら、この変換は失敗します; この場合、 +偽を返すか、C<fail_ok> が真でないなら、croak します。 =begin original @@ -11229,7 +11252,7 @@ =end original -SV の PV を UTF-8 エンコードされた形式に変換します。F +SV の PV を UTF-8 エンコードされた形式に変換します。 もしまだ行われていなければ、SV を文字列形式に強制します。 例え全てのバイトの最上位ビットがクリアされていても、将来の正当性チェックを 避けるために、常に SvUTF8 フラグがセットされます。 @@ -11453,6 +11476,8 @@ =head1 Unicode Support +(Unicode 対応) + =over 8 =item bytes_from_utf8 @@ -11469,13 +11494,13 @@ =end original -Converts a string C<s> of length C<len> from UTF-8 into byte encoding. -Unlike C<utf8_to_bytes> but like C<bytes_to_utf8>, returns a pointer to -the newly-created string, and updates C<len> to contain the new -length. Returns the original string if no conversion occurs, C<len> -is unchanged. Do nothing if C<is_utf8> points to 0. Sets C<is_utf8> to -0 if C<s> is converted or contains all 7bit characters. -(TBT) +長さ C<len> の文字列 C<s> を UTF-8 からバイトエンコーディングに変換します。 +C<utf8_to_bytes> と異なりますが C<bytes_to_utf8> と同様、 +新しく作成された文字列へのポインタを返し、C<len> を新しい長さで更新します。 +変換が行われなければ元の文字列を返し、C<len> は変更されません。 +C<is_utf8> が 0 を指しているなら何もしません。 +C<s> が変換されたか、全て 7 ビット文字からなっている場合は +C<is_utf8> を 0 にセットします。 =begin original @@ -11502,10 +11527,9 @@ =end original -Converts a string C<s> of length C<len> from ASCII into UTF-8 encoding. -Returns a pointer to the newly-created string, and sets C<len> to -reflect the new length. -(TBT) +長さ C<len> の文字列 C<s> を ASCII から UTF-8 エンコーディングに変換します。 +新しく作成された文字列へのポインタを返し、C<len> に新しい長さを +反映させます。 =begin original @@ -11568,16 +11592,14 @@ =end original -If the pe1 and pe2 are non-NULL, the scanning pointers will be copied -in there (they will point at the beginning of the I<next> character). -If the pointers behind pe1 or pe2 are non-NULL, they are the end -pointers beyond which scanning will not continue under any -circumstances. If the byte lengths l1 and l2 are non-zero, s1+l1 and -s2+l2 will be used as goal end pointers that will also stop the scan, -and which qualify towards defining a successful match: all the scans -that define an explicit length must reach their goal pointers for -a match to succeed). -(TBT) +pe1 と pe2 が非 NULL なら、スキャンポインタはここにコピーされます +(これらは I<next> 文字の先頭を指します)。 +pe1 または pe2 の背後のポインタが非 NULL なら、これらはどのような場合でも +スキャンが継続されないエンドポインタです。 +バイト長 l1 と l2 が非ゼロなら、s1+l1 と s2+l2 がスキャンを停止して +成功したマッチングを定義するための条件となるゴール端ポインタとして +使われます: 明示的な長さを定義した全てのスキャンはマッチングが +成功するためにゴールポインタに到達しなければなりません)。 =begin original @@ -11587,10 +11609,10 @@ =end original -For case-insensitiveness, the "casefolding" of Unicode is used -instead of upper/lowercasing both the characters, see -http://www.unicode.org/unicode/reports/tr21/ (Case Mappings). -(TBT) +大文字小文字の虫に関して、Unicode の「畳み込み化」は文字の大文字化/小文字化の +両方の代わりに使われます; +http://www.unicode.org/unicode/reports/tr21/ (Case Mappings) を +参照してください。 I32 ibcmp_utf8(const char* a, char **pe1, UV l1, bool u1, const char* b, char **pe2, UV l2, bool u2) @@ -11609,11 +11631,10 @@ =end original -Tests if some arbitrary number of bytes begins in a valid UTF-8 -character. Note that an INVARIANT (i.e. ASCII) character is a valid -UTF-8 character. The actual number of bytes in the UTF-8 character -will be returned if it is valid, otherwise 0. -(TBT) +任意の数のバイト列が妥当な UTF-8 文字から始まるかどうかをテストします。 +INVARIANT (つまり ASCII) は妥当な UTF-8 文字であることに注意してください。 +妥当であれば UTF-8 文字の実際のバイト数が返され、さもなければ 0 が +返されます。 STRLEN is_utf8_char(const U8 *p) @@ -11632,11 +11653,11 @@ =end original -Returns true if first C<len> bytes of the given string form a valid -UTF-8 string, false otherwise. Note that 'a valid UTF-8 string' does -not mean 'a string that contains code points above 0x7F encoded in UTF-8' -because a valid ASCII string is a valid UTF-8 string. -(TBT) +文字列の最初の C<len> バイトが妥当な UTF-8 文字列なら真を返し、さもなければ +偽を返します。 +「妥当な UTF-8 文字列」は「UTF-8 でエンコードされた、0x7F を超える符号位置の +文字を含む文字列」という意味ではないことに注意してください; なぜなら +妥当な ASCII 文字列は妥当な UTF-8 文字列だからです。 =begin original @@ -11662,10 +11683,8 @@ =end original -Like is_utf8_string() but stores the location of the failure (in the -case of "utf8ness failure") or the location s+len (in the case of -"utf8ness success") in the C<ep>. -(TBT) +is_utf8_string() と同様ですが、C<ep> に、(「utf8 失敗」の場合)失敗した +位置を、(「utf8 成功」の場合) s+len の位置を保管します。 =begin original @@ -11692,11 +11711,9 @@ =end original -Like is_utf8_string() but stores the location of the failure (in the -case of "utf8ness failure") or the location s+len (in the case of -"utf8ness success") in the C<ep>, and the number of UTF-8 -encoded characters in the C<el>. -(TBT) +is_utf8_string() と同様ですが、C<ep> に、(「utf8 失敗」の場合)失敗した +位置を、(「utf8 成功」の場合) s+len の位置を保管し、UTF-8 エンコードされた +文字の数を C<el> に保管します。 =begin original @@ -11722,10 +11739,9 @@ =end original -Build to the scalar dsv a displayable version of the string spv, -length len, the displayable version being at most pvlim bytes long -(if longer, the rest is truncated and "..." will be appended). -(TBT) +スカラ dsv を文字列 spv 長さ len の表示可能なバージョンに構築します; +表示可能なバージョンは最大でも pvlim バイトの長さです (もしより長ければ、 +残りは切り詰められて "..." が追加されます)。 =begin original @@ -11738,13 +11754,12 @@ =end original -The flags argument can have UNI_DISPLAY_ISPRINT set to display -isPRINT()able characters as themselves, UNI_DISPLAY_BACKSLASH -to display the \\[nrfta\\] as the backslashed versions (like '\n') -(UNI_DISPLAY_BACKSLASH is preferred over UNI_DISPLAY_ISPRINT for \\). -UNI_DISPLAY_QQ (and its alias UNI_DISPLAY_REGEX) have both -UNI_DISPLAY_BACKSLASH and UNI_DISPLAY_ISPRINT turned on. -(TBT) +flags 引数には、isPRINT() 可能な文字をそのまま表示する UNI_DISPLAY_ISPRINT、 +\\[nrfta\\] を ('\n' のように) バックスラッシュ版として表示する +UNI_DISPLAY_BACKSLASH を含むことができます +(UNI_DISPLAY_BACKSLASH は \\ に関して UNI_DISPLAY_ISPRINT より優先されます)。 +UNI_DISPLAY_QQ (およびその別名である UNI_DISPLAY_REGEX) は +UNI_DISPLAY_BACKSLASH と UNI_DISPLAY_ISPRINT の両方をオンにします。 =begin original @@ -11774,14 +11789,13 @@ =end original -The encoding is assumed to be an Encode object, the PV of the ssv is -assumed to be octets in that encoding and decoding the input starts -from the position which (PV + *offset) pointed to. The dsv will be -concatenated the decoded UTF-8 string from ssv. Decoding will terminate -when the string tstr appears in decoding output or the input ends on -the PV of the ssv. The value which the offset points will be modified -to the last input position on the ssv. -(TBT) +encoding は Encode オブジェクトであると仮定して、また ssv の PV は +そのエンコーディングのオクテットであると仮定して、入力のデコードは +(PV + *offset) が指す位置から開始されます。 +dsv は ssv からデコードされた UTF-8 文字列と連結されます。 +デコードは文字列 str がデコード出力に現れるか、ssv の PV の入力が +終わったときに終了します。 +オフセットが指す値は ssv の最後の入力位置によって修正されます。 =begin original @@ -11807,10 +11821,9 @@ =end original -The encoding is assumed to be an Encode object, on entry the PV -of the sv is assumed to be octets in that encoding, and the sv -will be converted into Unicode (and UTF-8). -(TBT) +encoding は Encode オブジェクトであると仮定して、また sv の PV のエントリは +そのエンコーディングのオクテットであると仮定して、sv を Unicode (と UTF-8) に +変換します。 =begin original @@ -11821,11 +11834,11 @@ =end original -If the sv already is UTF-8 (or if it is not POK), or if the encoding -is not a reference, nothing is done to the sv. If the encoding is not -an C<Encode::XS> Encoding object, bad things will happen. -(See F<lib/encoding.pm> and L<Encode>). -(TBT) +sv が既に UTF-8 なら(または POK でなければ)、あるいは encoding が +リファレンスでなければ、sv に対して何もしません。 +encoding が C<Encode::XS> エンコーディングオブジェクトでなければ、 +悪いことが起こります。 +(F<lib/encoding.pm> と L<Encode> を参照してください)。 =begin original @@ -11851,10 +11864,9 @@ =end original -Build to the scalar dsv a displayable version of the scalar sv, -the displayable version being at most pvlim bytes long -(if longer, the rest is truncated and "..." will be appended). -(TBT) +スカラ dsv をスカラ sv の表示可能なバージョンに構築します; 表示可能な +バージョンは最大でも pvlim バイトの長さです (もしより長ければ、残りは +切り詰められて "..." が追加されます)。 =begin original @@ -11917,10 +11929,10 @@ =end original -Both the special and normal mappings are stored lib/unicore/To/Foo.pl, -and loaded by SWASHNEW, using lib/utf8_heavy.pl. The special (usually, -but not always, a multicharacter mapping), is tried first. -(TBT) +特殊と通常の両方のマッピングは lib/unicore/To/Foo.pl に保管され、 +lib/utf8_heavy.pl を使って SWASHNEW によって読み込まれます。 +特殊(普通は複数文字マッピングですが常にそうというわけではありません)を +先に試します。 =begin original @@ -11930,10 +11942,9 @@ =end original -The "special" is a string like "utf8::ToSpecLower", which means the -hash %utf8::ToSpecLower. The access to the hash is through -Perl_to_utf8_case(). -(TBT) +「特殊」とは、ハッシュ %utf8::ToSpecLower を意味する +"utf8::ToSpecLower" のような文字列です。 +ハッシュへのアクセスは Perl_to_utf8_case() を通します。 =begin original @@ -11942,9 +11953,7 @@ =end original -The "normal" is a string like "ToLower" which means the swash -%utf8::ToLower. -(TBT) +「通常」とは、swash %utf8::ToLower を意味する "ToLower" のような文字列です。 UV to_utf8_case(const U8 *p, U8* ustrp, STRLEN *lenp, SV **swashp, const char *normal, const char *special) @@ -11964,12 +11973,10 @@ =end original -Convert the UTF-8 encoded character at p to its foldcase version and -store that in UTF-8 in ustrp and its length in bytes in lenp. Note -that the ustrp needs to be at least UTF8_MAXBYTES_CASE+1 bytes since the -foldcase version may be longer than the original character (up to -three characters). -(TBT) +p にある UTF-8 エンコードされた文字を畳み込み文字版に変換して、UTF-8 +エンコードしたものを ustrp に、そのバイト数を lenp に保管します。 +畳み込み文字版は元の文字より(最大 3 文字)長くなるかも知れないので、ustrp は +少なくとも UTF8_MAXBYTES_CASE+1 バイト必要であることに注意してください。 =begin original @@ -11998,11 +12005,10 @@ =end original -Convert the UTF-8 encoded character at p to its lowercase version and -store that in UTF-8 in ustrp and its length in bytes in lenp. Note -that the ustrp needs to be at least UTF8_MAXBYTES_CASE+1 bytes since the -lowercase version may be longer than the original character. -(TBT) +p にある UTF-8 エンコードされた文字を小文字版に変換して、UTF-8 +エンコードしたものを ustrp に、そのバイト数を lenp に保管します。 +小文字版は元の文字より長くなるかも知れないので、ustrp は少なくとも +UTF8_MAXBYTES_CASE+1 バイト必要であることに注意してください。 =begin original @@ -12031,11 +12037,10 @@ =end original -Convert the UTF-8 encoded character at p to its titlecase version and -store that in UTF-8 in ustrp and its length in bytes in lenp. Note -that the ustrp needs to be at least UTF8_MAXBYTES_CASE+1 bytes since the -titlecase version may be longer than the original character. -(TBT) +p にある UTF-8 エンコードされた文字をタイトル文字版に変換して、UTF-8 +エンコードしたものを ustrp に、そのバイト数を lenp に保管します。 +タイトル文字版は元の文字より長くなるかも知れないので、ustrp は少なくとも +UTF8_MAXBYTES_CASE+1 バイト必要であることに注意してください。 =begin original @@ -12064,11 +12069,10 @@ =end original -Convert the UTF-8 encoded character at p to its uppercase version and -store that in UTF-8 in ustrp and its length in bytes in lenp. Note -that the ustrp needs to be at least UTF8_MAXBYTES_CASE+1 bytes since -the uppercase version may be longer than the original character. -(TBT) +p にある UTF-8 エンコードされた文字を大文字版に変換して、UTF-8 +エンコードしたものを ustrp に、そのバイト数を lenp に保管します。 +小文字版は元の文字より長くなるかも知れないので、ustrp は少なくとも +UTF8_MAXBYTES_CASE+1 バイト必要であることに注意してください。 =begin original @@ -12151,14 +12155,12 @@ =end original -If C<s> does not point to a well-formed UTF-8 character, the behaviour -is dependent on the value of C<flags>: if it contains UTF8_CHECK_ONLY, -it is assumed that the caller will raise a warning, and this function -will silently just set C<retlen> to C<-1> and return zero. If the -C<flags> does not contain UTF8_CHECK_ONLY, warnings about -malformations will be given, C<retlen> will be set to the expected -length of the UTF-8 character in bytes, and zero will be returned. -(TBT) +C<s> が整形された UTF-8 文字を指していない場合、振る舞いは C<flags> の値に +依存します: UTF8_CHECK_ONLY を含んでいれば、呼び出し側が警告を発生させて、 +この関数は暗黙に C<retlen> を C<-1> にセットしてゼロを返すことを仮定します。 +C<flags> に UTF8_CHECK_ONLY が含まれていなければ、不正な文字に関する警告が +与えられ、C<retlen> は想定される UTF-8 文字のバイト数がセットされ、ゼロが +返されます。 =begin original @@ -12230,10 +12232,10 @@ =end original -WARNING: do not use the following unless you *know* C<off> is within -the UTF-8 data pointed to by C<s> *and* that on entry C<s> is aligned -on the first byte of character or just after the last byte of a character. -(TBT) +警告: C<off> が C<s> で指されている UTF-8 データの内側であることと、 +エントリ C<s> が文字の最初のバイトか文字の最後のバイトの直後に +位置合わせされているということが「分かっている」場合以外は +使わないでください。 U8* utf8_hop(const U8 *s, I32 off) @@ -12272,11 +12274,10 @@ =end original -Converts a string C<s> of length C<len> from UTF-8 into byte encoding. -Unlike C<bytes_to_utf8>, this over-writes the original string, and -updates len to contain the new length. -Returns zero on failure, setting C<len> to -1. -(TBT) +長さ C<len> の文字列 C<s> を UTF-8 からバイトエンコーディングに変換します。 +C<bytes_to_utf8> と違って、これは元の文字列を上書きし、新しい長さで len を +更新します。 +失敗時にはゼロを返し、C<len> に -1 をセットします。 =begin original @@ -12421,7 +12422,6 @@ C<d> は少なくとも C<UTF8_MAXBYTES+1> バイトの空きが必要です。 返り値は新しい文字の末尾の次のバイトへのポインタです。 言い換えると: -(TBT) d = uvuni_to_utf8_flags(d, uv, flags); @@ -12465,6 +12465,8 @@ =head1 Variables created by C<xsubpp> and C<xsubpp> internal functions +(C<xsubpp> および C<xsubpp> 内部関数で作成された変数) + =over 8 =item ax @@ -12871,8 +12873,6 @@ =head1 AUTHORS -(著者) - =begin original Until May 1997, this document was maintained by Jeff Okamoto @@ -12923,6 +12923,7 @@ Translate: KIMURA Koichi Update: Kentaro Shirakata <argra****@ub32*****> (5.10.0-) +Status: completed =end meta