| const char *blob_type = "blob"; |
| struct blob *lookup_blob(const unsigned char *sha1) |
| struct object *obj = lookup_object(sha1); |
| return create_object(sha1, OBJ_BLOB, alloc_blob_node()); |
| if (obj->type != OBJ_BLOB) { |
| error("Object %s is a %s, not a blob", |
| sha1_to_hex(sha1), typename(obj->type)); |
| return (struct blob *) obj; |
| int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size) |
| int parse_blob(struct blob *item) |
| buffer = read_sha1_file(item->object.sha1, &type, &size); |
| return error("Could not read %s", |
| sha1_to_hex(item->object.sha1)); |
| return error("Object %s not a blob", |
| sha1_to_hex(item->object.sha1)); |
| ret = parse_blob_buffer(item, buffer, size); |