Lines Matching refs:len
52 int len = strlen(s); in bootimage_add_string() local
54 if (len > 59) return NULL; in bootimage_add_string()
62 bootentry_file *bootimage_add_filedata(bootimage *img, unsigned type, void *data, unsigned len) { in bootimage_add_filedata() argument
73 img->entry[n].file.length = len; in bootimage_add_filedata()
74 SHA256_hash(data, len, img->entry[n].file.sha256); in bootimage_add_filedata()
78 img->length[n] = len; in bootimage_add_filedata()
80 img->next_offset += len; in bootimage_add_filedata()
95 static int writex(int fd, void *data, size_t len) { in writex() argument
98 while (len > 0) { in writex()
99 r = write(fd, x, len); in writex()
106 len -= r; in writex()
140 static void *load_file(const char *fn, size_t *len) { in load_file() argument
161 if (len) { in load_file()
162 *len = sz; in load_file()
188 size_t len; in bootimage_add_file() local
190 if ((data = load_file(fn, &len)) == NULL) { in bootimage_add_file()
200 if (len < sizeof(pat)) { in bootimage_add_file()
206 for (i = 0; i < len - sizeof(pat); i++) { in bootimage_add_file()
209 memmove(data, data + i, len - i); in bootimage_add_file()
210 len -= i; in bootimage_add_file()
218 for (i = 0; i < len / 4; i++) { in bootimage_add_file()
225 return bootimage_add_filedata(img, type, data, len); in bootimage_add_file()