MCPcopy Index your code
hub / github.com/git/git / utf8_fprintf

Function utf8_fprintf

utf8.c:459–474  ·  view source on GitHub ↗

* Wrapper for fprintf and returns the total number of columns required * for the printed string, assuming that the string is utf8. */

Source from the content-addressed store, hash-verified

457 * for the printed string, assuming that the string is utf8.
458 */
459int utf8_fprintf(FILE *stream, const char *format, ...)
460{
461 struct strbuf buf = STRBUF_INIT;
462 va_list arg;
463 int columns;
464
465 va_start(arg, format);
466 strbuf_vaddf(&buf, format, arg);
467 va_end(arg);
468
469 columns = fputs(buf.buf, stream);
470 if (0 <= columns) /* keep the error from the I/O */
471 columns = utf8_strwidth(buf.buf);
472 strbuf_release(&buf);
473 return columns;
474}
475
476/*
477 * Given a buffer and its encoding, return it re-encoded

Callers 2

usage_arghFunction · 0.85

Calls 3

strbuf_vaddfFunction · 0.85
utf8_strwidthFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected