Rizin
unix-like reverse engineering framework and cli tools
rz_pj.h File Reference

Go to the source code of this file.

Classes

struct  pj_t
 

Macros

#define RZ_PRINT_JSON_DEPTH_LIMIT   128
 

Typedefs

typedef struct pj_t PJ
 

Functions

RZ_API PJpj_new (void)
 
RZ_API void pj_free (PJ *j)
 
RZ_API void pj_reset (PJ *j)
 
RZ_API char * pj_drain (PJ *j)
 
RZ_API const char * pj_string (PJ *pj)
 
RZ_API void pj_raw (PJ *j, const char *k)
 
RZ_API PJpj_end (PJ *j)
 
RZ_API PJpj_o (PJ *j)
 
RZ_API PJpj_a (PJ *j)
 
RZ_API PJpj_k (PJ *j, const char *k)
 
RZ_API PJpj_knull (PJ *j, const char *k)
 
RZ_API PJpj_kn (PJ *j, const char *k, ut64 n)
 
RZ_API PJpj_kN (PJ *j, const char *k, st64 n)
 
RZ_API PJpj_ks (PJ *j, const char *k, const char *v)
 
RZ_API PJpj_ka (PJ *j, const char *k)
 
RZ_API PJpj_ko (PJ *j, const char *k)
 
RZ_API PJpj_ki (PJ *j, const char *k, int d)
 
RZ_API PJpj_kd (PJ *j, const char *k, double d)
 
RZ_API PJpj_kf (PJ *j, const char *k, float d)
 
RZ_API PJpj_kb (PJ *j, const char *k, bool v)
 
RZ_API PJpj_null (PJ *j)
 
RZ_API PJpj_r (PJ *j, const ut8 *v, size_t v_len)
 
RZ_API PJpj_kr (PJ *j, const char *k, const ut8 *v, size_t v_len)
 
RZ_API PJpj_s (PJ *j, const char *k)
 
RZ_API PJpj_S (PJ *j, const char *k)
 
RZ_API PJpj_j (PJ *j, const char *k)
 
RZ_API PJpj_n (PJ *j, ut64 n)
 
RZ_API PJpj_N (PJ *j, st64 n)
 
RZ_API PJpj_i (PJ *j, int d)
 
RZ_API PJpj_d (PJ *j, double d)
 
RZ_API PJpj_f (PJ *j, float d)
 
RZ_API PJpj_b (PJ *j, bool v)
 

Macro Definition Documentation

◆ RZ_PRINT_JSON_DEPTH_LIMIT

#define RZ_PRINT_JSON_DEPTH_LIMIT   128

Definition at line 4 of file rz_pj.h.

Typedef Documentation

◆ PJ

typedef struct pj_t PJ

Function Documentation

◆ pj_a()

RZ_API PJ* pj_a ( PJ j)

Definition at line 81 of file pj.c.

81  {
83  pj_comma(j);
84  return pj_begin(j, '[');
85 }
static void pj_comma(PJ *j)
Definition: pj.c:14
static PJ * pj_begin(PJ *j, char type)
Definition: pj.c:61
#define rz_return_val_if_fail(expr, val)
Definition: rz_assert.h:108

References pj_begin(), pj_comma(), and rz_return_val_if_fail.

Referenced by analysis_class_list_print_to_json(), analysis_class_print_to_json(), bb_info_print(), block_store(), cmd_print_bars(), cmd_print_blocks(), cmd_print_pv(), cmd_pxr(), core_analysis_bytes_json(), core_analysis_graph_construct_nodes(), core_analysis_graph_nodes(), core_analysis_name_print(), core_analysis_var_list_show(), do_analysis_search(), do_asm_search(), do_esil_search(), do_string_search(), draw_graph_nodes(), flag_print(), flag_tag_print(), func_walk_blocks(), function_list_print_to_json(), function_print_calls(), function_print_to_json(), graph_construct_nodes(), header(), json_pj_recurse(), lang_byte_array_json(), list_vars(), nonreturn_print_json(), pj_ka(), pj_r(), print_hint_tree(), print_source_info(), printAnalPaths(), rtti_itanium_print_vmi_class_type_info_json(), rz_agraph_print_json(), rz_analysis_function_get_json(), rz_analysis_list_vtables(), rz_bin_java_class_const_pool_as_json(), rz_bin_java_class_fields_as_json(), rz_bin_java_class_interfaces_as_json(), rz_bin_java_class_methods_as_json(), rz_cmd_eval_color_load_theme_handler(), rz_cmd_print(), rz_cmd_search(), rz_cmd_state_output_array_start(), rz_core_agraph_print_json(), rz_core_analysis_callgraph(), rz_core_analysis_function_signature(), rz_core_analysis_graph(), rz_core_analysis_paths(), rz_core_annotated_code_print_json(), rz_core_bin_method_flags_str(), rz_core_cmp_print(), rz_core_config_print_all(), rz_core_diff_show(), rz_core_diff_show_function(), rz_core_file_print(), rz_core_io_plugin_print(), rz_core_print_disasm(), rz_core_print_disasm_all(), rz_core_print_disasm_json(), rz_core_print_function_disasm_json(), rz_core_search_rop(), rz_core_task_list(), rz_core_types_calling_conventions_print(), rz_core_types_enum_print_all(), rz_core_types_function_print(), rz_core_types_function_print_all(), rz_core_types_link_print_all(), rz_core_types_print_all(), rz_core_types_struct_print_all(), rz_core_types_typedef_print_all(), rz_core_types_union_print_all(), rz_debug_pid_list(), rz_debug_signal_list(), rz_debug_thread_list(), rz_graph_drawable_to_json(), rz_heap_list_w32(), rz_il_vm_step_with_events_handler(), rz_main_rz_bin(), rz_pkcs7_cms_json(), rz_print_jsondump_str(), rz_reg_profile_handler(), rz_save_panels_layout(), rz_serialize_analysis_meta_save(), rz_serialize_analysis_switch_op_save(), rz_serialize_spaces_save(), rz_table_tojson(), rz_test_main(), rz_x509_crl_json(), rz_x509_extensions_json(), rz_x509_signedinfo_json(), rzfind_open_file(), serialize_memory_cb(), serialize_register_cb(), show_analinfo(), showmem_json(), showregs_json(), store_xrefs_list_cb(), strings_print(), types_cc_print(), w32_list_heaps_blocks(), xref_list_print_to_json(), xrefs_graph(), and xrefs_graph_fcn_start_json().

◆ pj_b()

RZ_API PJ* pj_b ( PJ j,
bool  v 
)

Definition at line 190 of file pj.c.

190  {
191  rz_return_val_if_fail(j, j);
192  pj_comma(j);
193  pj_raw(j, rz_str_bool(v));
194  return j;
195 }
const char * v
Definition: dsignal.c:12
RZ_API void pj_raw(PJ *j, const char *msg)
Definition: pj.c:7
RZ_API const char * rz_str_bool(int b)
Definition: str.c:3896

References pj_comma(), pj_raw(), rz_return_val_if_fail, rz_str_bool(), and v.

Referenced by json_pj_recurse(), and pj_kb().

◆ pj_d()

RZ_API PJ* pj_d ( PJ j,
double  d 
)

Definition at line 276 of file pj.c.

276  {
278  pj_comma(j);
279  char s[64] = { 0 };
280  pj_raw(j, rz_strf(s, "%lf", d));
281  return j;
282 }
#define NULL
Definition: cris-opc.c:27
static RzSocket * s
Definition: rtr.c:28
#define rz_strf(buf,...)
Convenience macro for local temporary strings.
Definition: rz_str.h:59
#define d(i)
Definition: sha256.c:44

References d, NULL, pj_comma(), pj_raw(), rz_return_val_if_fail, rz_strf, and s.

Referenced by json_pj_recurse(), and pj_kd().

◆ pj_drain()

RZ_API char* pj_drain ( PJ j)

Definition at line 50 of file pj.c.

50  {
51  rz_return_val_if_fail(pj && pj->level == 0, NULL);
52  char *res = rz_strbuf_drain_nofree(&pj->sb);
53  free(pj);
54  return res;
55 }
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
RZ_API RZ_OWN char * rz_strbuf_drain_nofree(RzStrBuf *sb)
Definition: strbuf.c:349

References free(), pj_t::level, NULL, rz_return_val_if_fail, rz_strbuf_drain_nofree(), and pj_t::sb.

Referenced by download_pdb(), entitlements(), lang_byte_array_json(), rz_analysis_function_args_and_vars_xrefs_handler(), rz_analysis_function_get_json(), rz_core_analysis_hasrefs(), rz_core_analysis_il_vm_status(), rz_json_as_string(), rz_save_panels_layout(), rz_table_tojson(), rz_test_main(), and signature().

◆ pj_end()

RZ_API PJ* pj_end ( PJ j)

Definition at line 87 of file pj.c.

87  {
89  if (j->level < 1) {
90  return j;
91  }
92  if (--j->level < 1) {
93  char msg[2] = { j->braces[j->level], 0 };
94  pj_raw(j, msg);
95  j->level = 0;
96  return j;
97  }
98  j->is_first = false;
99  char msg[2] = { j->braces[j->level], 0 };
100  pj_raw(j, msg);
101  return j;
102 }
static struct sockaddr static addrlen static backlog const void msg
Definition: sfsocketcall.h:119
char braces[RZ_PRINT_JSON_DEPTH_LIMIT]
Definition: rz_pj.h:16
bool is_first
Definition: rz_pj.h:14
int level
Definition: rz_pj.h:17

References pj_t::braces, pj_t::is_first, pj_t::level, msg, pj_raw(), and rz_return_val_if_fail.

Referenced by __printXtrPluginDetails(), __system(), _cb_hit(), _CbInRangeSearchV(), analysis_class_list_print_to_json(), analysis_class_print_to_json(), bb_info_print(), bin_elf_versioninfo(), bin_elf_versioninfo_verneed(), bin_elf_versioninfo_versym(), bin_mach0_versioninfo(), bin_memory_print_rec(), bin_pe_versioninfo(), bin_resources_print_json(), bin_versioninfo(), block_store(), calculate_hash(), calculate_luhn(), cmd_address_info(), cmd_aea(), cmd_debug_modules(), cmd_print_bars(), cmd_print_blocks(), cmd_print_pv(), cmd_pxr(), config_print_node(), core_analysis_bytes_json(), core_analysis_graph_construct_nodes(), core_analysis_graph_nodes(), core_analysis_name_print(), core_analysis_var_list_show(), core_bin_file_print(), desc_list_json_cb(), diff_unified_json_data(), diff_unified_json_ranges(), disassemble_till_return_is_found(), do_analysis_search(), do_asm_search(), do_esil_search(), do_string_search(), download_pdb(), draw_graph_nodes(), ds_newline(), end_state(), entries_initfini_print(), file_save_cb(), fill_args_json(), flag_print(), flag_save_cb(), flag_tag_print(), flag_zone_list(), flags_to_json(), func_walk_blocks(), function_list_print_to_json(), function_print_calls(), function_print_to_json(), function_store(), graph_construct_nodes(), hash_context_run(), header(), hints_acc_store_cb(), il_op_effect_resolve(), il_op_pure_resolve(), il_opdmp_bitv(), il_opdmp_blk(), il_opdmp_bool_false(), il_opdmp_bool_true(), il_opdmp_cast(), il_opdmp_goto(), il_opdmp_let(), il_opdmp_load(), il_opdmp_loadw(), il_opdmp_set(), il_opdmp_store(), il_opdmp_storew(), il_opdmp_var(), json_pj_recurse(), lang_byte_array_json(), list_vars(), meta_variable_comment_print(), nonreturn_print_json(), open_maps_show(), opex(), opex64(), pdb_types_print_json(), pj_r(), print_arch(), print_bin_content(), print_bin_string(), print_debug_map_json(), print_demangler_info(), print_flag_json(), print_function_labels_cb(), print_heap_chunk_simple(), print_heap_fastbin(), print_hint_tree(), print_json_string(), print_largebin_description(), print_main_arena_bins(), print_malloc_states(), print_rop(), print_smallbin_description(), print_source_info(), print_space_stack(), print_string(), print_tcache_content(), print_unsortedbin_description(), printAnalPaths(), rop_kuery(), rtti_itanium_print_class_type_info_json(), rtti_itanium_print_si_class_type_info_json(), rtti_itanium_print_vmi_class_type_info_json(), rtti_msvc_print_base_class_descriptor_json(), rtti_msvc_print_class_hierarchy_descriptor_json(), rtti_msvc_print_complete_object_locator_json(), rtti_msvc_print_complete_object_locator_recurse(), rtti_msvc_print_type_descriptor_json(), rz_agraph_print_json(), rz_analysis_basic_block_list_handler(), rz_analysis_function_address_handler(), rz_analysis_function_args_and_vars_xrefs_handler(), rz_analysis_function_get_json(), rz_analysis_function_vars_handler(), rz_analysis_list_vtables(), rz_analysis_syscall_print_handler(), rz_analysis_var_global_list_show(), rz_bin_java_class_as_json(), rz_bin_java_class_const_pool_as_json(), rz_bin_java_class_fields_as_json(), rz_bin_java_class_interfaces_as_json(), rz_bin_java_class_methods_as_json(), rz_bin_pdb_download(), rz_bin_print_plugin_details(), rz_block_handler(), rz_cmd_debug_display_bt_handler(), rz_cmd_debug_list_bp_handler(), rz_cmd_disassemble_ropchain_handler(), rz_cmd_disassembly_all_possible_opcodes_handler(), rz_cmd_eval_color_load_theme_handler(), rz_cmd_get_help_json(), rz_cmd_heap_chunks_print_handler(), rz_cmd_help(), rz_cmd_help_search_handler(), rz_cmd_info_all_handler(), rz_cmd_info_guess_size_handler(), rz_cmd_info_handler(), rz_cmd_info_hashes_handler(), rz_cmd_info_pdb_download_handler(), rz_cmd_kuery(), rz_cmd_print(), rz_cmd_search(), rz_cmd_state_output_array_end(), rz_core_agraph_print_json(), rz_core_analysis_callgraph(), rz_core_analysis_cc_print(), rz_core_analysis_function_signature(), rz_core_analysis_function_strings_print(), rz_core_analysis_graph(), rz_core_analysis_hasrefs_to_depth(), rz_core_analysis_il_vm_status(), rz_core_analysis_paths(), rz_core_annotated_code_print_json(), rz_core_asm_plugin_print(), rz_core_bin_basefind_print(), rz_core_bin_class_fields_print(), rz_core_bin_class_methods_print(), rz_core_bin_classes_print(), rz_core_bin_fields_print(), rz_core_bin_imports_print(), rz_core_bin_info_print(), rz_core_bin_main_print(), rz_core_bin_method_flags_str(), rz_core_bin_pdb_gvars_as_string(), rz_core_bin_plugin_print(), rz_core_bin_print_source_line_sample(), rz_core_bin_relocs_print(), rz_core_bin_signatures_print(), rz_core_binxtr_plugin_print(), rz_core_cmp_print(), rz_core_config_print_all(), rz_core_core_plugin_print(), rz_core_debug_plugin_print(), rz_core_diff_show(), rz_core_diff_show_function(), rz_core_file_info_print(), rz_core_file_print(), rz_core_flag_describe(), rz_core_hash_plugin_print(), rz_core_io_cache_print(), rz_core_io_plugin_print(), rz_core_lang_plugin_print(), rz_core_magic_at(), rz_core_meta_print(), rz_core_parser_plugin_print(), rz_core_print_disasm(), rz_core_print_disasm_all(), rz_core_print_disasm_json(), rz_core_print_function_disasm_json(), rz_core_search_rop(), rz_core_spaces_print(), rz_core_task_list(), rz_core_task_print(), rz_core_types_calling_conventions_print(), rz_core_types_enum_print(), rz_core_types_enum_print_all(), rz_core_types_function_print(), rz_core_types_function_print_all(), rz_core_types_link_print(), rz_core_types_link_print_all(), rz_core_types_print_all(), rz_core_types_show_format(), rz_core_types_struct_print(), rz_core_types_struct_print_all(), rz_core_types_typedef_print(), rz_core_types_typedef_print_all(), rz_core_types_union_print(), rz_core_types_union_print_all(), rz_core_yank_dump(), rz_debug_pid_list(), rz_debug_signal_list(), rz_debug_thread_list(), rz_diff_calculate_distance(), rz_diff_unified_json(), rz_flag_describe_at_handler(), rz_flag_local_list_all_handler(), rz_graph_drawable_to_json(), rz_heap_debug_block_win(), rz_heap_list_w32(), rz_il_event_json(), rz_il_vm_step_with_events_handler(), rz_main_rz_bin(), rz_pkcs7_cms_json(), rz_print_analysis_details_handler(), rz_print_jsondump_str(), rz_reg_profile_handler(), rz_resize_handler(), rz_save_panels_layout(), rz_seek_history_list_handler(), rz_serialize_analysis_case_op_save(), rz_serialize_analysis_diff_save(), rz_serialize_analysis_global_var_save(), rz_serialize_analysis_meta_save(), rz_serialize_analysis_switch_op_save(), rz_serialize_analysis_var_save(), rz_serialize_bp_save(), rz_serialize_flag_zones_save(), rz_serialize_spaces_save(), rz_table_tojson(), rz_test_main(), rz_x509_certificate_json(), rz_x509_crl_json(), rz_x509_extensions_json(), rz_x509_signedinfo_json(), rz_x509_tbscertificate_json(), rzfind_open_file(), sections_print_json(), serialize_checkpoints(), serialize_memory_cb(), serialize_register_cb(), show_analinfo(), show_regs_handler(), showanalysis(), showmem_json(), showregs_json(), siglistjsoncb(), store_xref_cb(), store_xrefs_list_cb(), strings_print(), symbols_print(), test_result_to_json(), types_cc_print(), var_accesses_list(), w32_list_heaps_blocks(), xref_list_print_to_json(), xref_print_to_json(), and xrefs_graph().

◆ pj_f()

RZ_API PJ* pj_f ( PJ j,
float  d 
)

Definition at line 268 of file pj.c.

268  {
270  pj_comma(j);
271  char s[64] = { 0 };
272  pj_raw(j, rz_strf(s, "%f", f));
273  return j;
274 }
#define f(i)
Definition: sha256.c:46

References f, NULL, pj_comma(), pj_raw(), rz_return_val_if_fail, rz_strf, and s.

Referenced by pj_kf().

◆ pj_free()

RZ_API void pj_free ( PJ j)

Definition at line 34 of file pj.c.

34  {
35  if (!pj) {
36  return;
37  }
38  rz_strbuf_fini(&pj->sb);
39  free(pj);
40 }
RZ_API void rz_strbuf_fini(RzStrBuf *sb)
Definition: strbuf.c:365

References free(), rz_strbuf_fini(), and pj_t::sb.

Referenced by __printXtrPluginDetails(), __system(), block_store(), cmd_aea(), cmd_print_bars(), cmd_print_blocks(), cmd_print_pv(), file_save_cb(), flag_save_cb(), func_walk_blocks(), function_store(), GetHeapGlobalsOffset(), hash_context_fini(), header(), hints_acc_store_cb(), nonreturn_print_json(), opex(), opex64(), print_json_string(), print_main_arena_bins(), print_malloc_states(), rtti_itanium_print_class_type_info_json(), rtti_itanium_print_si_class_type_info_json(), rtti_itanium_print_vmi_class_type_info_json(), rtti_msvc_print_complete_object_locator_recurse(), rz_analysis_function_address_handler(), rz_analysis_list_vtables(), rz_analysis_rtti_msvc_print_base_class_descriptor(), rz_analysis_rtti_msvc_print_class_hierarchy_descriptor(), rz_analysis_rtti_msvc_print_complete_object_locator(), rz_analysis_rtti_msvc_print_type_descriptor(), rz_cmd_debug_dmi(), rz_cmd_help(), rz_cmd_help_search_handler(), rz_cmd_javac_handler(), rz_cmd_javaf_handler(), rz_cmd_javai_handler(), rz_cmd_javam_handler(), rz_cmd_javap_handler(), rz_cmd_kuery(), rz_cmd_print(), rz_cmd_print_magic_handler(), rz_cmd_search(), rz_cmd_state_output_fini(), rz_core_agraph_print_json(), rz_core_analysis_callgraph(), rz_core_analysis_function_signature(), rz_core_analysis_graph(), rz_core_analysis_paths(), rz_core_annotated_code_print_json(), rz_core_bin_method_flags_str(), rz_core_diff_show(), rz_core_diff_show_function(), rz_core_file_print(), rz_core_graph_print(), rz_core_print_disasm(), rz_core_print_disasm_all(), rz_core_task_list(), rz_core_types_calling_conventions_print(), rz_core_types_enum_print_all(), rz_core_types_function_print_all(), rz_core_types_link_print_all(), rz_core_types_print_all(), rz_core_types_show_format(), rz_core_types_struct_print_all(), rz_core_types_typedef_print_all(), rz_core_types_union_print_all(), rz_debug_pid_list(), rz_debug_signal_list(), rz_debug_thread_list(), rz_diff_calculate_distance(), rz_diff_unified_files(), rz_diff_unified_json(), rz_heap_debug_block_win(), rz_heap_list_w32(), rz_il_vm_step_with_events_handler(), rz_main_rz_bin(), rz_print_jsondump_str(), rz_serialize_analysis_global_var_save(), rz_serialize_analysis_meta_save(), rz_serialize_bp_save(), rz_serialize_flag_zones_save(), rz_serialize_spaces_save(), rz_type_list_enum_handler(), rz_type_list_function_handler(), rz_type_list_structure_handler(), rz_type_list_typedef_handler(), rz_type_list_union_handler(), rzfind_open_file(), serialize_checkpoints(), serialize_memory_cb(), serialize_register_cb(), show_analinfo(), store_xrefs_list_cb(), types_cc_print(), and w32_list_heaps_blocks().

◆ pj_i()

RZ_API PJ* pj_i ( PJ j,
int  d 
)

Definition at line 284 of file pj.c.

284  {
285  if (j) {
286  pj_comma(j);
287  char s[64] = { 0 };
288  pj_raw(j, rz_strf(s, "%d", i));
289  }
290  return j;
291 }
lzma_index ** i
Definition: index.h:629

References i, pj_comma(), pj_raw(), rz_strf, and s.

Referenced by cmd_print_pv(), lang_byte_array_json(), pj_ki(), pj_r(), rz_agraph_print_json(), rz_graph_drawable_to_json(), rz_serialize_analysis_global_var_save(), rz_serialize_analysis_var_save(), and rz_serialize_bp_save().

◆ pj_j()

RZ_API PJ* pj_j ( PJ j,
const char *  k 
)

Definition at line 243 of file pj.c.

243  {
244  rz_return_val_if_fail(j && k, j);
245  if (*k) {
246  pj_comma(j);
247  pj_raw(j, k);
248  }
249  return j;
250 }
const char * k
Definition: dsignal.c:11

References k, pj_comma(), pj_raw(), and rz_return_val_if_fail.

Referenced by core_analysis_bytes_json(), and rz_core_bin_fields_print().

◆ pj_k()

RZ_API PJ* pj_k ( PJ j,
const char *  k 
)

Definition at line 104 of file pj.c.

104  {
105  rz_return_val_if_fail(j && k, j);
106  j->is_key = false;
107  pj_s(j, k);
108  pj_raw(j, ":");
109  j->is_first = false;
110  j->is_key = true;
111  return j;
112 }
RZ_API PJ * pj_s(PJ *j, const char *k)
Definition: pj.c:197
bool is_key
Definition: rz_pj.h:15

References pj_t::is_first, pj_t::is_key, k, pj_raw(), pj_s(), and rz_return_val_if_fail.

Referenced by add_header(), analysis_class_print_to_json(), bb_info_print(), block_store(), cmd_aea(), cmd_print_bars(), cmd_print_blocks(), cmd_print_pv(), cmd_pxr(), core_analysis_bytes_json(), core_analysis_graph_construct_nodes(), core_analysis_graph_nodes(), core_analysis_var_list_show(), draw_graph_nodes(), ds_begin_line(), flag_tag_print(), function_print_calls(), function_print_to_json(), function_store(), graph_construct_nodes(), header(), hints_acc_store_cb(), il_opdmp_blk(), il_opdmp_cast(), il_opdmp_let(), il_opdmp_load(), il_opdmp_loadw(), il_opdmp_set(), il_opdmp_store(), il_opdmp_storew(), pj_ka(), pj_kb(), pj_kd(), pj_kf(), pj_ki(), pj_kN(), pj_kn(), pj_knull(), pj_ko(), pj_kr(), pj_ks(), print_json_string(), rtti_itanium_print_vmi_class_type_info_json(), rtti_msvc_print_complete_object_locator_recurse(), rz_agraph_print_json(), rz_analysis_function_args_and_vars_xrefs_handler(), rz_analysis_function_get_json(), rz_analysis_function_vars_handler(), rz_bin_java_class_as_json(), rz_cmd_info_guess_size_handler(), rz_cmd_info_handler(), rz_core_agraph_print_json(), rz_core_analysis_function_signature(), rz_core_analysis_hasrefs_to_depth(), rz_core_annotated_code_print_json(), rz_core_bin_fields_print(), rz_core_bin_signatures_print(), rz_core_cmp_print(), rz_core_io_plugin_print(), rz_core_meta_print(), rz_core_print_disasm_json(), rz_core_print_function_disasm_json(), rz_core_types_enum_print(), rz_core_types_function_print(), rz_core_types_struct_print(), rz_core_types_union_print(), rz_flag_local_list_all_handler(), rz_graph_drawable_to_json(), rz_pkcs7_cms_json(), rz_reg_profile_handler(), rz_serialize_analysis_switch_op_save(), rz_x509_certificate_json(), rz_x509_crl_json(), rz_x509_signedinfo_json(), rz_x509_tbscertificate_json(), strings_print(), test_result_to_json(), w32_list_heaps_blocks(), xrefs_graph(), and xrefs_graph_fcn_start_json().

◆ pj_ka()

◆ pj_kb()

◆ pj_kd()

RZ_API PJ* pj_kd ( PJ j,
const char *  k,
double  d 
)

Definition at line 136 of file pj.c.

136  {
137  rz_return_val_if_fail(j && k, j);
138  pj_k(j, k);
139  pj_d(j, d);
140  return j;
141 }
RZ_API PJ * pj_d(PJ *j, double d)
Definition: pj.c:276

References d, k, pj_d(), pj_k(), and rz_return_val_if_fail.

Referenced by json_pj_recurse(), opex(), opex64(), rz_core_diff_show(), rz_diff_calculate_distance(), and rz_serialize_analysis_diff_save().

◆ pj_kf()

RZ_API PJ* pj_kf ( PJ j,
const char *  k,
float  d 
)

Definition at line 143 of file pj.c.

143  {
144  rz_return_val_if_fail(j && k, j);
145  pj_k(j, k);
146  pj_f(j, d);
147  return j;
148 }
RZ_API PJ * pj_f(PJ *j, float f)
Definition: pj.c:268

References d, k, pj_f(), pj_k(), and rz_return_val_if_fail.

◆ pj_ki()

RZ_API PJ* pj_ki ( PJ j,
const char *  k,
int  d 
)

Definition at line 149 of file pj.c.

149  {
150  rz_return_val_if_fail(j && k, j);
151  pj_k(j, k);
152  pj_i(j, i);
153  return j;
154 }
RZ_API PJ * pj_i(PJ *j, int i)
Definition: pj.c:284

References i, k, pj_i(), pj_k(), and rz_return_val_if_fail.

Referenced by _cb_hit(), bb_info_print(), bin_elf_versioninfo_verneed(), bin_memory_print_rec(), bin_resources_print_json(), block_store(), cmd_print_bars(), cmd_print_blocks(), core_analysis_bytes_json(), core_analysis_graph_construct_nodes(), core_analysis_graph_nodes(), core_bin_file_print(), do_analysis_search(), do_asm_search(), draw_graph_nodes(), file_save_cb(), flag_zone_list(), function_print_to_json(), function_store(), graph_construct_nodes(), hint_node_print(), hints_acc_store_cb(), open_maps_show(), opex(), opex64(), print_arch(), print_flag_json(), print_rop(), print_space_stack(), rtti_msvc_print_base_class_descriptor_json(), rz_agraph_print_json(), rz_analysis_function_address_handler(), rz_analysis_syscall_print_handler(), rz_block_handler(), rz_cmd_debug_display_bt_handler(), rz_cmd_debug_list_bp_handler(), rz_cmd_help(), rz_core_analysis_function_signature(), rz_core_bin_classes_print(), rz_core_bin_imports_print(), rz_core_bin_info_print(), rz_core_cmp_print(), rz_core_file_info_print(), rz_core_file_print(), rz_core_magic_at(), rz_core_print_disasm_json(), rz_core_spaces_print(), rz_core_task_print(), rz_core_types_print_all(), rz_debug_pid_list(), rz_debug_thread_list(), rz_graph_drawable_to_json(), rz_print_analysis_details_handler(), rz_serialize_analysis_meta_save(), rz_serialize_bp_save(), rz_x509_signedinfo_json(), rz_x509_tbscertificate_json(), symbols_print(), and test_result_to_json().

◆ pj_kN()

◆ pj_kn()

RZ_API PJ* pj_kn ( PJ j,
const char *  k,
ut64  n 
)

Definition at line 121 of file pj.c.

121  {
122  rz_return_val_if_fail(j && k, j);
123  pj_k(j, k);
124  pj_n(j, n);
125  return j;
126 }
RZ_API PJ * pj_n(PJ *j, ut64 n)
Definition: pj.c:252

References k, n, pj_k(), pj_n(), and rz_return_val_if_fail.

Referenced by analysis_class_print_to_json(), bb_info_print(), bin_elf_versioninfo_verneed(), bin_elf_versioninfo_versym(), bin_memory_print_rec(), bin_pe_versioninfo(), bin_resources_print_json(), block_store(), calculate_luhn(), cmd_debug_modules(), cmd_print_bars(), cmd_print_blocks(), cmd_pxr(), config_print_node(), core_analysis_bytes_json(), core_analysis_graph_construct_nodes(), core_analysis_graph_nodes(), core_analysis_name_print(), desc_list_json_cb(), disassemble_till_return_is_found(), do_esil_search(), draw_graph_nodes(), ds_begin_line(), entries_initfini_print(), flag_save_cb(), function_print_calls(), function_print_to_json(), graph_construct_nodes(), hash_context_compare_hashes(), hash_print_crypto(), hash_print_digest(), header(), hint_node_print(), hints_acc_store_cb(), il_opdmp_bitv(), il_opdmp_cast(), il_opdmp_load(), il_opdmp_loadw(), il_opdmp_store(), il_opdmp_storew(), open_maps_show(), opex(), opex64(), pdb_types_print_json(), print_arch(), print_bin_content(), print_bin_string(), print_debug_map_json(), print_flag_json(), print_function_labels_cb(), print_heap_chunk_simple(), print_heap_fastbin(), print_hint_tree(), print_json_string(), print_largebin_description(), print_malloc_states(), print_smallbin_description(), print_string(), print_tcache_content(), print_unsortedbin_description(), rtti_itanium_print_class_type_info_json(), rtti_itanium_print_si_class_type_info_json(), rtti_itanium_print_vmi_class_type_info_json(), rtti_msvc_print_base_class_descriptor_json(), rtti_msvc_print_class_hierarchy_descriptor_json(), rtti_msvc_print_complete_object_locator_json(), rtti_msvc_print_type_descriptor_json(), rz_analysis_basic_block_list_handler(), rz_bin_java_class_as_json(), rz_bin_java_class_const_pool_as_json(), rz_bin_java_class_fields_as_json(), rz_bin_java_class_interfaces_as_json(), rz_bin_java_class_methods_as_json(), rz_cmd_debug_display_bt_handler(), rz_cmd_disassemble_ropchain_handler(), rz_cmd_disassembly_all_possible_opcodes_handler(), rz_cmd_heap_chunks_print_handler(), rz_cmd_print(), rz_core_analysis_callgraph(), rz_core_analysis_function_strings_print(), rz_core_analysis_hasrefs_to_depth(), rz_core_annotated_code_print_json(), rz_core_bin_basefind_print(), rz_core_bin_imports_print(), rz_core_bin_info_print(), rz_core_bin_main_print(), rz_core_bin_print_source_line_sample(), rz_core_bin_relocs_print(), rz_core_cmp_print(), rz_core_diff_show(), rz_core_file_print(), rz_core_flag_describe(), rz_core_io_cache_print(), rz_core_meta_print(), rz_core_print_disasm_all(), rz_core_print_disasm_json(), rz_core_print_function_disasm_json(), rz_core_types_enum_print(), rz_core_yank_dump(), rz_diff_calculate_distance(), rz_graph_drawable_to_json(), rz_pkcs7_cms_json(), rz_reg_profile_handler(), rz_resize_handler(), rz_save_panels_layout(), rz_seek_history_list_handler(), rz_serialize_analysis_case_op_save(), rz_serialize_analysis_diff_save(), rz_serialize_analysis_meta_save(), rz_serialize_analysis_switch_op_save(), rz_serialize_analysis_var_save(), rz_serialize_bp_save(), rz_serialize_flag_zones_save(), rz_table_tojson(), serialize_checkpoints(), serialize_memory_cb(), serialize_register_cb(), show_regs_handler(), showanalysis(), store_label_cb(), store_xref_cb(), strings_print(), symbols_print(), test_result_to_json(), xref_print_to_json(), and xrefs_graph_fcn_start_json().

◆ pj_knull()

RZ_API PJ* pj_knull ( PJ j,
const char *  k 
)

Definition at line 114 of file pj.c.

114  {
115  rz_return_val_if_fail(j && k, j);
116  pj_k(j, k);
117  pj_null(j);
118  return j;
119 }
RZ_API PJ * pj_null(PJ *j)
Definition: pj.c:184

References k, pj_k(), pj_null(), and rz_return_val_if_fail.

Referenced by hint_node_print(), il_op_pure_resolve(), json_pj_recurse(), and siglistjsoncb().

◆ pj_ko()

◆ pj_kr()

RZ_API PJ* pj_kr ( PJ j,
const char *  k,
const ut8 v,
size_t  v_len 
)

Definition at line 236 of file pj.c.

236  {
237  rz_return_val_if_fail(j && k && v, j);
238  pj_k(j, k);
239  pj_r(j, v, v_len);
240  return j;
241 }
RZ_API PJ * pj_r(PJ *j, const ut8 *v, size_t v_len)
Definition: pj.c:225

References k, pj_k(), pj_r(), rz_return_val_if_fail, and v.

Referenced by rz_core_file_info_print().

◆ pj_ks()

RZ_API PJ* pj_ks ( PJ j,
const char *  k,
const char *  v 
)

Definition at line 170 of file pj.c.

170  {
171  rz_return_val_if_fail(j && k && v, j);
172  pj_k(j, k);
173  pj_s(j, v);
174  return j;
175 }

References k, pj_k(), pj_s(), rz_return_val_if_fail, and v.

Referenced by __printXtrPluginDetails(), __system(), _cb_hit(), analysis_class_print_to_json(), bin_elf_versioninfo_verneed(), bin_elf_versioninfo_versym(), bin_memory_print_rec(), bin_pe_versioninfo(), bin_resources_print_json(), block_store(), calculate_luhn(), cmd_address_info(), cmd_debug_modules(), cmd_print_blocks(), cmd_print_pv(), cmd_pxr(), config_print_node(), core_analysis_graph_nodes(), core_analysis_name_print(), core_analysis_var_list_show(), core_bin_file_print(), desc_list_json_cb(), diff_unified_json_data(), digests_pj_cb(), disassemble_till_return_is_found(), do_analysis_search(), do_asm_search(), draw_graph_nodes(), entries_initfini_print(), file_save_cb(), fill_args_json(), flag_save_cb(), flag_zone_list(), function_print_calls(), function_print_to_json(), function_store(), hash_context_compare_hashes(), hash_print_crypto(), hash_print_digest(), header(), hint_node_print(), hints_acc_store_cb(), il_op_effect_resolve(), il_op_pure_resolve(), il_opdmp_bitv(), il_opdmp_blk(), il_opdmp_bool_false(), il_opdmp_bool_true(), il_opdmp_cast(), il_opdmp_goto(), il_opdmp_let(), il_opdmp_load(), il_opdmp_loadw(), il_opdmp_set(), il_opdmp_store(), il_opdmp_storew(), il_opdmp_var(), json_pj_recurse(), meta_variable_comment_print(), open_maps_show(), opex(), opex64(), pdb_types_print_json(), print_arch(), print_bin_string(), print_debug_map_json(), print_demangler_info(), print_flag_json(), print_heap_fastbin(), print_json_string(), print_largebin_description(), print_malloc_states(), print_rop(), print_smallbin_description(), print_space_stack(), print_string(), print_tcache_content(), print_unsortedbin_description(), rop_kuery(), rtti_itanium_print_class_type_info_json(), rtti_itanium_print_si_class_type_info_json(), rtti_itanium_print_vmi_class_type_info_json(), rtti_msvc_print_type_descriptor_json(), rz_agraph_print_json(), rz_analysis_function_get_json(), rz_analysis_list_vtables(), rz_analysis_syscall_print_handler(), rz_analysis_var_global_list_show(), rz_bin_java_class_as_json(), rz_bin_java_class_const_pool_as_json(), rz_bin_java_class_fields_as_json(), rz_bin_java_class_interfaces_as_json(), rz_bin_java_class_methods_as_json(), rz_bin_pdb_download(), rz_bin_print_plugin_details(), rz_cmd_debug_display_bt_handler(), rz_cmd_debug_list_bp_handler(), rz_cmd_disassembly_all_possible_opcodes_handler(), rz_cmd_get_help_json(), rz_cmd_heap_chunks_print_handler(), rz_cmd_help(), rz_cmd_info_hashes_handler(), rz_cmd_print(), rz_core_analysis_callgraph(), rz_core_analysis_cc_print(), rz_core_analysis_function_signature(), rz_core_analysis_function_strings_print(), rz_core_analysis_hasrefs_to_depth(), rz_core_annotated_code_print_json(), rz_core_asm_plugin_print(), rz_core_bin_class_fields_print(), rz_core_bin_class_methods_print(), rz_core_bin_classes_print(), rz_core_bin_fields_print(), rz_core_bin_imports_print(), rz_core_bin_info_print(), rz_core_bin_pdb_gvars_as_string(), rz_core_bin_plugin_print(), rz_core_bin_print_source_line_sample(), rz_core_bin_relocs_print(), rz_core_binxtr_plugin_print(), rz_core_core_plugin_print(), rz_core_debug_plugin_print(), rz_core_diff_show(), rz_core_file_info_print(), rz_core_file_print(), rz_core_flag_describe(), rz_core_hash_plugin_print(), rz_core_io_cache_print(), rz_core_io_plugin_print(), rz_core_lang_plugin_print(), rz_core_magic_at(), rz_core_meta_print(), rz_core_parser_plugin_print(), rz_core_print_disasm_all(), rz_core_print_disasm_json(), rz_core_print_function_disasm_json(), rz_core_spaces_print(), rz_core_task_print(), rz_core_types_enum_print(), rz_core_types_function_print(), rz_core_types_link_print(), rz_core_types_print_all(), rz_core_types_show_format(), rz_core_types_struct_print(), rz_core_types_typedef_print(), rz_core_types_union_print(), rz_core_yank_dump(), rz_debug_pid_list(), rz_debug_thread_list(), rz_diff_unified_json(), rz_flag_describe_at_handler(), rz_graph_drawable_to_json(), rz_heap_debug_block_win(), rz_il_event_json(), rz_json_as_string(), rz_reg_profile_handler(), rz_save_panels_layout(), rz_seek_history_list_handler(), rz_serialize_analysis_diff_save(), rz_serialize_analysis_global_var_save(), rz_serialize_analysis_meta_save(), rz_serialize_analysis_var_save(), rz_serialize_bp_save(), rz_table_tojson(), rz_x509_certificate_json(), rz_x509_crl_json(), rz_x509_crlentry_json(), rz_x509_extensions_json(), rz_x509_name_json(), rz_x509_signedinfo_json(), rz_x509_subjectpublickeyinfo_json(), rz_x509_tbscertificate_json(), rz_x509_validity_json(), rzil_print_register_bitv(), sections_print_json(), serialize_checkpoints(), show_analinfo(), show_regs_handler(), showanalysis(), siglistjsoncb(), store_xref_cb(), strings_print(), symbols_print(), test_result_to_json(), types_cc_print(), var_accesses_list(), w32_list_heaps_blocks(), xref_print_to_json(), xrefs_graph(), and xrefs_graph_fcn_start_json().

◆ pj_N()

RZ_API PJ* pj_N ( PJ j,
st64  n 
)

Definition at line 260 of file pj.c.

260  {
262  pj_comma(j);
263  char s[64] = { 0 };
264  pj_raw(j, rz_strf(s, "%" PFMT64d, n));
265  return j;
266 }
#define PFMT64d
Definition: rz_types.h:394

References n, NULL, PFMT64d, pj_comma(), pj_raw(), rz_return_val_if_fail, rz_strf, and s.

Referenced by diff_unified_json_ranges(), json_pj_recurse(), pj_kN(), and rz_cmd_sizes_of_n_instructions_handler().

◆ pj_n()

◆ pj_new()

RZ_API PJ* pj_new ( void  )

Definition at line 25 of file pj.c.

25  {
26  PJ *j = RZ_NEW0(PJ);
27  if (j) {
28  rz_strbuf_init(&j->sb);
29  j->is_first = true;
30  }
31  return j;
32 }
RZ_API void rz_strbuf_init(RzStrBuf *sb)
Definition: strbuf.c:33
#define RZ_NEW0(x)
Definition: rz_types.h:284
Definition: rz_pj.h:12
RzStrBuf sb
Definition: rz_pj.h:13

References pj_t::is_first, RZ_NEW0, rz_strbuf_init(), and pj_t::sb.

Referenced by __printXtrPluginDetails(), __system(), block_store(), cmd_aea(), cmd_print_bars(), cmd_print_blocks(), cmd_print_pv(), download_pdb(), entitlements(), file_save_cb(), flag_save_cb(), func_walk_blocks(), function_store(), GetHeapGlobalsOffset(), hash_context_run(), header(), hints_acc_store_cb(), lang_byte_array_json(), nonreturn_print_json(), opex(), opex64(), print_json_string(), print_main_arena_bins(), print_malloc_states(), rtti_itanium_print_class_type_info_json(), rtti_itanium_print_si_class_type_info_json(), rtti_itanium_print_vmi_class_type_info_json(), rtti_msvc_print_complete_object_locator_recurse(), rz_analysis_function_address_handler(), rz_analysis_function_args_and_vars_xrefs_handler(), rz_analysis_function_get_json(), rz_analysis_list_vtables(), rz_analysis_rtti_msvc_print_base_class_descriptor(), rz_analysis_rtti_msvc_print_class_hierarchy_descriptor(), rz_analysis_rtti_msvc_print_complete_object_locator(), rz_analysis_rtti_msvc_print_type_descriptor(), rz_cmd_debug_dmi(), rz_cmd_help(), rz_cmd_help_search_handler(), rz_cmd_javac_handler(), rz_cmd_javaf_handler(), rz_cmd_javai_handler(), rz_cmd_javam_handler(), rz_cmd_javap_handler(), rz_cmd_kuery(), rz_cmd_print(), rz_cmd_print_magic_handler(), rz_cmd_search(), rz_cmd_state_output_init(), rz_core_agraph_print_json(), rz_core_analysis_callgraph(), rz_core_analysis_function_signature(), rz_core_analysis_graph(), rz_core_analysis_hasrefs(), rz_core_analysis_il_vm_status(), rz_core_analysis_paths(), rz_core_annotated_code_print_json(), rz_core_bin_method_flags_str(), rz_core_diff_show(), rz_core_diff_show_function(), rz_core_file_print(), rz_core_graph_print(), rz_core_print_disasm(), rz_core_print_disasm_all(), rz_core_task_list(), rz_core_types_calling_conventions_print(), rz_core_types_enum_print_all(), rz_core_types_function_print_all(), rz_core_types_link_print_all(), rz_core_types_print_all(), rz_core_types_show_format(), rz_core_types_struct_print_all(), rz_core_types_typedef_print_all(), rz_core_types_union_print_all(), rz_debug_pid_list(), rz_debug_signal_list(), rz_debug_thread_list(), rz_diff_calculate_distance(), rz_diff_unified_json(), rz_heap_debug_block_win(), rz_heap_list_w32(), rz_il_vm_step_with_events_handler(), rz_json_as_string(), rz_main_rz_bin(), rz_pkcs7_cms_json(), rz_print_jsondump_str(), rz_save_panels_layout(), rz_serialize_analysis_global_var_save(), rz_serialize_analysis_meta_save(), rz_serialize_bp_save(), rz_serialize_flag_zones_save(), rz_serialize_spaces_save(), rz_table_tojson(), rz_test_main(), rz_type_list_enum_handler(), rz_type_list_function_handler(), rz_type_list_structure_handler(), rz_type_list_typedef_handler(), rz_type_list_union_handler(), rzfind_open_file(), serialize_checkpoints(), serialize_memory_cb(), serialize_register_cb(), show_analinfo(), signature(), store_xrefs_list_cb(), types_cc_print(), and w32_list_heaps_blocks().

◆ pj_null()

RZ_API PJ* pj_null ( PJ j)

Definition at line 184 of file pj.c.

184  {
185  rz_return_val_if_fail(j, j);
186  pj_raw(j, "null");
187  return j;
188 }

References pj_raw(), and rz_return_val_if_fail.

Referenced by hints_acc_store_cb(), json_pj_recurse(), and pj_knull().

◆ pj_o()

RZ_API PJ* pj_o ( PJ j)

Definition at line 75 of file pj.c.

75  {
77  pj_comma(j);
78  return pj_begin(j, '{');
79 }

References pj_begin(), pj_comma(), and rz_return_val_if_fail.

Referenced by __printXtrPluginDetails(), __system(), _cb_hit(), _CbInRangeSearchV(), analysis_class_print_to_json(), bb_info_print(), bin_elf_versioninfo(), bin_elf_versioninfo_verneed(), bin_elf_versioninfo_versym(), bin_mach0_versioninfo(), bin_memory_print_rec(), bin_pe_versioninfo(), bin_resources_print_json(), bin_versioninfo(), block_store(), calculate_hash(), calculate_luhn(), cmd_address_info(), cmd_aea(), cmd_debug_modules(), cmd_print_bars(), cmd_print_blocks(), cmd_print_pv(), cmd_pxr(), config_print_node(), core_analysis_bytes_json(), core_analysis_graph_construct_nodes(), core_analysis_graph_nodes(), core_analysis_name_print(), core_analysis_var_list_show(), core_bin_file_print(), desc_list_json_cb(), diff_unified_json_data(), disassemble_till_return_is_found(), do_analysis_search(), do_asm_search(), do_esil_search(), download_pdb(), draw_graph_nodes(), ds_begin_line(), entries_initfini_print(), file_save_cb(), fill_args_json(), flag_save_cb(), flag_zone_list(), function_print_calls(), function_print_to_json(), function_store(), graph_construct_nodes(), hash_context_run(), header(), hints_acc_store_cb(), il_op_effect_resolve(), il_op_pure_resolve(), il_opdmp_bitv(), il_opdmp_blk(), il_opdmp_bool_false(), il_opdmp_bool_true(), il_opdmp_cast(), il_opdmp_goto(), il_opdmp_let(), il_opdmp_load(), il_opdmp_loadw(), il_opdmp_set(), il_opdmp_store(), il_opdmp_storew(), il_opdmp_var(), json_pj_recurse(), meta_variable_comment_print(), open_maps_show(), opex(), opex64(), pdb_types_print_json(), pj_ko(), print_arch(), print_bin_string(), print_debug_map_json(), print_demangler_info(), print_flag_json(), print_function_labels_cb(), print_heap_chunk_simple(), print_heap_fastbin(), print_hint_tree(), print_json_string(), print_largebin_description(), print_main_arena_bins(), print_malloc_states(), print_rop(), print_smallbin_description(), print_space_stack(), print_string(), print_tcache_content(), print_unsortedbin_description(), rop_kuery(), rtti_itanium_print_class_type_info_json(), rtti_itanium_print_si_class_type_info_json(), rtti_itanium_print_vmi_class_type_info_json(), rtti_msvc_print_base_class_descriptor_json(), rtti_msvc_print_class_hierarchy_descriptor_json(), rtti_msvc_print_complete_object_locator_json(), rtti_msvc_print_complete_object_locator_recurse(), rtti_msvc_print_type_descriptor_json(), rz_agraph_print_json(), rz_analysis_basic_block_list_handler(), rz_analysis_function_address_handler(), rz_analysis_function_args_and_vars_xrefs_handler(), rz_analysis_function_get_json(), rz_analysis_function_vars_handler(), rz_analysis_list_vtables(), rz_analysis_syscall_print_handler(), rz_analysis_var_global_list_show(), rz_bin_java_class_as_json(), rz_bin_java_class_const_pool_as_json(), rz_bin_java_class_fields_as_json(), rz_bin_java_class_interfaces_as_json(), rz_bin_java_class_methods_as_json(), rz_bin_print_plugin_details(), rz_block_handler(), rz_cmd_debug_display_bt_handler(), rz_cmd_debug_list_bp_handler(), rz_cmd_disassemble_ropchain_handler(), rz_cmd_disassembly_all_possible_opcodes_handler(), rz_cmd_heap_chunks_print_handler(), rz_cmd_help(), rz_cmd_help_search_handler(), rz_cmd_info_all_handler(), rz_cmd_info_guess_size_handler(), rz_cmd_info_handler(), rz_cmd_info_hashes_handler(), rz_cmd_info_pdb_download_handler(), rz_cmd_kuery(), rz_cmd_print(), rz_core_agraph_print_json(), rz_core_analysis_callgraph(), rz_core_analysis_cc_print(), rz_core_analysis_function_signature(), rz_core_analysis_function_strings_print(), rz_core_analysis_hasrefs_to_depth(), rz_core_analysis_il_vm_status(), rz_core_annotated_code_print_json(), rz_core_bin_basefind_print(), rz_core_bin_class_fields_print(), rz_core_bin_class_methods_print(), rz_core_bin_classes_print(), rz_core_bin_fields_print(), rz_core_bin_imports_print(), rz_core_bin_info_print(), rz_core_bin_main_print(), rz_core_bin_pdb_gvars_as_string(), rz_core_bin_plugin_print(), rz_core_bin_print_source_line_sample(), rz_core_bin_relocs_print(), rz_core_bin_signatures_print(), rz_core_binxtr_plugin_print(), rz_core_cmp_print(), rz_core_config_print_all(), rz_core_core_plugin_print(), rz_core_debug_plugin_print(), rz_core_diff_show(), rz_core_file_info_print(), rz_core_file_print(), rz_core_flag_describe(), rz_core_hash_plugin_print(), rz_core_io_cache_print(), rz_core_io_plugin_print(), rz_core_lang_plugin_print(), rz_core_magic_at(), rz_core_meta_print(), rz_core_parser_plugin_print(), rz_core_print_disasm_all(), rz_core_print_disasm_json(), rz_core_print_function_disasm_json(), rz_core_spaces_print(), rz_core_task_print(), rz_core_types_enum_print(), rz_core_types_function_print(), rz_core_types_link_print(), rz_core_types_print_all(), rz_core_types_show_format(), rz_core_types_struct_print(), rz_core_types_typedef_print(), rz_core_types_union_print(), rz_core_yank_dump(), rz_debug_pid_list(), rz_debug_thread_list(), rz_diff_calculate_distance(), rz_diff_unified_json(), rz_flag_describe_at_handler(), rz_graph_drawable_to_json(), rz_heap_debug_block_win(), rz_heap_list_w32(), rz_il_event_json(), rz_pkcs7_cms_json(), rz_print_analysis_details_handler(), rz_reg_profile_handler(), rz_resize_handler(), rz_save_panels_layout(), rz_seek_history_list_handler(), rz_serialize_analysis_case_op_save(), rz_serialize_analysis_diff_save(), rz_serialize_analysis_global_var_save(), rz_serialize_analysis_meta_save(), rz_serialize_analysis_switch_op_save(), rz_serialize_analysis_var_save(), rz_serialize_bp_save(), rz_serialize_flag_zones_save(), rz_table_tojson(), rz_x509_certificate_json(), rz_x509_crl_json(), rz_x509_extensions_json(), rz_x509_signedinfo_json(), rz_x509_tbscertificate_json(), sections_print_json(), serialize_checkpoints(), serialize_memory_cb(), serialize_register_cb(), show_analinfo(), show_regs_handler(), showanalysis(), siglistjsoncb(), start_state(), store_xref_cb(), strings_print(), symbols_print(), test_result_to_json(), var_accesses_list(), w32_list_heaps_blocks(), xref_print_to_json(), xrefs_graph(), and xrefs_graph_fcn_start_json().

◆ pj_r()

RZ_API PJ* pj_r ( PJ j,
const ut8 v,
size_t  v_len 
)

Definition at line 225 of file pj.c.

225  {
226  rz_return_val_if_fail(j && v, j);
227  size_t i;
228  pj_a(j);
229  for (i = 0; i < v_len; i++) {
230  pj_i(j, v[i]);
231  }
232  pj_end(j);
233  return j;
234 }
RZ_API PJ * pj_end(PJ *j)
Definition: pj.c:87

References i, pj_a(), pj_end(), pj_i(), rz_return_val_if_fail, and v.

Referenced by pj_kr().

◆ pj_raw()

RZ_API void pj_raw ( PJ j,
const char *  k 
)

Definition at line 7 of file pj.c.

7  {
9  if (*msg) {
10  rz_strbuf_append(&j->sb, msg);
11  }
12 }
#define rz_return_if_fail(expr)
Definition: rz_assert.h:100
RZ_API bool rz_strbuf_append(RzStrBuf *sb, const char *s)
Definition: strbuf.c:222

References msg, rz_return_if_fail, rz_strbuf_append(), and pj_t::sb.

Referenced by add_footer(), pj_b(), pj_begin(), pj_comma(), pj_d(), pj_end(), pj_f(), pj_i(), pj_j(), pj_k(), pj_N(), pj_n(), pj_null(), pj_s(), pj_S(), print_json_string(), and rz_core_bin_signatures_print().

◆ pj_reset()

RZ_API void pj_reset ( PJ j)

Definition at line 42 of file pj.c.

42  {
44  rz_strbuf_set(&j->sb, "");
45  j->level = 0;
46  j->is_first = true;
47  j->is_key = false;
48 }
RZ_API const char * rz_strbuf_set(RzStrBuf *sb, const char *s)
Definition: strbuf.c:153

References pj_t::is_first, pj_t::is_key, pj_t::level, rz_return_if_fail, rz_strbuf_set(), and pj_t::sb.

Referenced by rz_serialize_analysis_global_var_save(), and rz_serialize_analysis_meta_save().

◆ pj_s()

◆ pj_S()

RZ_API PJ* pj_S ( PJ j,
const char *  k 
)

Definition at line 212 of file pj.c.

212  {
213  rz_return_val_if_fail(j && k, j);
214  pj_comma(j);
215  char *ek = rz_str_escape_utf8_for_json(k, -1);
216  if (ek) {
217  pj_raw(j, ek);
218  free(ek);
219  } else {
220  eprintf("cannot escape string\n");
221  }
222  return j;
223 }

References eprintf, free(), k, pj_comma(), pj_raw(), rz_return_val_if_fail, and rz_str_escape_utf8_for_json().

Referenced by rz_json_as_string().

◆ pj_string()

RZ_API const char* pj_string ( PJ pj)

Definition at line 57 of file pj.c.

57  {
58  return j ? rz_strbuf_get(&j->sb) : NULL;
59 }
RZ_API char * rz_strbuf_get(RzStrBuf *sb)
Definition: strbuf.c:321

References NULL, rz_strbuf_get(), and pj_t::sb.

Referenced by __printXtrPluginDetails(), __system(), add_footer(), block_store(), cmd_aea(), cmd_print_bars(), cmd_print_blocks(), cmd_print_pv(), end_state(), file_save_cb(), flag_save_cb(), func_walk_blocks(), function_store(), hash_context_run(), header(), hints_acc_store_cb(), nonreturn_print_json(), opex(), opex64(), print_json_string(), print_main_arena_bins(), print_malloc_states(), rtti_itanium_print_class_type_info_json(), rtti_itanium_print_si_class_type_info_json(), rtti_itanium_print_vmi_class_type_info_json(), rtti_msvc_print_complete_object_locator_recurse(), rz_analysis_function_address_handler(), rz_analysis_list_vtables(), rz_analysis_rtti_msvc_print_base_class_descriptor(), rz_analysis_rtti_msvc_print_class_hierarchy_descriptor(), rz_analysis_rtti_msvc_print_complete_object_locator(), rz_analysis_rtti_msvc_print_type_descriptor(), rz_cmd_debug_dmi(), rz_cmd_help(), rz_cmd_help_search_handler(), rz_cmd_javac_handler(), rz_cmd_javaf_handler(), rz_cmd_javai_handler(), rz_cmd_javam_handler(), rz_cmd_javap_handler(), rz_cmd_kuery(), rz_cmd_print(), rz_cmd_print_magic_handler(), rz_cmd_search(), rz_cmd_state_output_print(), rz_core_agraph_print_json(), rz_core_analysis_callgraph(), rz_core_analysis_function_signature(), rz_core_analysis_graph(), rz_core_analysis_paths(), rz_core_annotated_code_print_json(), rz_core_bin_method_flags_str(), rz_core_bin_pdb_gvars_as_string(), rz_core_diff_show(), rz_core_diff_show_function(), rz_core_file_print(), rz_core_graph_print(), rz_core_print_disasm(), rz_core_print_disasm_all(), rz_core_task_list(), rz_core_types_calling_conventions_print(), rz_core_types_enum_print_all(), rz_core_types_function_print_all(), rz_core_types_link_print_all(), rz_core_types_print_all(), rz_core_types_show_format(), rz_core_types_struct_print_all(), rz_core_types_typedef_print_all(), rz_core_types_union_print_all(), rz_debug_pid_list(), rz_debug_signal_list(), rz_debug_thread_list(), rz_diff_calculate_distance(), rz_diff_unified_files(), rz_heap_debug_block_win(), rz_heap_list_w32(), rz_il_vm_step_with_events_handler(), rz_main_rz_bin(), rz_print_jsondump_str(), rz_serialize_analysis_global_var_save(), rz_serialize_bp_save(), rz_serialize_flag_zones_save(), rz_serialize_spaces_save(), rz_type_list_enum_handler(), rz_type_list_function_handler(), rz_type_list_structure_handler(), rz_type_list_typedef_handler(), rz_type_list_union_handler(), rzfind_open_file(), serialize_checkpoints(), serialize_memory_cb(), serialize_register_cb(), show_analinfo(), store_xrefs_list_cb(), types_cc_print(), and w32_list_heaps_blocks().