2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 2N/A * All interfaces described in this file are private to Solaris, and 2N/A * are subject to change at any time and without notice. The public 2N/A * Private nvlist printing interface that allows the caller some control 2N/A * over output rendering (as opposed to nvlist_print and dump_nvlist). 2N/A * Obtain an opaque nvlist_prtctl_t cookie using nvlist_prtctl_alloc 2N/A * (NULL on failure); on return the cookie is set up for default formatting 2N/A * and rendering. Quote the cookie in subsequent customisation functions and 2N/A * then pass the cookie to nvlist_prt to render the nvlist. Finally, 2N/A * use nvlist_prtctl_free to release the cookie. 2N/A * For all nvlist_lookup_xxx and nvlist_lookup_xxx_array functions 2N/A * we have a corresponding brace of functions that appoint replacement 2N/A * rendering functions: 2N/A * extern void nvlist_prtctl_xxx(nvlist_prtctl_t, 2N/A * void (*)(nvlist_prtctl_t ctl, void *private, const char *name, 2N/A * extern void nvlist_prtctl_xxx_array(nvlist_prtctl_t, 2N/A * void (*)(nvlist_prtctl_t ctl, void *private, const char *name, 2N/A * xxxtype value, uint_t count)) 2N/A * where xxxtype is the C datatype corresponding to xxx, eg int8_t for "int8" 2N/A * and char * for "string". The function that is appointed to render the 2N/A * specified datatype receives as arguments the cookie, the nvlist 2N/A * member name, the value of that member (or a pointer for array function), 2N/A * and (for array rendering functions) a count of the number of elements. 2N/A/* Indentation mode, start indent, indent increment; default tabbed/0/1 */ 2N/A * Function prototypes for interfaces that appoint a new rendering function 2N/A * for single-valued nvlist members. 2N/A * A replacement function receives arguments as follows: 2N/A * nvlist_prtctl_t Print control structure; do not change preferences 2N/A * for this object from a print callback function. 2N/A * void * The function-private cookie argument registered 2N/A * when the replacement function was appointed. 2N/A * nvlist_t * The full nvlist that is being processed. The 2N/A * rendering function is called to render a single 2N/A * member (name and value passed as below) but it may 2N/A * want to reference or incorporate other aspects of 2N/A * const char * Member name to render 2N/A * valtype Value of the member to render 2N/A * The function must return non-zero if it has rendered output for this 2N/A * member, or 0 if it wants to default to standard rendering for this 2N/A * Function prototypes for interfaces that appoint a new rendering function 2N/A * for array-valued nvlist members. 2N/A * One additional argument is taken: uint_t for the number of array elements 2N/A * Return values as above. 2N/A#
endif /* _LIBNVPAIR_H */