1247841Sbapt/*-
2330449Seadler * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3330449Seadler *
4247841Sbapt * Copyright (c) 2013 Baptiste Daroussin <bapt@FreeBSD.org>
5247841Sbapt * All rights reserved.
6247841Sbapt *
7247841Sbapt * Redistribution and use in source and binary forms, with or without
8247841Sbapt * modification, are permitted provided that the following conditions
9247841Sbapt * are met:
10247841Sbapt * 1. Redistributions of source code must retain the above copyright
11247841Sbapt *    notice, this list of conditions and the following disclaimer.
12247841Sbapt * 2. Redistributions in binary form must reproduce the above copyright
13247841Sbapt *    notice, this list of conditions and the following disclaimer in the
14247841Sbapt *    documentation and/or other materials provided with the distribution.
15247841Sbapt *
16247841Sbapt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17247841Sbapt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18247841Sbapt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19247841Sbapt * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20247841Sbapt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21247841Sbapt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22247841Sbapt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23247841Sbapt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24247841Sbapt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25247841Sbapt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26247841Sbapt * SUCH DAMAGE.
27247841Sbapt *
28247841Sbapt * $FreeBSD: stable/11/usr.sbin/pkg/config.h 330449 2018-03-05 07:26:05Z eadler $
29247841Sbapt */
30247841Sbapt
31247841Sbapt#ifndef _PKG_CONFIG_H
32247841Sbapt#define _PKG_CONFIG_H
33247841Sbapt
34247841Sbapt#define _LOCALBASE "/usr/local"
35257051Sbdrewery#define URL_SCHEME_PREFIX "pkg+"
36247841Sbapt
37247841Sbapttypedef enum {
38247841Sbapt	PACKAGESITE = 0,
39247841Sbapt	ABI,
40247841Sbapt	MIRROR_TYPE,
41247841Sbapt	ASSUME_ALWAYS_YES,
42257147Sbdrewery	SIGNATURE_TYPE,
43257147Sbdrewery	FINGERPRINTS,
44259266Sbdrewery	REPOS_DIR,
45287579Sbapt	PUBKEY,
46247841Sbapt	CONFIG_SIZE
47247841Sbapt} pkg_config_key;
48247841Sbapt
49247841Sbapttypedef enum {
50247841Sbapt	PKG_CONFIG_STRING=0,
51247841Sbapt	PKG_CONFIG_BOOL,
52259266Sbdrewery	PKG_CONFIG_LIST,
53247841Sbapt} pkg_config_t;
54247841Sbapt
55257145Sbdrewerytypedef enum {
56257145Sbdrewery	CONFFILE_PKG=0,
57257145Sbdrewery	CONFFILE_REPO,
58257145Sbdrewery} pkg_conf_file_t;
59257145Sbdrewery
60247841Sbaptint config_init(void);
61247841Sbaptvoid config_finish(void);
62247841Sbaptint config_string(pkg_config_key, const char **);
63247841Sbaptint config_bool(pkg_config_key, bool *);
64247841Sbapt
65247841Sbapt#endif
66