-#define COMMAND_HEAD_ANCESTOR(CLASS_NAME,ANCESTOR) \
-class CLASS_NAME : public ANCESTOR \
-{
-
-#define COMMAND_METHODS(CLASS_NAME) \
-public:\
- CLASS_NAME (char *aname,\
- int can_rep,\
- char *short_help,\
- char *long_help):\
- cl_cmd(operate_on_none, aname, can_rep, short_help, long_help) {}\
- virtual int do_work(class cl_cmdline *cmdline, class cl_console *con);
-
-#define COMMAND_METHODS_ON(ON,CLASS_NAME) \
-public:\
- CLASS_NAME (char *aname,\
- int can_rep,\
- char *short_help,\
- char *long_help):\
- cl_cmd(operate_on_ ## ON, aname, can_rep, short_help, long_help) {}\
- virtual int do_work(class cl_ ## ON * ON ,\
- class cl_cmdline *cmdline, class cl_console *con);
-
-#define COMMAND_METHODS_ANCESTOR(CLASS_NAME,ANCESTOR) \
-public:\
- CLASS_NAME (char *aname,\
- int can_rep,\
- char *short_help,\
- char *long_help):\
- ANCESTOR (aname, can_rep, short_help, long_help) {}\
- virtual int do_work(class cl_cmdline *cmdline, class cl_console *con);
-
-#define COMMAND_METHODS_ANCESTOR_ON(ON,CLASS_NAME,ANCESTOR) \
-public:\
- CLASS_NAME (char *aname,\
- int can_rep,\
- char *short_help,\
- char *long_help):\
- ANCESTOR (aname, can_rep, short_help, long_help) {}\
- virtual int do_work(class cl_ ## ON * ON ,\
- class cl_cmdline *cmdline, class cl_console *con); \
-
-
-#define COMMAND_TAIL }
-
-#define COMMAND(CLASS_NAME) \
-COMMAND_HEAD(CLASS_NAME) \
-COMMAND_METHODS(CLASS_NAME) \
-COMMAND_TAIL
-
-#define COMMAND_ON(ON,CLASS_NAME) \
-COMMAND_HEAD(CLASS_NAME) \
-COMMAND_METHODS_ON(ON,CLASS_NAME) \
-COMMAND_TAIL
-
-#define COMMAND_DATA(CLASS_NAME,DATA) \
-COMMAND_HEAD(CLASS_NAME) \
-public: DATA ; \
-COMMAND_METHODS(CLASS_NAME)\
-COMMAND_TAIL
-
-#define COMMAND_DATA_ON(ON,CLASS_NAME,DATA) \
-COMMAND_HEAD(CLASS_NAME) \
-public: DATA ; \
-COMMAND_METHODS_ON(ON,CLASS_NAME)\
-COMMAND_TAIL
-
-#define COMMAND_ANCESTOR_ON(ON,CLASS_NAME,ANCESTOR) \
-COMMAND_HEAD_ANCESTOR(CLASS_NAME,ANCESTOR) \
-COMMAND_METHODS_ANCESTOR_ON(ON,CLASS_NAME,ANCESTOR) \
-COMMAND_TAIL
-
-#define COMMAND_DATA_ANCESTOR(CLASS_NAME,ANCESTOR,DATA) \
-COMMAND_HEAD_ANCESTOR(CLASS_NAME,ANCESTOR) \
-public: DATA ; \
-COMMAND_METHODS_ANCESTOR(CLASS_NAME,ANCESTOR)\
-COMMAND_TAIL
-
-#define COMMAND_DATA_ANCESTOR_ON(ON,CLASS_NAME,ANCESTOR,DATA) \
-COMMAND_HEAD_ANCESTOR(CLASS_NAME,ANCESTOR) \
-public: DATA ; \
-COMMAND_METHODS_ANCESTOR_ON(ON,CLASS_NAME,ANCESTOR)\
-COMMAND_TAIL
-
-#define COMMAND_DO_WORK(CLASS_NAME) \
-int \
-CLASS_NAME::do_work(class cl_cmdline *cmdline, class cl_console *con)
-#define COMMAND_DO_WORK_APP(CLASS_NAME) \
-int \
-CLASS_NAME::do_work(class cl_app *app,\
- class cl_cmdline *cmdline, class cl_console *con)
-#define COMMAND_DO_WORK_SIM(CLASS_NAME) \
-int \
-CLASS_NAME::do_work(class cl_sim *sim,\
- class cl_cmdline *cmdline, class cl_console *con)
-#define COMMAND_DO_WORK_UC(CLASS_NAME) \
-int \
-CLASS_NAME::do_work(class cl_uc *uc,\
- class cl_cmdline *cmdline, class cl_console *con)
-
-// Command set is list of cl_cmd objects
-class cl_cmdset: public cl_list
-{
-public:
- //class cl_sim *sim;
- class cl_cmd *last_command;
-
-public:
- cl_cmdset(void);
- //cl_cmdset(class cl_sim *asim);
-
- virtual class cl_cmd *get_cmd(class cl_cmdline *cmdline);
- virtual class cl_cmd *get_cmd(char *cmd_name);
- virtual void del(char *name);
- virtual void replace(char *name, class cl_cmd *cmd);
-};
-
-// subset of commands
-class cl_super_cmd: public cl_cmd
-{
-public:
- class cl_cmdset *commands;
-