Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/head/config_admin.h
+++ new/usr/src/head/config_admin.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 + *
23 25 * Copyright 1998-2002 Sun Microsystems, Inc. All rights reserved.
24 26 * Use is subject to license terms.
25 27 */
26 28
27 29 #ifndef _SYS_CONFIG_ADMIN_H
28 30 #define _SYS_CONFIG_ADMIN_H
29 31
30 -#pragma ident "%Z%%M% %I% %E% SMI"
31 -
32 32 /*
33 33 * config_admin.h
34 34 *
35 35 * this file supports usage of the interfaces defined in
36 36 * config_admin.3x. which are contained in /usr/lib/libcfgadm.so.1
37 37 */
38 38
39 39 #include <sys/param.h>
40 40
41 41 #ifdef __cplusplus
42 42 extern "C" {
43 43 #endif
44 44
45 45
46 46 /*
47 47 * Defined constants
48 48 */
49 49 #define CFGA_AP_LOG_ID_LEN 20
50 50 #define CFGA_AP_PHYS_ID_LEN MAXPATHLEN
51 51 #define CFGA_INFO_LEN 4096
52 52 #define CFGA_TYPE_LEN 12
53 53
54 54 #define CFGA_CLASS_LEN 12
55 55 #define CFGA_LOG_EXT_LEN 30
56 56
57 57 #define CFGA_DYN_SEP "::"
58 58 #define CFGA_PHYS_EXT_LEN (CFGA_AP_PHYS_ID_LEN + CFGA_LOG_EXT_LEN)
59 59
60 60
61 61 /*
62 62 * Configuration change state commands
63 63 */
64 64 typedef enum {
65 65 CFGA_CMD_NONE = 0,
66 66 CFGA_CMD_LOAD,
67 67 CFGA_CMD_UNLOAD,
68 68 CFGA_CMD_CONNECT,
69 69 CFGA_CMD_DISCONNECT,
70 70 CFGA_CMD_CONFIGURE,
71 71 CFGA_CMD_UNCONFIGURE
72 72 } cfga_cmd_t;
73 73
74 74 /*
75 75 * Configuration states
76 76 */
77 77 typedef enum {
78 78 CFGA_STAT_NONE = 0,
79 79 CFGA_STAT_EMPTY,
80 80 CFGA_STAT_DISCONNECTED,
81 81 CFGA_STAT_CONNECTED,
82 82 CFGA_STAT_UNCONFIGURED,
83 83 CFGA_STAT_CONFIGURED
84 84 } cfga_stat_t;
85 85
86 86 /*
87 87 * Configuration conditions
88 88 */
89 89 typedef enum {
90 90 CFGA_COND_UNKNOWN = 0,
91 91 CFGA_COND_OK,
92 92 CFGA_COND_FAILING,
93 93 CFGA_COND_FAILED,
94 94 CFGA_COND_UNUSABLE
95 95 } cfga_cond_t;
96 96
97 97 /*
98 98 * Flags
99 99 */
100 100 #define CFGA_FLAG_FORCE 1
101 101 #define CFGA_FLAG_VERBOSE 2
102 102 #define CFGA_FLAG_LIST_ALL 4
103 103
104 104 typedef char cfga_ap_log_id_t[CFGA_AP_LOG_ID_LEN];
105 105 typedef char cfga_ap_phys_id_t[CFGA_AP_PHYS_ID_LEN];
106 106 typedef char cfga_info_t[CFGA_INFO_LEN];
107 107 typedef char cfga_type_t[CFGA_TYPE_LEN];
108 108 typedef int cfga_flags_t;
109 109 typedef int cfga_busy_t;
110 110
111 111
112 112 typedef char cfga_log_ext_t[CFGA_LOG_EXT_LEN];
113 113 typedef char cfga_phys_ext_t[CFGA_PHYS_EXT_LEN];
114 114 typedef char cfga_class_t[CFGA_CLASS_LEN];
115 115
116 116 typedef struct cfga_list_data {
117 117 cfga_log_ext_t ap_log_id; /* Attachment point logical id */
118 118 cfga_phys_ext_t ap_phys_id; /* Attachment point physical id */
119 119 cfga_class_t ap_class; /* Attachment point class */
120 120 cfga_stat_t ap_r_state; /* Receptacle state */
121 121 cfga_stat_t ap_o_state; /* Occupant state */
122 122 cfga_cond_t ap_cond; /* Attachment point condition */
123 123 cfga_busy_t ap_busy; /* Busy indicators */
124 124 time_t ap_status_time; /* Attachment point last change */
125 125 cfga_info_t ap_info; /* Miscellaneous information */
126 126 cfga_type_t ap_type; /* Occupant type */
127 127 } cfga_list_data_t;
128 128
129 129 /*
130 130 * The following structure is retained for backward compatibility
131 131 */
132 132 typedef struct cfga_stat_data {
133 133 cfga_ap_log_id_t ap_log_id; /* Attachment point logical id */
134 134 cfga_ap_phys_id_t ap_phys_id; /* Attachment point physical id */
135 135 cfga_stat_t ap_r_state; /* Receptacle state */
136 136 cfga_stat_t ap_o_state; /* Occupant state */
137 137 cfga_cond_t ap_cond; /* Attachment point condition */
138 138 cfga_busy_t ap_busy; /* Busy indicators */
139 139 time_t ap_status_time; /* Attachment point last change */
140 140 cfga_info_t ap_info; /* Miscellaneous information */
141 141 cfga_type_t ap_type; /* Occupant type */
142 142 } cfga_stat_data_t;
143 143
144 144
145 145 struct cfga_confirm {
146 146 int (*confirm)(void *appdata_ptr, const char *message);
147 147 void *appdata_ptr;
148 148 };
149 149
150 150 struct cfga_msg {
151 151 int (*message_routine)(void *appdata_ptr, const char *message);
152 152 void *appdata_ptr;
153 153 };
154 154
155 155 /*
156 156 * Library function error codes returned by all functions below
157 157 * except config_strerror which is used to decode the error
158 158 * codes.
159 159 */
160 160 typedef enum {
161 161 CFGA_OK = 0,
162 162 CFGA_NACK,
163 163 CFGA_NOTSUPP,
164 164 CFGA_OPNOTSUPP,
165 165 CFGA_PRIV,
166 166 CFGA_BUSY,
167 167 CFGA_SYSTEM_BUSY,
168 168 CFGA_DATA_ERROR,
↓ open down ↓ |
127 lines elided |
↑ open up ↑ |
169 169 CFGA_LIB_ERROR,
170 170 CFGA_NO_LIB,
171 171 CFGA_INSUFFICENT_CONDITION,
172 172 CFGA_INVAL,
173 173 CFGA_ERROR,
174 174 CFGA_APID_NOEXIST,
175 175 CFGA_ATTR_INVAL
176 176 } cfga_err_t;
177 177
178 178
179 -#if defined(__STDC__)
180 -
181 179 /*
182 180 * config_admin.3x library interfaces
183 181 */
184 182
185 183 cfga_err_t config_change_state(cfga_cmd_t state_change_cmd, int num_ap_ids,
186 184 char *const *ap_ids, const char *options, struct cfga_confirm *confp,
187 185 struct cfga_msg *msgp, char **errstring, cfga_flags_t flags);
188 186
189 187 cfga_err_t config_private_func(const char *function, int num_ap_ids,
190 188 char *const *ap_ids, const char *options, struct cfga_confirm *confp,
191 189 struct cfga_msg *msgp, char **errstring, cfga_flags_t flags);
192 190
193 191 cfga_err_t config_test(int num_ap_ids, char *const *ap_ids,
194 192 const char *options, struct cfga_msg *msgp, char **errstring,
195 193 cfga_flags_t flags);
196 194
197 195 cfga_err_t config_list_ext(int num_ap_ids, char *const *ap_ids,
198 196 struct cfga_list_data **ap_id_list, int *nlist, const char *options,
199 197 const char *listopts, char **errstring, cfga_flags_t flags);
200 198
201 199 cfga_err_t config_help(int num_ap_ids, char *const *ap_ids,
202 200 struct cfga_msg *msgp, const char *options, cfga_flags_t flags);
203 201
204 202 const char *config_strerror(cfga_err_t cfgerrnum);
205 203
206 204 int config_ap_id_cmp(const cfga_ap_log_id_t ap_id1,
207 205 const cfga_ap_log_id_t ap_id2);
208 206
209 207 void config_unload_libs();
210 208
211 209 /*
212 210 * The following two routines are retained only for backward compatibility
213 211 */
214 212 cfga_err_t config_stat(int num_ap_ids, char *const *ap_ids,
215 213 struct cfga_stat_data *buf, const char *options, char **errstring);
216 214
217 215 cfga_err_t config_list(struct cfga_stat_data **ap_di_list, int *nlist,
218 216 const char *options, char **errstring);
219 217
220 218
221 219 #ifdef CFGA_PLUGIN_LIB
222 220 /*
223 221 * Plugin library routine hooks - only to be used by the generic
224 222 * library and plugin libraries (who must define CFGA_PLUGIN_LIB
225 223 * prior to the inclusion of this header).
226 224 */
227 225
228 226 cfga_err_t cfga_change_state(cfga_cmd_t, const char *, const char *,
229 227 struct cfga_confirm *, struct cfga_msg *, char **, cfga_flags_t);
230 228 cfga_err_t cfga_private_func(const char *, const char *, const char *,
231 229 struct cfga_confirm *, struct cfga_msg *, char **, cfga_flags_t);
232 230 cfga_err_t cfga_test(const char *, const char *, struct cfga_msg *,
233 231 char **, cfga_flags_t);
234 232 cfga_err_t cfga_list_ext(const char *, struct cfga_list_data **, int *,
235 233 const char *, const char *, char **, cfga_flags_t);
236 234 cfga_err_t cfga_help(struct cfga_msg *, const char *, cfga_flags_t);
237 235 int cfga_ap_id_cmp(const cfga_ap_log_id_t,
238 236 const cfga_ap_log_id_t);
239 237
240 238
241 239 /*
242 240 * Plugin version information.
243 241 */
244 242 #define CFGA_HSL_V1 1
245 243 #define CFGA_HSL_V2 2
246 244 #define CFGA_HSL_VERS CFGA_HSL_V2
247 245
248 246 /*
↓ open down ↓ |
58 lines elided |
↑ open up ↑ |
249 247 * The following two routines are retained only for backward compatibility.
250 248 */
251 249 cfga_err_t cfga_stat(const char *, struct cfga_stat_data *,
252 250 const char *, char **);
253 251 cfga_err_t cfga_list(const char *, struct cfga_stat_data **, int *,
254 252 const char *, char **);
255 253
256 254
257 255 #endif /* CFGA_PLUGIN_LIB */
258 256
259 -#else /* !defined __STDC__ */
260 -
261 -extern const char *config_strerror();
262 -extern int config_ap_id_cmp();
263 -
264 -#endif /* __STDC__ */
265 -
266 257 #ifdef __cplusplus
267 258 }
268 259 #endif
269 260
270 261 #endif /* _SYS_CONFIG_ADMIN_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX