Rizin
unix-like reverse engineering framework and cli tools
rz_cmd_desc_t Struct Reference

#include <rz_cmd.h>

Public Attributes

RzCmdDescType type
 
char * name
 
struct rz_cmd_desc_tparent
 
int n_children
 
RzPVector children
 
const RzCmdDescHelphelp
 
union {
   struct {
      RzCmdCb   cb
 
   }   oldinput_data
 
   struct {
      RzCmdArgvCb   cb
 
      int   min_argc
 
      int   max_argc
 
   }   argv_data
 
   struct {
      struct rz_cmd_desc_t *   exec_cd
 
   }   group_data
 
   struct {
      RzCmdArgvModesCb   cb
 
      int   modes
 A combination of RzOutputMode values. More...
 
      RzOutputMode   default_mode
 Make one of the modes the default one, used even when the special suffix is not specified. More...
 
      int   min_argc
 
      int   max_argc
 
   }   argv_modes_data
 
   struct {
      RzCmdArgvStateCb   cb
 
      int   modes
 A combination of RzOutputMode values. More...
 
      RzOutputMode   default_mode
 Make one of the modes the default one, used even when the special suffix is not specified. More...
 
      int   min_argc
 
      int   max_argc
 
   }   argv_state_data
 
d
 

Detailed Description

Command Descriptor structure. It represents a command that can be executed by the user on the shell or a part of the command help (e.g. groups of commands). Anything that appears under ? has an associated command descriptor.

Definition at line 412 of file rz_cmd.h.

Member Data Documentation

◆ 

struct { ... } rz_cmd_desc_t::argv_data

Referenced by argv_new().

◆ 

struct { ... } rz_cmd_desc_t::argv_modes_data

Referenced by argv_modes_new().

◆ 

struct { ... } rz_cmd_desc_t::argv_state_data

Referenced by argv_state_new().

◆ cb [1/4]

RzCmdCb rz_cmd_desc_t::cb

Definition at line 451 of file rz_cmd.h.

◆ cb [2/4]

RzCmdArgvCb rz_cmd_desc_t::cb

Definition at line 454 of file rz_cmd.h.

◆ cb [3/4]

RzCmdArgvModesCb rz_cmd_desc_t::cb

Definition at line 462 of file rz_cmd.h.

◆ cb [4/4]

RzCmdArgvStateCb rz_cmd_desc_t::cb

Definition at line 469 of file rz_cmd.h.

◆ children

RzPVector rz_cmd_desc_t::children

Vector of childrens command descriptors.

Definition at line 440 of file rz_cmd.h.

Referenced by cmd_desc_set_parent(), cmd_desc_unset_parent(), create_cmd_desc(), and sort_groups().

◆ 

◆ default_mode

RzOutputMode rz_cmd_desc_t::default_mode

Make one of the modes the default one, used even when the special suffix is not specified.

Definition at line 464 of file rz_cmd.h.

◆ exec_cd

struct rz_cmd_desc_t* rz_cmd_desc_t::exec_cd

Definition at line 459 of file rz_cmd.h.

◆ 

struct { ... } rz_cmd_desc_t::group_data

◆ help

const RzCmdDescHelp* rz_cmd_desc_t::help

Reference to the help structure of this command descriptor.

Definition at line 444 of file rz_cmd.h.

Referenced by cmd_desc_set_parent(), create_cmd_desc(), and sort_groups().

◆ max_argc

int rz_cmd_desc_t::max_argc

Definition at line 456 of file rz_cmd.h.

◆ min_argc

int rz_cmd_desc_t::min_argc

Definition at line 455 of file rz_cmd.h.

◆ modes

int rz_cmd_desc_t::modes

A combination of RzOutputMode values.

Definition at line 463 of file rz_cmd.h.

◆ n_children

int rz_cmd_desc_t::n_children

Number of children command descriptors of this node.

Definition at line 436 of file rz_cmd.h.

Referenced by cmd_desc_set_parent(), cmd_desc_unset_parent(), and create_cmd_desc().

◆ name

char* rz_cmd_desc_t::name

Base name of the command. This is used to retrieve the RzCmdDesc when a user executes a command. It can match multiple user-called commands. For example a command that accepts STANDARD and JSON modes is called for both <name> and <name>j.

Definition at line 425 of file rz_cmd.h.

Referenced by cmd_descs_generate.Arg::__str__(), cmd_descs_generate.Detail::__str__(), cmd_descs_generate.Arg::_get_choices_cname(), cmd_descs_generate.CmdDesc::_validate(), cd_sort(), create_cmd_desc(), DEFINE_HANDLE_TS_FCN_AND_SYMBOL(), fill_children_chars(), cmd_descs_generate.Detail::get_detail_entries_cname(), test_group_name.GroupTest::run(), and cmd_descs_generate.CmdDesc::str_tab().

◆ 

struct { ... } rz_cmd_desc_t::oldinput_data

◆ parent

struct rz_cmd_desc_t* rz_cmd_desc_t::parent

Parent of this command descriptor.

Commands are organized in a tree, with the root being shown when doing ?. This relationship is used when showing commands helps.

Definition at line 432 of file rz_cmd.h.

Referenced by cmd_descs_generate.CmdDesc::_validate().

◆ type

RzCmdDescType rz_cmd_desc_t::type

Type of the command descriptor. There are several types of commands: those that are still using the old-style and parses the input string themselves, those that accept argc/argv, etc.

Definition at line 418 of file rz_cmd.h.

Referenced by cmd_descs_generate.Arg::__str__(), cmd_descs_generate.Arg::_get_choices_cname(), cmd_descs_generate.Arg::_get_union(), cmd_descs_generate.CmdDesc::_validate(), cmd_desc_set_parent(), create_cmd_desc(), cmd_descs_generate.Arg::decl(), fill_children_chars(), cmd_descs_generate.Arg::get_cstructure(), and cmd_descs_generate.CmdDesc::get_handler_cname().


The documentation for this struct was generated from the following file: