1 | @c |
---|
2 | @c COPYRIGHT (c) 1988-1998. |
---|
3 | @c On-Line Applications Research Corporation (OAR). |
---|
4 | @c All rights reserved. |
---|
5 | @c |
---|
6 | @c $Id$ |
---|
7 | @c |
---|
8 | |
---|
9 | @chapter Configuration Space Manager |
---|
10 | |
---|
11 | @section Introduction |
---|
12 | |
---|
13 | The |
---|
14 | configuration space manager is ... |
---|
15 | |
---|
16 | The directives provided by the configuration space manager are: |
---|
17 | |
---|
18 | @itemize @bullet |
---|
19 | @item @code{cfg_mount} - Mount a Configuration Space |
---|
20 | @item @code{cfg_unmount} - Unmount a Configuration Space |
---|
21 | @item @code{cfg_mknod} - Create a Configuration Node |
---|
22 | @item @code{cfg_get} - Get Configuration Node Value |
---|
23 | @item @code{cfg_set} - Set Configuration Node Value |
---|
24 | @item @code{cfg_link} - Create a Configuration Link |
---|
25 | @item @code{cfg_unlink} - Remove a Configuration Link |
---|
26 | @item @code{cfg_open} - Open a Configuration Space |
---|
27 | @item @code{cfg_read} - Read a Configuration Space |
---|
28 | @item @code{cfg_children} - Get Node Entries |
---|
29 | @item @code{cfg_mark} - Set Configuration Space Option |
---|
30 | @item @code{cfg_close} - Close a Configuration Space |
---|
31 | @end itemize |
---|
32 | |
---|
33 | @section Background |
---|
34 | |
---|
35 | @section Operations |
---|
36 | |
---|
37 | @section Directives |
---|
38 | |
---|
39 | This section details the configuration space manager's directives. |
---|
40 | A subsection is dedicated to each of this manager's directives |
---|
41 | and describes the calling sequence, related constants, usage, |
---|
42 | and status codes. |
---|
43 | |
---|
44 | @page |
---|
45 | @subsection cfg_mount - Mount a Configuration Space |
---|
46 | |
---|
47 | @subheading CALLING SEQUENCE: |
---|
48 | |
---|
49 | @ifset is-C |
---|
50 | @example |
---|
51 | int cfg_mount( |
---|
52 | const char *file, |
---|
53 | const char *cfgpath, |
---|
54 | log_facility_t notification, |
---|
55 | ); |
---|
56 | @end example |
---|
57 | @end ifset |
---|
58 | |
---|
59 | @ifset is-Ada |
---|
60 | @end ifset |
---|
61 | |
---|
62 | @subheading STATUS CODES: |
---|
63 | |
---|
64 | @table @b |
---|
65 | @item EPERM |
---|
66 | The caller does not have the appropriate privilege. |
---|
67 | @item EACCES |
---|
68 | Search permission is denied for a component of the path prefix. |
---|
69 | @item EEXIST |
---|
70 | The file specified by the file argument does not exist |
---|
71 | @item ENAMETOOLONG |
---|
72 | A component of a pathname exceeded {NAME_MAX} characters, |
---|
73 | or an entire path name exceed {PATH_MAX} characters while |
---|
74 | {_POSIX_NO_TRUNC} is in effect. |
---|
75 | @item ENOENT |
---|
76 | A component of cfgpath does not exist. |
---|
77 | @item ENOTDIR |
---|
78 | A component of the file path prefix is not a directory. |
---|
79 | @item EBUSY |
---|
80 | The configuration space defined by file is already mounted. |
---|
81 | @item EINVAL |
---|
82 | The notification argument specifies an invalid log facility. |
---|
83 | @item ENOSYS |
---|
84 | The cfg_mount() function is not supported by this implementation. |
---|
85 | |
---|
86 | @end table |
---|
87 | |
---|
88 | @subheading DESCRIPTION: |
---|
89 | |
---|
90 | If {_POSIX_CFG} is defined: |
---|
91 | |
---|
92 | The @code{cfg_mount} function maps a configuration space defined |
---|
93 | by the file identified by the the @code{file} argument. The |
---|
94 | distinguished node of the mapped configuration space shall be |
---|
95 | mounted in the active space at the point identified bt the |
---|
96 | @code{cfgpath} configuration pathname. |
---|
97 | |
---|
98 | The @code{notification} argument specifies how changes to the |
---|
99 | mapped configuration space shall be communicated to the application. |
---|
100 | If the @code{notification} argument is NULL, no notification shall |
---|
101 | be performed for the mapped configuration space. If the Event |
---|
102 | Logging option is defined, the notification argument defines the |
---|
103 | facility to which changes in the mapped configuration space shall |
---|
104 | be logged. Otherwise, the @code{notification} argument shall |
---|
105 | specify an implementation defined method of notifying the application |
---|
106 | of changes to the mapped configuration space. |
---|
107 | |
---|
108 | Otherwise: |
---|
109 | |
---|
110 | The @code{cfg_mount} function shall fail. |
---|
111 | |
---|
112 | @subheading NOTES: |
---|
113 | |
---|
114 | @page |
---|
115 | @subsection cfg_unmount - Unmount a Configuration Space |
---|
116 | |
---|
117 | @subheading CALLING SEQUENCE: |
---|
118 | |
---|
119 | @ifset is-C |
---|
120 | @example |
---|
121 | int cfg_unmount( |
---|
122 | const char *cfgpath |
---|
123 | ); |
---|
124 | @end example |
---|
125 | @end ifset |
---|
126 | |
---|
127 | @ifset is-Ada |
---|
128 | @end ifset |
---|
129 | |
---|
130 | @subheading STATUS CODES: |
---|
131 | |
---|
132 | @table @b |
---|
133 | @item EPERM |
---|
134 | The caller does not have the appropriate privileges. |
---|
135 | @item EACCES |
---|
136 | Search permission is denied for a component of the path prefix. |
---|
137 | @item ENOENT |
---|
138 | A component of cfgpath does not exist. |
---|
139 | @item ENAMETOOLONG |
---|
140 | A component of a pathname exceeded {NAME_MAX} characters, |
---|
141 | or an entire path name exceed {PATH_MAX} characters while |
---|
142 | {_POSIX_NO_TRUNC} is in effect. |
---|
143 | @item EINVAL |
---|
144 | The requested node is not the distinguished node of a mounted |
---|
145 | configuration space. |
---|
146 | @item EBUSY |
---|
147 | One or more processes has an open configuration traversal |
---|
148 | stream for the configuration space whose distinguished node is |
---|
149 | referenced by the cfgpath argument. |
---|
150 | @item ENOSYS |
---|
151 | The cfg_umount function is not supported by this implementation. |
---|
152 | @item ELOOP |
---|
153 | A node appears more than once in the path specified by the |
---|
154 | cfg_path argument |
---|
155 | @item ELOOP |
---|
156 | More than {SYMLOOP_MAX} symbolic links were encountered during |
---|
157 | resolution of the cfgpath argument |
---|
158 | |
---|
159 | @end table |
---|
160 | |
---|
161 | @subheading DESCRIPTION: |
---|
162 | |
---|
163 | If {_POSIX_CFG} is defined: |
---|
164 | |
---|
165 | The @code{cfg_umount} function unmaps the configuration space whose |
---|
166 | distinguished node is mapped in the active space at the location defined |
---|
167 | by @code{cfgpatah} configuration pathname. All system resources |
---|
168 | allocated for this configuration space should be deallocated. |
---|
169 | |
---|
170 | Otherwise: |
---|
171 | |
---|
172 | The @code{cfg_umount} function shall fail. |
---|
173 | |
---|
174 | @subheading NOTES: |
---|
175 | |
---|
176 | @page |
---|
177 | @subsection cfg_mknod - Create a Configuratioin Node |
---|
178 | |
---|
179 | @subheading CALLING SEQUENCE: |
---|
180 | |
---|
181 | @ifset is-C |
---|
182 | @example |
---|
183 | int cfg_mknod( |
---|
184 | const char *cfgpath, |
---|
185 | mode_t mode, |
---|
186 | cfg_type_t type |
---|
187 | ); |
---|
188 | @end example |
---|
189 | @end ifset |
---|
190 | |
---|
191 | @ifset is-Ada |
---|
192 | @end ifset |
---|
193 | |
---|
194 | @subheading STATUS CODES: |
---|
195 | |
---|
196 | @table @b |
---|
197 | @item ENAMETOOLONG |
---|
198 | A component of a pathname exceeded {NAME_MAX} characters, |
---|
199 | or an entire path name exceed {PATH_MAX} characters while |
---|
200 | {_POSIX_NO_TRUNC} is in effect. |
---|
201 | @item ENOENT |
---|
202 | A compent of the path prefix does not exist. |
---|
203 | @item EACCES |
---|
204 | Search permission is denied for a component of the path prefix. |
---|
205 | @item ELOOP |
---|
206 | Too many symbolic links were encountered in translating the |
---|
207 | pathname. |
---|
208 | @item EPERM |
---|
209 | The calling process does not have the appropriate privilege. |
---|
210 | @item EEXIST |
---|
211 | The named node exists. |
---|
212 | @item EINVAL |
---|
213 | The value of mode is invalid. |
---|
214 | @item EINVAL |
---|
215 | The value of type is invalid. |
---|
216 | @item ENOSYS |
---|
217 | The function cfg_mknod() is not supported by this implementation. |
---|
218 | @item ELOOP |
---|
219 | A node appears more than once in the path specified by the |
---|
220 | cfg_path argument |
---|
221 | @item ELOOP |
---|
222 | More than {SYMLOOP_MAX} symbolic links were encountered during |
---|
223 | resolution of the cfgpath argument. |
---|
224 | @item EROFS |
---|
225 | The named node resides on a read-only configuration space. |
---|
226 | |
---|
227 | @end table |
---|
228 | |
---|
229 | @subheading DESCRIPTION: |
---|
230 | |
---|
231 | If {_POSIX_CFG} is defined: |
---|
232 | |
---|
233 | The @code{cfg_mknod} function creates a new node in the configuration |
---|
234 | space which contains the pathname prefix of @cod{cfgpath}. T he node |
---|
235 | name shall be defined by the pathname suffix of @code{cfgpath}. The |
---|
236 | node name shall be defined by the pathname suffix of @code{cfgpath}. |
---|
237 | The node permissions shall be specified by the value of @code{mode}. |
---|
238 | The node type shall be specified by the value of @code{type}. |
---|
239 | |
---|
240 | Otherwise: |
---|
241 | |
---|
242 | The @code{cfg_mknod} function shall fail. |
---|
243 | |
---|
244 | @subheading NOTES: |
---|
245 | |
---|
246 | @page |
---|
247 | @subsection cfg_get - Get Configuration Node Value |
---|
248 | |
---|
249 | @subheading CALLING SEQUENCE: |
---|
250 | |
---|
251 | @ifset is-C |
---|
252 | @example |
---|
253 | int cfg_get( |
---|
254 | const char *cfgpath |
---|
255 | cfg_value_t *value |
---|
256 | ); |
---|
257 | @end example |
---|
258 | @end ifset |
---|
259 | |
---|
260 | @ifset is-Ada |
---|
261 | @end ifset |
---|
262 | |
---|
263 | @subheading STATUS CODES: |
---|
264 | |
---|
265 | @table @b |
---|
266 | @item ENAMETOOLONG |
---|
267 | A component of a pathname exceeded {NAME_MAX} characters, |
---|
268 | or an entire path name exceed {PATH_MAX} characters while |
---|
269 | {_POSIX_NO_TRUNC} is in effect. |
---|
270 | @item ENOENT |
---|
271 | A component of cfgpath does not exist. |
---|
272 | @item EACCES |
---|
273 | Search permission is denied for a component of the path prefix. |
---|
274 | @item EPERM |
---|
275 | The calling process does not have the appropriate priviledges. |
---|
276 | @item ENOSYS |
---|
277 | The function cfg_get() is not supported by this implementation |
---|
278 | @item ELOOP |
---|
279 | A node appears more than once in the path specified by the |
---|
280 | cfg_path argument |
---|
281 | @item ELOOP |
---|
282 | More than {SYMLOOP_MAX} symbolic links were encountered during |
---|
283 | resolution of the cfgpath argument. |
---|
284 | |
---|
285 | @end table |
---|
286 | |
---|
287 | @subheading DESCRIPTION: |
---|
288 | |
---|
289 | If {_POSIX_CFG} is defined: |
---|
290 | |
---|
291 | The @code{cfg_get} function stores the value attribute of the |
---|
292 | configuration node identified by @code{cfgpath}, into the buffer |
---|
293 | described by the @code{value} pointer. |
---|
294 | |
---|
295 | Otherwise: |
---|
296 | |
---|
297 | The @code{cfg_get} function shall fail. |
---|
298 | |
---|
299 | |
---|
300 | @subheading NOTES: |
---|
301 | |
---|
302 | @page |
---|
303 | @subsection cfg_set - Set Configuration Node Value |
---|
304 | |
---|
305 | @subheading CALLING SEQUENCE: |
---|
306 | |
---|
307 | @ifset is-C |
---|
308 | @example |
---|
309 | int cfg_set( |
---|
310 | const char *cfgpath |
---|
311 | cfg_value_t *value |
---|
312 | ); |
---|
313 | @end example |
---|
314 | @end ifset |
---|
315 | |
---|
316 | @ifset is-Ada |
---|
317 | @end ifset |
---|
318 | |
---|
319 | @subheading STATUS CODES: |
---|
320 | |
---|
321 | @table @b |
---|
322 | @item ENAMETOOLONG |
---|
323 | A component of a pathname exceeded {NAME_MAX} characters, |
---|
324 | or an entire path name exceed {PATH_MAX} characters while |
---|
325 | {_POSIX_NO_TRUNC} is in effect. |
---|
326 | @item ENOENT |
---|
327 | A component of cfgpath does not exist |
---|
328 | @item EACCES |
---|
329 | Search permission is denied for a component of the path prefix. |
---|
330 | @item EPERM |
---|
331 | The calling process does not have the appropriate privilege. |
---|
332 | @item ENOSYS |
---|
333 | The function cfg_set() is not supported by this implementation. |
---|
334 | @item ELOOP |
---|
335 | A node appears more than once in the path specified by the |
---|
336 | cfg-path argument. |
---|
337 | @item ELOOP |
---|
338 | More than {SYMLOOP_MAX} symbolic links were encountered during |
---|
339 | resolution of the cfgpath argument. |
---|
340 | |
---|
341 | @end table |
---|
342 | |
---|
343 | @subheading DESCRIPTION: |
---|
344 | |
---|
345 | If {_POSIX_CFG} is defined: |
---|
346 | |
---|
347 | The @code{cfg_set} function stores the value specified by the |
---|
348 | @code{value} argument in the configuration node defined by the |
---|
349 | @code{cfgpath} argument. |
---|
350 | |
---|
351 | Otherwise: |
---|
352 | |
---|
353 | The @code{cfg_set} function shall fail. |
---|
354 | |
---|
355 | |
---|
356 | @subheading NOTES: |
---|
357 | |
---|
358 | @page |
---|
359 | @subsection cfg_link - Create a Configuration Link |
---|
360 | |
---|
361 | @subheading CALLING SEQUENCE: |
---|
362 | |
---|
363 | @ifset is-C |
---|
364 | @example |
---|
365 | int cfg_link( |
---|
366 | const char *src |
---|
367 | const char *dest |
---|
368 | ); |
---|
369 | @end example |
---|
370 | @end ifset |
---|
371 | |
---|
372 | @ifset is-Ada |
---|
373 | @end ifset |
---|
374 | |
---|
375 | @subheading STATUS CODES: |
---|
376 | |
---|
377 | @table @b |
---|
378 | @item ENAMETOOLONG |
---|
379 | A component of a pathname exceeded {NAME_MAX} characters, |
---|
380 | or an entire path name exceed {PATH_MAX} characters while |
---|
381 | {_POSIX_NO_TRUNC} is in effect. |
---|
382 | @item ENOENT |
---|
383 | A component of either path prefix does not exist. |
---|
384 | @item EACCES |
---|
385 | A component of either path prefix denies search permission. |
---|
386 | @item EACCES |
---|
387 | The requested link requires writing in a node with a mode that |
---|
388 | denies write permission. |
---|
389 | @item ENOENT |
---|
390 | The node named by src does not exist. |
---|
391 | @item EEXIST |
---|
392 | The node named by dest does exist. |
---|
393 | @item EPERM |
---|
394 | The calling process does not have the appropriate privilege to |
---|
395 | modify the node indicated by the src argument. |
---|
396 | @item EXDEV |
---|
397 | The link named by dest and the node named by src are from different |
---|
398 | configuration spaces. |
---|
399 | @item ENOSPC |
---|
400 | The node in which the entry for the new link is boeing placed |
---|
401 | cannot be extended because there is no space left on the |
---|
402 | configuration space containing the node. |
---|
403 | @item EIO |
---|
404 | An I/O error occurred while reading from or writing to the |
---|
405 | configuration space to make the link entry. |
---|
406 | @item EROFS |
---|
407 | The requested link requires writing in a node on a read-only |
---|
408 | configuration space. |
---|
409 | @item ENOSYS |
---|
410 | The function cfg_link() is not supported by this implementation. |
---|
411 | @item ELOOP |
---|
412 | A node appears more than once in the path specified by the |
---|
413 | cfg-path argument. |
---|
414 | @item ELOOP |
---|
415 | More than {SYMLOOP_MAX} symbolic links were encountered during |
---|
416 | resolution of the cfgpath argument. |
---|
417 | |
---|
418 | @end table |
---|
419 | |
---|
420 | @subheading DESCRIPTION: |
---|
421 | |
---|
422 | If {_POSIX_CFG} is defined: |
---|
423 | |
---|
424 | The @code{src} and @code{dest}arguments point to pathnnames which |
---|
425 | name existing nodes. The @code{cfg_link} function shall atomically |
---|
426 | create a link between specified nodes, and increment by one the link |
---|
427 | count of the node specified by the @code{src} argument. |
---|
428 | |
---|
429 | If the @code{cfg_lin} function fails, no link shall be created, and |
---|
430 | the link count of the node shall remain unchanged by this function |
---|
431 | call. |
---|
432 | |
---|
433 | This implementation may require that the calling process has permission |
---|
434 | to access the specified nodes. |
---|
435 | |
---|
436 | Otherwise: |
---|
437 | |
---|
438 | The @code{cfg_link} functioin shall fail. |
---|
439 | |
---|
440 | @subheading NOTES: |
---|
441 | |
---|
442 | @page |
---|
443 | @subsection cfg_unlink - Remove a Configuration Link |
---|
444 | |
---|
445 | @subheading CALLING SEQUENCE: |
---|
446 | |
---|
447 | @ifset is-C |
---|
448 | @example |
---|
449 | int cfg_unlink( |
---|
450 | const char *cfgpath |
---|
451 | ); |
---|
452 | @end example |
---|
453 | @end ifset |
---|
454 | |
---|
455 | @ifset is-Ada |
---|
456 | @end ifset |
---|
457 | |
---|
458 | @subheading STATUS CODES: |
---|
459 | |
---|
460 | @table @b |
---|
461 | @item ENAMETOOLONG |
---|
462 | A component of a pathname exceeded {NAME_MAX} characters, |
---|
463 | or an entire path name exceed {PATH_MAX} characters. |
---|
464 | @item ENOENT |
---|
465 | The named node does not exist. |
---|
466 | @item EACCES |
---|
467 | Search permission is denied on the node containing the link to |
---|
468 | be removed. |
---|
469 | @item EACCES |
---|
470 | Write permission is denied on the node containing the link to |
---|
471 | be removed. |
---|
472 | @item ENOENT |
---|
473 | A component of cfgpath does not exist. |
---|
474 | @item EPERM |
---|
475 | The calling process does not have the appropriate priviledge to |
---|
476 | modify the node indicated by the path prefix of the cfgpath |
---|
477 | argument. |
---|
478 | @item EBUSY |
---|
479 | The node to be unlinked is the distinguished node of a mounted |
---|
480 | configuration space. |
---|
481 | @item EIO |
---|
482 | An I/O error occurred while deleting the link entry or deallocating |
---|
483 | the node. |
---|
484 | @item EROFS |
---|
485 | The named node resides in a read-opnly configuration space. |
---|
486 | @item ENOSYS |
---|
487 | The function cfg_unlink() is not supported by this implementation. |
---|
488 | @item ELOOP |
---|
489 | A node appears more than once in the path specified by the |
---|
490 | cfg-path argument. |
---|
491 | @item ELOOP |
---|
492 | More than {SYMLOOP_MAX} symbolic links were encountered during |
---|
493 | resolution of the cfgpath argument. |
---|
494 | |
---|
495 | @end table |
---|
496 | |
---|
497 | @subheading DESCRIPTION: |
---|
498 | |
---|
499 | If {_POSIX_CFG} is defined: |
---|
500 | |
---|
501 | The @code{cfg_unlink} function removes the link between the node |
---|
502 | specified by the @code{cfgpath} path prefix and the parent node |
---|
503 | specified by @code{cfgpaht}, and shall decrement the link count |
---|
504 | of the @code{cfgpath} node. |
---|
505 | |
---|
506 | When the link count of the node becomes zero, the space occupied |
---|
507 | by the node shall be freed and the node shall no longer be accessible. |
---|
508 | |
---|
509 | Otherwise: |
---|
510 | |
---|
511 | The @code{unlink} function shall fail. |
---|
512 | |
---|
513 | @subheading NOTES: |
---|
514 | |
---|
515 | @page |
---|
516 | @subsection cfg_open - Open a Configuration Space |
---|
517 | |
---|
518 | @subheading CALLING SEQUENCE: |
---|
519 | |
---|
520 | @ifset is-C |
---|
521 | @example |
---|
522 | int cfg_open( |
---|
523 | const char *pathnames[], |
---|
524 | int options, |
---|
525 | int (*compar)(const CFGENT **f1, const CFGENT **f2), |
---|
526 | CFG **cfgsrteam |
---|
527 | ); |
---|
528 | @end example |
---|
529 | @end ifset |
---|
530 | |
---|
531 | @ifset is-Ada |
---|
532 | @end ifset |
---|
533 | |
---|
534 | @subheading STATUS CODES: |
---|
535 | |
---|
536 | @table @b |
---|
537 | @item EACCES |
---|
538 | Search permission is denied for any component of a pathname. |
---|
539 | @item ELOOP |
---|
540 | A loop exists in symbolic links encountered during resolution |
---|
541 | of a pathname. |
---|
542 | @item ENAMETOOLONG |
---|
543 | The length of a pathname exceeds {PATH_MAX}, or a pathname |
---|
544 | component is longer than {NAME_MAX} while {_POSIX_NO_TRUNC} |
---|
545 | @item ENOENT |
---|
546 | The pathname argument is an empty string or the named node |
---|
547 | does not exist. |
---|
548 | @item EINVAL |
---|
549 | Either both or neither of CFG_LOGICAL and CFG_PHYSICAL are |
---|
550 | specified by the options argument ??????????? |
---|
551 | @item ENOMEM |
---|
552 | Not enough memory is available to create the necessary structures. |
---|
553 | @item ENOSYS |
---|
554 | The function cfg_open() is not supported by this implementation. |
---|
555 | @item ELOOP |
---|
556 | More than {SYMLOOP_MAX} symbolic links were encountered during |
---|
557 | resolution of the pathnames argument. |
---|
558 | @item ENAMETOOLONG |
---|
559 | As a result of encountering a symbolic link in resolution of the |
---|
560 | pathname specified by the pathnames argument, the lenght of |
---|
561 | the substituted pathname string exceeded {PATH_MAX}. |
---|
562 | |
---|
563 | @end table |
---|
564 | |
---|
565 | @subheading DESCRIPTION: |
---|
566 | |
---|
567 | If {_POSIX_CFG} is defined: |
---|
568 | |
---|
569 | The @code{cfg_open} function shall open a configuration traversal stream |
---|
570 | rooted in the configuration nodes name by the @code{pathnames} argument. |
---|
571 | It shall store a pointer to a CFG object that represents that stream at |
---|
572 | the location identified the @code{cfgstream} pointer. The @code{pathnames} |
---|
573 | argument is an array of character pointers to NULL-terminated strings. |
---|
574 | The last member of this array shall be a NULL pointer. |
---|
575 | |
---|
576 | The value of @code{options} is the bitwise inclusive OR of values from the |
---|
577 | following lists. Applications shall supply exactly one of the first two |
---|
578 | values below in @code{options}. |
---|
579 | CFG_LOGICAL |
---|
580 | CFG_PHYSICAL |
---|
581 | |
---|
582 | Any combination of the remaining flags can be specified in the value of |
---|
583 | @code{options} |
---|
584 | CFG_COMFOLLOW |
---|
585 | CFG_XDEV |
---|
586 | |
---|
587 | The @code{cfg_open} argument @code{compar} shall either be NULL or point |
---|
588 | to a function that shall be called with two pointers to pointers to CFGENT |
---|
589 | structures that shall return less than, equal to , or greater than zero if |
---|
590 | the node referenced by the first argument is considered to be respectively |
---|
591 | less than, equal to, or greater than the node referenced by the second. |
---|
592 | The CFGENT structure fields provided to the comparison routine shall be as |
---|
593 | described with the exception that the contents of the @code{cfg_path} and |
---|
594 | @code{cfg_pathlen} fields are unspecified. |
---|
595 | |
---|
596 | This comparison routine is used to determine the order in which nodes in |
---|
597 | directories encountered during the traversal are returned, and the order |
---|
598 | of traversal when more than one node is specified in the @code{pathnames} |
---|
599 | argument to @code{cfg_open}. If a comparison routine is specified, the |
---|
600 | order of traversal shall be from the least to the greatest. If the |
---|
601 | @code{compar} argument is NULL, the order of traversal shall be as listed |
---|
602 | in the @code{pathnames} argument. |
---|
603 | |
---|
604 | Otherwise: |
---|
605 | |
---|
606 | The @code{cfg_open} shall fail. |
---|
607 | |
---|
608 | @subheading NOTES: |
---|
609 | |
---|
610 | @page |
---|
611 | @subsection cfg_read - Read a Configuration Space |
---|
612 | |
---|
613 | @subheading CALLING SEQUENCE: |
---|
614 | |
---|
615 | @ifset is-C |
---|
616 | @example |
---|
617 | int cfg_read( |
---|
618 | CFG *cfgp, |
---|
619 | CFGENT **node |
---|
620 | ); |
---|
621 | @end example |
---|
622 | @end ifset |
---|
623 | |
---|
624 | @ifset is-Ada |
---|
625 | @end ifset |
---|
626 | |
---|
627 | @subheading STATUS CODES: |
---|
628 | |
---|
629 | @table @b |
---|
630 | @item EACCES |
---|
631 | Search permission is denied for any component of a pathname. |
---|
632 | @item EBADF |
---|
633 | The cfgp argument does not refer to an open configuration |
---|
634 | space. |
---|
635 | @item ELOOP |
---|
636 | A loop exists in symbolic links encountered during resolution |
---|
637 | of a pathname. |
---|
638 | @item ENOENT |
---|
639 | A named node does not exist. |
---|
640 | @item ENOMEM |
---|
641 | Not enough memory is available to create the necessary structures. |
---|
642 | @item ENOSYS |
---|
643 | The function cfg_read() is not suported by this implementation. |
---|
644 | @item ELOOP |
---|
645 | More than {SYMLOOP_MAX} symbolic links were encountered during |
---|
646 | resolution of the cfgpath argument. |
---|
647 | @item ENAMETOOLONG |
---|
648 | As aresult of encountering a symbolic link in resolution of the |
---|
649 | pathname specified by the pathnames argument, the length of the |
---|
650 | substituted pathname string exceeded {PATH_MATH}. |
---|
651 | |
---|
652 | @end table |
---|
653 | |
---|
654 | @subheading DESCRIPTION: |
---|
655 | |
---|
656 | if {_POSIX_CFG} is defined: |
---|
657 | |
---|
658 | The @code{cfg_read} function returns a pointer to a CFGENT sturcture |
---|
659 | representing a node in the configuration space to which @code{cfgp} |
---|
660 | refers. The returned pointer shall be stored at the location |
---|
661 | indicated by the @code{node} argument. |
---|
662 | |
---|
663 | The child nodes of each node in the configuration tree is returned |
---|
664 | by @code{cfg_read}. If a comparison routine is specified to the |
---|
665 | @code{cfg_open} function, the order of return of the child nodes shall |
---|
666 | be as specified by the routine, from least to greatest. Otherwise |
---|
667 | the order of return is unspecified. |
---|
668 | |
---|
669 | Structures referencing nodes with children shall be returned by the |
---|
670 | function @code{cfg_read} at least twice [unless the application |
---|
671 | specifies otherwise with @code{cfg_mark}]-once immediately before |
---|
672 | the structures representing their descendants, are returned |
---|
673 | (pre-order), and once immediately after structures representing all |
---|
674 | of their descendants, if any, are returned (post-order). The |
---|
675 | CFGENT structure returned in post-porder (with the exception of the |
---|
676 | @code{cfg_info} field) shall be identical to that returned in pre-order. |
---|
677 | Structures referencing nodes of other types shall be returned at least |
---|
678 | once. |
---|
679 | |
---|
680 | The fields of the CFGENT structure shall contain the following |
---|
681 | informatation: |
---|
682 | cfg_parent |
---|
683 | cfg_link |
---|
684 | cfg_cycle |
---|
685 | cfg_number |
---|
686 | cfg_pointer |
---|
687 | cfg_path |
---|
688 | cfg_name |
---|
689 | cfg_pathlen |
---|
690 | cfg_namelen |
---|
691 | cfg_level |
---|
692 | cfg_info |
---|
693 | |
---|
694 | Otherwise: |
---|
695 | |
---|
696 | The @code{cfg_read} function shall fail. |
---|
697 | |
---|
698 | @subheading NOTES: |
---|
699 | |
---|
700 | @page |
---|
701 | @subsection cfg_children - Get Node Entries |
---|
702 | |
---|
703 | @subheading CALLING SEQUENCE: |
---|
704 | |
---|
705 | @ifset is-C |
---|
706 | @example |
---|
707 | int cfg_children( |
---|
708 | CFG *cfgp, |
---|
709 | int options, |
---|
710 | CFGENT **children |
---|
711 | ); |
---|
712 | @end example |
---|
713 | @end ifset |
---|
714 | |
---|
715 | @ifset is-Ada |
---|
716 | @end ifset |
---|
717 | |
---|
718 | @subheading STATUS CODES: |
---|
719 | |
---|
720 | @table @b |
---|
721 | @item EACCES |
---|
722 | Search permission is denied for any component of a pathname |
---|
723 | @item EBADF |
---|
724 | The cfgp argument does not refer to an open configuration space. |
---|
725 | @item ELOOP |
---|
726 | A loop exists in symbolic links encountered during resolution of |
---|
727 | a pathname. |
---|
728 | @item ENAMETOOLONG |
---|
729 | The length of a pathname exceeds {PATH_MAX}, or a pathname |
---|
730 | component is longer than {NAME_MAX} while {_POSIX_NO_TRUNC} is |
---|
731 | in effect. |
---|
732 | @item EINVAL |
---|
733 | The specified value of the optiions argument is invalid. |
---|
734 | @item ENOENT |
---|
735 | The named node does not exist. |
---|
736 | @item ENOMEM |
---|
737 | Not enough memory is available to create the necessary structures. |
---|
738 | @item ENOSYS |
---|
739 | The function cfg_children() is not supported by this implementation. |
---|
740 | |
---|
741 | @end table |
---|
742 | |
---|
743 | @subheading DESCRIPTION: |
---|
744 | |
---|
745 | If {_POSIX_CFG} is defined: |
---|
746 | |
---|
747 | The first @code{cfg_children} call after a @code{cfg_read} shall |
---|
748 | return information about the first node without children under the |
---|
749 | node returned by @code}{cfg_read}. Subsequent calls to |
---|
750 | @code{cfg_children} without the intervening @code{cfg_read} shall |
---|
751 | return information about the remaining nodes without children under |
---|
752 | that same node. |
---|
753 | |
---|
754 | If @code{cfg_read} has not yet been called for the configuration |
---|
755 | traversal stream represented by @code{cfgp}, @code{cfg_children} |
---|
756 | shall return a pointer to the first entry in a list of the nodes |
---|
757 | represented by the @code{pathnames} argument to @code{cfg_open}. |
---|
758 | |
---|
759 | In either case, the list shall be NULL-terminated, ordered by the |
---|
760 | user-specified comparison function, if any, and linked through the |
---|
761 | cfg_link field. |
---|
762 | |
---|
763 | Otherwise: |
---|
764 | |
---|
765 | The @code{cfg_children} function shall fail. |
---|
766 | |
---|
767 | @subheading NOTES: |
---|
768 | |
---|
769 | @page |
---|
770 | @subsection cfg_mark - Set Configuration Space Options |
---|
771 | |
---|
772 | @subheading CALLING SEQUENCE: |
---|
773 | |
---|
774 | @ifset is-C |
---|
775 | @example |
---|
776 | int cfg_mark( |
---|
777 | CFG *cfgp, |
---|
778 | CFGENT *f, |
---|
779 | int options |
---|
780 | ); |
---|
781 | @end example |
---|
782 | @end ifset |
---|
783 | |
---|
784 | @ifset is-Ada |
---|
785 | @end ifset |
---|
786 | |
---|
787 | @subheading STATUS CODES: |
---|
788 | |
---|
789 | @table @b |
---|
790 | @item EINVAL |
---|
791 | The specified combination of the cfgp and f arguments is not |
---|
792 | supported by the implementation. |
---|
793 | @item EINVAL |
---|
794 | The specified value of the options argument is invalid. |
---|
795 | @item ENOSYS |
---|
796 | The function cfg_mark() is not supported by this implementation. |
---|
797 | |
---|
798 | @end table |
---|
799 | |
---|
800 | @subheading DESCRIPTION: |
---|
801 | |
---|
802 | If {_POSIX_CF} is defined: |
---|
803 | |
---|
804 | The @code{cfg_mark} function modifies the subsequent behavior of |
---|
805 | the cfg functions with regard to the node referenced by the structure |
---|
806 | pointed to by the argument @code{f} or the configuration space referenced |
---|
807 | by the structure pointed to by the argument @code{cfgp}. |
---|
808 | |
---|
809 | Exactly one of the @code{f} argument and the @code{cfgp} argument shall |
---|
810 | be NULL. |
---|
811 | |
---|
812 | The value of the @code{options} argument shall be exactly one of the |
---|
813 | flags specified in the following list: |
---|
814 | CFG_AGAIN |
---|
815 | CFG_SKIP |
---|
816 | CFG_FOLLOW |
---|
817 | |
---|
818 | Otherwise: |
---|
819 | |
---|
820 | The @code{cfg_mark} function shall fail. |
---|
821 | |
---|
822 | @subheading NOTES: |
---|
823 | |
---|
824 | @page |
---|
825 | @subsection cfg_close - Close a Configuration Space |
---|
826 | |
---|
827 | @subheading CALLING SEQUENCE: |
---|
828 | |
---|
829 | @ifset is-C |
---|
830 | @example |
---|
831 | int cfg_close( |
---|
832 | CFG *cfgp |
---|
833 | ); |
---|
834 | @end example |
---|
835 | @end ifset |
---|
836 | |
---|
837 | @ifset is-Ada |
---|
838 | @end ifset |
---|
839 | |
---|
840 | @subheading STATUS CODES: |
---|
841 | |
---|
842 | @table @b |
---|
843 | @item EBADF |
---|
844 | The cfgp argument does not refer to an open configuration space |
---|
845 | traversal stream. |
---|
846 | @item ENOSYS |
---|
847 | The function cfg_close() is not supported by this implementatioin. |
---|
848 | |
---|
849 | @end table |
---|
850 | |
---|
851 | @subheading DESCRIPTION: |
---|
852 | |
---|
853 | if {_POSIX_CFG} is defined: |
---|
854 | |
---|
855 | The @code{cfg_close} function closes a configuration space transversal |
---|
856 | stream represented by the CFG structure pointed at by the @code{cfgp} |
---|
857 | argument. All system resources allocated for this configuration space |
---|
858 | travsversal stream should be deallocated. Upon return, the value of |
---|
859 | @code{cfgp} need not point to an accessible object of type CFG. |
---|
860 | |
---|
861 | Otherwise: |
---|
862 | |
---|
863 | The @code{cfg_close} function shall fail. |
---|
864 | |
---|
865 | @subheading NOTES: |
---|
866 | |
---|