xref: /illumos-gate/usr/src/common/definit/definit.h (revision a28480fe)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source. A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
14  */
15 
16 #ifndef	_DEFINIT_H
17 #define	_DEFINIT_H
18 
19 #ifdef	__cplusplus
20 extern "C" {
21 #endif
22 
23 /*
24  * Routines for parsing the default init file, /etc/default/init.
25  * Used by init, svc.startd and libzonecfg for setting up a default
26  * environment.
27  *
28  * After calling definit_open(), callers should call definit_token() in a loop
29  * until it returns NULL, indicating that all tokens in the file have been
30  * processed. To clean up when finished, call definit_close().
31  */
32 
33 #define	DEFINIT_DEFAULT_FILE	"/etc/default/init"
34 #define	DEFINIT_MAXLINE		512
35 
36 #define	DEFINIT_MIN_UMASK	0
37 #define	DEFINIT_MAX_UMASK	077
38 
39 int definit_open(const char *, void **);
40 void definit_close(void *);
41 const char *definit_token(void *);
42 
43 #ifdef	__cplusplus
44 }
45 #endif
46 
47 #endif /* !_DEFINIT_H */
48