add jim_handler to command_registration

Adding jim_handler field to command_registration allows removing the
register_jim helper.  All command registrations now go through the
register_command{,s}() functions.
This commit is contained in:
Zachary T Welch
2009-11-23 15:03:04 -08:00
parent cd7e76ebf0
commit 17a9dea53a
6 changed files with 146 additions and 83 deletions

View File

@@ -164,6 +164,8 @@ struct command
struct command *parent;
struct command *children;
command_handler_t handler;
Jim_CmdProc jim_handler;
void *jim_handler_data;
enum command_mode mode;
struct command *next;
};
@@ -198,6 +200,8 @@ char *command_name(struct command *c, char delim);
struct command_registration {
const char *name;
command_handler_t handler;
Jim_CmdProc jim_handler;
void *jim_handler_data;
enum command_mode mode;
const char *help;
/// a string listing the options and arguments, required or optional
@@ -319,9 +323,6 @@ void process_jim_events(void);
extern Jim_Interp *interp;
void register_jim(struct command_context *context, const char *name,
Jim_CmdProc cmd, const char *help);
int parse_ulong(const char *str, unsigned long *ul);
int parse_ullong(const char *str, unsigned long long *ul);