aboutsummaryrefslogtreecommitdiff
path: root/include/sg_pr2serr.h
diff options
context:
space:
mode:
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 9a1fd273..1577b6ce 100644
--- a/include/sg_pr2serr.h
+++ b/include/sg_pr2serr.h
@@ -153,6 +153,9 @@ sgj_opaque_p sgj_new_named_array(sgj_state * jsp, sgj_opaque_p jop,
* a pointer newly formed JSON string. */
sgj_opaque_p sgj_add_nv_s(sgj_state * jsp, sgj_opaque_p jop,
const char * name, const char * value);
+sgj_opaque_p sgj_add_nv_s_len(sgj_state * jsp, sgj_opaque_p jop,
+ const char * name,
+ const char * value, int slen);
/* If either jsp is NULL or jsp->pr_as_json is false then nothing happens and
* NULL is returned. The insertion point is at jop but if it is NULL
@@ -256,6 +259,12 @@ void sgj_add_nv_ihexstr_ane(sgj_state * jsp, sgj_opaque_p jop,
const char * str_name, const char * val_s,
const char * ane_s);
+/* Breaks up the string pointed to by 'sp' into lines and adds them to the
+ * jsp->outputp array. Treat '\n' in sp as line breaks. Consumes characters
+ * from sp until either a '\0' is found or slen is exhausted. Add each line
+ * to jsp->outputp JSON array (if conditions met). */
+void sgj_pr_str_output(sgj_state * jsp, const char * sp, int slen);
+
/* This function only produces JSON output if jsp is non-NULL and
* jsp->pr_as_json is true. 'sbp' is assumed to point to sense data as
* defined by T10 with a length of 'sb_len' bytes. Returns false if an
@@ -287,6 +296,8 @@ void sgj_free_unattached(sgj_opaque_p jop);
* jsp->userp will all be set to NULL. */
void sgj_finish(sgj_state * jsp);
+char * sg_json_usage(int char_if_not_j, char * b, int blen);
+
#ifdef __cplusplus
}