示例#1
0
文件: main.c 项目: clbr/SGDK
static const param_def *getParam(const driver_def *d, const cmd_def *c)
{
    const s16 driver_ind = getDriverIndex(d);
    const s16 cmd_ind = getCmdIndex(c);

    if ((driver_ind != -1) && (cmd_ind != -1))
        return params_value[driver_ind][cmd_ind];

    return NULL;
}
示例#2
0
int help_cmd(int argc, char *argv[]) {
	int cmdIndex;
	if (argc == 1) {
		cmdIndex = getCmdIndex(argv[0]);
		if (cmdIndex != -1) {
			printf("\n%s\n", getCmdsTable()[cmdIndex].help);
		} else {
			printf("\nCommand not found\n");
		}
	} else if (argc == 0) {
		int i;
		printf("\nAvailable commands:\n\n");
		for( i=0; getCmdsTable()[i].func != NULL; i++) {
			printf("\t%s\n", getCmdsTable()[i].name);
		}
		printf("\nType in help \"cmdName\" to see the help menu for that \
command.\n");
	}
示例#3
0
文件: main.c 项目: clbr/SGDK
static s16 getCurrentCmdIndex()
{
    return getCmdIndex(cmd);
}