2 a1fd68d8 2018-01-12 stsp * Copyright (c) 2018 Stefan Sperling <stsp@openbsd.org>
4 7b19e0f1 2017-11-05 stsp * Permission to use, copy, modify, and distribute this software for any
5 7b19e0f1 2017-11-05 stsp * purpose with or without fee is hereby granted, provided that the above
6 7b19e0f1 2017-11-05 stsp * copyright notice and this permission notice appear in all copies.
8 7b19e0f1 2017-11-05 stsp * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 7b19e0f1 2017-11-05 stsp * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 7b19e0f1 2017-11-05 stsp * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 7b19e0f1 2017-11-05 stsp * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 7b19e0f1 2017-11-05 stsp * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 7b19e0f1 2017-11-05 stsp * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 7b19e0f1 2017-11-05 stsp * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 59ece79d 2018-02-12 stsp struct got_object_id;
19 f934cf2c 2018-02-12 stsp struct got_blob_object;
21 0ffeb3c2 2017-11-26 stsp struct got_tree_entry {
22 0ffeb3c2 2017-11-26 stsp SIMPLEQ_ENTRY(got_tree_entry) entry;
23 0ffeb3c2 2017-11-26 stsp mode_t mode;
25 59ece79d 2018-02-12 stsp struct got_object_id *id;
28 d1cda826 2017-11-06 stsp struct got_tree_object {
29 0ffeb3c2 2017-11-26 stsp int nentries;
30 0ffeb3c2 2017-11-26 stsp SIMPLEQ_HEAD(, got_tree_entry) entries;
33 d1cda826 2017-11-06 stsp struct got_parent_id {
34 d1cda826 2017-11-06 stsp SIMPLEQ_ENTRY(got_parent_id) entry;
35 59ece79d 2018-02-12 stsp struct got_object_id *id;
38 d1cda826 2017-11-06 stsp SIMPLEQ_HEAD(got_parent_id_list, got_parent_id);
40 d1cda826 2017-11-06 stsp struct got_commit_object {
41 59ece79d 2018-02-12 stsp struct got_object_id *tree_id;
42 d1cda826 2017-11-06 stsp unsigned int nparents;
43 d1cda826 2017-11-06 stsp SIMPLEQ_HEAD(, got_parent_id) parent_ids;
44 d1cda826 2017-11-06 stsp char *author;
45 d1cda826 2017-11-06 stsp char *committer;
46 d1cda826 2017-11-06 stsp char *logmsg;
49 eef6493a 2018-01-19 stsp struct got_object;
50 9b1d5162 2017-12-03 stsp #define GOT_OBJ_TYPE_COMMIT 1
51 9b1d5162 2017-12-03 stsp #define GOT_OBJ_TYPE_TREE 2
52 9b1d5162 2017-12-03 stsp #define GOT_OBJ_TYPE_BLOB 3
53 9b1d5162 2017-12-03 stsp #define GOT_OBJ_TYPE_TAG 4
54 f9a4270b 2017-12-03 stsp /* 5 is reserved */
55 9b1d5162 2017-12-03 stsp #define GOT_OBJ_TYPE_OFFSET_DELTA 6
56 9b1d5162 2017-12-03 stsp #define GOT_OBJ_TYPE_REF_DELTA 7
58 ab9a70b2 2017-11-06 stsp struct got_repository;
60 a1fd68d8 2018-01-12 stsp char *got_object_id_str(struct got_object_id *, char *, size_t);
61 59ece79d 2018-02-12 stsp const struct got_error *got_parse_object_id(struct got_object_id **, const char *);
62 a1fd68d8 2018-01-12 stsp int got_object_id_cmp(struct got_object_id *, struct got_object_id *);
63 b107e67f 2018-01-19 stsp int got_object_get_type(struct got_object *);
64 ab9a70b2 2017-11-06 stsp const struct got_error *got_object_open(struct got_object **,
65 ab9a70b2 2017-11-06 stsp struct got_repository *, struct got_object_id *);
66 ab9a70b2 2017-11-06 stsp void got_object_close(struct got_object *);
67 d1cda826 2017-11-06 stsp const struct got_error *got_object_commit_open(struct got_commit_object **,
68 d1cda826 2017-11-06 stsp struct got_repository *, struct got_object *);
69 d1cda826 2017-11-06 stsp void got_object_commit_close(struct got_commit_object *);
70 0ffeb3c2 2017-11-26 stsp const struct got_error *got_object_tree_open(struct got_tree_object **,
71 0ffeb3c2 2017-11-26 stsp struct got_repository *, struct got_object *);
72 0ffeb3c2 2017-11-26 stsp void got_object_tree_close(struct got_tree_object *);
73 68482ea3 2017-11-27 stsp const struct got_error *got_object_blob_open(struct got_blob_object **,
74 68482ea3 2017-11-27 stsp struct got_repository *, struct got_object *, size_t);
75 68482ea3 2017-11-27 stsp void got_object_blob_close(struct got_blob_object *);
76 f934cf2c 2018-02-12 stsp char *got_object_blob_id_str(struct got_blob_object*, char *, size_t);
77 f934cf2c 2018-02-12 stsp size_t got_object_blob_get_hdrlen(struct got_blob_object *);
78 f934cf2c 2018-02-12 stsp const uint8_t *got_object_blob_get_read_buf(struct got_blob_object *);
79 eb651edf 2018-02-11 stsp const struct got_error *got_object_blob_read_block(size_t *,
80 eb651edf 2018-02-11 stsp struct got_blob_object *);