Print this page
OS-1840 fmdump shall emit JSON (rm feedback)


  30 #include <stdlib.h>
  31 #include <stdio.h>
  32 #include <regex.h>
  33 
  34 #ifdef  __cplusplus
  35 extern "C" {
  36 #endif
  37 
  38 /*
  39  * All interfaces described in this file are private to Solaris, and
  40  * are subject to change at any time and without notice.  The public
  41  * nvlist/nvpair interfaces, as documented in manpage sections 3NVPAIR,
  42  * are all imported from <sys/nvpair.h> included above.
  43  */
  44 
  45 extern int nvpair_value_match(nvpair_t *, int, char *, char **);
  46 extern int nvpair_value_match_regex(nvpair_t *, int, char *, regex_t *,
  47     char **);
  48 
  49 extern void nvlist_print(FILE *, nvlist_t *);
  50 extern void nvlist_print_json(FILE *, nvlist_t *);
  51 extern void dump_nvlist(nvlist_t *, int);
  52 
  53 /*
  54  * Private nvlist printing interface that allows the caller some control
  55  * over output rendering (as opposed to nvlist_print and dump_nvlist).
  56  *
  57  * Obtain an opaque nvlist_prtctl_t cookie using nvlist_prtctl_alloc
  58  * (NULL on failure);  on return the cookie is set up for default formatting
  59  * and rendering.  Quote the cookie in subsequent customisation functions and
  60  * then pass the cookie to nvlist_prt to render the nvlist.  Finally,
  61  * use nvlist_prtctl_free to release the cookie.
  62  *
  63  * For all nvlist_lookup_xxx and nvlist_lookup_xxx_array functions
  64  * we have a corresponding brace of functions that appoint replacement
  65  * rendering functions:
  66  *
  67  *      extern void nvlist_prtctl_xxx(nvlist_prtctl_t,
  68  *          void (*)(nvlist_prtctl_t ctl, void *private, const char *name,
  69  *          xxxtype value))
  70  *




  30 #include <stdlib.h>
  31 #include <stdio.h>
  32 #include <regex.h>
  33 
  34 #ifdef  __cplusplus
  35 extern "C" {
  36 #endif
  37 
  38 /*
  39  * All interfaces described in this file are private to Solaris, and
  40  * are subject to change at any time and without notice.  The public
  41  * nvlist/nvpair interfaces, as documented in manpage sections 3NVPAIR,
  42  * are all imported from <sys/nvpair.h> included above.
  43  */
  44 
  45 extern int nvpair_value_match(nvpair_t *, int, char *, char **);
  46 extern int nvpair_value_match_regex(nvpair_t *, int, char *, regex_t *,
  47     char **);
  48 
  49 extern void nvlist_print(FILE *, nvlist_t *);
  50 extern int nvlist_print_json(FILE *, nvlist_t *);
  51 extern void dump_nvlist(nvlist_t *, int);
  52 
  53 /*
  54  * Private nvlist printing interface that allows the caller some control
  55  * over output rendering (as opposed to nvlist_print and dump_nvlist).
  56  *
  57  * Obtain an opaque nvlist_prtctl_t cookie using nvlist_prtctl_alloc
  58  * (NULL on failure);  on return the cookie is set up for default formatting
  59  * and rendering.  Quote the cookie in subsequent customisation functions and
  60  * then pass the cookie to nvlist_prt to render the nvlist.  Finally,
  61  * use nvlist_prtctl_free to release the cookie.
  62  *
  63  * For all nvlist_lookup_xxx and nvlist_lookup_xxx_array functions
  64  * we have a corresponding brace of functions that appoint replacement
  65  * rendering functions:
  66  *
  67  *      extern void nvlist_prtctl_xxx(nvlist_prtctl_t,
  68  *          void (*)(nvlist_prtctl_t ctl, void *private, const char *name,
  69  *          xxxtype value))
  70  *