Lines Matching defs:tnf

39 	TNF 		*tnf;
61 if ((tnf = (TNF*)calloc(1, sizeof (*tnf))) == (TNF*)NULL)
64 tnf->file_magic = magic;
65 tnf->file_native = native;
66 tnf->file_start = base;
67 tnf->file_size = size;
68 tnf->file_end = base + size;
76 tnf->file_header = fhdr;
79 p = _tnf_get_slot_named(tnf, fhdr, TNF_N_BLOCK_SIZE);
81 tnf->block_size = _GET_UINT32(tnf, (tnf_uint32_t *)p);
84 p = _tnf_get_slot_named(tnf, fhdr, TNF_N_DIRECTORY_SIZE);
86 tnf->directory_size = _GET_UINT32(tnf, (tnf_uint32_t *)p);
89 p = _tnf_get_slot_named(tnf, fhdr, TNF_N_BLOCK_COUNT);
91 tnf->block_count = _GET_UINT32(tnf, (tnf_uint32_t *)p);
96 tnf->block_count -= tnf->directory_size / tnf->block_size;
103 tmpsz = tnf->directory_size + tnf->block_count * tnf->block_size;
109 tnf->file_size = tmpsz;
110 tnf->file_end = base + tmpsz;
116 while (tmpsz != tnf->block_size) {
118 tnf->block_shift++;
122 tnf->block_mask = ~(tnf->block_size - 1);
125 p = _tnf_get_slot_named(tnf, fhdr, TNF_N_FILE_LOGICAL_SIZE);
127 tnf->generation_shift = _GET_UINT32(tnf, (tnf_uint32_t *)p);
135 tnf->address_mask = 0xffffffff;
136 tnf->address_mask <<= tnf->generation_shift;
137 tnf->address_mask = ~(tnf->address_mask);
144 tnf->data_start = tnf->file_start + tnf->directory_size;
146 bhdr = (tnf_ref32_t *)tnf->data_start;
149 genp = _tnf_get_slot_named(tnf, bhdr, TNF_N_GENERATION);
150 tnf->block_generation_offset = genp - (caddr_t)bhdr;
153 bvp = _tnf_get_slot_named(tnf, bhdr, TNF_N_BYTES_VALID);
154 tnf->block_bytes_valid_offset = bvp - (caddr_t)bhdr;
160 if ((err = _tnf_init_tags(tnf)) != TNF_ERR_NONE)
163 tnf->file_header_info = _tnf_get_info(tnf, _tnf_get_tag(tnf, fhdr));
164 tnf->block_header_info = _tnf_get_info(tnf, _tnf_get_tag(tnf, bhdr));
170 *tnfret = tnf;
179 tnf_reader_end(TNF *tnf)
184 if ((err = _tnf_fini_tags(tnf)) != TNF_ERR_NONE)
188 free(tnf);