Lines Matching defs:end
75 /*[clinic end generated code: output=da39a3ee5e6b4b0d input=4884c934de622cf6]*/
89 /*[python end generated code: output=da39a3ee5e6b4b0d input=88f5dd06cd8e7a61]*/
186 from_type and to_type have to be valid type names, begin and end
190 #define _PyUnicode_CONVERT_BYTES(from_type, to_type, begin, end, to) \
194 const from_type *_end = (const from_type *)(end);\
289 const Py_UCS2 *end = to + length;
290 for (; to < end; ++to) *to = ch;
297 const Py_UCS4 *end = to + length;
298 for (; to < end; ++to) *to = ch;
870 TYPE *end = data + LEN; \
872 for (; data != end; data++) { \
1485 unicode_convert_wchar_to_ucs4(const wchar_t *begin, const wchar_t *end,
1496 for (iter = begin; iter < end; ) {
1500 && (iter+1) < end
1740 find_maxchar_surrogates(const wchar_t *begin, const wchar_t *end,
1750 for (iter = begin; iter < end; ) {
1753 && (iter+1) < end
1782 wchar_t *end;
1801 end = _PyUnicode_WSTR(unicode) + _PyUnicode_WSTR_LENGTH(unicode);
1802 if (find_maxchar_surrogates(_PyUnicode_WSTR(unicode), end,
1813 _PyUnicode_WSTR(unicode), end,
1855 _PyUnicode_WSTR(unicode), end,
1888 unicode_convert_wchar_to_ucs4(_PyUnicode_WSTR(unicode), end, unicode);
2069 const char *end = str + len;
2089 for (; str < end; ++ucs2, ++str)
2099 for (; str < end; ++ucs4, ++str)
2492 _PyUnicode_FindMaxChar(PyObject *unicode, Py_ssize_t start, Py_ssize_t end)
2499 assert(end <= PyUnicode_GET_LENGTH(unicode));
2500 assert(start <= end);
2502 if (start == 0 && end == PyUnicode_GET_LENGTH(unicode))
2505 if (start == end)
2513 endptr = (char *)startptr + end * kind;
3176 const Py_UCS4 *end = s + res;
3177 for (; s < end; ++s) {
4692 * i.e. how many characters we have consumed. So if we end in the
4845 /* end of string */
5041 ascii_decode(const char *start, const char *end, Py_UCS1 *dest)
5053 while (_p + SIZEOF_SIZE_T <= end) {
5062 while (p < end) {
5070 while (p < end) {
5076 while (_p + SIZEOF_SIZE_T <= end) {
5083 if (_p == end)
5114 const char *end = s + size;
5121 s += ascii_decode(s, end, PyUnicode_1BYTE_DATA(u));
5122 if (s == end) {
5136 while (s < end) {
5142 ch = asciilib_utf8_decode(&s, end, writer.data, &writer.pos);
5144 ch = ucs1lib_utf8_decode(&s, end, writer.data, &writer.pos);
5146 ch = ucs2lib_utf8_decode(&s, end, writer.data, &writer.pos);
5149 ch = ucs4lib_utf8_decode(&s, end, writer.data, &writer.pos);
5154 if (s == end || consumed)
5156 errmsg = "unexpected end of data";
5158 endinpos = end - starts;
5166 if (consumed && (unsigned char)s[0] == 0xED && end - s == 2
5219 &starts, &end, &startinpos, &endinpos, &exc, &s,
5344 *reason = "unexpected end of data";
5530 and allocate exactly as much space needed at the end. Else allocate the
5532 the excess memory at the end.
5555 char *end;
5563 end = ucs1lib_utf8_encoder(&writer, unicode, data, size, error_handler, errors);
5566 end = ucs2lib_utf8_encoder(&writer, unicode, data, size, error_handler, errors);
5569 end = ucs4lib_utf8_encoder(&writer, unicode, data, size, error_handler, errors);
5573 if (end == NULL) {
5577 return _PyBytesWriter_Finish(&writer, end);
5591 char *end;
5597 end = ucs1lib_utf8_encoder(&writer, unicode, data, size,
5601 end = ucs2lib_utf8_encoder(&writer, unicode, data, size,
5605 end = ucs4lib_utf8_encoder(&writer, unicode, data, size,
5609 if (end == NULL) {
5616 Py_ssize_t len = end - start;
5760 /* remaining bytes at the end? (size should be divisible by 4) */
6060 /* remaining byte at the end? (size should be even) */
6073 errmsg = "unexpected end of data";
6157 const Py_UCS4 *end = in + len;
6158 while (in < end) {
6309 const char *end;
6333 end = s + size;
6334 while (s < end) {
6366 if (s >= end) {
6367 message = "\\ at end of string";
6395 if (s < end && '0' <= *s && *s <= '7') {
6397 if (s < end && '0' <= *s && *s <= '7') {
6429 if (s >= end) {
6473 if (s >= end) {
6480 while (s < end && *s != '}')
6482 if (s >= end) {
6519 writer.min_length = end - s + writer.pos;
6523 &starts, &end, &startinpos, &endinpos, &exc, &s,
6527 assert(end - s <= writer.size - writer.pos);
6718 const char *end;
6739 end = s + size;
6740 while (s < end) {
6758 if (c != '\\' || (s >= end && !consumed)) {
6765 if (s >= end) {
6769 message = "\\ at end of string";
6791 if (s >= end) {
6823 writer.min_length = end - s + writer.pos;
6827 &starts, &end, &startinpos, &endinpos, &exc, &s,
6831 assert(end - s <= writer.size - writer.pos);
8365 /*[clinic end generated code: output=da39a3ee5e6b4b0d input=14e46bbb6c522d22]*/
8382 /*[clinic end generated code: output=c4c969e4c99342a4 input=004ff13f26bb5366]*/
9146 const Py_UCS1 *in, *end;
9155 end = in + len;
9161 for (; in < end; in++) {
9371 /* helper macro to fixup start/end slice values */
9372 #define ADJUST_INDICES(start, end, len) \
9373 if (end > len) \
9374 end = len; \
9375 else if (end < 0) { \
9376 end += len; \
9377 if (end < 0) \
9378 end = 0; \
9389 Py_ssize_t end,
9403 ADJUST_INDICES(start, end, len1);
9404 if (end - start < len2)
9412 kind1, end - start, ch, direction);
9429 result = asciilib_find_slice(buf1, len1, buf2, len2, start, end);
9431 result = ucs1lib_find_slice(buf1, len1, buf2, len2, start, end);
9434 result = ucs2lib_find_slice(buf1, len1, buf2, len2, start, end);
9437 result = ucs4lib_find_slice(buf1, len1, buf2, len2, start, end);
9447 result = asciilib_rfind_slice(buf1, len1, buf2, len2, start, end);
9449 result = ucs1lib_rfind_slice(buf1, len1, buf2, len2, start, end);
9452 result = ucs2lib_rfind_slice(buf1, len1, buf2, len2, start, end);
9455 result = ucs4lib_rfind_slice(buf1, len1, buf2, len2, start, end);
9619 Py_ssize_t end)
9636 ADJUST_INDICES(start, end, len1);
9637 if (end - start < len2)
9652 ((const Py_UCS1*)buf1) + start, end - start,
9657 ((const Py_UCS1*)buf1) + start, end - start,
9663 ((const Py_UCS2*)buf1) + start, end - start,
9669 ((const Py_UCS4*)buf1) + start, end - start,
9693 Py_ssize_t end,
9699 return any_find_slice(str, substr, start, end, direction);
9704 Py_ssize_t start, Py_ssize_t end,
9712 ADJUST_INDICES(start, end, len);
9713 if (end - start < 1)
9717 kind, end-start, ch, direction);
9728 Py_ssize_t end,
9743 ADJUST_INDICES(start, end, PyUnicode_GET_LENGTH(self));
9744 end -= PyUnicode_GET_LENGTH(substring);
9745 if (end < start)
9758 offset = end;
9778 when we end up here. */
9795 Py_ssize_t end,
9801 return tailmatch(str, substr, start, end, direction);
10896 /*[clinic end generated code: output=c75ae03809574902 input=fa945d669b26e683]*/
10914 /*[clinic end generated code: output=e49a4c333cdb7667 input=f4cbf1016938da6d]*/
10931 /*[clinic end generated code: output=0120daf657ca40af input=384d66cc2ae30daf]*/
10979 /*[clinic end generated code: output=420c8859effc7c0c input=b42b247eb26e6519]*/
11004 TYPE1* end = p1 + len; \
11006 for (; p1 != end; p1++, p2++) { \
11186 /* This check keeps Python strings that end in '\0' from comparing equal
11221 /* This check keeps Python strings that end in '\0' from comparing equal
11573 Py_ssize_t *start, Py_ssize_t *end)
11576 start, end)) {
11585 "S.count(sub[, start[, end]]) -> int\n\
11588 string S[start:end]. Optional arguments start and end are\n\
11596 Py_ssize_t end = PY_SSIZE_T_MAX;
11602 if (!parse_args_finds_unicode("count", args, &substring, &start, &end))
11612 ADJUST_INDICES(start, end, len1);
11613 if (end - start < len2)
11626 ((const Py_UCS1*)buf1) + start, end - start,
11632 ((const Py_UCS2*)buf1) + start, end - start,
11638 ((const Py_UCS4*)buf1) + start, end - start,
11672 /*[clinic end generated code: output=bf78b6e2a9470e3c input=f0a9eb293d08fe02]*/
11689 /*[clinic end generated code: output=3457c5dcee26928f input=8a01914034af4c85]*/
11767 "S.find(sub[, start[, end]]) -> int\n\
11770 such that sub is contained within S[start:end]. Optional\n\
11771 arguments start and end are interpreted as in slice notation.\n\
11781 Py_ssize_t end = 0;
11784 if (!parse_args_finds_unicode("find", args, &substring, &start, &end))
11790 result = any_find_slice(self, substring, start, end, 1);
11844 "S.index(sub[, start[, end]]) -> int\n\
11847 such that sub is contained within S[start:end]. Optional\n\
11848 arguments start and end are interpreted as in slice notation.\n\
11859 Py_ssize_t end = 0;
11861 if (!parse_args_finds_unicode("index", args, &substring, &start, &end))
11867 result = any_find_slice(self, substring, start, end, 1);
11891 /*[clinic end generated code: output=c5910d64b5a8003f input=5a43cbc6399621d5]*/
11910 /*[clinic end generated code: output=dbd41995bd005b81 input=acec65ac6821ae47]*/
11955 /*[clinic end generated code: output=049209c8e7f15f59 input=e9b1feda5d17f2d3]*/
12000 /*[clinic end generated code: output=e9bf6eb91f5d3f0e input=98d32bd2e1f06f8c]*/
12058 /*[clinic end generated code: output=163a63bfa08ac2b9 input=fe462cb74f8437d8]*/
12098 /*[clinic end generated code: output=cc81b9ac3883ec4f input=d0fd18a96cbca5eb]*/
12137 /*[clinic end generated code: output=a5a23490ffc3660c input=5c6579bf2e04758c]*/
12179 /*[clinic end generated code: output=fb2dcdb62d3fc548 input=336bc97ab4c8268f]*/
12218 /*[clinic end generated code: output=10a6985311da6858 input=901116c31deeea4c]*/
12258 /*[clinic end generated code: output=9172a32d9013051a input=722507db976f826c]*/
12387 /*[clinic end generated code: output=fe585a9666572905 input=2d807a104f21c0c5]*/
12403 /*[clinic end generated code: output=3ab9626cd32dd1a0 input=98a0e1c2c1813209]*/
12444 /*[clinic end generated code: output=6857e7cecfe7bf98 input=2f70422bfb8fa189]*/
12471 /*[clinic end generated code: output=1cce0e0e0a0b84b3 input=3ab599e335e60a32]*/
12490 /*[clinic end generated code: output=84ef9ed42efad663 input=60a2984b8beff23a]*/
12560 PyUnicode_Substring(PyObject *self, Py_ssize_t start, Py_ssize_t end)
12570 end = Py_MIN(end, length);
12572 if (start == 0 && end == length)
12575 if (start < 0 || end < 0) {
12579 if (start >= length || end < start)
12582 length = end - start;
12693 /*[clinic end generated code: output=ca19018454345d57 input=385289c6f423b954]*/
12712 /*[clinic end generated code: output=3b43683251f79ca7 input=529f9f3834448671]*/
12731 /*[clinic end generated code: output=4a59230017cc3b7a input=62566c627916557f]*/
12825 /*[clinic end generated code: output=b63f1a8b5eebf448 input=147d12206276ebeb]*/
12846 /*[clinic end generated code: output=f1e5945e9763bcb9 input=27ec40b99a37eb88]*/
12874 /*[clinic end generated code: output=d36629e227636822 input=12cc32561e769be4]*/
13053 "S.rfind(sub[, start[, end]]) -> int\n\
13056 such that sub is contained within S[start:end]. Optional\n\
13057 arguments start and end are interpreted as in slice notation.\n\
13067 Py_ssize_t end = 0;
13070 if (!parse_args_finds_unicode("rfind", args, &substring, &start, &end))
13076 result = any_find_slice(self, substring, start, end, -1);
13085 "S.rindex(sub[, start[, end]]) -> int\n\
13088 such that sub is contained within S[start:end]. Optional\n\
13089 arguments start and end are interpreted as in slice notation.\n\
13099 Py_ssize_t end = 0;
13102 if (!parse_args_finds_unicode("rindex", args, &substring, &start, &end))
13108 result = any_find_slice(self, substring, start, end, -1);
13135 /*[clinic end generated code: output=804a1a57fbe8d5cf input=d05f550b5beb1f72]*/
13178 /*[clinic end generated code: output=3a65b1db356948dc input=906d953b44efc43b]*/
13312 /*[clinic end generated code: output=e4ced7bd253ca3c4 input=f29b8d06c63e50be]*/
13322 This will search for the separator in the string, starting at the end. If
13332 /*[clinic end generated code: output=1aa13cf1156572aa input=c4b7db3ef5cf336a]*/
13351 Splitting starts at the end of the string and works to the front.
13356 /*[clinic end generated code: output=c2b815c63bcabffc input=ea78406060fce33c]*/
13382 /*[clinic end generated code: output=f664dcdad153ec40 input=b508e180459bdd8b]*/
13401 /*[clinic end generated code: output=5d28966bf6d7b2af input=3f3ef96d5798a7bb]*/
13434 /*[clinic end generated code: output=a925c89452bd5881 input=7bfbf529a293c6c5]*/
13555 /*[clinic end generated code: output=3cb448ff2fd96bf3 input=6d38343db63d8eb0]*/
13568 /*[clinic end generated code: output=1b7ddd16bbcdc092 input=db3d55682dfe2e6c]*/
13590 /*[clinic end generated code: output=e13fb6bdf8e3b9df input=c6b2f772c6f27799]*/
13626 "S.startswith(prefix[, start[, end]]) -> bool\n\
13630 With optional end, stop comparing S at that position.\n\
13640 Py_ssize_t end = PY_SSIZE_T_MAX;
13643 if (!stringlib_parse_args_finds("startswith", args, &subobj, &start, &end))
13656 result = tailmatch(self, substring, start, end, -1);
13672 result = tailmatch(self, subobj, start, end, -1);
13680 "S.endswith(suffix[, start[, end]]) -> bool\n\
13684 With optional end, stop comparing S at that position.\n\
13694 Py_ssize_t end = PY_SSIZE_T_MAX;
13697 if (!stringlib_parse_args_finds("endswith", args, &subobj, &start, &end))
13710 result = tailmatch(self, substring, start, end, +1);
13725 result = tailmatch(self, subobj, start, end, +1);
13926 Py_ssize_t start, Py_ssize_t end)
13935 assert(end <= PyUnicode_GET_LENGTH(str));
13936 assert(start <= end);
13938 if (end == 0)
13941 if (start == 0 && end == PyUnicode_GET_LENGTH(str))
13945 maxchar = _PyUnicode_FindMaxChar(str, start, end);
13948 len = end - start;
14096 /*[clinic end generated code: output=45fceaca6d2ba4c8 input=5e135645d167a214]*/
14122 /*[clinic end generated code: output=6dbc2f5a408b6d4f input=6dd011c108e33fb0]*/
14790 /* Since arg->ch is unsigned, the RHS would end up as unsigned,
15283 /*[clinic end generated code: output=fc72d4878b0b57e9 input=e81255e5676d174e]*/