int cli_jsonstrlen_nojson(const char* key, const char* s, int len) { char *sp = cli_malloc(len+1); strncpy(sp, s, len); sp[len] = '\0'; nojson_func("nojson: %s: %s\n", key, sp); free(sp); return CL_SUCCESS; }
int cli_jsonstrlen_nojson(const char* key, const char* s, int len) { char *sp = cli_malloc(len+1); if (NULL == sp) { cli_errmsg("json: no memory for json strlen object.\n"); return CL_EMEM; } strncpy(sp, s, len); sp[len] = '\0'; nojson_func("nojson: %s: %s\n", key, sp); free(sp); return CL_SUCCESS; }
int cli_jsonint_array_nojson(int32_t val) { nojson_func("nojson: %d\n", val); return CL_SUCCESS; }
void *cli_jsonarray_nojson(const char *key) { nojson_func("nojson: %s\n", key); return NULL; }
int cli_jsondouble_nojson(const char* key, double d) { nojson_func("nojson: %s: %f\n", key, d); return CL_SUCCESS; }
int cli_jsonbool_nojson(const char* key, int i) { nojson_func("nojson: %s: %s\n", key, i ? "true" : "false"); return CL_SUCCESS; }
int cli_jsonint64_nojson(const char* key, int64_t i) { nojson_func("nojson: %s: %ld\n", key, (long int)i); return CL_SUCCESS; }
int cli_jsonint_nojson(const char* key, int32_t i) { nojson_func("nojson: %s: %d\n", key, i); return CL_SUCCESS; }
int cli_jsonstr_nojson(const char* key, const char* s) { nojson_func("nojson: %s: %s\n", key, s); return CL_SUCCESS; }
int cli_jsonnull_nojson(const char* key) { nojson_func("nojson: %s: null\n", key); return CL_SUCCESS; }
int cli_json_nojson() { nojson_func("nojson: json needs to be enabled for this feature\n"); return CL_SUCCESS; }