xref: /illumos-gate/usr/src/head/deflt.h (revision 8b80e8cb6855118d46f605e91b5ed4ce83417395)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 /*	Copyright (c) 1987, 1988 Microsoft Corporation	*/
31 /*	  All Rights Reserved	*/
32 
33 #ifndef	_DEFLT_H
34 #define	_DEFLT_H
35 
36 #pragma ident	"%Z%%M%	%I%	%E% SMI"
37 
38 #ifdef	__cplusplus
39 extern "C" {
40 #endif
41 
42 #define	DEFLT	"/etc/default"
43 
44 /*
45  * Following for defcntl(3).
46  * If you add new args, make sure that the default is:
47  *	OFF	new-improved-feature-off, i.e. current state of affairs
48  *	ON	new-improved-feature-on
49  * or that you change the code for deflt(3) to have the old value as the
50  * default.  (for compatibility).
51  */
52 
53 /* ... cmds */
54 #define	DC_GETFLAGS	0	/* get current flags */
55 #define	DC_SETFLAGS	1	/* set flags */
56 
57 /* ... args */
58 #define	DC_CASE		0001	/* ON: respect case; OFF: ignore case */
59 #define	DC_NOREWIND	0002	/* ON: don't rewind in defread */
60 				/* OFF: do rewind in defread */
61 #define	DC_STRIP_QUOTES	0004	/* ON: strip quotes; OFF: leave quotes */
62 
63 #define	DC_STD		((0) | (DC_CASE))
64 
65 #ifdef __STDC__
66 extern int defcntl(int, int);
67 extern int defopen(char *);
68 extern char *defread(char *);
69 #else
70 extern int defcntl();
71 extern int defopen();
72 extern char *defread();
73 #endif
74 
75 #define	TURNON(flags, mask)	((flags) |= (mask))
76 #define	TURNOFF(flags, mask)	((flags) &= ~(mask))
77 #define	ISON(flags, mask)	(((flags) & (mask)) == (mask))
78 #define	ISOFF(flags, mask)	(((flags) & (mask)) != (mask))
79 
80 #ifdef	__cplusplus
81 }
82 #endif
83 
84 #endif	/* _DEFLT_H */
85