aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
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
}