/** * Computes the checksum of the registered functions. * The function name is used to compute the checksum. */ uint32_t compute_functions_checksum() { uint32_t checksum = 0; for (int i = funcs.size(); i-->0; ) { checksum += string_crc(funcs[i].userFuncKey); } return checksum; }
/** * Computes the checksum of the registered variables. * The checksum is derived from the variable name and type. */ uint32_t compute_variables_checksum() { uint32_t checksum = 0; for (int i = vars.size(); i-->0; ) { checksum += string_crc(vars[i].userVarKey); checksum += crc(vars[i].userVarType); } return checksum; }
User_Var_Lookup_Table_t* find_var_by_key(const char* varKey) { for (int i = vars.size(); i-->0; ) { if (0 == strncmp(vars[i].userVarKey, varKey, USER_VAR_KEY_LENGTH)) { return &vars[i]; } } return NULL; }
User_Func_Lookup_Table_t* find_func_by_key(const char* funcKey) { for (int i = funcs.size(); i-->0; ) { if (0 == strncmp(funcs[i].userFuncKey, funcKey, USER_FUNC_KEY_LENGTH)) { return &funcs[i]; } } return NULL; }