25 lines
559 B
C++
25 lines
559 B
C++
|
|
#include "interface.h"
|
|
#include "string.h"
|
|
#include "QDebug"
|
|
|
|
InterFace *interFaceFind(const char *name)
|
|
{
|
|
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++)
|
|
{
|
|
if (item != nullptr)
|
|
{
|
|
if (strcmp(name, item->name) == 0)
|
|
return item->if_get_fun();
|
|
// qDebug("if dev: %s",item->name);
|
|
}
|
|
}
|
|
qWarning("can not find interface named '%s'", name);
|
|
return nullptr;
|
|
}
|