envstat.h revision 1.1.2.2 1 1.1.2.2 matt /* $NetBSD: envstat.h,v 1.1.2.2 2007/11/06 23:36:25 matt Exp $ */
2 1.1.2.2 matt
3 1.1.2.2 matt /*-
4 1.1.2.2 matt * Copyright (c) 2007 Juan Romero Pardines.
5 1.1.2.2 matt * All rights reserved.
6 1.1.2.2 matt *
7 1.1.2.2 matt * Redistribution and use in source and binary forms, with or without
8 1.1.2.2 matt * modification, are permitted provided that the following conditions
9 1.1.2.2 matt * are met:
10 1.1.2.2 matt * 1. Redistributions of source code must retain the above copyright
11 1.1.2.2 matt * notice, this list of conditions and the following disclaimer.
12 1.1.2.2 matt * 2. Redistributions in binary form must reproduce the above copyright
13 1.1.2.2 matt * notice, this list of conditions and the following disclaimer in the
14 1.1.2.2 matt * documentation and/or other materials provided with the distribution.
15 1.1.2.2 matt *
16 1.1.2.2 matt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 1.1.2.2 matt * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 1.1.2.2 matt * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 1.1.2.2 matt * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 1.1.2.2 matt * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 1.1.2.2 matt * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 1.1.2.2 matt * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 1.1.2.2 matt * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 1.1.2.2 matt * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 1.1.2.2 matt * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 1.1.2.2 matt */
27 1.1.2.2 matt
28 1.1.2.2 matt #ifndef _ENVSTAT_H_
29 1.1.2.2 matt #define _ENVSTAT_H_
30 1.1.2.2 matt
31 1.1.2.2 matt #include <stdio.h>
32 1.1.2.2 matt #include <sys/queue.h>
33 1.1.2.2 matt #include <prop/proplib.h>
34 1.1.2.2 matt
35 1.1.2.2 matt struct sensor_block {
36 1.1.2.2 matt SLIST_ENTRY(sensor_block) sb_head;
37 1.1.2.2 matt prop_dictionary_t dict; /* dictionary associated */
38 1.1.2.2 matt };
39 1.1.2.2 matt
40 1.1.2.2 matt struct device_block {
41 1.1.2.2 matt SLIST_ENTRY(device_block) db_head;
42 1.1.2.2 matt prop_array_t array; /* array associated */
43 1.1.2.2 matt const char *dev_key; /* keyword to find device array */
44 1.1.2.2 matt };
45 1.1.2.2 matt
46 1.1.2.2 matt void config_dict_add_prop(const char *, char *);
47 1.1.2.2 matt void config_dict_destroy(prop_dictionary_t);
48 1.1.2.2 matt void config_dict_dump(prop_dictionary_t);
49 1.1.2.2 matt void config_dict_fulldump(void);
50 1.1.2.2 matt void config_dict_mark(const char *);
51 1.1.2.2 matt prop_dictionary_t config_dict_parsed(void);
52 1.1.2.2 matt
53 1.1.2.2 matt prop_number_t convert_val_to_pnumber(prop_dictionary_t, const char *,
54 1.1.2.2 matt const char *, char *);
55 1.1.2.2 matt
56 1.1.2.2 matt void config_devblock_add(const char *, prop_dictionary_t);
57 1.1.2.2 matt void config_devblock_check_sensorprops(prop_dictionary_t,
58 1.1.2.2 matt prop_dictionary_t,
59 1.1.2.2 matt const char *);
60 1.1.2.2 matt prop_dictionary_t config_devblock_getdict(const char *, const char *);
61 1.1.2.2 matt
62 1.1.2.2 matt /*
63 1.1.2.2 matt * The yacc function that parses the configuration file.
64 1.1.2.2 matt */
65 1.1.2.2 matt void config_parse(FILE *, prop_dictionary_t);
66 1.1.2.2 matt
67 1.1.2.2 matt #endif /* _ENVSTAT_H_ */
68