Blame


1 32cb896c 2018-03-11 stsp /*
2 32cb896c 2018-03-11 stsp * Copyright (c) 2018 Stefan Sperling <stsp@openbsd.org>
3 32cb896c 2018-03-11 stsp *
4 32cb896c 2018-03-11 stsp * Permission to use, copy, modify, and distribute this software for any
5 32cb896c 2018-03-11 stsp * purpose with or without fee is hereby granted, provided that the above
6 32cb896c 2018-03-11 stsp * copyright notice and this permission notice appear in all copies.
7 32cb896c 2018-03-11 stsp *
8 32cb896c 2018-03-11 stsp * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 32cb896c 2018-03-11 stsp * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 32cb896c 2018-03-11 stsp * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 32cb896c 2018-03-11 stsp * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 32cb896c 2018-03-11 stsp * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 32cb896c 2018-03-11 stsp * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 32cb896c 2018-03-11 stsp * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 32cb896c 2018-03-11 stsp */
16 32cb896c 2018-03-11 stsp
17 32cb896c 2018-03-11 stsp struct got_object_id {
18 32cb896c 2018-03-11 stsp u_int8_t sha1[SHA1_DIGEST_LENGTH];
19 32cb896c 2018-03-11 stsp };
20 32cb896c 2018-03-11 stsp
21 32cb896c 2018-03-11 stsp struct got_object {
22 32cb896c 2018-03-11 stsp int type;
23 32cb896c 2018-03-11 stsp int flags;
24 32cb896c 2018-03-11 stsp #define GOT_OBJ_FLAG_PACKED 0x01
25 32cb896c 2018-03-11 stsp #define GOT_OBJ_FLAG_DELTIFIED 0x02
26 32cb896c 2018-03-11 stsp
27 32cb896c 2018-03-11 stsp size_t hdrlen;
28 32cb896c 2018-03-11 stsp size_t size;
29 32cb896c 2018-03-11 stsp struct got_object_id id;
30 32cb896c 2018-03-11 stsp
31 32cb896c 2018-03-11 stsp char *path_packfile; /* if packed */
32 32cb896c 2018-03-11 stsp off_t pack_offset; /* if packed */
33 32cb896c 2018-03-11 stsp struct got_delta_chain deltas; /* if deltified */
34 32cb896c 2018-03-11 stsp };
35 32cb896c 2018-03-11 stsp
36 32cb896c 2018-03-11 stsp struct got_blob_object {
37 32cb896c 2018-03-11 stsp FILE *f;
38 32cb896c 2018-03-11 stsp struct got_zstream_buf zb;
39 32cb896c 2018-03-11 stsp size_t hdrlen;
40 32cb896c 2018-03-11 stsp size_t blocksize;
41 32cb896c 2018-03-11 stsp uint8_t *read_buf;
42 32cb896c 2018-03-11 stsp int flags;
43 32cb896c 2018-03-11 stsp #define GOT_BLOB_F_COMPRESSED 0x01
44 32cb896c 2018-03-11 stsp struct got_object_id id;
45 32cb896c 2018-03-11 stsp };