Blame


1 ad242220 2018-09-08 stsp /*
2 5aa81393 2020-01-06 stsp * Copyright (c) 2018, 2019, 2020 Stefan Sperling <stsp@openbsd.org>
3 ad242220 2018-09-08 stsp *
4 ad242220 2018-09-08 stsp * Permission to use, copy, modify, and distribute this software for any
5 ad242220 2018-09-08 stsp * purpose with or without fee is hereby granted, provided that the above
6 ad242220 2018-09-08 stsp * copyright notice and this permission notice appear in all copies.
7 ad242220 2018-09-08 stsp *
8 ad242220 2018-09-08 stsp * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 ad242220 2018-09-08 stsp * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 ad242220 2018-09-08 stsp * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 ad242220 2018-09-08 stsp * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 ad242220 2018-09-08 stsp * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 ad242220 2018-09-08 stsp * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 ad242220 2018-09-08 stsp * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 ad242220 2018-09-08 stsp */
16 ad242220 2018-09-08 stsp
17 3022d272 2019-11-14 stsp struct got_pathlist_head;
18 3022d272 2019-11-14 stsp
19 01986ce9 2023-02-07 thomas /*
20 01986ce9 2023-02-07 thomas * Write the string representation fo an object ID in the given buffer.
21 01986ce9 2023-02-07 thomas * This buffer must be at least GOT_OBJECT_ID_HEX_MAXLEN bytes in size.
22 01986ce9 2023-02-07 thomas * The output depneds on the hash function used by the repository format.
23 01986ce9 2023-02-07 thomas */
24 01986ce9 2023-02-07 thomas char *got_object_id_hex(struct got_object_id *, char *, size_t);
25 01986ce9 2023-02-07 thomas
26 6d7eb4f7 2023-04-04 thomas const struct got_error *got_object_type_label(const char **, int);
27 6d7eb4f7 2023-04-04 thomas
28 5df4932d 2018-11-05 stsp const struct got_error *got_object_qid_alloc_partial(struct got_object_qid **);
29 ad242220 2018-09-08 stsp struct got_commit_object *got_object_commit_alloc_partial(void);
30 ad242220 2018-09-08 stsp struct got_tree_entry *got_alloc_tree_entry_partial(void);
31 ebc55e2d 2018-12-24 stsp
32 ad242220 2018-09-08 stsp const struct got_error *got_object_parse_commit(struct got_commit_object **,
33 ad242220 2018-09-08 stsp char *, size_t);
34 3efd8e31 2022-10-23 thomas const struct got_error *got_object_read_commit(struct got_commit_object **, int,
35 3efd8e31 2022-10-23 thomas struct got_object_id *, size_t);
36 3022d272 2019-11-14 stsp
37 3022d272 2019-11-14 stsp struct got_parsed_tree_entry {
38 78e7b7b8 2022-05-19 thomas const char *name; /* Points to name in parsed buffer */
39 78e7b7b8 2022-05-19 thomas size_t namelen; /* strlen(name) */
40 3022d272 2019-11-14 stsp mode_t mode; /* Mode parsed from tree buffer. */
41 3022d272 2019-11-14 stsp uint8_t *id; /* Points to ID in parsed tree buffer. */
42 3022d272 2019-11-14 stsp };
43 78e7b7b8 2022-05-19 thomas const struct got_error *got_object_parse_tree(struct got_parsed_tree_entry **,
44 c77e00b3 2022-10-18 thomas size_t *, size_t *, uint8_t *, size_t);
45 3efd8e31 2022-10-23 thomas const struct got_error *got_object_read_tree(struct got_parsed_tree_entry **,
46 3efd8e31 2022-10-23 thomas size_t *, size_t *, uint8_t **, int, struct got_object_id *);
47 3022d272 2019-11-14 stsp
48 f4a881ce 2018-11-17 stsp const struct got_error *got_object_parse_tag(struct got_tag_object **,
49 f4a881ce 2018-11-17 stsp uint8_t *, size_t);
50 946e0798 2022-11-06 thomas const struct got_error *got_object_read_tag(struct got_tag_object **, int,
51 3efd8e31 2022-10-23 thomas struct got_object_id *, size_t);
52 ad242220 2018-09-08 stsp const struct got_error *got_read_file_to_mem(uint8_t **, size_t *, FILE *);
53 ad242220 2018-09-08 stsp
54 876c234b 2018-09-10 stsp struct got_pack;
55 876c234b 2018-09-10 stsp struct got_packidx;
56 d5c81d44 2021-07-08 stsp struct got_inflate_checksum;
57 876c234b 2018-09-10 stsp
58 48b4f239 2021-12-31 thomas const struct got_error *got_object_parse_header(struct got_object **, char *,
59 48b4f239 2021-12-31 thomas size_t);
60 1785f84a 2018-12-23 stsp const struct got_error *got_object_read_header(struct got_object **, int);
61 3efd8e31 2022-10-23 thomas const struct got_error *got_object_read_raw(uint8_t **, off_t *,
62 3efd8e31 2022-10-23 thomas size_t *, size_t, int, struct got_object_id *, int);