Lines Matching defs:writer
234 _PyUnicodeWriter_WriteCharInline(_PyUnicodeWriter *writer, Py_UCS4 ch);
236 _PyUnicodeWriter_InitWithBuffer(_PyUnicodeWriter *writer, PyObject *buffer);
712 backslashreplace(_PyBytesWriter *writer, char *str,
746 str = _PyBytesWriter_Prepare(writer, str, size);
779 xmlcharrefreplace(_PyBytesWriter *writer, char *str,
821 str = _PyBytesWriter_Prepare(writer, str, size);
2720 unicode_fromformat_write_str(_PyUnicodeWriter *writer, PyObject *str,
2732 return _PyUnicodeWriter_WriteStr(writer, str);
2738 if (PyUnicode_MAX_CHAR_VALUE(str) > writer->maxchar)
2741 maxchar = writer->maxchar;
2743 if (_PyUnicodeWriter_Prepare(writer, arglen, maxchar) == -1)
2748 if (PyUnicode_Fill(writer->buffer, writer->pos, fill, ' ') == -1)
2750 writer->pos += fill;
2753 _PyUnicode_FastCopyCharacters(writer->buffer, writer->pos,
2755 writer->pos += length;
2760 unicode_fromformat_write_cstr(_PyUnicodeWriter *writer, const char *str,
2781 res = unicode_fromformat_write_str(writer, unicode, width, -1);
2787 unicode_fromformat_arg(_PyUnicodeWriter *writer,
2871 writer->overallocate = 0;
2882 if (_PyUnicodeWriter_WriteCharInline(writer, ordinal) < 0)
2933 if (_PyUnicodeWriter_Prepare(writer, arglen, 127) == -1)
2940 if (PyUnicode_Fill(writer->buffer, writer->pos, fill, fillchar) == -1)
2942 writer->pos += fill;
2946 if (PyUnicode_Fill(writer->buffer, writer->pos, fill, '0') == -1)
2948 writer->pos += fill;
2951 if (_PyUnicodeWriter_WriteASCIIString(writer, buffer, len) < 0)
2974 if (_PyUnicodeWriter_WriteASCIIString(writer, number, len) < 0)
2983 if (unicode_fromformat_write_cstr(writer, s, width, precision) < 0)
2993 if (unicode_fromformat_write_str(writer, obj, width, precision) == -1)
3004 if (unicode_fromformat_write_str(writer, obj, width, precision) == -1)
3009 if (unicode_fromformat_write_cstr(writer, str, width, precision) < 0)
3023 if (unicode_fromformat_write_str(writer, str, width, precision) == -1) {
3039 if (unicode_fromformat_write_str(writer, repr, width, precision) == -1) {
3055 if (unicode_fromformat_write_str(writer, ascii, width, precision) == -1) {
3064 if (_PyUnicodeWriter_WriteCharInline(writer, '%') < 0)
3074 if (_PyUnicodeWriter_WriteLatin1String(writer, p, len) == -1)
3089 _PyUnicodeWriter writer;
3091 _PyUnicodeWriter_Init(&writer);
3092 writer.min_length = strlen(format) + 100;
3093 writer.overallocate = 1;
3100 f = unicode_fromformat_arg(&writer, f, &vargs2);
3124 writer.overallocate = 0;
3126 if (_PyUnicodeWriter_WriteASCIIString(&writer, f, len) < 0)
3133 return _PyUnicodeWriter_Finish(&writer);
3137 _PyUnicodeWriter_Dealloc(&writer);
4508 _PyUnicodeWriter *writer /* PyObject **output, Py_ssize_t *outpos */)
4568 writer->min_length += replen - 1;
4578 writer->min_length += *inend - new_inptr - remain;
4582 writer->overallocate = 1;
4583 if (_PyUnicodeWriter_Prepare(writer, writer->min_length - writer->pos,
4587 if (_PyUnicodeWriter_WriteStr(writer, repunicode) == -1)
4708 _PyUnicodeWriter writer;
4725 _PyUnicodeWriter_Init(&writer);
4726 writer.min_length = size;
4751 if (_PyUnicodeWriter_WriteCharInline(&writer, ch2) < 0)
4757 if (_PyUnicodeWriter_WriteCharInline(&writer, surrogate) < 0)
4767 if (_PyUnicodeWriter_WriteCharInline(&writer, outCh) < 0)
4791 if (_PyUnicodeWriter_WriteCharInline(&writer, surrogate) < 0)
4807 if (_PyUnicodeWriter_WriteCharInline(&writer, '+') < 0)
4818 shiftOutStart = writer.pos;
4825 if (_PyUnicodeWriter_WriteCharInline(&writer, ch) < 0)
4841 &writer))
4858 &writer))
4869 if (writer.pos != shiftOutStart && writer.maxchar > 127) {
4871 writer.kind, writer.data, shiftOutStart);
4874 _PyUnicodeWriter_Dealloc(&writer);
4877 writer.pos = shiftOutStart; /* back off output */
4886 return _PyUnicodeWriter_Finish(&writer);
4891 _PyUnicodeWriter_Dealloc(&writer);
5127 _PyUnicodeWriter writer;
5128 _PyUnicodeWriter_InitWithBuffer(&writer, u);
5129 writer.pos = s - starts;
5138 int kind = writer.kind;
5141 if (PyUnicode_IS_ASCII(writer.buffer))
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);
5180 if (_PyUnicodeWriter_WriteCharInline(&writer, ch) < 0)
5194 if (_PyUnicodeWriter_WriteCharInline(&writer, 0xfffd) < 0)
5203 if (_PyUnicodeWriter_PrepareKind(&writer, PyUnicode_2BYTE_KIND) < 0)
5207 PyUnicode_WRITE(writer.kind, writer.data, writer.pos,
5209 writer.pos++;
5220 &writer))
5231 return _PyUnicodeWriter_Finish(&writer);
5236 _PyUnicodeWriter_Dealloc(&writer);
5554 _PyBytesWriter writer;
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);
5574 _PyBytesWriter_Dealloc(&writer);
5577 return _PyBytesWriter_Finish(&writer, end);
5590 _PyBytesWriter writer;
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,
5610 _PyBytesWriter_Dealloc(&writer);
5614 const char *start = writer.use_small_buffer ? writer.small_buffer :
5615 PyBytes_AS_STRING(writer.buffer);
5620 _PyBytesWriter_Dealloc(&writer);
5628 _PyBytesWriter_Dealloc(&writer);
5666 _PyUnicodeWriter writer;
5711 _PyUnicodeWriter_Init(&writer);
5712 writer.min_length = (e - q + 3) / 4;
5713 if (_PyUnicodeWriter_Prepare(&writer, writer.min_length, 127) == -1)
5718 Py_UCS4 maxch = PyUnicode_MAX_CHAR_VALUE(writer.buffer);
5721 enum PyUnicode_Kind kind = writer.kind;
5722 void *data = writer.data;
5724 Py_ssize_t pos = writer.pos;
5749 writer.pos = pos;
5767 if (_PyUnicodeWriter_WriteCharInline(&writer, ch) < 0)
5783 &writer))
5792 return _PyUnicodeWriter_Finish(&writer);
5795 _PyUnicodeWriter_Dealloc(&writer);
5977 _PyUnicodeWriter writer;
6027 _PyUnicodeWriter_Init(&writer);
6028 writer.min_length = (e - q + 1) / 2;
6029 if (_PyUnicodeWriter_Prepare(&writer, writer.min_length, 127) == -1)
6035 int kind = writer.kind;
6037 if (PyUnicode_IS_ASCII(writer.buffer))
6039 (Py_UCS1*)writer.data, &writer.pos,
6043 (Py_UCS1*)writer.data, &writer.pos,
6047 (Py_UCS2*)writer.data, &writer.pos,
6052 (Py_UCS4*)writer.data, &writer.pos,
6088 if (_PyUnicodeWriter_WriteCharInline(&writer, ch) < 0)
6103 &writer))
6113 return _PyUnicodeWriter_Finish(&writer);
6116 _PyUnicodeWriter_Dealloc(&writer);
6308 _PyUnicodeWriter writer;
6327 _PyUnicodeWriter_Init(&writer);
6328 writer.min_length = size;
6329 if (_PyUnicodeWriter_Prepare(&writer, size, 127) < 0) {
6343 assert(writer.pos < writer.size); \
6344 PyUnicode_WRITE(writer.kind, writer.data, writer.pos++, ch); \
6349 if (ch <= writer.maxchar) { \
6350 assert(writer.pos < writer.size); \
6351 PyUnicode_WRITE(writer.kind, writer.data, writer.pos++, ch); \
6353 else if (_PyUnicodeWriter_WriteCharInline(&writer, ch) < 0) { \
6372 assert(writer.pos < writer.size);
6519 writer.min_length = end - s + writer.pos;
6524 &writer)) {
6527 assert(end - s <= writer.size - writer.pos);
6535 return _PyUnicodeWriter_Finish(&writer);
6538 _PyUnicodeWriter_Dealloc(&writer);
6717 _PyUnicodeWriter writer;
6733 _PyUnicodeWriter_Init(&writer);
6734 writer.min_length = size;
6735 if (_PyUnicodeWriter_Prepare(&writer, size, 127) < 0) {
6748 if (ch <= writer.maxchar) { \
6749 assert(writer.pos < writer.size); \
6750 PyUnicode_WRITE(writer.kind, writer.data, writer.pos++, ch); \
6752 else if (_PyUnicodeWriter_WriteCharInline(&writer, ch) < 0) { \
6783 assert(writer.pos < writer.size);
6784 PyUnicode_WRITE(writer.kind, writer.data, writer.pos++, '\\');
6823 writer.min_length = end - s + writer.pos;
6828 &writer)) {
6831 assert(end - s <= writer.size - writer.pos);
6837 return _PyUnicodeWriter_Finish(&writer);
6840 _PyUnicodeWriter_Dealloc(&writer);
7065 _PyBytesWriter writer;
7077 _PyBytesWriter_Init(&writer);
7078 str = _PyBytesWriter_Alloc(&writer, size);
7102 writer.overallocate = (collend < size);
7123 writer.min_size -= (collend - collstart);
7124 str = backslashreplace(&writer, str,
7133 writer.min_size -= (collend - collstart);
7134 str = xmlcharrefreplace(&writer, str,
7165 writer.overallocate = 1;
7166 str = _PyBytesWriter_Prepare(&writer, str,
7173 writer.min_size -= newpos - collstart;
7175 writer.overallocate = (newpos < size);
7180 str = _PyBytesWriter_WriteBytes(&writer, str,
7200 str = _PyBytesWriter_WriteBytes(&writer, str,
7213 assert(writer.overallocate || pos == size);
7219 return _PyBytesWriter_Finish(&writer, str);
7223 _PyBytesWriter_Dealloc(&writer);
7285 _PyUnicodeWriter writer;
7286 _PyUnicodeWriter_InitWithBuffer(&writer, u);
7287 writer.pos = outpos;
7290 int kind = writer.kind;
7291 void *data = writer.data;
7297 PyUnicode_WRITE(kind, data, writer.pos, c);
7298 writer.pos++;
7314 if (_PyUnicodeWriter_PrepareKind(&writer, PyUnicode_2BYTE_KIND) < 0)
7316 kind = writer.kind;
7317 data = writer.data;
7320 PyUnicode_WRITE(kind, data, writer.pos, 0xfffd);
7322 PyUnicode_WRITE(kind, data, writer.pos, c + 0xdc00);
7323 writer.pos++;
7338 &writer))
7340 kind = writer.kind;
7341 data = writer.data;
7346 return _PyUnicodeWriter_Finish(&writer);
7349 _PyUnicodeWriter_Dealloc(&writer);
8110 _PyUnicodeWriter *writer)
8136 Py_UCS1 *outdata = (Py_UCS1 *)writer->data;
8137 Py_UCS4 maxchar = writer->maxchar;
8139 assert (writer->kind == PyUnicode_1BYTE_KIND);
8144 if (_PyUnicodeWriter_Prepare(writer, 1, 0xff) == -1)
8146 maxchar = writer->maxchar;
8147 outdata = (Py_UCS1 *)writer->data;
8149 outdata[writer->pos] = x;
8150 writer->pos++;
8158 enum PyUnicode_Kind outkind = writer->kind;
8161 Py_UCS1 *outdata = (Py_UCS1 *)writer->data;
8162 Py_UCS4 maxchar = writer->maxchar;
8168 outdata[writer->pos] = x;
8169 writer->pos++;
8175 Py_UCS2 *outdata = (Py_UCS2 *)writer->data;
8181 outdata[writer->pos] = x;
8182 writer->pos++;
8204 writer)) {
8210 if (_PyUnicodeWriter_WriteCharInline(writer, x) < 0)
8229 _PyUnicodeWriter *writer)
8273 if (_PyUnicodeWriter_WriteCharInline(writer, value) < 0)
8283 if (_PyUnicodeWriter_WriteCharInline(writer, value) < 0)
8287 writer->overallocate = 1;
8288 if (_PyUnicodeWriter_WriteStr(writer, item) == -1)
8311 writer)) {
8332 _PyUnicodeWriter writer;
8340 _PyUnicodeWriter_Init(&writer);
8341 writer.min_length = size;
8342 if (_PyUnicodeWriter_Prepare(&writer, writer.min_length, 127) == -1)
8346 if (charmap_decode_string(s, size, mapping, errors, &writer) < 0)
8350 if (charmap_decode_mapping(s, size, mapping, errors, &writer) < 0)
8353 return _PyUnicodeWriter_Finish(&writer);
8356 _PyUnicodeWriter_Dealloc(&writer);
9028 /* lookup the character, write the result into the writer.
9029 Return 1 if the result was written into the writer, return 0 if the mapping
9033 _PyUnicodeWriter *writer)
9042 if (_PyUnicodeWriter_WriteCharInline(writer, ch) < 0) {
9057 if (_PyUnicodeWriter_WriteCharInline(writer, ch) < 0) {
9070 if (_PyUnicodeWriter_WriteStr(writer, item) < 0) {
9137 was translated into writer, return 0 if the input string was partially
9138 translated into writer, raise an exception and return -1 on error. */
9141 _PyUnicodeWriter *writer, int ignore,
9157 assert(PyUnicode_IS_ASCII(writer->buffer));
9158 assert(PyUnicode_GET_LENGTH(writer->buffer) == len);
9159 out = PyUnicode_1BYTE_DATA(writer->buffer);
9185 writer->pos = out - PyUnicode_1BYTE_DATA(writer->buffer);
9200 _PyUnicodeWriter writer;
9224 _PyUnicodeWriter_Init(&writer);
9225 if (_PyUnicodeWriter_Prepare(&writer, size, 127) == -1)
9233 res = unicode_fast_translate(input, mapping, &writer, ignore, &i);
9235 _PyUnicodeWriter_Dealloc(&writer);
9239 return _PyUnicodeWriter_Finish(&writer);
9256 translate = charmaptranslate_output(ch, mapping, &writer);
9291 if (_PyUnicodeWriter_WriteStr(&writer, repunicode) < 0) {
9301 return _PyUnicodeWriter_Finish(&writer);
9304 _PyUnicodeWriter_Dealloc(&writer);
9474 * @writer: Unicode writer.
9485 * There are 2 modes: counting and filling. If @writer is NULL,
9491 * thousands_sep) into @writer.
9497 _PyUnicodeWriter *writer,
9508 if (writer) {
9552 if (writer) {
9553 buffer_pos = writer->pos + n_buffer;
9554 assert(buffer_pos <= PyUnicode_GET_LENGTH(writer->buffer));
9561 if (!writer) {
9575 /* Copy into the writer. */
9576 InsertThousandsGrouping_fill(writer, &buffer_pos,
9604 /* Copy into the writer. */
9605 InsertThousandsGrouping_fill(writer, &buffer_pos,
13732 _PyUnicodeWriter_Update(_PyUnicodeWriter *writer)
13734 writer->maxchar = PyUnicode_MAX_CHAR_VALUE(writer->buffer);
13735 writer->data = PyUnicode_DATA(writer->buffer);
13737 if (!writer->readonly) {
13738 writer->kind = PyUnicode_KIND(writer->buffer);
13739 writer->size = PyUnicode_GET_LENGTH(writer->buffer);
13744 writer->kind = PyUnicode_WCHAR_KIND;
13745 assert(writer->kind <= PyUnicode_1BYTE_KIND);
13750 writer->size = 0;
13755 _PyUnicodeWriter_Init(_PyUnicodeWriter *writer)
13757 memset(writer, 0, sizeof(*writer));
13760 writer->min_char = 127;
13764 writer->kind = PyUnicode_WCHAR_KIND;
13765 assert(writer->kind <= PyUnicode_1BYTE_KIND);
13770 _PyUnicodeWriter_InitWithBuffer(_PyUnicodeWriter *writer, PyObject *buffer)
13772 memset(writer, 0, sizeof(*writer));
13773 writer->buffer = buffer;
13774 _PyUnicodeWriter_Update(writer);
13775 writer->min_length = writer->size;
13779 _PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer,
13788 assert((maxchar > writer->maxchar && length >= 0)
13791 if (length > PY_SSIZE_T_MAX - writer->pos) {
13795 newlen = writer->pos + length;
13797 maxchar = Py_MAX(maxchar, writer->min_char);
13799 if (writer->buffer == NULL) {
13800 assert(!writer->readonly);
13801 if (writer->overallocate
13806 if (newlen < writer->min_length)
13807 newlen = writer->min_length;
13809 writer->buffer = PyUnicode_New(newlen, maxchar);
13810 if (writer->buffer == NULL)
13813 else if (newlen > writer->size) {
13814 if (writer->overallocate
13819 if (newlen < writer->min_length)
13820 newlen = writer->min_length;
13822 if (maxchar > writer->maxchar || writer->readonly) {
13824 maxchar = Py_MAX(maxchar, writer->maxchar);
13829 writer->buffer, 0, writer->pos);
13830 Py_DECREF(writer->buffer);
13831 writer->readonly = 0;
13834 newbuffer = resize_compact(writer->buffer, newlen);
13838 writer->buffer = newbuffer;
13840 else if (maxchar > writer->maxchar) {
13841 assert(!writer->readonly);
13842 newbuffer = PyUnicode_New(writer->size, maxchar);
13846 writer->buffer, 0, writer->pos);
13847 Py_SETREF(writer->buffer, newbuffer);
13849 _PyUnicodeWriter_Update(writer);
13856 _PyUnicodeWriter_PrepareKindInternal(_PyUnicodeWriter *writer,
13862 assert(writer->kind < kind);
13873 return _PyUnicodeWriter_PrepareInternal(writer, 0, maxchar);
13877 _PyUnicodeWriter_WriteCharInline(_PyUnicodeWriter *writer, Py_UCS4 ch)
13880 if (_PyUnicodeWriter_Prepare(writer, 1, ch) < 0)
13882 PyUnicode_WRITE(writer->kind, writer->data, writer->pos, ch);
13883 writer->pos++;
13888 _PyUnicodeWriter_WriteChar(_PyUnicodeWriter *writer, Py_UCS4 ch)
13890 return _PyUnicodeWriter_WriteCharInline(writer, ch);
13894 _PyUnicodeWriter_WriteStr(_PyUnicodeWriter *writer, PyObject *str)
13905 if (maxchar > writer->maxchar || len > writer->size - writer->pos) {
13906 if (writer->buffer == NULL && !writer->overallocate) {
13908 writer->readonly = 1;
13910 writer->buffer = str;
13911 _PyUnicodeWriter_Update(writer);
13912 writer->pos += len;
13915 if (_PyUnicodeWriter_PrepareInternal(writer, len, maxchar) == -1)
13918 _PyUnicode_FastCopyCharacters(writer->buffer, writer->pos,
13920 writer->pos += len;
13925 _PyUnicodeWriter_WriteSubstring(_PyUnicodeWriter *writer, PyObject *str,
13942 return _PyUnicodeWriter_WriteStr(writer, str);
13944 if (PyUnicode_MAX_CHAR_VALUE(str) > writer->maxchar)
13947 maxchar = writer->maxchar;
13950 if (_PyUnicodeWriter_Prepare(writer, len, maxchar) < 0)
13953 _PyUnicode_FastCopyCharacters(writer->buffer, writer->pos,
13955 writer->pos += len;
13960 _PyUnicodeWriter_WriteASCIIString(_PyUnicodeWriter *writer,
13968 if (writer->buffer == NULL && !writer->overallocate) {
13975 writer->readonly = 1;
13976 writer->buffer = str;
13977 _PyUnicodeWriter_Update(writer);
13978 writer->pos += len;
13982 if (_PyUnicodeWriter_Prepare(writer, len, 127) == -1)
13985 switch (writer->kind)
13990 Py_UCS1 *data = writer->data;
13992 memcpy(data + writer->pos, str, len);
14000 (Py_UCS2 *)writer->data + writer->pos);
14008 (Py_UCS4 *)writer->data + writer->pos);
14015 writer->pos += len;
14020 _PyUnicodeWriter_WriteLatin1String(_PyUnicodeWriter *writer,
14026 if (_PyUnicodeWriter_Prepare(writer, len, maxchar) == -1)
14028 unicode_write_cstr(writer->buffer, writer->pos, str, len);
14029 writer->pos += len;
14034 _PyUnicodeWriter_Finish(_PyUnicodeWriter *writer)
14038 if (writer->pos == 0) {
14039 Py_CLEAR(writer->buffer);
14043 str = writer->buffer;
14044 writer->buffer = NULL;
14046 if (writer->readonly) {
14047 assert(PyUnicode_GET_LENGTH(str) == writer->pos);
14051 if (PyUnicode_GET_LENGTH(str) != writer->pos) {
14053 str2 = resize_compact(str, writer->pos);
14066 _PyUnicodeWriter_Dealloc(_PyUnicodeWriter *writer)
14068 Py_CLEAR(writer->buffer);
14098 _PyUnicodeWriter writer;
14103 _PyUnicodeWriter_Init(&writer);
14104 ret = _PyUnicode_FormatAdvancedWriter(&writer,
14108 _PyUnicodeWriter_Dealloc(&writer);
14111 return _PyUnicodeWriter_Finish(&writer);
14333 _PyUnicodeWriter writer;
14363 /* Format a float into the writer if the writer is not NULL, or into *p_output
14370 _PyUnicodeWriter *writer)
14392 if (writer) {
14393 if (_PyUnicodeWriter_WriteASCIIString(writer, p, len) < 0) {
14551 * Return 1 if the number has been formatted into the writer,
14558 _PyUnicodeWriter *writer)
14613 if (_PyLong_FormatWriter(writer, v, base, alternate) == -1) {
14689 Return 1 if the argument has been written into ctx->writer,
14872 When possible, the output is written directly into the Unicode writer
14873 (ctx->writer). A string is created when padding is required.
14876 1 if the argument has been written into ctx->writer,
14884 _PyUnicodeWriter *writer = &ctx->writer;
14887 ctx->writer.overallocate = 0;
14900 if (_PyLong_FormatWriter(writer, v, 10, arg->flags & F_ALT) == -1)
14926 int ret = mainformatlong(v, arg, p_str, writer);
14943 if (formatfloat(v, arg, NULL, writer) == -1)
14960 if (_PyUnicodeWriter_WriteCharInline(writer, ch) < 0)
14996 _PyUnicodeWriter *writer = &ctx->writer;
15012 if (_PyUnicodeWriter_WriteStr(writer, str) == -1)
15046 /* Prepare the writer */
15047 maxchar = writer->maxchar;
15066 if (_PyUnicodeWriter_Prepare(writer, buflen, maxchar) == -1)
15072 PyUnicode_WRITE(writer->kind, writer->data, writer->pos, signchar);
15073 writer->pos += 1;
15086 PyUnicode_WRITE(writer->kind, writer->data, writer->pos, '0');
15087 PyUnicode_WRITE(writer->kind, writer->data, writer->pos+1, arg->ch);
15088 writer->pos += 2;
15100 unicode_fill(writer->kind, writer->data, fill, writer->pos, sublen);
15101 writer->pos += sublen;
15109 PyUnicode_WRITE(writer->kind, writer->data, writer->pos, signchar);
15110 writer->pos += 1;
15115 PyUnicode_WRITE(writer->kind, writer->data, writer->pos, '0');
15116 PyUnicode_WRITE(writer->kind, writer->data, writer->pos+1, arg->ch);
15117 writer->pos += 2;
15124 _PyUnicode_FastCopyCharacters(writer->buffer, writer->pos,
15126 writer->pos += len;
15132 unicode_fill(writer->kind, writer->data, ' ', writer->pos, sublen);
15133 writer->pos += sublen;
15151 if (_PyUnicodeWriter_WriteCharInline(&ctx->writer, '%') < 0)
15203 _PyUnicodeWriter_Init(&ctx.writer);
15204 ctx.writer.min_length = ctx.fmtcnt + 100;
15205 ctx.writer.overallocate = 1;
15234 ctx.writer.overallocate = 0;
15237 if (_PyUnicodeWriter_WriteSubstring(&ctx.writer, ctx.fmtstr,
15257 return _PyUnicodeWriter_Finish(&ctx.writer);
15260 _PyUnicodeWriter_Dealloc(&ctx.writer);