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

55-freebsd-126-freebsd-12freebsd-9.3
Last change on this file since 05d47ae was 05d47ae, checked in by Chris Johns <chrisj@…>, on 05/18/16 at 05:20:36

Clean up whitespace.

  • Property mode set to 100644
File size: 3.2 KB
RevLine 
[f5c6651]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#ifdef __cplusplus
35extern "C" {
36#endif /* __cplusplus */
37
38/*
39 * Maximum size of an rc.conf file.
40 */
41#define RTEMS_BSD_RC_CONF_MAX_SIZE (8 * 1024)
42
43/*
44 * Directive processing data. This data is opaque externally.
45 */
46typedef struct rtems_bsd_rc_conf_ rtems_bsd_rc_conf;
47
48/*
49 * A directive is a line in rc.conf and is 'name=value'. The handler is invoked
50 * if the name matches directive's regular expression.
51 */
52typedef int (*rtems_bsd_rc_conf_directive)(rtems_bsd_rc_conf* rc_conf,
[05d47ae]53                                           int                argc,
54                                           const char**       argv);
[f5c6651]55
56/*
57 * Register a directive handler.
58 */
[05d47ae]59extern int rtems_bsd_rc_conf_directive_add(const char*  dir_regex,
60                                           rtems_bsd_rc_conf_directive handler);
[f5c6651]61
62/*
63 * Run an rc.conf script loaded into memory.
64 */
65extern int rtems_bsd_run_rc_conf_script(const char* name, const char* text, bool verbose);
66
67/*
68 * Run the rc.conf file.
69 */
70extern int rtems_bsd_run_rc_conf(const char* name, bool verbose);
71
72/*
73 * Run /etc/rc.conf.
74 */
75extern int rtems_bsd_run_etc_rc_conf(bool verbose);
76
77/*
78 * Return the name of the file being processed.
79 */
80extern const char* rtems_bsd_rc_conf_name(rtems_bsd_rc_conf* rc_conf);
81
82/*
83 * Return the line number being processed.
84 */
85extern int rtems_bsd_rc_conf_line(rtems_bsd_rc_conf* rc_conf);
86
87/*
88 * Print the argv list. Helper for verbose modes.
89 */
90extern void rtems_bsd_rc_conf_print_cmd(rtems_bsd_rc_conf* rc_conf,
[05d47ae]91                                        const char*        name,
92                                        int                argc,
93                                        const char**       argv);
[f5c6651]94
95#ifdef __cplusplus
96}
97#endif /* __cplusplus */
98
99#endif
Note: See TracBrowser for help on using the repository browser.