Files
checker_host/interface/interface.cpp

33 lines
524 B
C++
Raw Normal View History

2023-11-21 20:28:23 +08:00
#include "interface.h"
#include "string.h"
#include "QDebug"
2023-11-26 23:05:35 +08:00
2023-11-21 20:28:23 +08:00
InterFace *interFaceFind(const char *name)
{
2023-11-26 23:05:35 +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;
if_def *item = 0;
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-21 20:28:23 +08:00
}
}
qWarning("can not find interface named '%s'", name);
return nullptr;
}
2023-11-26 23:05:35 +08:00