mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-30 16:40:57 +00:00
54bdfb22bd
- Fixes ruby warnings - Follow java syntax conventions - Helped to identify and fix bugs in many vapis - Sync swig examples - Add test-r_core.rb (ruby test for RCore) * Some work in r_cons, some refactoring and cleanup - scr.html is now working again - w32 cons support should work now - Rename r_cons_get_columns -> r_cons_get_size() - But it needs more work * Typedef all r_range, r_parse and r_anal structs - Add missing r_lib.pc in configure.acr * 'make' clean now removes the libr* in swig/${LANG}/
42 lines
1.2 KiB
C
42 lines
1.2 KiB
C
#ifndef _INCLUDE_R_CMD_H_
|
|
#define _INCLUDE_R_CMD_H_
|
|
|
|
#include <r_types.h>
|
|
#include "list.h"
|
|
|
|
#define r_cmd_callback(x) int (*x)(void *data, const char *input)
|
|
#define r_cmd_nullcallback(x) int (*x)(void *data);
|
|
|
|
typedef struct r_cmd_item_t {
|
|
char cmd[64];
|
|
char desc[128];
|
|
r_cmd_callback(callback);
|
|
} RCommandItem;
|
|
|
|
typedef struct r_cmd_long_item_t {
|
|
char cmd[64]; /* long command */
|
|
int cmd_len;
|
|
char cmd_short[32]; /* short command */
|
|
char desc[128];
|
|
struct list_head list;
|
|
} RCommandLongItem;
|
|
|
|
typedef struct r_cmd_t {
|
|
void *data;
|
|
r_cmd_nullcallback(nullcallback);
|
|
struct list_head lcmds;
|
|
struct r_cmd_item_t *cmds[255];
|
|
} RCommand;
|
|
|
|
#ifdef R_API
|
|
R_API int r_cmd_init(struct r_cmd_t *cmd);
|
|
R_API int r_cmd_set_data(struct r_cmd_t *cmd, void *data);
|
|
R_API int r_cmd_add(struct r_cmd_t *cmd, const char *command, const char *desc, r_cmd_callback(callback));
|
|
R_API int r_cmd_add_long(struct r_cmd_t *cmd, const char *longcmd, const char *shortcmd, const char *desc);
|
|
R_API int r_cmd_del(struct r_cmd_t *cmd, const char *command);
|
|
R_API int r_cmd_call(struct r_cmd_t *cmd, const char *command);
|
|
R_API int r_cmd_call_long(struct r_cmd_t *cmd, const char *input);
|
|
R_API char **r_cmd_args(struct r_cmd_t *cmd, int *argc);
|
|
#endif
|
|
#endif
|