19#include <freerdp/config.h>
21#include <freerdp/server/shadow.h>
22#include <freerdp/log.h>
24#define TAG SERVER_TAG("shadow")
28 const char* (*name)(void);
29 pfnShadowSubsystemEntry entry;
30} RDP_SHADOW_SUBSYSTEM;
32#if defined(WITH_SHADOW_MUTTER)
33extern int MutterShadowSubsystemEntry(RDP_SHADOW_ENTRY_POINTS* pEntryPoints);
34extern const char* MutterShadowSubsystemName(
void);
37#if defined(WITH_SHADOW_PLATFORM)
39extern int ShadowSubsystemEntry(RDP_SHADOW_ENTRY_POINTS* pEntryPoints);
40extern const char* ShadowSubsystemName(
void);
45static const RDP_SHADOW_SUBSYSTEM g_Subsystems[] = {
46#if defined(WITH_SHADOW_MUTTER)
47 { MutterShadowSubsystemName, MutterShadowSubsystemEntry },
49#if defined(WITH_SHADOW_PLATFORM)
50 { ShadowSubsystemName, ShadowSubsystemEntry },
54static const size_t g_SubsystemCount = ARRAYSIZE(g_Subsystems);
57static pfnShadowSubsystemEntry shadow_subsystem_load_static_entry(
const char* name)
61 for (
size_t index = 0; index < g_SubsystemCount; index++)
63 const RDP_SHADOW_SUBSYSTEM* cur = &g_Subsystems[index];
64 WINPR_ASSERT(cur->name);
65 WINPR_ASSERT(cur->entry);
67 if (strcmp(name, cur->name()) == 0)
74void shadow_subsystem_set_entry_builtin(
const char* name)
79 for (
size_t index = 0; index < g_SubsystemCount; index++)
81 const RDP_SHADOW_SUBSYSTEM* cur = &g_Subsystems[index];
82 if (!shadow_subsystem_add_entry(cur->name(), cur->entry))
83 WLog_ERR(TAG,
"cannot add the %s subsystem", cur->name());
88 pfnShadowSubsystemEntry entry = shadow_subsystem_load_static_entry(name);
91 shadow_subsystem_set_entry(entry);