添加一些基本类

This commit is contained in:
andy
2023-11-21 20:28:23 +08:00
commit b1b69d307f
21 changed files with 1453 additions and 0 deletions

32
interface/interface.cpp Normal file
View File

@@ -0,0 +1,32 @@
#include "interface.h"
#include "string.h"
#include "QDebug"
typedef struct
{
InterFace *interface;
const char *name;
} self_table_def;
static self_table_def g_self_table[] =
{
{.interface = 0, .name = "default"},
};
InterFace *interFaceFind(const char *name)
{
int num = sizeof(g_self_table) / sizeof(g_self_table[0]);
self_table_def *item = 0;
for (int i = 0; i < num; i++)
{
item = &g_self_table[i];
if (item != nullptr)
{
if (strcmp(name, item->name) == 0)
return item->interface;
}
}
qWarning("can not find interface named '%s'", name);
return nullptr;
}