MCPcopy Create free account
hub / github.com/RsyncProject/rsync / send_all_trees

Function send_all_trees

zlib/trees.c:814–836  ·  view source on GitHub ↗

=========================================================================== * Send the header for a block using dynamic Huffman trees: the counts, the * lengths of the bit length codes, the literal tree and the distance tree. * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. */

Source from the content-addressed store, hash-verified

812 * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
813 */
814local void send_all_trees(deflate_state *s, int lcodes, int dcodes, int blcodes)
815{
816 int rank; /* index in bl_order */
817
818 Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
819 Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
820 "too many codes");
821 Tracev((stderr, "\nbl counts: "));
822 send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
823 send_bits(s, dcodes-1, 5);
824 send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */
825 for (rank = 0; rank < blcodes; rank++) {
826 Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
827 send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
828 }
829 Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
830
831 send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */
832 Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
833
834 send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */
835 Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
836}
837
838/* ===========================================================================
839 * Send a stored block

Callers 1

trees.cFile · 0.85

Calls 2

send_bitsFunction · 0.85
send_treeFunction · 0.85

Tested by

no test coverage detected