Blame src/plugin.h

Packit 34410b
/*
Packit 34410b
 *
Packit 34410b
 *  BlueZ - Bluetooth protocol stack for Linux
Packit 34410b
 *
Packit 34410b
 *  Copyright (C) 2004-2010  Marcel Holtmann <marcel@holtmann.org>
Packit 34410b
 *
Packit 34410b
 *
Packit 34410b
 *  This program is free software; you can redistribute it and/or modify
Packit 34410b
 *  it under the terms of the GNU General Public License as published by
Packit 34410b
 *  the Free Software Foundation; either version 2 of the License, or
Packit 34410b
 *  (at your option) any later version.
Packit 34410b
 *
Packit 34410b
 *  This program is distributed in the hope that it will be useful,
Packit 34410b
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 34410b
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 34410b
 *  GNU General Public License for more details.
Packit 34410b
 *
Packit 34410b
 *  You should have received a copy of the GNU General Public License
Packit 34410b
 *  along with this program; if not, write to the Free Software
Packit 34410b
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
Packit 34410b
 *
Packit 34410b
 */
Packit 34410b
#define BLUETOOTH_PLUGIN_PRIORITY_LOW      -100
Packit 34410b
#define BLUETOOTH_PLUGIN_PRIORITY_DEFAULT     0
Packit 34410b
#define BLUETOOTH_PLUGIN_PRIORITY_HIGH      100
Packit 34410b
Packit 34410b
struct bluetooth_plugin_desc {
Packit 34410b
	const char *name;
Packit 34410b
	const char *version;
Packit 34410b
	int priority;
Packit 34410b
	int (*init) (void);
Packit 34410b
	void (*exit) (void);
Packit 34410b
	void *debug_start;
Packit 34410b
	void *debug_stop;
Packit 34410b
};
Packit 34410b
Packit 34410b
#ifdef BLUETOOTH_PLUGIN_BUILTIN
Packit 34410b
#define BLUETOOTH_PLUGIN_DEFINE(name, version, priority, init, exit) \
Packit 34410b
		struct bluetooth_plugin_desc __bluetooth_builtin_ ## name = { \
Packit 34410b
			#name, version, priority, init, exit \
Packit 34410b
		};
Packit 34410b
#else
Packit 34410b
#define BLUETOOTH_PLUGIN_DEFINE(name, version, priority, init, exit) \
Packit 34410b
		extern struct btd_debug_desc __start___debug[] \
Packit 34410b
				__attribute__ ((weak, visibility("hidden"))); \
Packit 34410b
		extern struct btd_debug_desc __stop___debug[] \
Packit 34410b
				__attribute__ ((weak, visibility("hidden"))); \
Packit 34410b
		extern struct bluetooth_plugin_desc bluetooth_plugin_desc \
Packit 34410b
				__attribute__ ((visibility("default"))); \
Packit 34410b
		struct bluetooth_plugin_desc bluetooth_plugin_desc = { \
Packit 34410b
			#name, version, priority, init, exit, \
Packit 34410b
			__start___debug, __stop___debug \
Packit 34410b
		};
Packit 34410b
#endif