1247841Sbapt/*-
2247841Sbapt * Copyright (c) 2013 Baptiste Daroussin <bapt@FreeBSD.org>
3247841Sbapt * All rights reserved.
4247841Sbapt *
5247841Sbapt * Redistribution and use in source and binary forms, with or without
6247841Sbapt * modification, are permitted provided that the following conditions
7247841Sbapt * are met:
8247841Sbapt * 1. Redistributions of source code must retain the above copyright
9247841Sbapt *    notice, this list of conditions and the following disclaimer.
10247841Sbapt * 2. Redistributions in binary form must reproduce the above copyright
11247841Sbapt *    notice, this list of conditions and the following disclaimer in the
12247841Sbapt *    documentation and/or other materials provided with the distribution.
13247841Sbapt *
14247841Sbapt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15247841Sbapt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16247841Sbapt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17247841Sbapt * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18247841Sbapt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19247841Sbapt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20247841Sbapt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21247841Sbapt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22247841Sbapt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23247841Sbapt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24247841Sbapt * SUCH DAMAGE.
25247841Sbapt *
26247841Sbapt * $FreeBSD$
27247841Sbapt */
28247841Sbapt
29247841Sbapt#ifndef _PKG_CONFIG_H
30247841Sbapt#define _PKG_CONFIG_H
31247841Sbapt
32247841Sbapt#define _LOCALBASE "/usr/local"
33257328Sbdrewery#define URL_SCHEME_PREFIX "pkg+"
34247841Sbapt
35247841Sbapttypedef enum {
36247841Sbapt	PACKAGESITE = 0,
37247841Sbapt	ABI,
38247841Sbapt	MIRROR_TYPE,
39247841Sbapt	ASSUME_ALWAYS_YES,
40257353Sbdrewery	SIGNATURE_TYPE,
41257353Sbdrewery	FINGERPRINTS,
42259613Sbdrewery	REPOS_DIR,
43287873Sdelphij	PUBKEY,
44247841Sbapt	CONFIG_SIZE
45247841Sbapt} pkg_config_key;
46247841Sbapt
47247841Sbapttypedef enum {
48247841Sbapt	PKG_CONFIG_STRING=0,
49247841Sbapt	PKG_CONFIG_BOOL,
50259613Sbdrewery	PKG_CONFIG_LIST,
51247841Sbapt} pkg_config_t;
52247841Sbapt
53257353Sbdrewerytypedef enum {
54257353Sbdrewery	CONFFILE_PKG=0,
55257353Sbdrewery	CONFFILE_REPO,
56257353Sbdrewery} pkg_conf_file_t;
57257353Sbdrewery
58247841Sbaptint config_init(void);
59247841Sbaptvoid config_finish(void);
60247841Sbaptint config_string(pkg_config_key, const char **);
61247841Sbaptint config_bool(pkg_config_key, bool *);
62247841Sbapt
63247841Sbapt#endif
64