backupkey: Handle more clearly the case where we find the secret, but it has no value
[Samba.git] / lib / util / tiniparser.h
blob4803ca6d6ecb26a1b06ecbcfd96203bd59bd1bba
1 #ifndef _TINIPARSER_H_
2 #define _TINIPARSER_H_
3 /*
4 * Trivial smb.conf parsing code
5 * iniparser compatibility layer.
7 * Copyright Jeremy Allison <jra@samba.org> 2014
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, and the entire permission notice in its entirety,
14 * including the disclaimer of warranties.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. The name of the author may not be used to endorse or promote
19 * products derived from this software without specific prior
20 * written permission.
22 * ALTERNATIVELY, this product may be distributed under the terms of
23 * the GNU Public License, in which case the provisions of the GPL are
24 * required INSTEAD OF the above restrictions. (This clause is
25 * necessary due to a potential bad interaction between the GPL and
26 * the restrictions contained in a BSD-style copyright.)
28 * THIS SOFTWARE IS PROVIDED `AS IS'' AND ANY EXPRESS OR IMPLIED
29 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
30 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
31 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
32 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
33 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
34 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
38 * OF THE POSSIBILITY OF SUCH DAMAGE.
41 struct tiniparser_dictionary;
43 bool tiniparser_getboolean(struct tiniparser_dictionary *d,
44 const char *key,
45 bool default_value);
46 const char *tiniparser_getstring(struct tiniparser_dictionary *d,
47 const char *key,
48 const char *default_value);
49 int tiniparser_getint(struct tiniparser_dictionary *d,
50 const char *key,
51 int default_value);
52 struct tiniparser_dictionary *tiniparser_load(const char *filename);
53 void tiniparser_freedict(struct tiniparser_dictionary *d);
55 #endif