1 /* Simple Config file API
4 * Tim Martin (originally in Cyrus distribution)
5 * $Id: cfile.h,v 1.1 2005/01/19 00:11:42 shadow Exp $
8 * Copyright (c) 2001 Carnegie Mellon University. All rights reserved.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in
19 * the documentation and/or other materials provided with the
22 * 3. The name "Carnegie Mellon University" must not be used to
23 * endorse or promote products derived from this software without
24 * prior written permission. For permission or any other legal
25 * details, please contact
26 * Office of Technology Transfer
27 * Carnegie Mellon University
29 * Pittsburgh, PA 15213-3890
30 * (412) 268-4387, fax: (412) 268-7395
31 * tech-transfer@andrew.cmu.edu
33 * 4. Redistributions of any form whatsoever must retain the following
35 * "This product includes software developed by Computing Services
36 * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
38 * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
39 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
40 * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
41 * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
42 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
43 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
44 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
47 struct cfile; /* cc can type check, nobody can look inside */
49 typedef struct cfile *cfile;
51 cfile cfile_read(const char *filename, char *complaint, int complaint_len);
52 const char *cfile_getstring(cfile cf,const char *key,const char *def);
53 int cfile_getint(cfile cf,const char *key,int def);
54 int cfile_getswitch(cfile cf,const char *key,int def);
55 void cfile_free(cfile cf);