aboutsummaryrefslogtreecommitdiff
path: root/include/sg_pr2serr.h
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2018-06-03 23:59:56 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2018-06-03 23:59:56 +0000
commite05f7acda57fbbbad555df38fef89aa70447b590 (patch)
treeeeb77582446b28c0b89f2415f8a0a34eef3e1fc4 /include/sg_pr2serr.h
parent14a6fbe3500a5ead474126ded5e0f1df8dd88ade (diff)
downloadsg3_utils-e05f7acda57fbbbad555df38fef89aa70447b590.tar.gz
sg_decode sense: add --err=ES; sg_dd, sgp_dd, sgm_dd: add --dry-run and --verbose options; introduce SG3_UTILS_DSENSE environment variable; sg_lib: add sg_nvme_desc2sense(), sg_build_sense_buffer(), and pr2ws()
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@777 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'include/sg_pr2serr.h')
-rw-r--r--include/sg_pr2serr.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/sg_pr2serr.h b/include/sg_pr2serr.h
index 4419087e..6f0b766a 100644
--- a/include/sg_pr2serr.h
+++ b/include/sg_pr2serr.h
@@ -8,6 +8,12 @@
* license that can be found in the BSD_LICENSE file.
*/
+/* These are convenience functions that replace the somewhat long-winded
+ * fprintf(stderr, ....). The second form (i.e. pr2ws() ) is for internal
+ * library use and may place its output somewhere other than stderr; it
+ * depends on the external variable sg_warnings_strm which can be set
+ * with sg_set_warnings_strm(). By default it uses stderr. */
+
#include <stdio.h>
#ifdef __cplusplus
@@ -18,8 +24,13 @@ extern "C" {
#if defined(__GNUC__) || defined(__clang__)
int pr2serr(const char * fmt, ...)
__attribute__ ((format (printf, 1, 2)));
+
+int pr2ws(const char * fmt, ...)
+ __attribute__ ((format (printf, 1, 2)));
#else
int pr2serr(const char * fmt, ...);
+
+int pr2ws(const char * fmt, ...);
#endif