MCPcopy Create free account
hub / github.com/git/git / block_writer_init

Function block_writer_init

reftable/block.c:73–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73int block_writer_init(struct block_writer *bw, uint8_t typ, uint8_t *block,
74 uint32_t block_size, uint32_t header_off, uint32_t hash_size)
75{
76 bw->block = block;
77 bw->hash_size = hash_size;
78 bw->block_size = block_size;
79 bw->header_off = header_off;
80 bw->block[header_off] = typ;
81 bw->next = header_off + 4;
82 bw->restart_interval = 16;
83 bw->entries = 0;
84 bw->restart_len = 0;
85 bw->last_key.len = 0;
86 if (!bw->zstream) {
87 REFTABLE_CALLOC_ARRAY(bw->zstream, 1);
88 if (!bw->zstream)
89 return REFTABLE_OUT_OF_MEMORY_ERROR;
90 deflateInit(bw->zstream, 9);
91 }
92
93 return 0;
94}
95
96uint8_t block_writer_type(struct block_writer *bw)
97{

Calls

no outgoing calls