xref: /titanic_41/usr/src/head/priv.h (revision 1816cb7076d3ec8a78ef9ac9f895574e13c43645)
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-2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_PRIV_H_
28 #define	_PRIV_H_
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/priv.h>
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 #define	PRIV_STR_PORT		0x00			/* portable output */
39 #define	PRIV_STR_LIT		0x01			/* literal output */
40 #define	PRIV_STR_SHORT		0x02			/* shortest output */
41 
42 #define	PRIV_ALLSETS		((priv_ptype_t)0)	/* for priv_set() */
43 
44 /*
45  * library functions prototype.
46  */
47 #if	defined(__STDC__)
48 
49 extern int setppriv(priv_op_t, priv_ptype_t, const priv_set_t *);
50 extern int getppriv(priv_ptype_t, priv_set_t *);
51 extern int setpflags(uint_t, uint_t);
52 extern uint_t getpflags(uint_t);
53 extern const priv_impl_info_t *getprivimplinfo(void);
54 
55 extern int priv_set(priv_op_t, priv_ptype_t, ...);
56 extern boolean_t priv_ineffect(const char *);
57 extern priv_set_t *priv_str_to_set(const char *, const char *, const char **);
58 extern char *priv_set_to_str(const priv_set_t *, char, int);
59 
60 extern int priv_getbyname(const char *);
61 extern const char *priv_getbynum(int);
62 extern int priv_getsetbyname(const char *);
63 extern const char *priv_getsetbynum(int);
64 extern char *priv_gettext(const char *);
65 
66 extern priv_set_t *priv_allocset(void);
67 extern void priv_freeset(priv_set_t *);
68 
69 extern void priv_emptyset(priv_set_t *);
70 extern void priv_fillset(priv_set_t *);
71 extern boolean_t priv_isemptyset(const priv_set_t *);
72 extern boolean_t priv_isfullset(const priv_set_t *);
73 extern boolean_t priv_isequalset(const priv_set_t *, const priv_set_t *);
74 extern boolean_t priv_issubset(const priv_set_t *, const priv_set_t *);
75 extern void priv_intersect(const priv_set_t *, priv_set_t *);
76 extern void priv_union(const priv_set_t *, priv_set_t *);
77 extern void priv_inverse(priv_set_t *);
78 extern int priv_addset(priv_set_t *, const char *);
79 extern void priv_copyset(const priv_set_t *, priv_set_t *);
80 extern int priv_delset(priv_set_t *, const char *);
81 extern boolean_t priv_ismember(const priv_set_t *, const char *);
82 
83 #else	/* Non ANSI */
84 
85 extern int setppriv(/* priv_op_t, priv_ptype_t, const priv_set_t * */);
86 extern int getppriv(/* priv_ptype_t, priv_set_t * */);
87 extern int setpflags(/* uint_t, uint_t */);
88 extern uint_t getpflags(/* uint_t */);
89 extern priv_impl_info_t *getprivimplinfo(/* void */);
90 
91 extern int priv_set(/* priv_op_t, priv_ptype_t, ... */);
92 extern boolean_t priv_ineffect(/* const char * */);
93 extern priv_set_t *priv_str_to_set(/*
94 			    const char *, const char *, const char ** */);
95 extern char *priv_set_to_str(/* const priv_set_t *, char, int */);
96 
97 extern int priv_getbyname(/* const char * */);
98 extern char *priv_getbynum(/* int */);
99 extern int priv_getsetbyname(/* const char * */);
100 extern char *priv_getsetbynum(/* int */);
101 extern char *priv_gettext(/* const char * */);
102 
103 extern priv_set_t *priv_allocset(/* void */);
104 extern void priv_freeset(/* priv_set_t * */);
105 
106 extern void priv_emptyset(/* priv_set_t * */);
107 extern void priv_fillset(/* priv_set_t * */);
108 extern boolean_t priv_isemptyset(/* const priv_set_t * */);
109 extern boolean_t priv_isfullset(/* const priv_set_t * */);
110 extern boolean_t priv_isequalset(/* const priv_set_t *, const priv_set_t * */);
111 extern boolean_t priv_issubset(/* const priv_set_t *, const priv_set_t * */);
112 extern void priv_intersect(/* const priv_set_t *, priv_set_t * */);
113 extern void priv_union(/* const priv_set_t *, priv_set_t * */);
114 extern void priv_inverse(/* priv_set_t * */);
115 extern int priv_addset(/* priv_set_t *, const char * */);
116 extern void priv_copyset(/* const priv_set_t *, priv_set_t * */);
117 extern int priv_delset(/* priv_set_t *, const char * */);
118 extern boolean_t priv_ismember(/* const priv_set_t *, const char * */);
119 
120 #endif	/* __STDC__ */
121 
122 #ifdef	__cplusplus
123 }
124 #endif
125 
126 #endif	/* _PRIV_H_ */
127