#include "cache.h" static int fill_mmfile_blob(mmfile_t *f, struct blob *obj) { void *buf; unsigned long size; enum object_type type; buf = read_sha1_file(obj->object.sha1, &type, &size); if (!buf) return -1; if (type != OBJ_BLOB) return -1; f->ptr = buf; f->size = size; return 0; } static void free_mmfile(mmfile_t *f) { free(f->ptr); }