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>
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.
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.
19 aaf30ee7 2021-08-29 stsp * We maintain two different structures for fetch and send configuration
20 aaf30ee7 2021-08-29 stsp * settings in case they diverge in the future.
22 aaf30ee7 2021-08-29 stsp struct fetch_config {
23 aaf30ee7 2021-08-29 stsp char *repository;
24 aaf30ee7 2021-08-29 stsp char *server;
25 aaf30ee7 2021-08-29 stsp char *protocol;
27 aaf30ee7 2021-08-29 stsp struct node_branch *branch;
29 aaf30ee7 2021-08-29 stsp struct send_config {
30 aaf30ee7 2021-08-29 stsp char *repository;
31 aaf30ee7 2021-08-29 stsp char *server;
32 aaf30ee7 2021-08-29 stsp char *protocol;
34 aaf30ee7 2021-08-29 stsp struct node_branch *branch;
37 b8adfa55 2020-09-25 stsp struct node_branch {
38 b8adfa55 2020-09-25 stsp char *branch_name;
39 b8adfa55 2020-09-25 stsp struct node_branch *next;
40 b8adfa55 2020-09-25 stsp struct node_branch *tail;
43 99495ddb 2021-01-10 stsp struct node_ref {
44 99495ddb 2021-01-10 stsp char *ref_name;
45 99495ddb 2021-01-10 stsp struct node_ref *next;
46 99495ddb 2021-01-10 stsp struct node_ref *tail;
49 257add31 2020-09-09 stsp struct gotconfig_remote_repo {
50 257add31 2020-09-09 stsp TAILQ_ENTRY(gotconfig_remote_repo) entry;
52 257add31 2020-09-09 stsp char *repository;
53 257add31 2020-09-09 stsp char *server;
54 257add31 2020-09-09 stsp char *protocol;
56 257add31 2020-09-09 stsp int mirror_references;
57 0c8b29c5 2021-01-05 stsp int fetch_all_branches;
58 b8adfa55 2020-09-25 stsp struct node_branch *branch;
59 6480c871 2021-08-30 stsp struct node_ref *fetch_ref;
60 aaf30ee7 2021-08-29 stsp struct fetch_config *fetch_config;
61 aaf30ee7 2021-08-29 stsp struct send_config *send_config;
63 257add31 2020-09-09 stsp TAILQ_HEAD(gotconfig_remote_repo_list, gotconfig_remote_repo);
65 257add31 2020-09-09 stsp struct gotconfig {
66 257add31 2020-09-09 stsp char *author;
67 257add31 2020-09-09 stsp struct gotconfig_remote_repo_list remotes;
68 257add31 2020-09-09 stsp int nremotes;
72 257add31 2020-09-09 stsp * Parse individual gotconfig repository files
74 257add31 2020-09-09 stsp const struct got_error *gotconfig_parse(struct gotconfig **, const char *,
76 257add31 2020-09-09 stsp void gotconfig_free(struct gotconfig *);