Ken Yourek / ucmd

Dependents:   nucleo_ucmd_helloworld

ucCmdTok.c

Committer:
kyourek
Date:
2015-10-12
Revision:
0:9e2fc73e5a12

File content as of revision 0:9e2fc73e5a12:

#include "ucmd_internal.h"

ucArgTok *ucCmdTok_get_arg(ucCmdTok *p) {
    return ucArgTokOwner_get_arg((ucArgTokOwner*)p);
}

ucSwitchTok *ucCmdTok_get_switch(ucCmdTok *p) {
    ucTok *tok;
    if (NULL == p) return NULL;
    tok = ucTok_get_next((ucTok*)p);
    while (NULL != tok) {
        if (ucTok_is_switch(tok)) {
            return (ucSwitchTok*)tok;
        }
        tok = ucTok_get_next(tok);
    }
    return NULL;
}