source: rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-rc-conf.h @ f575822

5-freebsd-12freebsd-9.3
Last change on this file since f575822 was f575822, checked in by Sebastian Huber <sebastian.huber@…>, on May 30, 2016 at 2:00:25 PM

rtems-bsd-rc-conf.h: Add missing include

  • Property mode set to 100644
File size: 3.2 KB
Line 
1/*
2 * Copyright (c) 2016 Chris Johns <chrisj@rtems.org>.  All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 *    notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 *    notice, this list of conditions and the following disclaimer in the
11 *    documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
24 */
25
26/*
27 * Parse a FreeBSD /etc/rc.conf format file and execute the configuration
28 * options we want to support.
29 */
30
31#ifndef _RTEMS_BSP_RC_CONF_h
32#define _RTEMS_BSP_RC_CONF_h
33
34#include <stdbool.h>
35
36#ifdef __cplusplus
37extern "C" {
38#endif /* __cplusplus */
39
40/*
41 * Maximum size of an rc.conf file.
42 */
43#define RTEMS_BSD_RC_CONF_MAX_SIZE (8 * 1024)
44
45/*
46 * Directive processing data. This data is opaque externally.
47 */
48typedef struct rtems_bsd_rc_conf_ rtems_bsd_rc_conf;
49
50/*
51 * A directive is a line in rc.conf and is 'name=value'. The handler is invoked
52 * if the name matches directive's regular expression.
53 */
54typedef int (*rtems_bsd_rc_conf_directive)(rtems_bsd_rc_conf* rc_conf,
55                                           int                argc,
56                                           const char**       argv);
57
58/*
59 * Register a directive handler.
60 */
61extern int rtems_bsd_rc_conf_directive_add(const char*  dir_regex,
62                                           rtems_bsd_rc_conf_directive handler);
63
64/*
65 * Run an rc.conf script loaded into memory.
66 */
67extern int rtems_bsd_run_rc_conf_script(const char* name, const char* text, bool verbose);
68
69/*
70 * Run the rc.conf file.
71 */
72extern int rtems_bsd_run_rc_conf(const char* name, bool verbose);
73
74/*
75 * Run /etc/rc.conf.
76 */
77extern int rtems_bsd_run_etc_rc_conf(bool verbose);
78
79/*
80 * Return the name of the file being processed.
81 */
82extern const char* rtems_bsd_rc_conf_name(rtems_bsd_rc_conf* rc_conf);
83
84/*
85 * Return the line number being processed.
86 */
87extern int rtems_bsd_rc_conf_line(rtems_bsd_rc_conf* rc_conf);
88
89/*
90 * Print the argv list. Helper for verbose modes.
91 */
92extern void rtems_bsd_rc_conf_print_cmd(rtems_bsd_rc_conf* rc_conf,
93                                        const char*        name,
94                                        int                argc,
95                                        const char**       argv);
96
97#ifdef __cplusplus
98}
99#endif /* __cplusplus */
100
101#endif
Note: See TracBrowser for help on using the repository browser.