Files
checker_host/interface/interface.cpp

25 lines
559 B
C++
Raw Normal View History

2023-11-21 20:28:23 +08:00
#include "interface.h"
#include "string.h"
#include "QDebug"
InterFace *interFaceFind(const char *name)
{
2023-11-27 14:31:00 +08:00
extern const int __start_ifdef;
extern const int __stop_ifdef;
if_def *start = (if_def *)&__start_ifdef;
if_def *end = (if_def *)&__stop_ifdef;
2023-11-26 23:05:35 +08:00
if_def *item = 0;
2023-11-27 14:31:00 +08:00
for (item = start; item < end; item++)
2023-11-21 20:28:23 +08:00
{
if (item != nullptr)
{
if (strcmp(name, item->name) == 0)
2023-11-26 23:05:35 +08:00
return item->if_get_fun();
2023-11-29 15:36:45 +08:00
// qDebug("if dev: %s",item->name);
2023-11-21 20:28:23 +08:00
}
}
qWarning("can not find interface named '%s'", name);
return nullptr;
}