static void term_handle_command(char *cmdline)

{

    char *p, *pstart;

    int argc;

    const char *args[MAX_ARGS + 1];

    term_cmd_t *cmd;



#ifdef DEBUG

    term_printf("command='%s'\n", cmdline);

#endif

    

    /* split command in words */

    argc = 0;

    p = cmdline;

    for(;;) {

        while (isspace(*p))

            p++;

        if (*p == '\0')

            break;

        pstart = p;

        while (*p != '\0' && !isspace(*p))

            p++;

        args[argc] = pstart;

        argc++;

        if (argc >= MAX_ARGS)

            break;

        if (*p == '\0')

            break;

        *p++ = '\0';

    }

    args[argc] = NULL;

#ifdef DEBUG

    for(i=0;i<argc;i++) {

        term_printf(" '%s'", args[i]);

    }

    term_printf("\n");

#endif

    if (argc <= 0)

        return;

    for(cmd = term_cmds; cmd->name != NULL; cmd++) {

        if (compare_cmd(args[0], cmd->name)) 

            goto found;

    }

    term_printf("unknown command: '%s'\n", args[0]);

    return;

 found:

    cmd->handler(argc, args);

}

static void term_handle_command(char *cmdline)

{

    char *p, *pstart;

    int argc;

    const char *args[MAX_ARGS + 1];

    term_cmd_t *cmd;



#ifdef DEBUG

    term_printf("command='%s'\n", cmdline);

#endif

    

    

    argc = 0;

    p = cmdline;

    for(;;) {

        while (isspace(*p))

            p++;

        if (*p == '\0')

            break;

        pstart = p;

        while (*p != '\0' && !isspace(*p))

            p++;

        args[argc] = pstart;

        argc++;

        if (argc >= MAX_ARGS)

            break;

        if (*p == '\0')

            break;

        *p++ = '\0';

    }

    args[argc] = NULL;

#ifdef DEBUG

    for(i=0;i<argc;i++) {

        term_printf(" '%s'", args[i]);

    }

    term_printf("\n");

#endif

    if (argc <= 0)

        return;

    for(cmd = term_cmds; cmd->name != NULL; cmd++) {

        if (compare_cmd(args[0], cmd->name)) 

            goto found;

    }

    term_printf("unknown command: '%s'\n", args[0]);

    return;

 found:

    cmd->handler(argc, args);

}

static void FUNC_0(char *VAR_0)

{

    char *VAR_1, *VAR_2;

    int VAR_3;

    const char *VAR_4[MAX_ARGS + 1];

    term_cmd_t *cmd;



#ifdef DEBUG

    term_printf("command='%s'\n", VAR_0);

#endif

    

    

    VAR_3 = 0;

    VAR_1 = VAR_0;

    for(;;) {

        while (isspace(*VAR_1))

            VAR_1++;

        if (*VAR_1 == '\0')

            break;

        VAR_2 = VAR_1;

        while (*VAR_1 != '\0' && !isspace(*VAR_1))

            VAR_1++;

        VAR_4[VAR_3] = VAR_2;

        VAR_3++;

        if (VAR_3 >= MAX_ARGS)

            break;

        if (*VAR_1 == '\0')

            break;

        *VAR_1++ = '\0';

    }

    VAR_4[VAR_3] = NULL;

#ifdef DEBUG

    for(i=0;i<VAR_3;i++) {

        term_printf(" '%s'", VAR_4[i]);

    }

    term_printf("\n");

#endif

    if (VAR_3 <= 0)

        return;

    for(cmd = term_cmds; cmd->name != NULL; cmd++) {

        if (compare_cmd(VAR_4[0], cmd->name)) 

            goto found;

    }

    term_printf("unknown command: '%s'\n", VAR_4[0]);

    return;

 found:

    cmd->handler(VAR_3, VAR_4);

}

static void FUNC_0(char *VAR_0)
{ char *VAR_1, *VAR_2; int VAR_3; const char *VAR_4[MAX_ARGS + 1]; term_cmd_t *cmd; #ifdef DEBUG
term_printf("command='%s'\n", VAR_0); #endif
VAR_3 = 0; VAR_1 = VAR_0; for(;;) { while (isspace(*VAR_1))
VAR_1++; if (*VAR_1 == '\0')
break; VAR_2 = VAR_1; while (*VAR_1 != '\0' && !isspace(*VAR_1))
VAR_1++; VAR_4[VAR_3] = VAR_2; VAR_3++; if (VAR_3 >= MAX_ARGS)
break; if (*VAR_1 == '\0')
break; *VAR_1++ = '\0'; } VAR_4[VAR_3] = NULL; #ifdef DEBUG
for(i=0;i<VAR_3;i++) { term_printf(" '%s'", VAR_4[i]); } term_printf("\n"); #endif
if (VAR_3 <= 0)
return; for(cmd = term_cmds; cmd->name != NULL; cmd++) { if (compare_cmd(VAR_4[0], cmd->name))
goto found; } term_printf("unknown command: '%s'\n", VAR_4[0]); return; found:
cmd->handler(VAR_3, VAR_4); }