-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathctypes.po
3027 lines (2623 loc) · 162 KB
/
ctypes.po
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2018, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.7\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-14 08:34+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Osamu NAKAMURA, 2017\n"
"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/ja/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ja\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../library/ctypes.rst:2
msgid ":mod:`ctypes` --- A foreign function library for Python"
msgstr ":mod:`ctypes` --- Pythonのための外部関数ライブラリ"
#: ../../library/ctypes.rst:11
msgid ""
":mod:`ctypes` is a foreign function library for Python. It provides C "
"compatible data types, and allows calling functions in DLLs or shared "
"libraries. It can be used to wrap these libraries in pure Python."
msgstr ""
":mod:`ctypes` は Python のための外部関数ライブラリです。このライブラリは C "
"と互換性のあるデータ型を提供し、動的リンク/共有ライブラリ内の関数呼び出しを可能にします。動的リンク/共有ライブラリを純粋な Python "
"でラップするために使うことができます。"
#: ../../library/ctypes.rst:19
msgid "ctypes tutorial"
msgstr "ctypesチュートリアル"
#: ../../library/ctypes.rst:21
msgid ""
"Note: The code samples in this tutorial use :mod:`doctest` to make sure that"
" they actually work. Since some code samples behave differently under "
"Linux, Windows, or Mac OS X, they contain doctest directives in comments."
msgstr ""
"注意: このチュートリアルのコードサンプルは動作確認のために :mod:`doctest` を使います。コードサンプルの中には Linux、 "
"Windows、あるいは Mac OS X 上で異なる動作をするものがあるため、サンプルのコメントに doctest 命令を入れてあります。"
#: ../../library/ctypes.rst:25
msgid ""
"Note: Some code samples reference the ctypes :class:`c_int` type. On "
"platforms where ``sizeof(long) == sizeof(int)`` it is an alias to "
":class:`c_long`. So, you should not be confused if :class:`c_long` is "
"printed if you would expect :class:`c_int` --- they are actually the same "
"type."
msgstr ""
"注意: いくつかのコードサンプルで ctypes の :class:`c_int` 型を参照しています。 ``sizeof(long) == "
"sizeof(int)`` であるようなプラットフォームでは、この型は :class:`c_long` のエイリアスです。そのため、 "
":class:`c_int` 型を想定しているときに :class:`c_long` が表示されたとしても、混乱しないようにしてください --- "
"実際には同じ型なのです。"
#: ../../library/ctypes.rst:33
msgid "Loading dynamic link libraries"
msgstr "動的リンクライブラリをロードする"
#: ../../library/ctypes.rst:35
msgid ""
":mod:`ctypes` exports the *cdll*, and on Windows *windll* and *oledll* "
"objects, for loading dynamic link libraries."
msgstr ""
"動的リンクライブラリをロードするために、 :mod:`ctypes` は *cdll* をエクスポートします。 Windows では *windll* "
"と *oledll* オブジェクトをエクスポートします。"
#: ../../library/ctypes.rst:38
msgid ""
"You load libraries by accessing them as attributes of these objects. *cdll* "
"loads libraries which export functions using the standard ``cdecl`` calling "
"convention, while *windll* libraries call functions using the ``stdcall`` "
"calling convention. *oledll* also uses the ``stdcall`` calling convention, "
"and assumes the functions return a Windows :c:type:`HRESULT` error code. The"
" error code is used to automatically raise an :class:`OSError` exception "
"when the function call fails."
msgstr ""
"これらのオブジェクトの属性としてライブラリにアクセスすることでライブラリをロードします。 *cdll* は、標準 ``cdecl`` "
"呼び出し規約を用いて関数をエクスポートしているライブラリをロードします。それに対して、 *windll* ライブラリは ``stdcall`` "
"呼び出し規約を用いる関数を呼び出します。 *oledll* も ``stdcall`` 呼び出し規約を使いますが、関数が Windows "
":c:type:`HRESULT` エラーコードを返すことを想定しています。このエラーコードは関数呼び出しが失敗したとき、 "
":class:`OSError` 例外を自動的に送出させるために使われます。"
#: ../../library/ctypes.rst:46
msgid ""
"Windows errors used to raise :exc:`WindowsError`, which is now an alias of "
":exc:`OSError`."
msgstr ""
"Windows エラーは以前は :exc:`WindowsError` を送出していましたが、これは現在では :exc:`OSError` "
"の別名になっています。"
#: ../../library/ctypes.rst:51
msgid ""
"Here are some examples for Windows. Note that ``msvcrt`` is the MS standard "
"C library containing most standard C functions, and uses the cdecl calling "
"convention::"
msgstr ""
"Windows用の例ですが、 ``msvcrt`` はほとんどの標準 C 関数が含まれている MS 標準 C ライブラリであり、 cdecl "
"呼び出し規約を使うことに注意してください::"
#: ../../library/ctypes.rst:63
msgid "Windows appends the usual ``.dll`` file suffix automatically."
msgstr "Windows では通常の ``.dll`` ファイル拡張子を自動的に追加します。"
#: ../../library/ctypes.rst:66
msgid ""
"Accessing the standard C library through ``cdll.msvcrt`` will use an "
"outdated version of the library that may be incompatible with the one being "
"used by Python. Where possible, use native Python functionality, or else "
"import and use the ``msvcrt`` module."
msgstr ""
"``cdll.msvcrt`` 経由で標準 C ライブラリにアクセスすると、Python "
"が使用しているライブラリとは互換性のない可能性のある、古いバージョンのライブラリが使用されます。可能な場合には、ネイティブ Python "
"の機能を使用するか、``msvcrt`` モジュールをインポートして使用してください。"
#: ../../library/ctypes.rst:71
msgid ""
"On Linux, it is required to specify the filename *including* the extension "
"to load a library, so attribute access can not be used to load libraries. "
"Either the :meth:`LoadLibrary` method of the dll loaders should be used, or "
"you should load the library by creating an instance of CDLL by calling the "
"constructor::"
msgstr ""
"Linux ではライブラリをロードするために拡張子を *含む* "
"ファイル名を指定する必要があるので、ロードしたライブラリに対する属性アクセスはできません。 dll ローダーの :meth:`LoadLibrary` "
"メソッドを使うか、コンストラクタを呼び出して CDLL のインスタンスを作ることでライブラリをロードするかのどちらかを行わなければなりません::"
#: ../../library/ctypes.rst:89
msgid "Accessing functions from loaded dlls"
msgstr "ロードしたdllから関数にアクセスする"
#: ../../library/ctypes.rst:91
msgid "Functions are accessed as attributes of dll objects::"
msgstr "dll オブジェクトの属性として関数にアクセスします::"
#: ../../library/ctypes.rst:106
msgid ""
"Note that win32 system dlls like ``kernel32`` and ``user32`` often export "
"ANSI as well as UNICODE versions of a function. The UNICODE version is "
"exported with an ``W`` appended to the name, while the ANSI version is "
"exported with an ``A`` appended to the name. The win32 ``GetModuleHandle`` "
"function, which returns a *module handle* for a given module name, has the "
"following C prototype, and a macro is used to expose one of them as "
"``GetModuleHandle`` depending on whether UNICODE is defined or not::"
msgstr ""
"``kernel32`` や ``user32`` のような win32 システム dll は、多くの場合関数の UNICODE バージョンに加えて "
"ANSI バージョンもエクスポートすることに注意してください。 UNICODE バージョンは後ろに ``W`` が付いた名前でエクスポートされ、 "
"ANSI バージョンは ``A`` が付いた名前でエクスポートされます。与えられたモジュールの *モジュールハンドル* を返す win32 "
"``GetModuleHandle`` 関数は次のような C プロトタイプを持ちます。 UNICODE バージョンが定義されているかどうかにより "
"``GetModuleHandle`` としてどちらか一つを公開するためにマクロが使われます::"
#: ../../library/ctypes.rst:119
msgid ""
"*windll* does not try to select one of them by magic, you must access the "
"version you need by specifying ``GetModuleHandleA`` or ``GetModuleHandleW`` "
"explicitly, and then call it with bytes or string objects respectively."
msgstr ""
"*windll* は魔法を使ってどちらか一つを選ぶようなことはしません。``GetModuleHandleA`` もしくは "
"``GetModuleHandleW`` "
"を明示的に指定して必要とするバージョンにアクセスし、バイト列か文字列を使ってそれぞれ呼び出さなければなりません。"
#: ../../library/ctypes.rst:123
msgid ""
"Sometimes, dlls export functions with names which aren't valid Python "
"identifiers, like ``\"??2@YAPAXI@Z\"``. In this case you have to use "
":func:`getattr` to retrieve the function::"
msgstr ""
"時には、 dll が関数を ``\"??2@YAPAXI@Z\"`` のような Python "
"識別子として有効でない名前でエクスポートすることがあります。このような場合に関数を取り出すには、 :func:`getattr` "
"を使わなければなりません。::"
#: ../../library/ctypes.rst:131
msgid ""
"On Windows, some dlls export functions not by name but by ordinal. These "
"functions can be accessed by indexing the dll object with the ordinal "
"number::"
msgstr ""
"Windows では、名前ではなく序数によって関数をエクスポートする dll もあります。こうした関数には序数を使って dll "
"オブジェクトにインデックス指定することでアクセスします::"
#: ../../library/ctypes.rst:148
msgid "Calling functions"
msgstr "関数を呼び出す"
#: ../../library/ctypes.rst:150
msgid ""
"You can call these functions like any other Python callable. This example "
"uses the ``time()`` function, which returns system time in seconds since the"
" Unix epoch, and the ``GetModuleHandleA()`` function, which returns a win32 "
"module handle."
msgstr ""
"これらの関数は他の Python 呼び出し可能オブジェクトと同じように呼び出すことができます。この例では ``time()`` 関数 "
"(Unixエポックからのシステム時間を秒単位で返す) と、 ``GetModuleHandleA()`` 関数 (win32モジュールハンドルを返す) "
"を使います。"
#: ../../library/ctypes.rst:155
msgid ""
"This example calls both functions with a NULL pointer (``None`` should be "
"used as the NULL pointer)::"
msgstr "この例は両方の関数を NULL ポインタとともに呼び出します (``None`` を NULL ポインタとして使う必要があります)::"
#: ../../library/ctypes.rst:166
msgid ""
":mod:`ctypes` may raise a :exc:`ValueError` after calling the function, if "
"it detects that an invalid number of arguments were passed. This behavior "
"should not be relied upon. It is deprecated in 3.6.2, and will be removed "
"in 3.7."
msgstr ""
"不正な数の引数が渡されたことを検知した場合、 :mod:`ctypes` は関数を呼び出した後に :exc:`ValueError` を送出することがあります。\n"
"この動作には依存するべきではありません。\n"
"この動作は 3.6.2 で非推奨であり、 3.7 で削除予定です。"
#: ../../library/ctypes.rst:171
msgid ""
":exc:`ValueError` is raised when you call an ``stdcall`` function with the "
"``cdecl`` calling convention, or vice versa::"
msgstr ""
"``cdecl`` 呼び出し規約を使って ``stdcall`` 関数を呼び出したときには、 :exc:`ValueError` "
"が送出されます。逆の場合も同様です::"
#: ../../library/ctypes.rst:186
msgid ""
"To find out the correct calling convention you have to look into the C "
"header file or the documentation for the function you want to call."
msgstr "正しい呼び出し規約を知るためには、呼び出したい関数についての C ヘッダファイルもしくはドキュメントを見なければなりません。"
#: ../../library/ctypes.rst:189
msgid ""
"On Windows, :mod:`ctypes` uses win32 structured exception handling to "
"prevent crashes from general protection faults when functions are called "
"with invalid argument values::"
msgstr ""
"Windows では、関数が無効な引数とともに呼び出された場合の一般保護例外によるクラッシュを防ぐために、 :mod:`ctypes` は win32 "
"構造化例外処理を使います::"
#: ../../library/ctypes.rst:199
msgid ""
"There are, however, enough ways to crash Python with :mod:`ctypes`, so you "
"should be careful anyway. The :mod:`faulthandler` module can be helpful in "
"debugging crashes (e.g. from segmentation faults produced by erroneous C "
"library calls)."
msgstr ""
"しかしそれでも他に :mod:`ctypes` で Python "
"がクラッシュする状況はあるので、どちらにせよ気を配るべきです。クラッシュのデバッグには、 :mod:`faulthandler` "
"モジュールが役に立つ場合があります (例えば、誤った C ライブラリ呼び出しによって引き起こされたセグメンテーション違反) 。"
#: ../../library/ctypes.rst:204
msgid ""
"``None``, integers, bytes objects and (unicode) strings are the only native "
"Python objects that can directly be used as parameters in these function "
"calls. ``None`` is passed as a C ``NULL`` pointer, bytes objects and strings"
" are passed as pointer to the memory block that contains their data "
"(:c:type:`char *` or :c:type:`wchar_t *`). Python integers are passed as "
"the platforms default C :c:type:`int` type, their value is masked to fit "
"into the C type."
msgstr ""
"``None`` 、整数、バイト列オブジェクトおよび (Unicode) "
"文字列だけが、こうした関数呼び出しにおいてパラメータとして直接使えるネイティブの Python オブジェクトです。 ``None`` は C の "
"``NULL`` ポインタとして渡され、バイト文字列とユニコード文字列はそのデータを含むメモリブロックへのポインタ (:c:type:`char *` "
"または :c:type:`wchar_t *`) として渡されます。 Python 整数はプラットホームのデフォルトの C :c:type:`int` "
"型として渡され、その値は C :c:type:`int` 型に合うようにマスクされます。"
#: ../../library/ctypes.rst:211
msgid ""
"Before we move on calling functions with other parameter types, we have to "
"learn more about :mod:`ctypes` data types."
msgstr "他のパラメータ型をもつ関数呼び出しに移る前に、 :mod:`ctypes` データ型についてさらに学ぶ必要があります。"
#: ../../library/ctypes.rst:218 ../../library/ctypes.rst:2066
msgid "Fundamental data types"
msgstr "基本データ型"
#: ../../library/ctypes.rst:220
msgid ":mod:`ctypes` defines a number of primitive C compatible data types:"
msgstr ":mod:`ctypes` ではいくつもの C 互換のプリミティブなデータ型を定義しています:"
#: ../../library/ctypes.rst:223
msgid "ctypes type"
msgstr "ctypes の型"
#: ../../library/ctypes.rst:223
msgid "C type"
msgstr "C の型"
#: ../../library/ctypes.rst:223
msgid "Python type"
msgstr "Python の型"
#: ../../library/ctypes.rst:225
msgid ":class:`c_bool`"
msgstr ":class:`c_bool`"
#: ../../library/ctypes.rst:225
msgid ":c:type:`_Bool`"
msgstr ":c:type:`_Bool`"
#: ../../library/ctypes.rst:225
msgid "bool (1)"
msgstr "bool (1)"
#: ../../library/ctypes.rst:227
msgid ":class:`c_char`"
msgstr ":class:`c_char`"
#: ../../library/ctypes.rst:227 ../../library/ctypes.rst:231
msgid ":c:type:`char`"
msgstr ":c:type:`char`"
#: ../../library/ctypes.rst:227
msgid "1-character bytes object"
msgstr "1文字のバイト列オブジェクト"
#: ../../library/ctypes.rst:229
msgid ":class:`c_wchar`"
msgstr ":class:`c_wchar`"
#: ../../library/ctypes.rst:229
msgid ":c:type:`wchar_t`"
msgstr ":c:type:`wchar_t`"
#: ../../library/ctypes.rst:229
msgid "1-character string"
msgstr "1文字の文字列"
#: ../../library/ctypes.rst:231
msgid ":class:`c_byte`"
msgstr ":class:`c_byte`"
#: ../../library/ctypes.rst:231 ../../library/ctypes.rst:233
#: ../../library/ctypes.rst:235 ../../library/ctypes.rst:237
#: ../../library/ctypes.rst:239 ../../library/ctypes.rst:241
#: ../../library/ctypes.rst:243 ../../library/ctypes.rst:245
#: ../../library/ctypes.rst:247 ../../library/ctypes.rst:249
#: ../../library/ctypes.rst:252 ../../library/ctypes.rst:254
msgid "int"
msgstr "int"
#: ../../library/ctypes.rst:233
msgid ":class:`c_ubyte`"
msgstr ":class:`c_ubyte`"
#: ../../library/ctypes.rst:233
msgid ":c:type:`unsigned char`"
msgstr ":c:type:`unsigned char`"
#: ../../library/ctypes.rst:235
msgid ":class:`c_short`"
msgstr ":class:`c_short`"
#: ../../library/ctypes.rst:235
msgid ":c:type:`short`"
msgstr ":c:type:`short`"
#: ../../library/ctypes.rst:237
msgid ":class:`c_ushort`"
msgstr ":class:`c_ushort`"
#: ../../library/ctypes.rst:237
msgid ":c:type:`unsigned short`"
msgstr ":c:type:`unsigned short`"
#: ../../library/ctypes.rst:239
msgid ":class:`c_int`"
msgstr ":class:`c_int`"
#: ../../library/ctypes.rst:239
msgid ":c:type:`int`"
msgstr ":c:type:`int`"
#: ../../library/ctypes.rst:241
msgid ":class:`c_uint`"
msgstr ":class:`c_uint`"
#: ../../library/ctypes.rst:241
msgid ":c:type:`unsigned int`"
msgstr ":c:type:`unsigned int`"
#: ../../library/ctypes.rst:243
msgid ":class:`c_long`"
msgstr ":class:`c_long`"
#: ../../library/ctypes.rst:243
msgid ":c:type:`long`"
msgstr ":c:type:`long`"
#: ../../library/ctypes.rst:245
msgid ":class:`c_ulong`"
msgstr ":class:`c_ulong`"
#: ../../library/ctypes.rst:245
msgid ":c:type:`unsigned long`"
msgstr ":c:type:`unsigned long`"
#: ../../library/ctypes.rst:247
msgid ":class:`c_longlong`"
msgstr ":class:`c_longlong`"
#: ../../library/ctypes.rst:247
msgid ":c:type:`__int64` or :c:type:`long long`"
msgstr ":c:type:`__int64` または :c:type:`long long`"
#: ../../library/ctypes.rst:249
msgid ":class:`c_ulonglong`"
msgstr ":class:`c_ulonglong`"
#: ../../library/ctypes.rst:249
msgid ":c:type:`unsigned __int64` or :c:type:`unsigned long long`"
msgstr ":c:type:`unsigned __int64` または :c:type:`unsigned long long`"
#: ../../library/ctypes.rst:252
msgid ":class:`c_size_t`"
msgstr ":class:`c_size_t`"
#: ../../library/ctypes.rst:252
msgid ":c:type:`size_t`"
msgstr ":c:type:`size_t`"
#: ../../library/ctypes.rst:254
msgid ":class:`c_ssize_t`"
msgstr ":class:`c_ssize_t`"
#: ../../library/ctypes.rst:254
msgid ":c:type:`ssize_t` or :c:type:`Py_ssize_t`"
msgstr ":c:type:`ssize_t` または :c:type:`Py_ssize_t`"
#: ../../library/ctypes.rst:257
msgid ":class:`c_float`"
msgstr ":class:`c_float`"
#: ../../library/ctypes.rst:257
msgid ":c:type:`float`"
msgstr ":c:type:`float`"
#: ../../library/ctypes.rst:257 ../../library/ctypes.rst:259
#: ../../library/ctypes.rst:261
msgid "float"
msgstr "浮動小数点数"
#: ../../library/ctypes.rst:259
msgid ":class:`c_double`"
msgstr ":class:`c_double`"
#: ../../library/ctypes.rst:259
msgid ":c:type:`double`"
msgstr ":c:type:`double`"
#: ../../library/ctypes.rst:261
msgid ":class:`c_longdouble`"
msgstr ":class:`c_longdouble`"
#: ../../library/ctypes.rst:261
msgid ":c:type:`long double`"
msgstr ":c:type:`long double`"
#: ../../library/ctypes.rst:263
msgid ":class:`c_char_p`"
msgstr ":class:`c_char_p`"
#: ../../library/ctypes.rst:263
msgid ":c:type:`char *` (NUL terminated)"
msgstr ":c:type:`char *` (NUL 終端)"
#: ../../library/ctypes.rst:263
msgid "bytes object or ``None``"
msgstr "バイト列オブジェクトまたは ``None``"
#: ../../library/ctypes.rst:265
msgid ":class:`c_wchar_p`"
msgstr ":class:`c_wchar_p`"
#: ../../library/ctypes.rst:265
msgid ":c:type:`wchar_t *` (NUL terminated)"
msgstr ":c:type:`wchar_t *` (NUL 終端)"
#: ../../library/ctypes.rst:265
msgid "string or ``None``"
msgstr "文字列または ``None``"
#: ../../library/ctypes.rst:267
msgid ":class:`c_void_p`"
msgstr ":class:`c_void_p`"
#: ../../library/ctypes.rst:267
msgid ":c:type:`void *`"
msgstr ":c:type:`void *`"
#: ../../library/ctypes.rst:267
msgid "int or ``None``"
msgstr "整数または ``None``"
#: ../../library/ctypes.rst:271
msgid "The constructor accepts any object with a truth value."
msgstr "コンストラクタは任意のオブジェクトをその真偽値として受け取ります。"
#: ../../library/ctypes.rst:273
msgid ""
"All these types can be created by calling them with an optional initializer "
"of the correct type and value::"
msgstr "これら全ての型はその型を呼び出すことによって作成でき、オプションとして型と値が合っている初期化子を指定することができます::"
#: ../../library/ctypes.rst:284
msgid ""
"Since these types are mutable, their value can also be changed afterwards::"
msgstr "これらの型は変更可能であり、値を後で変更することもできます::"
#: ../../library/ctypes.rst:296
msgid ""
"Assigning a new value to instances of the pointer types :class:`c_char_p`, "
":class:`c_wchar_p`, and :class:`c_void_p` changes the *memory location* they"
" point to, *not the contents* of the memory block (of course not, because "
"Python bytes objects are immutable)::"
msgstr ""
"新しい値をポインタ型 :class:`c_char_p`, :class:`c_wchar_p` および :class:`c_void_p` "
"のインスタンスへ代入すると、変わるのは指している *メモリ位置* であって、メモリブロックの *内容ではありません* (これは当然で、なぜなら、 "
"Python バイト列オブジェクトは変更不可能だからです)::"
#: ../../library/ctypes.rst:316
msgid ""
"You should be careful, however, not to pass them to functions expecting "
"pointers to mutable memory. If you need mutable memory blocks, ctypes has a "
":func:`create_string_buffer` function which creates these in various ways. "
"The current memory block contents can be accessed (or changed) with the "
"``raw`` property; if you want to access it as NUL terminated string, use the"
" ``value`` property::"
msgstr ""
"しかし、変更可能なメモリを指すポインタであることを想定している関数へそれらを渡さないように注意すべきです。もし変更可能なメモリブロックが必要なら、 "
"ctypes には :func:`create_string_buffer` "
"関数があり、いろいろな方法で作成することできます。現在のメモリブロックの内容は ``raw`` プロパティを使ってアクセス (あるいは変更) "
"することができます。もし現在のメモリブロックに NUL 終端文字列としてアクセスしたいなら、 ``value`` プロパティを使ってください::"
#: ../../library/ctypes.rst:340
msgid ""
"The :func:`create_string_buffer` function replaces the :func:`c_buffer` "
"function (which is still available as an alias), as well as the "
":func:`c_string` function from earlier ctypes releases. To create a mutable"
" memory block containing unicode characters of the C type :c:type:`wchar_t` "
"use the :func:`create_unicode_buffer` function."
msgstr ""
":func:`create_string_buffer` 関数は初期の ctypes リリースにあった :func:`c_string` "
"関数だけでなく、 (エイリアスとしてはまだ利用できる) :func:`c_buffer` 関数をも置き換えるものです。 C の型 "
":c:type:`wchar_t` の Unicode 文字を含む変更可能なメモリブロックを作成するには、 "
":func:`create_unicode_buffer` 関数を使ってください。"
#: ../../library/ctypes.rst:350
msgid "Calling functions, continued"
msgstr "続・関数を呼び出す"
#: ../../library/ctypes.rst:352
msgid ""
"Note that printf prints to the real standard output channel, *not* to "
":data:`sys.stdout`, so these examples will only work at the console prompt, "
"not from within *IDLE* or *PythonWin*::"
msgstr ""
"printf は :data:`sys.stdout` では *なく* "
"、本物の標準出力チャンネルへプリントすることに注意してください。したがって、これらの例はコンソールプロンプトでのみ動作し、 *IDLE* や "
"*PythonWin* では動作しません。::"
#: ../../library/ctypes.rst:372
msgid ""
"As has been mentioned before, all Python types except integers, strings, and"
" bytes objects have to be wrapped in their corresponding :mod:`ctypes` type,"
" so that they can be converted to the required C data type::"
msgstr ""
"前に述べたように、必要な C のデータ型へ変換できるようにするためには、整数、文字列およびバイト列オブジェクトを除くすべての Python 型を対応する"
" :mod:`ctypes` 型でラップしなければなりません::"
#: ../../library/ctypes.rst:385
msgid "Calling functions with your own custom data types"
msgstr "自作のデータ型とともに関数を呼び出す"
#: ../../library/ctypes.rst:387
msgid ""
"You can also customize :mod:`ctypes` argument conversion to allow instances "
"of your own classes be used as function arguments. :mod:`ctypes` looks for "
"an :attr:`_as_parameter_` attribute and uses this as the function argument."
" Of course, it must be one of integer, string, or bytes::"
msgstr ""
"自作のクラスのインスタンスを関数引数として使えるように、 :mod:`ctypes` 引数変換をカスタマイズすることもできます。 "
":mod:`ctypes` は :attr:`_as_parameter_` "
"属性を探し出し、関数引数として使います。もちろん、整数、文字列もしくはバイト列オブジェクトの中の一つでなければなりません::"
#: ../../library/ctypes.rst:402
msgid ""
"If you don't want to store the instance's data in the :attr:`_as_parameter_`"
" instance variable, you could define a :class:`property` which makes the "
"attribute available on request."
msgstr ""
":attr:`_as_parameter_` インスタンス変数にインスタンスのデータを保持したくない場合は、必要に応じて利用できる属性を作る "
":class:`property` を定義しても構いません。"
#: ../../library/ctypes.rst:410
msgid "Specifying the required argument types (function prototypes)"
msgstr "要求される引数の型を指定する (関数プロトタイプ)"
#: ../../library/ctypes.rst:412
msgid ""
"It is possible to specify the required argument types of functions exported "
"from DLLs by setting the :attr:`argtypes` attribute."
msgstr ""
":attr:`argtypes` 属性を設定することによって、 DLL からエクスポートされている関数に要求される引数の型を指定することができます。"
#: ../../library/ctypes.rst:415
msgid ""
":attr:`argtypes` must be a sequence of C data types (the ``printf`` function"
" is probably not a good example here, because it takes a variable number and"
" different types of parameters depending on the format string, on the other "
"hand this is quite handy to experiment with this feature)::"
msgstr ""
":attr:`argtypes` は C データ型のシーケンスでなければなりません (この場合 ``printf`` "
"関数はおそらく良い例ではありません。なぜなら、引数の数が可変であり、フォーマット文字列に依存した異なる型のパラメータを取るからです。一方では、この機能の実験にはとても便利です)。::"
#: ../../library/ctypes.rst:426
msgid ""
"Specifying a format protects against incompatible argument types (just as a "
"prototype for a C function), and tries to convert the arguments to valid "
"types::"
msgstr "(C の関数のプロトタイプのように) 書式を指定すると互換性のない引数型になるのを防ぎ、引数を有効な型へ変換しようとします。::"
#: ../../library/ctypes.rst:438
msgid ""
"If you have defined your own classes which you pass to function calls, you "
"have to implement a :meth:`from_param` class method for them to be able to "
"use them in the :attr:`argtypes` sequence. The :meth:`from_param` class "
"method receives the Python object passed to the function call, it should do "
"a typecheck or whatever is needed to make sure this object is acceptable, "
"and then return the object itself, its :attr:`_as_parameter_` attribute, or "
"whatever you want to pass as the C function argument in this case. Again, "
"the result should be an integer, string, bytes, a :mod:`ctypes` instance, or"
" an object with an :attr:`_as_parameter_` attribute."
msgstr ""
"関数呼び出しへ渡す自作のクラスを定義した場合には、 :attr:`argtypes` シーケンスの中で使えるようにするために、そのクラスに "
":meth:`from_param` クラスメソッドを実装しなければなりません。 :meth:`from_param` "
"クラスメソッドは関数呼び出しへ渡された Python "
"オブジェクトを受け取り、型チェックもしくはこのオブジェクトが受け入れ可能であると確かめるために必要なことはすべて行ってから、オブジェクト自身、 "
":attr:`_as_parameter_` 属性、あるいは、この場合に C "
"関数引数として渡したい何かの値を返さなければなりません。繰り返しになりますが、その返される結果は整数、文字列、バイト列、 :mod:`ctypes` "
"インスタンス、あるいは :attr:`_as_parameter_` 属性をもつオブジェクトであるべきです。"
#: ../../library/ctypes.rst:452
msgid "Return types"
msgstr "戻り値の型"
#: ../../library/ctypes.rst:454
msgid ""
"By default functions are assumed to return the C :c:type:`int` type. Other "
"return types can be specified by setting the :attr:`restype` attribute of "
"the function object."
msgstr ""
"デフォルトでは、関数は C :c:type:`int` を返すと仮定されます。他の戻り値の型を指定するには、関数オブジェクトの "
":attr:`restype` 属性に設定します。"
#: ../../library/ctypes.rst:458
msgid ""
"Here is a more advanced example, it uses the ``strchr`` function, which "
"expects a string pointer and a char, and returns a pointer to a string::"
msgstr ""
"さらに高度な例として、 ``strchr`` 関数を使います。この関数は文字列ポインタと char を受け取り、文字列へのポインタを返します。::"
#: ../../library/ctypes.rst:471
msgid ""
"If you want to avoid the ``ord(\"x\")`` calls above, you can set the "
":attr:`argtypes` attribute, and the second argument will be converted from a"
" single character Python bytes object into a C char::"
msgstr ""
"上の ``ord(\"x\")`` 呼び出しを避けたいなら、 :attr:`argtypes` 属性を設定することができます。二番目の引数が一文字の "
"Python バイト列オブジェクトから C の char へ変換されます::"
#: ../../library/ctypes.rst:489
msgid ""
"You can also use a callable Python object (a function or a class for "
"example) as the :attr:`restype` attribute, if the foreign function returns "
"an integer. The callable will be called with the *integer* the C function "
"returns, and the result of this call will be used as the result of your "
"function call. This is useful to check for error return values and "
"automatically raise an exception::"
msgstr ""
"外部関数が整数を返す場合は、 :attr:`restype` 属性として呼び出し可能な Python オブジェクト (例えば、関数またはクラス) "
"を使うこともできます。呼び出し可能オブジェクトは C 関数が返す *整数* "
"とともに呼び出され、この呼び出しの結果は関数呼び出しの結果として使われるでしょう。これはエラーの戻り値をチェックして自動的に例外を送出させるために役に立ちます。::"
#: ../../library/ctypes.rst:512
msgid ""
"``WinError`` is a function which will call Windows ``FormatMessage()`` api "
"to get the string representation of an error code, and *returns* an "
"exception. ``WinError`` takes an optional error code parameter, if no one is"
" used, it calls :func:`GetLastError` to retrieve it."
msgstr ""
"``WinError`` はエラーコードの文字列表現を得るために Windows の ``FormatMessage()`` api を呼び出し、例外を"
" *返す* 関数です。 ``WinError`` "
"はオプションでエラーコードパラメータを取ります。このパラメータが使われない場合は、エラーコードを取り出すために :func:`GetLastError`"
" を呼び出します。"
#: ../../library/ctypes.rst:517
msgid ""
"Please note that a much more powerful error checking mechanism is available "
"through the :attr:`errcheck` attribute; see the reference manual for "
"details."
msgstr ""
":attr:`errcheck` "
"属性によってもっと強力なエラーチェック機構を利用できることに注意してください。詳細はリファレンスマニュアルを参照してください。"
#: ../../library/ctypes.rst:524
msgid "Passing pointers (or: passing parameters by reference)"
msgstr "ポインタを渡す(または、パラメータの参照渡し)"
#: ../../library/ctypes.rst:526
msgid ""
"Sometimes a C api function expects a *pointer* to a data type as parameter, "
"probably to write into the corresponding location, or if the data is too "
"large to be passed by value. This is also known as *passing parameters by "
"reference*."
msgstr ""
"時には、 C api 関数がパラメータのデータ型として *ポインタ* "
"を想定していることがあります。おそらくパラメータと同一の場所に書き込むためか、もしくはそのデータが大きすぎて値渡しできない場合です。これは "
"*パラメータの参照渡し* としても知られています。"
#: ../../library/ctypes.rst:530
msgid ""
":mod:`ctypes` exports the :func:`byref` function which is used to pass "
"parameters by reference. The same effect can be achieved with the "
":func:`pointer` function, although :func:`pointer` does a lot more work "
"since it constructs a real pointer object, so it is faster to use "
":func:`byref` if you don't need the pointer object in Python itself::"
msgstr ""
":mod:`ctypes` は :func:`byref` 関数をエクスポートしており、パラメータを参照渡しするために使用します。 "
":func:`pointer` 関数を使っても同じ効果が得られます。しかし、 :func:`pointer` "
"は本当のポインタオブジェクトを構築するためより多くの処理を行うことから、 Python 側でポインタオブジェクト自体を必要としないならば "
":func:`byref` を使う方がより高速です。::"
#: ../../library/ctypes.rst:552
msgid "Structures and unions"
msgstr "構造体と共用体"
#: ../../library/ctypes.rst:554
msgid ""
"Structures and unions must derive from the :class:`Structure` and "
":class:`Union` base classes which are defined in the :mod:`ctypes` module. "
"Each subclass must define a :attr:`_fields_` attribute. :attr:`_fields_` "
"must be a list of *2-tuples*, containing a *field name* and a *field type*."
msgstr ""
"構造体と共用体は :mod:`ctypes` モジュールに定義されている :class:`Structure` および :class:`Union` "
"ベースクラスからの派生クラスでなければなりません。それぞれのサブクラスは :attr:`_fields_` 属性を定義する必要があります。 "
":attr:`_fields_` は *フィールド名* と *フィールド型* を持つ *2要素タプル* のリストでなければなりません。"
#: ../../library/ctypes.rst:559
msgid ""
"The field type must be a :mod:`ctypes` type like :class:`c_int`, or any "
"other derived :mod:`ctypes` type: structure, union, array, pointer."
msgstr ""
"フィールド型は :class:`c_int` か他の :mod:`ctypes` 型 (構造体、共用体、配列、ポインタ) から派生した "
":mod:`ctypes` 型である必要があります。"
#: ../../library/ctypes.rst:562
msgid ""
"Here is a simple example of a POINT structure, which contains two integers "
"named *x* and *y*, and also shows how to initialize a structure in the "
"constructor::"
msgstr ""
"以下は、 *x* と *y* という名前の二つの整数からなる簡単な POINT "
"構造体の例です。コンストラクタで構造体を初期化する方法も説明しています::"
#: ../../library/ctypes.rst:582
msgid ""
"You can, however, build much more complicated structures. A structure can "
"itself contain other structures by using a structure as a field type."
msgstr ""
"しかし、もっと複雑な構造体を構築することもできます。ある構造体は、他の構造体をフィールド型として使うことで、他の構造体を含むことができます。"
#: ../../library/ctypes.rst:585
msgid ""
"Here is a RECT structure which contains two POINTs named *upperleft* and "
"*lowerright*::"
msgstr "*upperleft* と *lowerright* という名前の二つの POINT を持つ RECT 構造体です。::"
#: ../../library/ctypes.rst:599
msgid ""
"Nested structures can also be initialized in the constructor in several "
"ways::"
msgstr "入れ子になった構造体はいくつかの方法を用いてコンストラクタで初期化することができます。::"
#: ../../library/ctypes.rst:604
msgid ""
"Field :term:`descriptor`\\s can be retrieved from the *class*, they are "
"useful for debugging because they can provide useful information::"
msgstr ""
"フィールド :term:`descriptor` (記述子)は *クラス* から取り出せます。デバッグするときに役に立つ情報を得ることができます::"
#: ../../library/ctypes.rst:618
msgid ""
":mod:`ctypes` does not support passing unions or structures with bit-fields "
"to functions by value. While this may work on 32-bit x86, it's not "
"guaranteed by the library to work in the general case. Unions and "
"structures with bit-fields should always be passed to functions by pointer."
msgstr ""
":mod:`ctypes` では、ビットフィールドのある共用体や構造体の関数への値渡しはサポートしていません。これは 32-bit の x86 "
"環境では動くかもしれませんが、このライブラリでは一般の場合に動作することは保証していません。"
#: ../../library/ctypes.rst:624
msgid "Structure/union alignment and byte order"
msgstr "構造体/共用体アライメントとバイトオーダー"
#: ../../library/ctypes.rst:626
msgid ""
"By default, Structure and Union fields are aligned in the same way the C "
"compiler does it. It is possible to override this behavior be specifying a "
":attr:`_pack_` class attribute in the subclass definition. This must be set "
"to a positive integer and specifies the maximum alignment for the fields. "
"This is what ``#pragma pack(n)`` also does in MSVC."
msgstr ""
"デフォルトでは、構造体 (Structure) と共用体(Union) のフィールドは C "
"コンパイラが行うのと同じ方法でアライメントされています。サブクラスを定義するときに :attr:`_pack_` "
"クラス属性を指定することでこの動作を変えることは可能です。このクラス属性には正の整数を設定する必要があり、フィールドの最大アライメントを指定します。これは"
" MSVC で ``#pragma pack(n)`` が行っていること同じです。"
#: ../../library/ctypes.rst:632
msgid ""
":mod:`ctypes` uses the native byte order for Structures and Unions. To "
"build structures with non-native byte order, you can use one of the "
":class:`BigEndianStructure`, :class:`LittleEndianStructure`, "
":class:`BigEndianUnion`, and :class:`LittleEndianUnion` base classes. These"
" classes cannot contain pointer fields."
msgstr ""
":mod:`ctypes` は Structure と Union "
"に対してネイティブのバイトオーダーを使います。ネイティブではないバイトオーダーの構造体を作成するには、 "
":class:`BigEndianStructure`, :class:`LittleEndianStructure`, "
":class:`BigEndianUnion` および :class:`LittleEndianUnion` "
"ベースクラスの中の一つを使います。これらのクラスにポインタフィールドを持たせることはできません。"
#: ../../library/ctypes.rst:642
msgid "Bit fields in structures and unions"
msgstr "構造体と共用体におけるビットフィールド"
#: ../../library/ctypes.rst:644
msgid ""
"It is possible to create structures and unions containing bit fields. Bit "
"fields are only possible for integer fields, the bit width is specified as "
"the third item in the :attr:`_fields_` tuples::"
msgstr ""
"ビットフィールドを含む構造体と共用体を作ることができます。ビットフィールドは整数フィールドに対してのみ作ることができ、ビット幅は "
":attr:`_fields_` タプルの第三要素で指定します。::"
#: ../../library/ctypes.rst:662
msgid "Arrays"
msgstr "配列"
#: ../../library/ctypes.rst:664
msgid ""
"Arrays are sequences, containing a fixed number of instances of the same "
"type."
msgstr "配列 (Array) はシーケンスであり、決まった数の同じ型のインスタンスを持ちます。"
#: ../../library/ctypes.rst:666
msgid ""
"The recommended way to create array types is by multiplying a data type with"
" a positive integer::"
msgstr "推奨されている配列の作成方法はデータ型に正の整数を掛けることです。::"
#: ../../library/ctypes.rst:671
msgid ""
"Here is an example of a somewhat artificial data type, a structure "
"containing 4 POINTs among other stuff::"
msgstr "ややわざとらしいデータ型の例になりますが、他のものに混ざって 4 個の POINT がある構造体です::"
#: ../../library/ctypes.rst:687
msgid "Instances are created in the usual way, by calling the class::"
msgstr "インスタンスはクラスを呼び出す通常の方法で作成します。::"
#: ../../library/ctypes.rst:693
msgid ""
"The above code print a series of ``0 0`` lines, because the array contents "
"is initialized to zeros."
msgstr "上記のコードは ``0 0`` という行が並んだものを表示します。配列の要素がゼロで初期化されているためです。"
#: ../../library/ctypes.rst:696
msgid "Initializers of the correct type can also be specified::"
msgstr "正しい型の初期化子を指定することもできます。::"
#: ../../library/ctypes.rst:712
msgid "Pointers"
msgstr "ポインタ"
#: ../../library/ctypes.rst:714
msgid ""
"Pointer instances are created by calling the :func:`pointer` function on a "
":mod:`ctypes` type::"
msgstr "ポインタのインスタンスは :mod:`ctypes` 型に対して :func:`pointer` 関数を呼び出して作成します。::"
#: ../../library/ctypes.rst:722
msgid ""
"Pointer instances have a :attr:`~_Pointer.contents` attribute which returns "
"the object to which the pointer points, the ``i`` object above::"
msgstr ""
"次のように、ポインタインスタンスは、ポインタが指すオブジェクト (上の例では ``i``) を返す :attr:`~_Pointer.contents`"
" 属性を持ちます::"
#: ../../library/ctypes.rst:729
msgid ""
"Note that :mod:`ctypes` does not have OOR (original object return), it "
"constructs a new, equivalent object each time you retrieve an attribute::"
msgstr ""
":mod:`ctypes` は OOR (original object return 、元のオブジェクトを返すこと) "
"ではないことに注意してください。属性を取り出す度に、新しい同等のオブジェクトを作成しているのです。::"
#: ../../library/ctypes.rst:738
msgid ""
"Assigning another :class:`c_int` instance to the pointer's contents "
"attribute would cause the pointer to point to the memory location where this"
" is stored::"
msgstr ""
"別の :class:`c_int` インスタンスがポインタの contents "
"属性に代入されると、これが記憶されているメモリ位置を指すポインタに変化します。::"
#: ../../library/ctypes.rst:750
msgid "Pointer instances can also be indexed with integers::"
msgstr "ポインタインスタンスは整数でインデックス指定することもできます。::"
#: ../../library/ctypes.rst:756
msgid "Assigning to an integer index changes the pointed to value::"
msgstr "整数インデックスへ代入するとポインタが指す値が変更されます。::"
#: ../../library/ctypes.rst:765
msgid ""
"It is also possible to use indexes different from 0, but you must know what "
"you're doing, just as in C: You can access or change arbitrary memory "
"locations. Generally you only use this feature if you receive a pointer from"
" a C function, and you *know* that the pointer actually points to an array "
"instead of a single item."
msgstr ""
"0 ではないインデックスを使うこともできますが、 C "
"の場合と同じように自分が何をしているかを理解している必要があります。任意のメモリ位置にアクセスもしくは変更できるのです。一般的にこの機能を使うのは、 C"
" 関数からポインタを受け取り、そのポインタが単一の要素ではなく実際に配列を指していると *分かっている* 場合だけです。"
#: ../../library/ctypes.rst:771
msgid ""
"Behind the scenes, the :func:`pointer` function does more than simply create"
" pointer instances, it has to create pointer *types* first. This is done "
"with the :func:`POINTER` function, which accepts any :mod:`ctypes` type, and"
" returns a new type::"
msgstr ""
"舞台裏では、 :func:`pointer` 関数は単にポインタインスタンスを作成するという以上のことを行っています。はじめにポインタ *型* "
"を作成する必要があります。これは任意の :mod:`ctypes` 型を受け取る :func:`POINTER` "
"関数を使って行われ、新しい型を返します::"
#: ../../library/ctypes.rst:787
msgid ""
"Calling the pointer type without an argument creates a ``NULL`` pointer. "
"``NULL`` pointers have a ``False`` boolean value::"
msgstr ""
"ポインタ型を引数なしで呼び出すと ``NULL`` ポインタを作成します。 ``NULL`` ポインタは ``False`` "
"ブール値を持っています。::"
#: ../../library/ctypes.rst:795
msgid ""
":mod:`ctypes` checks for ``NULL`` when dereferencing pointers (but "
"dereferencing invalid non-\\ ``NULL`` pointers would crash Python)::"
msgstr ""
":mod:`ctypes` はポインタの指す値を取り出すときに ``NULL`` かどうかを調べます(しかし、 ``NULL`` "
"でない不正なポインタの指す値の取り出す行為は Python をクラッシュさせるでしょう)。::"
#: ../../library/ctypes.rst:814
msgid "Type conversions"
msgstr "型変換"
#: ../../library/ctypes.rst:816
msgid ""
"Usually, ctypes does strict type checking. This means, if you have "
"``POINTER(c_int)`` in the :attr:`argtypes` list of a function or as the type"
" of a member field in a structure definition, only instances of exactly the "
"same type are accepted. There are some exceptions to this rule, where "
"ctypes accepts other objects. For example, you can pass compatible array "
"instances instead of pointer types. So, for ``POINTER(c_int)``, ctypes "
"accepts an array of c_int::"
msgstr ""
"たいていの場合、 ctypes は厳密な型チェックを行います。これが意味するのは、関数の :attr:`argtypes` "
"リスト内に、もしくは、構造体定義におけるメンバーフィールドの型として ``POINTER(c_int)`` "
"がある場合、厳密に同じ型のインスタンスだけを受け取るということです。このルールには ctypes "
"が他のオブジェクトを受け取る場合に例外がいくつかあります。例えば、ポインタ型の代わりに互換性のある配列インスタンスを渡すことができます。このように、 "
"``POINTER(c_int)`` に対して、 ctypes は c_int の配列を受け取ります。::"
#: ../../library/ctypes.rst:837
msgid ""
"In addition, if a function argument is explicitly declared to be a pointer "
"type (such as ``POINTER(c_int)``) in :attr:`argtypes`, an object of the "
"pointed type (``c_int`` in this case) can be passed to the function. ctypes"
" will apply the required :func:`byref` conversion in this case "
"automatically."
msgstr ""
"それに加えて、 :attr:`argtypes` で関数の引数が明示的に (``POINTER(c_int)`` などの) "
"ポインタ型であると宣言されていた場合、ポインタ型が指し示している型のオブジェクト (この場合では ``c_int``) "
"を関数に渡すことができます。この場合 ctypes は、必要となる :func:`byref` での変換を自動的に適用します。"
#: ../../library/ctypes.rst:842
msgid "To set a POINTER type field to ``NULL``, you can assign ``None``::"
msgstr "POINTER型フィールドを ``NULL`` に設定するために、 ``None`` を代入してもかまいません。::"