Lines Matching defs:bytes
85 static int utf8_lnw(int *width, char *s, int bytes)
92 length = utf8towc(&wc, s, bytes);
485 size_t bytes, pos = offset;
488 bytes = text_getline(toybuf, pos, ARRAY_LEN(toybuf));
489 if (!bytes) pos++; //empty line
491 else pos += bytes;
1310 //crunch_str with n bytes restriction for printing substrings or
1315 int columns = 0, col, bytes;
1319 for (end = start = *str; *end && n>0; columns += col, end += bytes, n -= bytes) {
1320 if ((bytes = utf8towc(&wc, end, 4))>0 && (col = wcwidth(wc))>=0) {
1323 if (out) fwrite(end, bytes, 1, out);
1329 if (bytes<1) {
1330 bytes = 1;
1337 } else if (out) fwrite(end, 1, bytes, out);
1350 int bytes = 0;
1377 bytes = text_getline(toybuf, SOL, ARRAY_LEN(toybuf));
1387 bytes = TT.cursor-SOL; // TT.cur_col;
1394 aw = crunch_nstr(&end, INT_MAX, bytes, 0, "\t\n", vi_crunch);
1416 aw -= crunch_nstr(&end, clip, bytes, 0, "\t\n", vi_crunch);
1426 aw -= crunch_nstr(&end, clip, bytes, 0, "\t\n", vi_crunch);
1431 x = crunch_nstr(&end, aw, bytes, stdout, "\t\n", vi_crunch);
1440 bytes = text_getline(toybuf, SSOL, ARRAY_LEN(toybuf));
1449 SSOL += bytes+1;
1450 bytes = text_getline(line, SSOL, ARRAY_LEN(toybuf));
1461 aw = crunch_nstr(&line, clip, bytes, 0, "\t\n", vi_crunch);
1466 if (SSOL+bytes < TT.filesize) {
1468 SSOL += bytes+1;
1469 bytes = text_getline(line, SSOL, ARRAY_LEN(toybuf));
1485 // TODO: real vi shows the percentage by lines, not bytes