7
7
msgstr ""
8
8
"Project-Id-Version : Python 3.12\n "
9
9
"Report-Msgid-Bugs-To : \n "
10
- "POT-Creation-Date : 2024-06 -01 00:16 +0000\n "
10
+ "POT-Creation-Date : 2024-11 -01 00:21 +0000\n "
11
11
"PO-Revision-Date : YEAR-MO-DA HO:MI+ZONE\n "
12
12
"Last-Translator : \n "
13
13
"Language-Team : TURKISH <python.docs.tr@gmail.com>\n "
@@ -512,13 +512,49 @@ msgid ""
512
512
"dimensional array as follows:"
513
513
msgstr ""
514
514
515
+ #: c-api/buffer.rst:368
516
+ msgid ""
517
+ "ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * "
518
+ "strides[n-1];\n"
519
+ "item = *((typeof(item) *)ptr);"
520
+ msgstr ""
521
+
515
522
#: c-api/buffer.rst:374
516
523
msgid ""
517
524
"As noted above, :c:member:`~Py_buffer.buf` can point to any location within "
518
525
"the actual memory block. An exporter can check the validity of a buffer with "
519
526
"this function:"
520
527
msgstr ""
521
528
529
+ #: c-api/buffer.rst:378
530
+ msgid ""
531
+ "def verify_structure(memlen, itemsize, ndim, shape, strides, offset):\n"
532
+ " \"\"\" Verify that the parameters represent a valid array within\n"
533
+ " the bounds of the allocated memory:\n"
534
+ " char *mem: start of the physical memory block\n"
535
+ " memlen: length of the physical memory block\n"
536
+ " offset: (char *)buf - mem\n"
537
+ " \"\"\" \n"
538
+ " if offset % itemsize:\n"
539
+ " return False\n"
540
+ " if offset < 0 or offset+itemsize > memlen:\n"
541
+ " return False\n"
542
+ " if any(v % itemsize for v in strides):\n"
543
+ " return False\n"
544
+ "\n"
545
+ " if ndim <= 0:\n"
546
+ " return ndim == 0 and not shape and not strides\n"
547
+ " if 0 in shape:\n"
548
+ " return True\n"
549
+ "\n"
550
+ " imin = sum(strides[j]*(shape[j]-1) for j in range(ndim)\n"
551
+ " if strides[j] <= 0)\n"
552
+ " imax = sum(strides[j]*(shape[j]-1) for j in range(ndim)\n"
553
+ " if strides[j] > 0)\n"
554
+ "\n"
555
+ " return 0 <= offset+imin and offset+imax+itemsize <= memlen"
556
+ msgstr ""
557
+
522
558
#: c-api/buffer.rst:408
523
559
msgid "PIL-style: shape, strides and suboffsets"
524
560
msgstr ""
@@ -541,6 +577,22 @@ msgid ""
541
577
"strides and suboffsets::"
542
578
msgstr ""
543
579
580
+ #: c-api/buffer.rst:423
581
+ msgid ""
582
+ "void *get_item_pointer(int ndim, void *buf, Py_ssize_t *strides,\n"
583
+ " Py_ssize_t *suboffsets, Py_ssize_t *indices) {\n"
584
+ " char *pointer = (char*)buf;\n"
585
+ " int i;\n"
586
+ " for (i = 0; i < ndim; i++) {\n"
587
+ " pointer += strides[i] * indices[i];\n"
588
+ " if (suboffsets[i] >=0 ) {\n"
589
+ " pointer = *((char**)pointer) + suboffsets[i];\n"
590
+ " }\n"
591
+ " }\n"
592
+ " return (void*)pointer;\n"
593
+ "}"
594
+ msgstr ""
595
+
544
596
#: c-api/buffer.rst:438
545
597
msgid "Buffer-related functions"
546
598
msgstr ""
0 commit comments