Lines Matching +full:offset +full:- +full:y
1 /*-
2 * Copyright 2003-2005 Colin Percival
49 off_t y; in offtin() local
51 y = buf[7] & 0x7F; in offtin()
52 y = y * 256; y += buf[6]; in offtin()
53 y = y * 256; y += buf[5]; in offtin()
54 y = y * 256; y += buf[4]; in offtin()
55 y = y * 256; y += buf[3]; in offtin()
56 y = y * 256; y += buf[2]; in offtin()
57 y = y * 256; y += buf[1]; in offtin()
58 y = y * 256; y += buf[0]; in offtin()
60 if (buf[7] & 0x80) y = -y; in offtin()
62 return y; in offtin()
66 * -1 patching error,
71 int do_patch_rkimg(const char *img, ssize_t offset, ssize_t size, in do_patch_rkimg() argument
86 // "DIFF:%-15s:%-12s:%-12s:%-32s:" in do_patch_rkimg()
112 return -1; in do_patch_rkimg()
114 if (lseek(fd_img, offset + size - TAIL_SIZE, SEEK_SET) < 0) { in do_patch_rkimg()
116 offset + size - TAIL_SIZE, strerror(errno)); in do_patch_rkimg()
118 return -1; in do_patch_rkimg()
122 ret = read(fd_img, tail + len, TAIL_SIZE - len); in do_patch_rkimg()
126 return -1; in do_patch_rkimg()
132 tail[TAIL_SIZE - 1] = '\0'; in do_patch_rkimg()
166 return -1; in do_patch_rkimg()
169 //TODO: check dst_file dir size, return -1 if space too small. in do_patch_rkimg()
174 return -1; in do_patch_rkimg()
176 if (fseeko(f, offset, SEEK_SET)) { in do_patch_rkimg()
179 return -1; in do_patch_rkimg()
186 16 8 Y in do_patch_rkimg()
189 32+X Y bzip2(diff block) in do_patch_rkimg()
190 32+X+Y ??? bzip2(extra block) in do_patch_rkimg()
191 with control block a set of triples (x,y,z) meaning "add x bytes in do_patch_rkimg()
192 from oldfile to x bytes from the diff block; copy y bytes from the in do_patch_rkimg()
200 return -1; in do_patch_rkimg()
208 return -1; in do_patch_rkimg()
217 return -1; in do_patch_rkimg()
220 /* re-open patch file via libbzip2 at the right places */ in do_patch_rkimg()
222 return -1; in do_patch_rkimg()
223 if (fseeko(cpf, offset + 32, SEEK_SET)) { in do_patch_rkimg()
224 LOGE("fseeko(%s, %lld) err\n", img, (long long)(32 + offset)); in do_patch_rkimg()
233 if (fseeko(dpf, offset + 32 + bzctrllen, SEEK_SET)) { in do_patch_rkimg()
235 (long long)(offset + 32 + bzctrllen)); in do_patch_rkimg()
246 if (fseeko(epf, offset + 32 + bzctrllen + bzdatalen, SEEK_SET)) { in do_patch_rkimg()
248 (long long)(offset + 32 + bzctrllen + bzdatalen)); in do_patch_rkimg()
263 fd = -1; in do_patch_rkimg()
267 (lseek(fd, newsize - 1, SEEK_SET) != (newsize - 1)) || in do_patch_rkimg()
276 fd = -1; in do_patch_rkimg()
291 /* Sanity-check */ in do_patch_rkimg()
293 LOGE("Sanity-check: Corrupt patch\n"); in do_patch_rkimg()
314 /* Sanity-check */ in do_patch_rkimg()
316 LOGE("Sanity-check: Corrupt patch\n"); in do_patch_rkimg()
347 return -1; in do_patch_rkimg()
365 return -1; in do_patch_rkimg()