Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Macros | |
#define | FMT_NONE 0 |
#define | FMT_RAW 1 |
#define | FMT_JSON 2 |
Functions | |
static char * | showfile (char *res, const int nth, const char *fpath, const char *name, int printfmt) |
RZ_API RZ_OWN char * | rz_syscmd_ls (RZ_NONNULL const char *input) |
static int | cmpstr (const void *_a, const void *_b) |
RZ_API RZ_OWN char * | rz_syscmd_sort (RZ_NONNULL const char *file) |
RZ_API RZ_OWN char * | rz_syscmd_head (RZ_NONNULL const char *file, int count) |
RZ_API RZ_OWN char * | rz_syscmd_tail (RZ_NONNULL const char *file, int count) |
RZ_API RZ_OWN char * | rz_syscmd_uniq (RZ_NONNULL const char *file) |
RZ_API RZ_OWN char * | rz_syscmd_join (RZ_NONNULL const char *file1, RZ_NONNULL const char *file2) |
RZ_API RZ_OWN char * | rz_syscmd_cat (RZ_NONNULL const char *file) |
RZ_API RZ_OWN char * | rz_syscmd_mkdir (RZ_NONNULL const char *dir) |
Variables | |
static int | needs_newline = 0 |
RZ_API RZ_OWN char* rz_syscmd_cat | ( | RZ_NONNULL const char * | file | ) |
Definition at line 442 of file syscmd.c.
References eprintf, file, free(), NULL, p, rz_file_slurp(), rz_return_val_if_fail, rz_str_trim(), and strdup().
Referenced by rz_cmd_shell_cat_handler().
RZ_API RZ_OWN char* rz_syscmd_head | ( | RZ_NONNULL const char * | file, |
int | count | ||
) |
Definition at line 284 of file syscmd.c.
References count, eprintf, file, free(), NULL, p, rz_file_slurp_lines(), rz_return_val_if_fail, rz_str_trim(), and strdup().
RZ_API RZ_OWN char* rz_syscmd_join | ( | RZ_NONNULL const char * | file1, |
RZ_NONNULL const char * | file2 | ||
) |
Definition at line 367 of file syscmd.c.
References test_evm::end, eprintf, free(), list(), NULL, out, rz_file_slurp(), rz_list_append(), rz_list_free(), rz_list_newf(), rz_list_to_str(), rz_return_val_if_fail, rz_str_append(), rz_str_new(), rz_str_split_list(), rz_str_startswith(), rz_str_trim(), and strdup().
RZ_API RZ_OWN char* rz_syscmd_ls | ( | RZ_NONNULL const char * | input | ) |
Definition at line 121 of file syscmd.c.
References calloc(), d, eprintf, files, FMT_JSON, FMT_RAW, free(), input(), memcpy(), n, name, needs_newline, NULL, off, p, path, rz_file_is_directory(), rz_file_is_regular(), rz_list_free(), rz_path_home_expand(), rz_str_append(), rz_str_glob(), rz_str_home(), rz_str_startswith(), rz_str_trim_head_ro(), rz_sys_dir(), showfile(), and strdup().
Referenced by rz_cmd_shell_ls_handler().
RZ_API RZ_OWN char* rz_syscmd_mkdir | ( | RZ_NONNULL const char * | dir | ) |
Definition at line 468 of file syscmd.c.
References free(), NULL, rz_return_val_if_fail, rz_str_dup(), rz_str_newf(), rz_str_trim(), rz_str_trim_head_ro(), rz_sys_mkdir_failed, rz_sys_mkdirp(), strdup(), and suffix.
Referenced by rz_cmd_shell_mkdir_handler().
RZ_API RZ_OWN char* rz_syscmd_sort | ( | RZ_NONNULL const char * | file | ) |
Definition at line 254 of file syscmd.c.
References cmpstr(), eprintf, file, free(), list(), NULL, p, rz_file_slurp(), rz_list_free(), rz_list_sort(), rz_list_to_str(), rz_return_val_if_fail, rz_str_split_list(), rz_str_trim(), and strdup().
Referenced by rz_cmd_shell_sort_handler().
RZ_API RZ_OWN char* rz_syscmd_tail | ( | RZ_NONNULL const char * | file, |
int | count | ||
) |
Definition at line 308 of file syscmd.c.
References count, eprintf, file, free(), NULL, p, rz_file_slurp_lines_from_bottom(), rz_return_val_if_fail, rz_str_trim(), and strdup().
RZ_API RZ_OWN char* rz_syscmd_uniq | ( | RZ_NONNULL const char * | file | ) |
Definition at line 334 of file syscmd.c.
References cmpstr(), eprintf, file, free(), list(), NULL, p, rz_file_slurp(), rz_list_free(), rz_list_to_str(), rz_list_uniq(), rz_return_val_if_fail, rz_str_split_list(), rz_str_trim(), and strdup().
Referenced by rz_cmd_shell_uniq_handler().
|
static |
Definition at line 13 of file syscmd.c.
References FMT_JSON, FMT_RAW, free(), n, needs_newline, NULL, rz_file_is_directory(), rz_file_size(), rz_str_append(), rz_str_appendf(), rz_str_casestr(), rz_str_rwx_i(), S_IFLNK, sb, and strdup().
Referenced by rz_syscmd_ls().
|
static |
Definition at line 11 of file syscmd.c.
Referenced by rz_syscmd_ls(), and showfile().