Lines Matching refs:temp
469 } temp;
806 * Flush pending filtered data from temp to the output buffer.
808 * data to the beginning of temp.
814 copy_size = minof(s->temp.filtered, b->out_size - b->out_pos);
815 memcpy(b->out + b->out_pos, s->temp.buf, copy_size);
818 s->temp.filtered -= copy_size;
819 s->temp.size -= copy_size;
820 memmove(s->temp.buf, s->temp.buf + copy_size, s->temp.size);
839 if (s->temp.filtered > 0) {
841 if (s->temp.filtered > 0)
850 * temp, copy the unfiltered data from temp to the output buffer
854 * to temp and rewind the output buffer position accordingly.
856 * This needs to be always run when temp.size == 0 to handle a special
860 if (s->temp.size < b->out_size - b->out_pos || s->temp.size == 0) {
862 memcpy(b->out + b->out_pos, s->temp.buf, s->temp.size);
863 b->out_pos += s->temp.size;
880 s->temp.size = b->out_pos - out_start;
881 b->out_pos -= s->temp.size;
882 memcpy(s->temp.buf, b->out + b->out_pos, s->temp.size);
887 * to try decoding more data to temp.
889 if (b->out_pos + s->temp.size < b->out_size)
894 * We have unfiltered data in temp. If the output buffer isn't full
895 * yet, try to fill the temp buffer by decoding more data from the
896 * next filter. Apply the BCJ filter on temp. Then we hopefully can
897 * fill the actual output buffer by copying filtered data from temp.
898 * A mix of filtered and unfiltered data may be left in temp; it will
902 /* Make b->out{,_pos,_size} temporarily point to s->temp. */
906 b->out = s->temp.buf;
907 b->out_pos = s->temp.size;
908 b->out_size = sizeof(s->temp.buf);
912 s->temp.size = b->out_pos;
920 bcj_apply(s, s->temp.buf, &s->temp.filtered, s->temp.size);
928 s->temp.filtered = s->temp.size;
931 if (s->temp.filtered > 0)
970 s->temp.filtered = 0;
971 s->temp.size = 0;
1263 * temp.buf or the caller-provided input buffer.
1431 } temp;
1984 * s->temp.buf, which (hopefully) gets filled on the next call to this
1994 if (s->temp.size > 0 || s->lzma2.compressed == 0) {
1995 tmp = 2 * LZMA_IN_REQUIRED - s->temp.size;
1996 if (tmp > s->lzma2.compressed - s->temp.size)
1997 tmp = s->lzma2.compressed - s->temp.size;
2001 memcpy(s->temp.buf + s->temp.size, b->in + b->in_pos, tmp);
2003 if (s->temp.size + tmp == s->lzma2.compressed) {
2004 memset(s->temp.buf + s->temp.size + tmp, 0,
2005 sizeof(s->temp.buf)
2006 - s->temp.size - tmp);
2007 s->rc.in_limit = s->temp.size + tmp;
2008 } else if (s->temp.size + tmp < LZMA_IN_REQUIRED) {
2009 s->temp.size += tmp;
2013 s->rc.in_limit = s->temp.size + tmp - LZMA_IN_REQUIRED;
2016 s->rc.in = s->temp.buf;
2019 if (!lzma_main(s) || s->rc.in_pos > s->temp.size + tmp)
2024 if (s->rc.in_pos < s->temp.size) {
2025 s->temp.size -= s->rc.in_pos;
2026 memmove(s->temp.buf, s->temp.buf + s->rc.in_pos,
2027 s->temp.size);
2031 b->in_pos += s->rc.in_pos - s->temp.size;
2032 s->temp.size = 0;
2060 memcpy(s->temp.buf, b->in + b->in_pos, in_avail);
2061 s->temp.size = in_avail;
2224 && s->temp.size
2285 s->temp.size = 0;
2458 } temp;
2479 * Fill s->temp by copying data starting from b->in[b->in_pos]. Caller
2480 * must have set s->temp.pos to indicate how much data we are supposed
2481 * to copy into s->temp.buf. Return true once s->temp.pos has reached
2482 * s->temp.size.
2486 size_t copy_size = minof(b->in_size - b->in_pos, s->temp.size - s->temp.pos);
2488 memcpy(s->temp.buf + s->temp.pos, b->in + b->in_pos, copy_size);
2490 s->temp.pos += copy_size;
2492 if (s->temp.pos == s->temp.size) {
2493 s->temp.pos = 0;
2719 if (!memeq(s->temp.buf, HEADER_MAGIC, HEADER_MAGIC_SIZE))
2722 if (xz_crc32(s->temp.buf + HEADER_MAGIC_SIZE, 2, 0)
2723 != get_le32(s->temp.buf + HEADER_MAGIC_SIZE + 2))
2726 if (s->temp.buf[HEADER_MAGIC_SIZE] != 0)
2736 s->check_type = s->temp.buf[HEADER_MAGIC_SIZE + 1];
2750 if (!memeq(s->temp.buf + 10, FOOTER_MAGIC, FOOTER_MAGIC_SIZE))
2753 if (xz_crc32(s->temp.buf + 4, 6, 0) != get_le32(s->temp.buf))
2761 if ((s->index.size >> 2) != get_le32(s->temp.buf + 4))
2764 if (s->temp.buf[8] != 0 || s->temp.buf[9] != s->check_type)
2780 * Validate the CRC32. We know that the temp buffer is at least
2783 s->temp.size -= 4;
2784 if (xz_crc32(s->temp.buf, s->temp.size, 0)
2785 != get_le32(s->temp.buf + s->temp.size))
2788 s->temp.pos = 2;
2795 if (s->temp.buf[1] & 0x3E)
2797 if (s->temp.buf[1] & 0x3F)
2802 if (s->temp.buf[1] & 0x40) {
2803 if (dec_vli(s, s->temp.buf, &s->temp.pos, s->temp.size)
2813 if (s->temp.buf[1] & 0x80) {
2814 if (dec_vli(s, s->temp.buf, &s->temp.pos, s->temp.size)
2825 s->bcj_active = s->temp.buf[1] & 0x01;
2827 if (s->temp.size - s->temp.pos < 2)
2830 ret = xz_dec_bcj_reset(s->bcj, s->temp.buf[s->temp.pos++]);
2838 if (s->temp.buf[s->temp.pos++] != 0x00)
2844 if (s->temp.size - s->temp.pos < 2)
2848 if (s->temp.buf[s->temp.pos++] != 0x21)
2852 if (s->temp.buf[s->temp.pos++] != 0x01)
2856 if (s->temp.size - s->temp.pos < 1)
2859 ret = xz_dec_lzma2_reset(s->lzma2, s->temp.buf[s->temp.pos++]);
2864 while (s->temp.pos < s->temp.size)
2865 if (s->temp.buf[s->temp.pos++] != 0x00)
2868 s->temp.pos = 0;
2889 * Stream Header is copied to s->temp, and then
2931 s->temp.size = s->block_header.size;
2932 s->temp.pos = 0;
3024 s->temp.size = STREAM_HEADER_SIZE;
3121 s->temp.pos = 0;
3122 s->temp.size = STREAM_HEADER_SIZE;