1139823Simp/*- 2206361Sjoel * Copyright (c) 1999 Boris Popov 352153Sbp * All rights reserved. 452153Sbp * 552153Sbp * Redistribution and use in source and binary forms, with or without 652153Sbp * modification, are permitted provided that the following conditions 752153Sbp * are met: 852153Sbp * 1. Redistributions of source code must retain the above copyright 952153Sbp * notice, this list of conditions and the following disclaimer. 1052153Sbp * 2. Redistributions in binary form must reproduce the above copyright 1152153Sbp * notice, this list of conditions and the following disclaimer in the 1252153Sbp * documentation and/or other materials provided with the distribution. 1352153Sbp * 1452153Sbp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1552153Sbp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1652153Sbp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1752153Sbp * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1852153Sbp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1952153Sbp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2052153Sbp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2152153Sbp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2252153Sbp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2352153Sbp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2452153Sbp * SUCH DAMAGE. 2552153Sbp * 2652153Sbp * $FreeBSD$ 2752153Sbp */ 2852704Sbp#ifndef _NETNCP_NCP_RCFILE_H_ 2952704Sbp#define _NETNCP_NCP_RCFILE_H_ 3052153Sbp#include <sys/queue.h> 3152153Sbp 3252153Sbpstruct rckey { 3360938Sjake SLIST_ENTRY(rckey) rk_next; 3452153Sbp char *rk_name; 3552153Sbp char *rk_value; 3652153Sbp}; 3752153Sbp 3852153Sbpstruct rcsection { 3960938Sjake SLIST_ENTRY(rcsection) rs_next; 4060938Sjake SLIST_HEAD(rckey_head,rckey) rs_keys; 4152153Sbp char *rs_name; 4252153Sbp}; 4352153Sbp 4452153Sbpstruct rcfile { 4560938Sjake SLIST_ENTRY(rcfile) rf_next; 4660938Sjake SLIST_HEAD(rcsec_head, rcsection) rf_sect; 4752153Sbp char *rf_name; 4852153Sbp FILE *rf_f; 4952153Sbp}; 5052153Sbp 5152704Sbp__BEGIN_DECLS 5252153Sbp 5352704Sbpint rc_open(char *, char *,struct rcfile **); 5452704Sbpint rc_close(struct rcfile *); 5552704Sbpint rc_getstringptr(struct rcfile *, char *, char *, char **); 5652704Sbpint rc_getstring(struct rcfile *, char *, char *, int, char *); 5752704Sbpint rc_getint(struct rcfile *, char *, char *, int *); 5852704Sbpint rc_getbool(struct rcfile *, char *, char *, int *); 5952704Sbp 6052704Sbp__END_DECLS 6152704Sbp 6252704Sbp#endif /* _NETNCP_NCP_RCFILE_H_ */ 63