Blob: plugin.h

Blob id: e1756b9bfc4f5fa15f90389e7905586fa2205008

Size: 756 B

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 *
 *  OBEX Server
 *
 *  Copyright (C) 2007-2010  Marcel Holtmann <marcel@holtmann.org>
 *
 *
 */

struct obex_plugin_desc {
	const char *name;
	int (*init) (void);
	void (*exit) (void);
};

#ifdef OBEX_PLUGIN_BUILTIN
#define OBEX_PLUGIN_DEFINE(name, init, exit) \
		const struct obex_plugin_desc __obex_builtin_ ## name = { \
			#name, init, exit \
		};
#else
#if EXTERNAL_PLUGINS
#define OBEX_PLUGIN_DEFINE(name,init,exit) \
		extern struct obex_plugin_desc obex_plugin_desc \
				__attribute__ ((visibility("default"))); \
		const struct obex_plugin_desc obex_plugin_desc = { \
			#name, init, exit \
		};
#else
#error "Requested non built-in plugin, while external plugins is disabled"
#endif
#endif