There is a list of tasks that are launched depending on the state bool active;. The list is constantly updated and accessing the index is not very convenient, what is the best and simplest way to implement this mechanism?
struct App
{
char const *text; //command
char const *name; //name task-function
void (*f)(void); //task-function
bool active; //activ status task-function
int priority; //execution priority
const uint8_t *bitMap; //icon task-function
bool state; //0-task-function any 1-Application
};
/* enumeration of objects - commands */
App commands[]
{
{"clearcomm", "Clear command", clearCommandTerminal, false, 0, NULL, 0},
{"desctop", "Desctop", desctop, true, 0, NULL, 1},
{"deepsleep", "Deep sleep PWS-mode", powerSaveDeepSleep, true, 0, NULL, 0},
{"rawadc", "Raw data ADC", systemRawADC, false, 0, NULL, 0},
{"clearbuffer","Clear Buffer", clearBufferString, false, 0, NULL, 0},
{"test","Test", testApp, false, 0, NULL, 2},
{"wifisetup", "WiFi", wifiSetup, true, 0, NULL, 0},
{"wificonect","WiFi", wifiConnect, true, 0, NULL, 0},
{"ntpsetup", "Time NTP Setup", timeNtpSetup, true, 0, NULL, 0},
{"ntptime", "Time NTP", timeNtpUpdate, true, 0, NULL, 0},
{"systray", "Tray", systemTray, true, 0, NULL, 0},
{"syscursor", "Cursor", systemCursor, true, 0, NULL, 0},
};