|
|
@ -51,6 +51,18 @@ struct command* createCommands(){ |
|
|
|
return ptrCommands; |
|
|
|
} |
|
|
|
|
|
|
|
commandFunction getCommandById( struct command* commands, int id ){ |
|
|
|
commandFunction result = NULL; |
|
|
|
size_t arraySize = sizeof(*commands) / sizeof(commands[0]); |
|
|
|
for (size_t i = 0; i < arraySize; i++) { |
|
|
|
if( commands[i].id == id ){ |
|
|
|
result = commands[i].fun; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
int startMenu(){ |
|
|
|
|
|
|
|
return 1; |
|
|
|