/************************************************************************ * * * Process math. * * (STATIC) * * */ void Win_math::execute(Panel_item item) { /* Get the command string */ int len = (int)xv_get(wm->expression_box, TEXTSW_LENGTH); char *cmd = (char *)malloc(len + 1); xv_get(wm->expression_box, TEXTSW_CONTENTS, 0, cmd, len); cmd[len] = '\0'; exec_string(cmd); }
/************************************************************************ * * * Execute an image math expression * [MACRO interface] * argv[0]: (string) the expression to be executed * [STATIC Function] * * */ int Win_math::Exec(int argc, char **argv, int, char **) { if (argc != 2){ msgerr_print("Usage: %s('expression')", *argv); ABORT; } argc--; argv++; if (!wm){ wm = new Win_math; } exec_string(*argv); return PROC_COMPLETE; }
void serial_term(void) { char cmd_buf[MAX_CMDBUF_SIZE]; for (;;) { printk("%s> ", prompt); getcmd(cmd_buf, MAX_CMDBUF_SIZE); /* execute a user command */ if (cmd_buf[0]) exec_string(cmd_buf); } }