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; }
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"); }
static s16 getCurrentCmdIndex() { return getCmdIndex(cmd); }