Blob


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