Blame


1 257add31 2020-09-09 stsp /*
2 cfd92333 2021-08-27 tracey * Copyright (c) 2020, 2021 Tracey Emery <tracey@openbsd.org>
3 257add31 2020-09-09 stsp * Copyright (c) 2020 Stefan Sperling <stsp@openbsd.org>
4 257add31 2020-09-09 stsp *
5 257add31 2020-09-09 stsp * Permission to use, copy, modify, and distribute this software for any
6 257add31 2020-09-09 stsp * purpose with or without fee is hereby granted, provided that the above
7 257add31 2020-09-09 stsp * copyright notice and this permission notice appear in all copies.
8 257add31 2020-09-09 stsp *
9 257add31 2020-09-09 stsp * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 257add31 2020-09-09 stsp * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 257add31 2020-09-09 stsp * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 257add31 2020-09-09 stsp * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 257add31 2020-09-09 stsp * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 257add31 2020-09-09 stsp * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 257add31 2020-09-09 stsp * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 257add31 2020-09-09 stsp */
17 257add31 2020-09-09 stsp
18 cfd92333 2021-08-27 tracey struct fetch_repo {
19 cfd92333 2021-08-27 tracey char *fetch_repository;
20 cfd92333 2021-08-27 tracey char *fetch_server;
21 cfd92333 2021-08-27 tracey char *fetch_protocol;
22 cfd92333 2021-08-27 tracey int fetch_port;
23 cfd92333 2021-08-27 tracey struct node_branch *fetch_branch;
24 cfd92333 2021-08-27 tracey };
25 cfd92333 2021-08-27 tracey
26 cfd92333 2021-08-27 tracey struct send_repo {
27 cfd92333 2021-08-27 tracey char *send_repository;
28 cfd92333 2021-08-27 tracey char *send_server;
29 cfd92333 2021-08-27 tracey char *send_protocol;
30 cfd92333 2021-08-27 tracey int send_port;
31 cfd92333 2021-08-27 tracey struct node_branch *send_branch;
32 cfd92333 2021-08-27 tracey };
33 cfd92333 2021-08-27 tracey
34 b8adfa55 2020-09-25 stsp struct node_branch {
35 b8adfa55 2020-09-25 stsp char *branch_name;
36 b8adfa55 2020-09-25 stsp struct node_branch *next;
37 b8adfa55 2020-09-25 stsp struct node_branch *tail;
38 b8adfa55 2020-09-25 stsp };
39 b8adfa55 2020-09-25 stsp
40 99495ddb 2021-01-10 stsp struct node_ref {
41 99495ddb 2021-01-10 stsp char *ref_name;
42 99495ddb 2021-01-10 stsp struct node_ref *next;
43 99495ddb 2021-01-10 stsp struct node_ref *tail;
44 99495ddb 2021-01-10 stsp };
45 99495ddb 2021-01-10 stsp
46 257add31 2020-09-09 stsp struct gotconfig_remote_repo {
47 257add31 2020-09-09 stsp TAILQ_ENTRY(gotconfig_remote_repo) entry;
48 257add31 2020-09-09 stsp char *name;
49 257add31 2020-09-09 stsp char *repository;
50 257add31 2020-09-09 stsp char *server;
51 257add31 2020-09-09 stsp char *protocol;
52 257add31 2020-09-09 stsp int port;
53 257add31 2020-09-09 stsp int mirror_references;
54 0c8b29c5 2021-01-05 stsp int fetch_all_branches;
55 b8adfa55 2020-09-25 stsp struct node_branch *branch;
56 99495ddb 2021-01-10 stsp struct node_ref *ref;
57 cfd92333 2021-08-27 tracey struct fetch_repo *fetch_repo;
58 cfd92333 2021-08-27 tracey struct send_repo *send_repo;
59 257add31 2020-09-09 stsp };
60 257add31 2020-09-09 stsp TAILQ_HEAD(gotconfig_remote_repo_list, gotconfig_remote_repo);
61 257add31 2020-09-09 stsp
62 257add31 2020-09-09 stsp struct gotconfig {
63 257add31 2020-09-09 stsp char *author;
64 257add31 2020-09-09 stsp struct gotconfig_remote_repo_list remotes;
65 257add31 2020-09-09 stsp int nremotes;
66 257add31 2020-09-09 stsp };
67 257add31 2020-09-09 stsp
68 257add31 2020-09-09 stsp /*
69 257add31 2020-09-09 stsp * Parse individual gotconfig repository files
70 257add31 2020-09-09 stsp */
71 257add31 2020-09-09 stsp const struct got_error *gotconfig_parse(struct gotconfig **, const char *,
72 257add31 2020-09-09 stsp int *);
73 257add31 2020-09-09 stsp void gotconfig_free(struct gotconfig *);