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 | * FreeBSD /etc/rc.conf initialisation. Initialise the software stack using the |
---|
28 | * the configuration options held in your rc.conf file. The file conforms to the |
---|
29 | * format defined in the FreeBSD man page rc.conf(5). |
---|
30 | * |
---|
31 | * The services and configuration present in your rc.conf will only work if the |
---|
32 | * services have been configured into your application. |
---|
33 | */ |
---|
34 | |
---|
35 | #ifndef _RTEMS_BSD_RC_CONF_h |
---|
36 | #define _RTEMS_BSD_RC_CONF_h |
---|
37 | |
---|
38 | #include <stdbool.h> |
---|
39 | |
---|
40 | #ifdef __cplusplus |
---|
41 | extern "C" { |
---|
42 | #endif /* __cplusplus */ |
---|
43 | |
---|
44 | /* |
---|
45 | * Maximum size of an rc.conf file. |
---|
46 | */ |
---|
47 | #define RTEMS_BSD_RC_CONF_MAX_SIZE (8 * 1024) |
---|
48 | |
---|
49 | /* |
---|
50 | * The rc.conf data. It is externally opaque. |
---|
51 | */ |
---|
52 | typedef struct rtems_bsd_rc_conf_ rtems_bsd_rc_conf; |
---|
53 | |
---|
54 | /* |
---|
55 | * Run an rc.conf script loaded into memory. |
---|
56 | * |
---|
57 | * The timeout can be -1 for no wait, 0 to wait forever or a timeout in seconds. |
---|
58 | */ |
---|
59 | extern int rtems_bsd_run_rc_conf_script(const char* name, |
---|
60 | const char* text, |
---|
61 | int timeout, |
---|
62 | bool verbose); |
---|
63 | |
---|
64 | /* |
---|
65 | * Run the rc.conf file. |
---|
66 | * |
---|
67 | * The timeout can be -1 for no wait, 0 to wait forever or a timeout in seconds. |
---|
68 | */ |
---|
69 | extern int rtems_bsd_run_rc_conf(const char* name, int timeout, bool verbose); |
---|
70 | |
---|
71 | /* |
---|
72 | * Run /etc/rc.conf. |
---|
73 | * |
---|
74 | * The timeout can be -1 for no wait, 0 to wait forever or a timeout in seconds. |
---|
75 | */ |
---|
76 | extern int rtems_bsd_run_etc_rc_conf(int timeout, bool verbose); |
---|
77 | |
---|
78 | #ifdef __cplusplus |
---|
79 | } |
---|
80 | #endif /* __cplusplus */ |
---|
81 | |
---|
82 | #endif |
---|