libxnvme_pp.h#
Enums#
xnvme_pr#
-
enum xnvme_pr#
SPDX-FileCopyrightText: Samsung Electronics Co., Ltd.
SPDX-License-Identifier: BSD-3-Clause Options for pretty-printer (
*_pr
,*_fpr
) functionsSee also
libxnvme_pp.h
Values:
-
enumerator XNVME_PR_DEF#
XNVME_PR_DEF: Default options.
-
enumerator XNVME_PR_YAML#
XNVME_PR_YAML: Print formatted as YAML.
-
enumerator XNVME_PR_TERSE#
XNVME_PR_TERSE: Print without formatting.
-
enumerator XNVME_PR_DEF#
Functions#
xnvme_be_attr_fpr#
-
int xnvme_be_attr_fpr(FILE *stream, const struct xnvme_be_attr *attr, int opts)#
Prints the given backend attribute to the given output stream.
- Parameters:
stream – output stream used for printing
attr – Pointer to the xnvme_be_attr to print
opts – printer options, see xnvme_pr
- Returns:
On success, the number of characters printed is returned.
xnvme_be_attr_list_fpr#
-
int xnvme_be_attr_list_fpr(FILE *stream, const struct xnvme_be_attr_list *list, int opts)#
Prints the given backend attribute list to the given output stream.
- Parameters:
stream – output stream used for printing
list – Pointer to the backend attribute list to print
opts – printer options, see xnvme_pr
- Returns:
On success, the number of characters printed is returned.
xnvme_be_attr_list_pr#
-
int xnvme_be_attr_list_pr(const struct xnvme_be_attr_list *list, int opts)#
Prints the given backend attribute list to standard out.
- Parameters:
list – Pointer to the backend attribute list to print
opts – printer options, see xnvme_pr
- Returns:
On success, the number of characters printed is returned.
xnvme_be_attr_pr#
-
int xnvme_be_attr_pr(const struct xnvme_be_attr *attr, int opts)#
Prints the given backend attribute to stdout.
- Parameters:
attr – Pointer to the xnvme_be_attr to print
opts – printer options, see xnvme_pr
- Returns:
On success, the number of characters printed is returned.
xnvme_cmd_ctx_pr#
-
void xnvme_cmd_ctx_pr(const struct xnvme_cmd_ctx *ctx, int UNUSED_opts)#
Prints a humanly readable representation the given xnvme_cmd_ctx.
- Parameters:
ctx – Pointer to the xnvme_cmd_ctx to print
UNUSED_opts – Printer options
xnvme_dev_fpr#
-
int xnvme_dev_fpr(FILE *stream, const struct xnvme_dev *dev, int opts)#
Prints the given xnvme_dev to the given output stream.
- Parameters:
stream – output stream used for printing
dev – pointer to structure to print
opts – printer options, see xnvme_pr
- Returns:
On success, the number of characters printed is returned.
xnvme_dev_pr#
xnvme_geo_fpr#
xnvme_geo_pr#
xnvme_ident_fpr#
-
int xnvme_ident_fpr(FILE *stream, const struct xnvme_ident *ident, int opts)#
Prints the given xnvme_ident to the given output stream.
- Parameters:
stream – output stream used for printing
ident – pointer to structure to print
opts – printer options, see xnvme_pr
- Returns:
On success, the number of characters printed is returned.
xnvme_ident_pr#
-
int xnvme_ident_pr(const struct xnvme_ident *ident, int opts)#
Prints the given xnvme_ident to stdout.
- Parameters:
ident – pointer to structure to print
opts – printer options, see xnvme_pr
- Returns:
On success, the number of characters printed is returned.
xnvme_ident_yaml#
-
int xnvme_ident_yaml(FILE *stream, const struct xnvme_ident *ident, int indent, const char *sep, int head)#
Writes a YAML-representation of the given ‘ident’ to stream.
xnvme_lba_fpr#
xnvme_lba_fprn#
-
int xnvme_lba_fprn(FILE *stream, const uint64_t *lba, uint16_t nlb, enum xnvme_pr opts)#
Prints the given list of Logical Block Addresses (LBAs)to the given output stream.
- Parameters:
stream – output stream used for printing
lba – Pointer to an array of LBAs to print
nlb – Number of LBAs to print from the given list
opts – printer options, see xnvme_pr
xnvme_lba_pr#
xnvme_lba_prn#
-
int xnvme_lba_prn(const uint64_t *lba, uint16_t nlb, enum xnvme_pr opts)#
Print a list of Logical Block Addresses (LBAs)
- Parameters:
lba – Pointer to an array of LBAs to print
nlb – Length of the array in items
opts – Printer options
- Returns:
On success, the number of characters printed is returned.
xnvme_opts_pr#
-
int xnvme_opts_pr(const struct xnvme_opts *opts, int pr_opts)#
Prints a humanly readable representation of the given xnvme_opts.
- Parameters:
opts – Pointer to the xnvme_opts to print
pr_opts – printer options, see xnvme_pr
- Returns:
On success, the number of characters printed is returned.
Header#
/**
* SPDX-FileCopyrightText: Samsung Electronics Co., Ltd
*
* SPDX-License-Identifier: BSD-3-Clause
*
* @headerfile libxnvme_pp.h
*/
/**
* Options for pretty-printer (``*_pr``, ``*_fpr``) functions
*
* @see libxnvme_pp.h
*
* @enum xnvme_pr
*/
enum xnvme_pr {
XNVME_PR_DEF = 0x0, ///< XNVME_PR_DEF: Default options
XNVME_PR_YAML = 0x1, ///< XNVME_PR_YAML: Print formatted as YAML
XNVME_PR_TERSE = 0x2 ///< XNVME_PR_TERSE: Print without formatting
};
/**
* Prints the given backend attribute to the given output stream
*
* @param stream output stream used for printing
* @param attr Pointer to the ::xnvme_be_attr to print
* @param opts printer options, see ::xnvme_pr
*
* @return On success, the number of characters printed is returned.
*/
int
xnvme_be_attr_fpr(FILE *stream, const struct xnvme_be_attr *attr, int opts);
/**
* Prints the given backend attribute to stdout
*
* @param attr Pointer to the ::xnvme_be_attr to print
* @param opts printer options, see ::xnvme_pr
*
* @return On success, the number of characters printed is returned.
*/
int
xnvme_be_attr_pr(const struct xnvme_be_attr *attr, int opts);
/**
* Prints the given backend attribute list to the given output stream
*
* @param stream output stream used for printing
* @param list Pointer to the backend attribute list to print
* @param opts printer options, see ::xnvme_pr
*
* @return On success, the number of characters printed is returned.
*/
int
xnvme_be_attr_list_fpr(FILE *stream, const struct xnvme_be_attr_list *list, int opts);
/**
* Prints the given backend attribute list to standard out
*
* @param list Pointer to the backend attribute list to print
* @param opts printer options, see ::xnvme_pr
*
* @return On success, the number of characters printed is returned.
*/
int
xnvme_be_attr_list_pr(const struct xnvme_be_attr_list *list, int opts);
/**
* Prints the given LBA to the given output stream
*
* @param stream output stream used for printing
* @param lba the LBA to print
* @param opts printer options, see ::xnvme_pr
*
* @return On success, the number of characters printed is returned.
*/
int
xnvme_lba_fpr(FILE *stream, uint64_t lba, enum xnvme_pr opts);
/**
* Prints the given Logical Block Addresses (LBA) to stdout
*
* @param lba the LBA to print
* @param opts printer options, see ::xnvme_pr
*
* @return On success, the number of characters printed is returned.
*/
int
xnvme_lba_pr(uint64_t lba, enum xnvme_pr opts);
/**
* Prints the given list of Logical Block Addresses (LBAs)to the given output
* stream
*
* @param stream output stream used for printing
* @param lba Pointer to an array of LBAs to print
* @param nlb Number of LBAs to print from the given list
* @param opts printer options, see ::xnvme_pr
*/
int
xnvme_lba_fprn(FILE *stream, const uint64_t *lba, uint16_t nlb, enum xnvme_pr opts);
/**
* Print a list of Logical Block Addresses (LBAs)
*
* @param lba Pointer to an array of LBAs to print
* @param nlb Length of the array in items
* @param opts Printer options
*
* @return On success, the number of characters printed is returned.
*/
int
xnvme_lba_prn(const uint64_t *lba, uint16_t nlb, enum xnvme_pr opts);
/**
* Writes a YAML-representation of the given 'ident' to stream
*/
int
xnvme_ident_yaml(FILE *stream, const struct xnvme_ident *ident, int indent, const char *sep,
int head);
/**
* Prints the given ::xnvme_ident to the given output stream
*
* @param stream output stream used for printing
* @param ident pointer to structure to print
* @param opts printer options, see ::xnvme_pr
*
* @return On success, the number of characters printed is returned.
*/
int
xnvme_ident_fpr(FILE *stream, const struct xnvme_ident *ident, int opts);
/**
* Prints the given ::xnvme_ident to stdout
*
* @param ident pointer to structure to print
* @param opts printer options, see ::xnvme_pr
*
* @return On success, the number of characters printed is returned.
*/
int
xnvme_ident_pr(const struct xnvme_ident *ident, int opts);
/**
* Prints the given ::xnvme_dev to the given output stream
*
* @param stream output stream used for printing
* @param dev pointer to structure to print
* @param opts printer options, see ::xnvme_pr
*
* @return On success, the number of characters printed is returned.
*/
int
xnvme_dev_fpr(FILE *stream, const struct xnvme_dev *dev, int opts);
/**
* Prints the given ::xnvme_dev to stdout
*
* @param dev pointer to structure to print
* @param opts printer options, see ::xnvme_pr
*
* @return On success, the number of characters printed is returned.
*/
int
xnvme_dev_pr(const struct xnvme_dev *dev, int opts);
/**
* Prints the given ::xnvme_geo to the given output stream
*
* @param stream output stream used for printing
* @param geo pointer to the the ::xnvme_geo to print
* @param opts printer options, see ::xnvme_pr
*
* @return On success, the number of characters printed is returned.
*/
int
xnvme_geo_fpr(FILE *stream, const struct xnvme_geo *geo, int opts);
/**
* Prints the given ::xnvme_geo to stdout
*
* @param geo pointer to the the ::xnvme_geo to print
* @param opts printer options, see ::xnvme_pr
*
* @return On success, the number of characters printed is returned.
*/
int
xnvme_geo_pr(const struct xnvme_geo *geo, int opts);
/**
* Prints a humanly readable representation the given #xnvme_cmd_ctx
*
* @param ctx Pointer to the #xnvme_cmd_ctx to print
* @param UNUSED_opts Printer options
*/
void
xnvme_cmd_ctx_pr(const struct xnvme_cmd_ctx *ctx, int UNUSED_opts);
/**
* Prints a humanly readable representation of the given ::xnvme_opts
*
* @param opts Pointer to the #xnvme_opts to print
* @param pr_opts printer options, see ::xnvme_pr
*
* @return On success, the number of characters printed is returned.
*/
int
xnvme_opts_pr(const struct xnvme_opts *opts, int pr_opts);