Lines Matching refs:file

17     // local file header

34 read_central_dir_values(Zipfile* file, const unsigned char* buf, int len)
37 // looks like ZIP file got truncated
43 file->disknum = read_le_short(&buf[0x04]);
44 file->diskWithCentralDir = read_le_short(&buf[0x06]);
45 file->entryCount = read_le_short(&buf[0x08]);
46 file->totalEntryCount = read_le_short(&buf[0x0a]);
47 file->centralDirSize = read_le_int(&buf[0x0c]);
48 file->centralDirOffest = read_le_int(&buf[0x10]);
49 file->commentLen = read_le_short(&buf[0x14]);
51 if (file->commentLen > 0) {
52 if (EOCD_LEN + file->commentLen > len) {
54 EOCD_LEN, file->commentLen, len);
57 file->comment = buf + EOCD_LEN;
64 read_central_directory_entry(Zipfile* file, Zipentry* entry,
146 // but the one in the local file header also contains some padding.
147 p = file->buf + localHeaderRelOffset;
152 entry->data = file->buf + dataOffset;
154 printf("file->buf=%p entry->data=%p dataOffset=%x localHeaderRelOffset=%d "
156 file->buf, entry->data, dataOffset, localHeaderRelOffset,
168 * central directory at the end of the file.
181 read_central_dir(Zipfile *file)
185 const unsigned char* buf = file->buf;
186 ssize_t bufsize = file->bufsize;
219 err = read_central_dir_values(file, eocd, (buf+bufsize)-eocd);
224 if (file->disknum != 0
225 || file->diskWithCentralDir != 0
226 || file->entryCount != file->totalEntryCount) {
232 p = buf + file->centralDirOffest;
234 for (i=0; i < file->totalEntryCount; i++) {
238 err = read_central_directory_entry(file, entry, &p, &len);
246 entry->next = file->entries;
247 file->entries = entry;