Lines Matching refs:tmp

616   LBUFFER *first, *last, *tmp;  in pipe_lines()  local
624 tmp = xmalloc (sizeof (LBUFFER)); in pipe_lines()
629 n_read = safe_read (fd, tmp->buffer, BUFSIZ); in pipe_lines()
632 tmp->nbytes = n_read; in pipe_lines()
634 tmp->nlines = 0; in pipe_lines()
635 tmp->next = nullptr; in pipe_lines()
639 char const *buffer_end = tmp->buffer + n_read; in pipe_lines()
640 char const *p = tmp->buffer; in pipe_lines()
644 ++tmp->nlines; in pipe_lines()
647 total_lines += tmp->nlines; in pipe_lines()
652 if (tmp->nbytes + last->nbytes < BUFSIZ) in pipe_lines()
654 memcpy (&last->buffer[last->nbytes], tmp->buffer, tmp->nbytes); in pipe_lines()
655 last->nbytes += tmp->nbytes; in pipe_lines()
656 last->nlines += tmp->nlines; in pipe_lines()
665 last = last->next = tmp; in pipe_lines()
668 tmp = first; in pipe_lines()
673 tmp = xmalloc (sizeof (LBUFFER)); in pipe_lines()
677 free (tmp); in pipe_lines()
703 for (tmp = first; total_lines - tmp->nlines > n_lines; tmp = tmp->next) in pipe_lines()
704 total_lines -= tmp->nlines; in pipe_lines()
708 char const *beg = tmp->buffer; in pipe_lines()
709 char const *buffer_end = tmp->buffer + tmp->nbytes; in pipe_lines()
725 for (tmp = tmp->next; tmp; tmp = tmp->next) in pipe_lines()
726 xwrite_stdout (tmp->buffer, tmp->nbytes); in pipe_lines()
731 tmp = first->next; in pipe_lines()
733 first = tmp; in pipe_lines()
753 CBUFFER *first, *last, *tmp; in pipe_bytes() local
762 tmp = xmalloc (sizeof (CBUFFER)); in pipe_bytes()
767 n_read = safe_read (fd, tmp->buffer, BUFSIZ); in pipe_bytes()
771 tmp->nbytes = n_read; in pipe_bytes()
772 tmp->next = nullptr; in pipe_bytes()
774 total_bytes += tmp->nbytes; in pipe_bytes()
778 if (tmp->nbytes + last->nbytes < BUFSIZ) in pipe_bytes()
780 memcpy (&last->buffer[last->nbytes], tmp->buffer, tmp->nbytes); in pipe_bytes()
781 last->nbytes += tmp->nbytes; in pipe_bytes()
790 last = last->next = tmp; in pipe_bytes()
793 tmp = first; in pipe_bytes()
799 tmp = xmalloc (sizeof (CBUFFER)); in pipe_bytes()
804 free (tmp); in pipe_bytes()
815 for (tmp = first; total_bytes - tmp->nbytes > n_bytes; tmp = tmp->next) in pipe_bytes()
816 total_bytes -= tmp->nbytes; in pipe_bytes()
824 xwrite_stdout (&tmp->buffer[i], tmp->nbytes - i); in pipe_bytes()
826 for (tmp = tmp->next; tmp; tmp = tmp->next) in pipe_bytes()
827 xwrite_stdout (tmp->buffer, tmp->nbytes); in pipe_bytes()
832 tmp = first->next; in pipe_bytes()
834 first = tmp; in pipe_bytes()