|
|
@ -64,11 +64,11 @@ int handleCommand( char* input ){ |
|
|
|
|
|
|
|
commandFunction getCommandById( int id ){ |
|
|
|
commandFunction result = NULL; |
|
|
|
size_t arraySize = sizeof(COMMANDS) / sizeof(COMMANDS[0]); |
|
|
|
size_t arraySize = sizeof(COMMANDS) / sizeof(COMMANDS[0]); // calculate size of Array |
|
|
|
for (size_t i = 0; i < arraySize; i++) { |
|
|
|
//printf( "%s", COMMANDS[i].description ); |
|
|
|
if( COMMANDS[i].id == id ){ |
|
|
|
result = COMMANDS[i].fun; |
|
|
|
result = COMMANDS[i].fun; // save the function pointer as result |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|