aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2022-04-17 14:15:24 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2022-04-17 14:15:24 +0000
commitf26bb872bf4f043a1b817c808a6947fcb03ecda4 (patch)
tree132ab4d71c41c26fe05e12a57fc9e684ffbd08ec /include
parent5e7262973c7b0bf753e5e560956c176d9d12424d (diff)
downloadsg3_utils-f26bb872bf4f043a1b817c808a6947fcb03ecda4.tar.gz
sg_lib: add hex2fp(); sg_rtpg: https://github.com/hreinecke/sg3_utils/pull/79 applies; json_builder work
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@944 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'include')
-rw-r--r--include/sg_lib.h4
-rw-r--r--include/sg_pr2serr.h23
2 files changed, 27 insertions, 0 deletions
diff --git a/include/sg_lib.h b/include/sg_lib.h
index 16e6fc15..383e9072 100644
--- a/include/sg_lib.h
+++ b/include/sg_lib.h
@@ -622,6 +622,10 @@ int dStrHexStr(const char * str, int len, const char * leadin, int format,
int hex2str(const uint8_t * b_str, int len, const char * leadin, int format,
int cb_len, char * cbp);
+/* Similar to hex2str() but outputs to file pointed to be fp */
+void hex2fp(const uint8_t * b_str, int len, const char * leadin, int format,
+ FILE * fp);
+
/* The following 2 functions are equivalent to dStrHex() and dStrHexErr()
* respectively. The difference is only the type of the first of argument:
* uint8_t instead of char. The name of the argument is changed to b_str to
diff --git a/include/sg_pr2serr.h b/include/sg_pr2serr.h
index 351b3e31..70592781 100644
--- a/include/sg_pr2serr.h
+++ b/include/sg_pr2serr.h
@@ -32,6 +32,20 @@
extern "C" {
#endif
+#if 0
+enum sg_json_separator_t {
+ SG_JSON_SEP_NONE = 0,
+ SG_JSON_SEP_SPACE_1,
+ SG_JSON_SEP_SPACE_2,
+ SG_JSON_SEP_SPACE_3,
+ SG_JSON_SEP_SPACE_4,
+ SG_JSON_SEP_EQUAL_NO_SPACE,
+ SG_JSON_SEP_EQUAL_1_SPACE,
+ SG_JSON_SEP_COLON_NO_SPACE,
+ SG_JSON_SEP_COLON_1_SPACE,
+};
+#endif
+
#if defined(__GNUC__) || defined(__clang__)
#ifdef SG_LIB_MINGW
@@ -64,6 +78,15 @@ int sg_scnpr(char * cp, int cp_max_len, const char * fmt, ...);
#endif
+#if 0
+/* Print function for normal and/or json output. "hr" stands for human
+ * readable (only); "j" for JSON (only). */
+void pr_j_simple(int leadin_sp, const char * name,
+ enum sg_json_separator_t sep, const char * value);
+void pr_j_hr_line(const char * hr_line, const char * jname,
+ const char * jvalue);
+#endif
+
#ifdef __cplusplus
}