diff --git a/obexd/src/genbuiltin b/obexd/src/genbuiltin
index 39f7735..e60b518 100755
--- a/obexd/src/genbuiltin
+++ b/obexd/src/genbuiltin
for i in $*
do
- echo "extern struct obex_plugin_desc __obex_builtin_$i;"
+ echo "extern const struct obex_plugin_desc __obex_builtin_$i;"
done
echo
-echo "static struct obex_plugin_desc *__obex_builtin[] = {"
+echo "static const struct obex_plugin_desc *__obex_builtin[] = {"
for i in $*
do
diff --git a/obexd/src/plugin.c b/obexd/src/plugin.c
index 0df9d52..a3eb247 100644
--- a/obexd/src/plugin.c
+++ b/obexd/src/plugin.c
struct obex_plugin {
void *handle;
- struct obex_plugin_desc *desc;
+ const struct obex_plugin_desc *desc;
};
-static gboolean add_plugin(void *handle, struct obex_plugin_desc *desc)
+static gboolean add_plugin(void *handle, const struct obex_plugin_desc *desc)
{
struct obex_plugin *plugin;
return TRUE;
}
-static gboolean check_plugin(struct obex_plugin_desc *desc,
+static gboolean check_plugin(const struct obex_plugin_desc *desc,
char **patterns, char **excludes)
{
if (excludes) {
}
while ((file = g_dir_read_name(dir)) != NULL) {
- struct obex_plugin_desc *desc;
+ const struct obex_plugin_desc *desc;
void *handle;
char *filename;
diff --git a/obexd/src/plugin.h b/obexd/src/plugin.h
index 7038784..a91746c 100644
--- a/obexd/src/plugin.h
+++ b/obexd/src/plugin.h
#ifdef OBEX_PLUGIN_BUILTIN
#define OBEX_PLUGIN_DEFINE(name, init, exit) \
- struct obex_plugin_desc __obex_builtin_ ## name = { \
+ const struct obex_plugin_desc __obex_builtin_ ## name = { \
#name, init, exit \
};
#else
#define OBEX_PLUGIN_DEFINE(name,init,exit) \
extern struct obex_plugin_desc obex_plugin_desc \
__attribute__ ((visibility("default"))); \
- struct obex_plugin_desc obex_plugin_desc = { \
+ const struct obex_plugin_desc obex_plugin_desc = { \
#name, init, exit \
};
#endif