Lines Matching refs:bytes_read
36 static int hscroll = 0, fd, file_size, bytes_read, begin_reached = 1,
82 if ((bytes_read = read(fd, buf, BUF_SIZE)) == -1) {
86 buf[bytes_read] = '\0'; /* mark end of valid data */
171 if (fpos > bytes_read) { /* Yes, we have to read it in */
177 if ((bytes_read = read(fd, buf, BUF_SIZE)) == -1) {
182 buf[bytes_read] = '\0';
208 if ((bytes_read = read(fd, buf, BUF_SIZE)) == -1) {
213 buf[bytes_read] = '\0';
215 page = buf + bytes_read;
363 fpos -= bytes_read;
387 if ((bytes_read = read(fd, buf, BUF_SIZE)) == -1) {
392 buf[bytes_read] = '\0';
451 if (fpos > bytes_read) { /* Not beginning of file yet */
457 if (fpos < BUF_SIZE/2 + bytes_read) {
464 page = buf + fpos - bytes_read;
467 if (lseek(fd, -(BUF_SIZE/2 + bytes_read), SEEK_CUR) == -1) {
474 if ((bytes_read = read(fd, buf, BUF_SIZE)) == -1) {
479 buf[bytes_read] = '\0';
503 if (fpos > bytes_read) {
505 if (fpos < BUF_SIZE/2 + bytes_read) {
512 page = buf + fpos - bytes_read;
515 if (lseek(fd, -(BUF_SIZE/2 + bytes_read), SEEK_CUR) == -1) {
522 if ((bytes_read = read(fd, buf, BUF_SIZE)) == -1) {
527 buf[bytes_read] = '\0';
608 if ((bytes_read = read(fd, buf, BUF_SIZE)) == -1) {
613 buf[bytes_read] = '\0';
695 percent = !file_size ? 100 : ((fpos-bytes_read+page-buf)*100)/file_size;