Blame


1 257add31 2020-09-09 stsp /*
2 257add31 2020-09-09 stsp * Copyright (c) 2020 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 b8adfa55 2020-09-25 stsp struct node_branch {
19 b8adfa55 2020-09-25 stsp char *branch_name;
20 b8adfa55 2020-09-25 stsp struct node_branch *next;
21 b8adfa55 2020-09-25 stsp struct node_branch *tail;
22 b8adfa55 2020-09-25 stsp };
23 b8adfa55 2020-09-25 stsp
24 257add31 2020-09-09 stsp struct gotconfig_remote_repo {
25 257add31 2020-09-09 stsp TAILQ_ENTRY(gotconfig_remote_repo) entry;
26 257add31 2020-09-09 stsp char *name;
27 257add31 2020-09-09 stsp char *repository;
28 257add31 2020-09-09 stsp char *server;
29 257add31 2020-09-09 stsp char *protocol;
30 257add31 2020-09-09 stsp int port;
31 257add31 2020-09-09 stsp int mirror_references;
32 b8adfa55 2020-09-25 stsp struct node_branch *branch;
33 257add31 2020-09-09 stsp };
34 257add31 2020-09-09 stsp TAILQ_HEAD(gotconfig_remote_repo_list, gotconfig_remote_repo);
35 257add31 2020-09-09 stsp
36 257add31 2020-09-09 stsp struct gotconfig {
37 257add31 2020-09-09 stsp char *author;
38 257add31 2020-09-09 stsp struct gotconfig_remote_repo_list remotes;
39 257add31 2020-09-09 stsp int nremotes;
40 257add31 2020-09-09 stsp };
41 257add31 2020-09-09 stsp
42 257add31 2020-09-09 stsp /*
43 257add31 2020-09-09 stsp * Parse individual gotconfig repository files
44 257add31 2020-09-09 stsp */
45 257add31 2020-09-09 stsp const struct got_error *gotconfig_parse(struct gotconfig **, const char *,
46 257add31 2020-09-09 stsp int *);
47 257add31 2020-09-09 stsp void gotconfig_free(struct gotconfig *);