Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
DynamicDll.h File Reference
#include "DllPaths.h"
#include "cores/DllLoader/LibraryLoader.h"
#include <string>

Classes

class  DllDynamic
 

Macros

#define DECLARE_DLL_WRAPPER(classname, dllname)
 
#define XDECLARE_DLL_WRAPPER(classname, dllname)
 
#define DECLARE_DLL_WRAPPER_TEMPLATE(classname)
 
#define LOAD_SYMBOLS()
 
#define DEFINE_GLOBAL_PTR(type, name)
 
#define DEFINE_GLOBAL(type, name)
 
#define DEFINE_METHOD_LINKAGE_FP(result, linkage, name, args)
 
#define DEFINE_METHOD_LINKAGE_BASE(result, linkage, name, args, args2)
 
#define DEFINE_METHOD_LINKAGE0(result, linkage, name)
 
#define DEFINE_METHOD_LINKAGE1(result, linkage, name, args)
 
#define DEFINE_METHOD_LINKAGE2(result, linkage, name, args)
 
#define DEFINE_METHOD_LINKAGE3(result, linkage, name, args)
 
#define DEFINE_METHOD_LINKAGE4(result, linkage, name, args)
 
#define DEFINE_METHOD_LINKAGE5(result, linkage, name, args)
 
#define DEFINE_METHOD_LINKAGE6(result, linkage, name, args)
 
#define DEFINE_METHOD_LINKAGE7(result, linkage, name, args)
 
#define DEFINE_METHOD_LINKAGE8(result, linkage, name, args)
 
#define DEFINE_METHOD_LINKAGE9(result, linkage, name, args)
 
#define DEFINE_METHOD_LINKAGE10(result, linkage, name, args)
 
#define DEFINE_METHOD_LINKAGE11(result, linkage, name, args)
 
#define DEFINE_METHOD_FP(result, name, args)
 
#define DEFINE_METHOD0(result, name)
 
#define DEFINE_METHOD1(result, name, args)
 
#define DEFINE_METHOD2(result, name, args)
 
#define DEFINE_METHOD3(result, name, args)
 
#define DEFINE_METHOD4(result, name, args)
 
#define DEFINE_METHOD5(result, name, args)
 
#define DEFINE_METHOD6(result, name, args)
 
#define DEFINE_METHOD7(result, name, args)
 
#define DEFINE_METHOD8(result, name, args)
 
#define DEFINE_METHOD9(result, name, args)
 
#define DEFINE_METHOD10(result, name, args)
 
#define DEFINE_METHOD11(result, name, args)
 
#define DEFINE_FUNC_ALIGNED0(result, linkage, name)
 
#define DEFINE_FUNC_ALIGNED1(result, linkage, name, t1)
 
#define DEFINE_FUNC_ALIGNED2(result, linkage, name, t1, t2)
 
#define DEFINE_FUNC_ALIGNED3(result, linkage, name, t1, t2, t3)
 
#define DEFINE_FUNC_ALIGNED4(result, linkage, name, t1, t2, t3, t4)
 
#define DEFINE_FUNC_ALIGNED5(result, linkage, name, t1, t2, t3, t4, t5)
 
#define DEFINE_FUNC_ALIGNED6(result, linkage, name, t1, t2, t3, t4, t5, t6)
 
#define DEFINE_FUNC_ALIGNED7(result, linkage, name, t1, t2, t3, t4, t5, t6, t7)
 
#define DEFINE_FUNC_ALIGNED8(result, linkage, name, t1, t2, t3, t4, t5, t6, t7, t8)
 
#define DEFINE_FUNC_ALIGNED9(result, linkage, name, t1, t2, t3, t4, t5, t6, t7, t8, t9)
 
#define DEFINE_FUNC_ALIGNED10(result, linkage, name, t1, t2, t3, t4, t5, t6, t7, t8, t10)
 
#define DEFINE_FUNC_ALIGNED11(result, linkage, name, t1, t2, t3, t4, t5, t6, t7, t8, t10, t11)
 
#define BEGIN_METHOD_RESOLVE()
 
#define END_METHOD_RESOLVE()
 
#define RESOLVE_METHOD(method)
 
#define RESOLVE_METHOD_FP(method)
 
#define RESOLVE_METHOD_OPTIONAL(method)
 
#define RESOLVE_METHOD_OPTIONAL_FP(method)
 
#define RESOLVE_METHOD_RENAME(dllmethod, method)
 
#define RESOLVE_METHOD_RENAME_OPTIONAL(dllmethod, method)
 
#define RESOLVE_METHOD_RENAME_FP(dllmethod, method)
 

Macro Definition Documentation

◆ BEGIN_METHOD_RESOLVE

#define BEGIN_METHOD_RESOLVE ( )
Value:
protected: \
virtual bool ResolveExports() override \
{

◆ DECLARE_DLL_WRAPPER

#define DECLARE_DLL_WRAPPER ( classname,
dllname )
Value:
XDECLARE_DLL_WRAPPER(classname,dllname)
#define XDECLARE_DLL_WRAPPER(classname, dllname)
Definition DynamicDll.h:31

◆ DECLARE_DLL_WRAPPER_TEMPLATE

#define DECLARE_DLL_WRAPPER_TEMPLATE ( classname)
Value:
public: \
classname () {} \

◆ DEFINE_FUNC_ALIGNED0

#define DEFINE_FUNC_ALIGNED0 ( result,
linkage,
name )
Value:
DEFINE_METHOD_LINKAGE0 (result, linkage, name)
#define DEFINE_METHOD_LINKAGE0(result, linkage, name)
Definition DynamicDll.h:132
enum const char * name
Definition addon_base.h:203

◆ DEFINE_FUNC_ALIGNED1

#define DEFINE_FUNC_ALIGNED1 ( result,
linkage,
name,
t1 )
Value:
DEFINE_METHOD_LINKAGE1 (result, linkage, name, (t1 p1) )
#define DEFINE_METHOD_LINKAGE1(result, linkage, name, args)
Definition DynamicDll.h:135

◆ DEFINE_FUNC_ALIGNED10

#define DEFINE_FUNC_ALIGNED10 ( result,
linkage,
name,
t1,
t2,
t3,
t4,
t5,
t6,
t7,
t8,
t10 )
Value:
DEFINE_METHOD_LINKAGE10(result, linkage, name, (t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10) )
#define DEFINE_METHOD_LINKAGE10(result, linkage, name, args)
Definition DynamicDll.h:162

◆ DEFINE_FUNC_ALIGNED11

#define DEFINE_FUNC_ALIGNED11 ( result,
linkage,
name,
t1,
t2,
t3,
t4,
t5,
t6,
t7,
t8,
t10,
t11 )
Value:
DEFINE_METHOD_LINKAGE11(result, linkage, name, (t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11) )
#define DEFINE_METHOD_LINKAGE11(result, linkage, name, args)
Definition DynamicDll.h:165

◆ DEFINE_FUNC_ALIGNED2

#define DEFINE_FUNC_ALIGNED2 ( result,
linkage,
name,
t1,
t2 )
Value:
DEFINE_METHOD_LINKAGE2 (result, linkage, name, (t1 p1, t2 p2) )
#define DEFINE_METHOD_LINKAGE2(result, linkage, name, args)
Definition DynamicDll.h:138

◆ DEFINE_FUNC_ALIGNED3

#define DEFINE_FUNC_ALIGNED3 ( result,
linkage,
name,
t1,
t2,
t3 )
Value:
DEFINE_METHOD_LINKAGE3 (result, linkage, name, (t1 p1, t2 p2, t3 p3) )
#define DEFINE_METHOD_LINKAGE3(result, linkage, name, args)
Definition DynamicDll.h:141

◆ DEFINE_FUNC_ALIGNED4

#define DEFINE_FUNC_ALIGNED4 ( result,
linkage,
name,
t1,
t2,
t3,
t4 )
Value:
DEFINE_METHOD_LINKAGE4 (result, linkage, name, (t1 p1, t2 p2, t3 p3, t4 p4) )
#define DEFINE_METHOD_LINKAGE4(result, linkage, name, args)
Definition DynamicDll.h:144

◆ DEFINE_FUNC_ALIGNED5

#define DEFINE_FUNC_ALIGNED5 ( result,
linkage,
name,
t1,
t2,
t3,
t4,
t5 )
Value:
DEFINE_METHOD_LINKAGE5 (result, linkage, name, (t1 p1, t2 p2, t3 p3, t4 p4, t5 p5) )
#define DEFINE_METHOD_LINKAGE5(result, linkage, name, args)
Definition DynamicDll.h:147

◆ DEFINE_FUNC_ALIGNED6

#define DEFINE_FUNC_ALIGNED6 ( result,
linkage,
name,
t1,
t2,
t3,
t4,
t5,
t6 )
Value:
DEFINE_METHOD_LINKAGE6 (result, linkage, name, (t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6) )
#define DEFINE_METHOD_LINKAGE6(result, linkage, name, args)
Definition DynamicDll.h:150

◆ DEFINE_FUNC_ALIGNED7

#define DEFINE_FUNC_ALIGNED7 ( result,
linkage,
name,
t1,
t2,
t3,
t4,
t5,
t6,
t7 )
Value:
DEFINE_METHOD_LINKAGE7 (result, linkage, name, (t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7) )
#define DEFINE_METHOD_LINKAGE7(result, linkage, name, args)
Definition DynamicDll.h:153

◆ DEFINE_FUNC_ALIGNED8

#define DEFINE_FUNC_ALIGNED8 ( result,
linkage,
name,
t1,
t2,
t3,
t4,
t5,
t6,
t7,
t8 )
Value:
DEFINE_METHOD_LINKAGE8 (result, linkage, name, (t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8) )
#define DEFINE_METHOD_LINKAGE8(result, linkage, name, args)
Definition DynamicDll.h:156

◆ DEFINE_FUNC_ALIGNED9

#define DEFINE_FUNC_ALIGNED9 ( result,
linkage,
name,
t1,
t2,
t3,
t4,
t5,
t6,
t7,
t8,
t9 )
Value:
DEFINE_METHOD_LINKAGE9 (result, linkage, name, (t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9) )
#define DEFINE_METHOD_LINKAGE9(result, linkage, name, args)
Definition DynamicDll.h:159

◆ DEFINE_GLOBAL

#define DEFINE_GLOBAL ( type,
name )
Value:
protected: \
union { \
type* m_##name; \
void* m_##name##_ptr; \
}; \
public: \
virtual type Get_##name (void) \
{ \
return *m_##name; \
}

◆ DEFINE_GLOBAL_PTR

#define DEFINE_GLOBAL_PTR ( type,
name )
Value:
protected: \
union { \
type* m_##name; \
void* m_##name##_ptr; \
}; \
public: \
virtual type* Get_##name (void) \
{ \
return m_##name; \
}

◆ DEFINE_METHOD0

#define DEFINE_METHOD0 ( result,
name )
Value:
#define __cdecl
Definition addon_base.h:22

◆ DEFINE_METHOD1

#define DEFINE_METHOD1 ( result,
name,
args )
Value:

◆ DEFINE_METHOD10

#define DEFINE_METHOD10 ( result,
name,
args )
Value:

◆ DEFINE_METHOD11

#define DEFINE_METHOD11 ( result,
name,
args )
Value:

◆ DEFINE_METHOD2

#define DEFINE_METHOD2 ( result,
name,
args )
Value:

◆ DEFINE_METHOD3

#define DEFINE_METHOD3 ( result,
name,
args )
Value:

◆ DEFINE_METHOD4

#define DEFINE_METHOD4 ( result,
name,
args )
Value:

◆ DEFINE_METHOD5

#define DEFINE_METHOD5 ( result,
name,
args )
Value:

◆ DEFINE_METHOD6

#define DEFINE_METHOD6 ( result,
name,
args )
Value:

◆ DEFINE_METHOD7

#define DEFINE_METHOD7 ( result,
name,
args )
Value:

◆ DEFINE_METHOD8

#define DEFINE_METHOD8 ( result,
name,
args )
Value:

◆ DEFINE_METHOD9

#define DEFINE_METHOD9 ( result,
name,
args )
Value:

◆ DEFINE_METHOD_FP

#define DEFINE_METHOD_FP ( result,
name,
args )
Value:
#define DEFINE_METHOD_LINKAGE_FP(result, linkage, name, args)
Definition DynamicDll.h:110

◆ DEFINE_METHOD_LINKAGE0

#define DEFINE_METHOD_LINKAGE0 ( result,
linkage,
name )
Value:
DEFINE_METHOD_LINKAGE_BASE(result, linkage, name, () , ())
#define DEFINE_METHOD_LINKAGE_BASE(result, linkage, name, args, args2)
Definition DynamicDll.h:119

◆ DEFINE_METHOD_LINKAGE1

#define DEFINE_METHOD_LINKAGE1 ( result,
linkage,
name,
args )
Value:
DEFINE_METHOD_LINKAGE_BASE(result, linkage, name, args, (p1))

◆ DEFINE_METHOD_LINKAGE10

#define DEFINE_METHOD_LINKAGE10 ( result,
linkage,
name,
args )
Value:
DEFINE_METHOD_LINKAGE_BASE(result, linkage, name, args, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10))

◆ DEFINE_METHOD_LINKAGE11

#define DEFINE_METHOD_LINKAGE11 ( result,
linkage,
name,
args )
Value:
DEFINE_METHOD_LINKAGE_BASE(result, linkage, name, args, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11))

◆ DEFINE_METHOD_LINKAGE2

#define DEFINE_METHOD_LINKAGE2 ( result,
linkage,
name,
args )
Value:
DEFINE_METHOD_LINKAGE_BASE(result, linkage, name, args, (p1, p2))

◆ DEFINE_METHOD_LINKAGE3

#define DEFINE_METHOD_LINKAGE3 ( result,
linkage,
name,
args )
Value:
DEFINE_METHOD_LINKAGE_BASE(result, linkage, name, args, (p1, p2, p3))

◆ DEFINE_METHOD_LINKAGE4

#define DEFINE_METHOD_LINKAGE4 ( result,
linkage,
name,
args )
Value:
DEFINE_METHOD_LINKAGE_BASE(result, linkage, name, args, (p1, p2, p3, p4))

◆ DEFINE_METHOD_LINKAGE5

#define DEFINE_METHOD_LINKAGE5 ( result,
linkage,
name,
args )
Value:
DEFINE_METHOD_LINKAGE_BASE(result, linkage, name, args, (p1, p2, p3, p4, p5))

◆ DEFINE_METHOD_LINKAGE6

#define DEFINE_METHOD_LINKAGE6 ( result,
linkage,
name,
args )
Value:
DEFINE_METHOD_LINKAGE_BASE(result, linkage, name, args, (p1, p2, p3, p4, p5, p6))

◆ DEFINE_METHOD_LINKAGE7

#define DEFINE_METHOD_LINKAGE7 ( result,
linkage,
name,
args )
Value:
DEFINE_METHOD_LINKAGE_BASE(result, linkage, name, args, (p1, p2, p3, p4, p5, p6, p7))

◆ DEFINE_METHOD_LINKAGE8

#define DEFINE_METHOD_LINKAGE8 ( result,
linkage,
name,
args )
Value:
DEFINE_METHOD_LINKAGE_BASE(result, linkage, name, args, (p1, p2, p3, p4, p5, p6, p7, p8))

◆ DEFINE_METHOD_LINKAGE9

#define DEFINE_METHOD_LINKAGE9 ( result,
linkage,
name,
args )
Value:
DEFINE_METHOD_LINKAGE_BASE(result, linkage, name, args, (p1, p2, p3, p4, p5, p6, p7, p8, p9))

◆ DEFINE_METHOD_LINKAGE_BASE

#define DEFINE_METHOD_LINKAGE_BASE ( result,
linkage,
name,
args,
args2 )
Value:
protected: \
typedef result (linkage * name##_METHOD) args; \
union { \
name##_METHOD m_##name; \
void* m_##name##_ptr; \
}; \
public: \
virtual result name args override \
{ \
return m_##name ? m_##name args2 : (result) 0; \
}

◆ DEFINE_METHOD_LINKAGE_FP

#define DEFINE_METHOD_LINKAGE_FP ( result,
linkage,
name,
args )
Value:
protected: \
typedef result (linkage * name##_METHOD) args; \
public: \
union { \
name##_METHOD m_##name; \
void* m_##name##_ptr; \
};

◆ END_METHOD_RESOLVE

#define END_METHOD_RESOLVE ( )
Value:
return true; \
}

◆ LOAD_SYMBOLS

#define LOAD_SYMBOLS ( )
Value:
protected: \
virtual bool LoadSymbols() { return true; }

◆ RESOLVE_METHOD

#define RESOLVE_METHOD ( method)
Value:
if (!m_dll->ResolveExport( #method , & m_##method##_ptr )) \
return false;

◆ RESOLVE_METHOD_FP

#define RESOLVE_METHOD_FP ( method)
Value:
if (!m_dll->ResolveExport( #method , & m_##method##_ptr )) \
return false;

◆ RESOLVE_METHOD_OPTIONAL

#define RESOLVE_METHOD_OPTIONAL ( method)
Value:
m_##method##_ptr = nullptr; \
m_dll->ResolveExport( #method , & m_##method##_ptr, false );

◆ RESOLVE_METHOD_OPTIONAL_FP

#define RESOLVE_METHOD_OPTIONAL_FP ( method)
Value:
m_##method##_ptr = NULL; \
m_dll->ResolveExport( #method , & m_##method##_ptr, false );

◆ RESOLVE_METHOD_RENAME

#define RESOLVE_METHOD_RENAME ( dllmethod,
method )
Value:
if (!m_dll->ResolveExport( #dllmethod , & m_##method##_ptr )) \
return false;

◆ RESOLVE_METHOD_RENAME_FP

#define RESOLVE_METHOD_RENAME_FP ( dllmethod,
method )
Value:
if (!m_dll->ResolveExport( #dllmethod , & method##_ptr )) \
return false;

◆ RESOLVE_METHOD_RENAME_OPTIONAL

#define RESOLVE_METHOD_RENAME_OPTIONAL ( dllmethod,
method )
Value:
m_##method##_ptr = nullptr; \
m_dll->ResolveExport( #dllmethod , & m_##method##_ptr, false );

◆ XDECLARE_DLL_WRAPPER

#define XDECLARE_DLL_WRAPPER ( classname,
dllname )
Value:
public: \
classname () : DllDynamic( dllname ) {}
Definition DynamicDll.h:515