You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
574 B

#include "reg_index_table.hpp"
#include <stdlib.h>
#include <string.h>
#include "api/api.hpp"
using namespace iflytop;
static reg_index_table_iterm_t iterms[] = {};
namespace iflytop {
void reg_index_table_get(reg_index_table_iterm_t** table, int32_t* size) {
*size = sizeof(iterms) / sizeof(iterms[0]);
*table = iterms;
}
int32_t str_to_reg_index(const char* val) {
for (int32_t i = 0; i < sizeof(iterms) / sizeof(iterms[0]); i++) {
if (strcmp(iterms[i].name, val) == 0) {
return iterms[i].index;
}
}
return atoi(val);
}
} // namespace iflytop