1 #ifndef _PLINKMAN_H
2 #define _PLINKMAN_H 1
3 
4 struct __attribute__ ((aligned (64))) linkinfostruct
5 {
6 	const char *name;
7 	const char *desc;
8 	uint32_t ver;
9 	uint32_t size;
10 
11 	int (*PreInit)(void); /* high priority init */
12 	int (*Init)(void);
13 	int (*LateInit)(void);
14 	void (*PreClose)(void);
15 	void (*Close)(void);
16 	void (*LateClose)(void); /* low priority Close */
17 };
18 
19 struct dll_handle
20 {
21 	void *handle;
22 	int id;
23 	struct linkinfostruct *info;
24 };
25 extern struct dll_handle loadlist[MAXDLLLIST];
26 extern int loadlist_n;
27 
28 extern int lnkLinkDir(const char *dir);
29 extern int lnkLink(const char *files);
30 extern void lnkFree(const int id);
31 extern void lnkInit(void);
32 #define _lnkGetSymbol(name) lnkGetSymbol(0, name)
33 extern void *lnkGetSymbol(const int id, const char *name);
34 extern char *_lnkReadInfoReg(const char *key);
35 extern char *lnkReadInfoReg(const int id, const char *key);
36 extern int lnkCountLinks(void);
37 extern int lnkGetLinkInfo(struct linkinfostruct *l, int index);
38 
39 #ifdef SUPPORT_STATIC_PLUGINS
40 #define DLLEXTINFO_PREFIX __attribute__ ((section ("plugin_list"))) __attribute__ ((used)) static
41 #else
42 #define DLLEXTINFO_PREFIX
43 #endif
44 
45 #endif
46