libpurple/plugins/mono/loader/mono-helper.h

Sat, 24 Mar 2007 06:24:59 +0000

author
Richard Laager <rlaager@pidgin.im>
date
Sat, 24 Mar 2007 06:24:59 +0000
changeset 15938
1b037158411e
parent 15884
4de1981757fc
child 16238
33bf2fd32108
child 18068
b6554e3c8224
child 20478
46933dc62880
child 31293
169eeb43b52c
permissions
-rw-r--r--

SF Patch #1686400 from Eoin Coffey ("ecoffey")

ecoffey described the changes:

1) Small tweaks to the loader to bring it up to speed with new mono
versions and API wrapper changes that grim had made. (was in original
patch, just forgot about it :-P)
2) .NET Plugins are now required to define an Id as part of their info.
3) Modified gaim_probe_plugin to check for existence of info->id and to
make sure it's not empty; Prints an error, stores an error in the plugin
and sets plugin->unloadable = TRUE.

15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1 #ifndef _PURPLE_MONO_LOADER_MONO_HELPER_H_
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
2 #define _PURPLE_MONO_LOADER_MONO_HELPER_H_
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
3
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
4 #include <mono/jit/jit.h>
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
5 #include <mono/metadata/object.h>
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
6 #include <mono/metadata/environment.h>
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
7 #include <mono/metadata/assembly.h>
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
8 #include <mono/metadata/debug-helpers.h>
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
9 #include <mono/metadata/tokentype.h>
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
10 #include "plugin.h"
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
11 #include "value.h"
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
12 #include "debug.h"
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
13
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
14 typedef struct {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
15 PurplePlugin *plugin;
11980
fe5c2c58508c [gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11952
diff changeset
16
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
17 MonoAssembly *assm;
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
18 MonoClass *klass;
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
19 MonoObject *obj;
11980
fe5c2c58508c [gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11952
diff changeset
20
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
21 MonoMethod *init;
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
22 MonoMethod *load;
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
23 MonoMethod *unload;
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
24 MonoMethod *destroy;
11980
fe5c2c58508c [gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11952
diff changeset
25
fe5c2c58508c [gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11952
diff changeset
26 GList *signal_data;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
27 } PurpleMonoPlugin;
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
28
12323
f52908fb23b0 [gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents: 11996
diff changeset
29 gboolean ml_init(void);
11980
fe5c2c58508c [gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11952
diff changeset
30
12323
f52908fb23b0 [gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents: 11996
diff changeset
31 void ml_uninit(void);
11952
9cefc8360bff [gaim-migrate @ 14243]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11660
diff changeset
32
11980
fe5c2c58508c [gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11952
diff changeset
33 MonoObject* ml_invoke(MonoMethod *method, void *obj, void **params);
11952
9cefc8360bff [gaim-migrate @ 14243]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11660
diff changeset
34
11980
fe5c2c58508c [gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11952
diff changeset
35 MonoObject* ml_delegate_invoke(MonoObject *method, void **params);
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
36
11980
fe5c2c58508c [gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11952
diff changeset
37 MonoClass* ml_find_plugin_class(MonoImage *image);
fe5c2c58508c [gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11952
diff changeset
38
fe5c2c58508c [gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11952
diff changeset
39 gchar* ml_get_prop_string(MonoObject *obj, char *field);
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
40
11980
fe5c2c58508c [gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11952
diff changeset
41 void ml_set_prop_string(MonoObject *obj, char *field, char *data);
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
42
15938
1b037158411e SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@pidgin.im>
parents: 15884
diff changeset
43 MonoObject* ml_get_info_prop(MonoObject *obj);
1b037158411e SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@pidgin.im>
parents: 15884
diff changeset
44
11980
fe5c2c58508c [gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11952
diff changeset
45 gboolean ml_is_api_dll(MonoImage *image);
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
46
11980
fe5c2c58508c [gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11952
diff changeset
47 MonoDomain* ml_get_domain(void);
fe5c2c58508c [gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11952
diff changeset
48
fe5c2c58508c [gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11952
diff changeset
49 void ml_set_domain(MonoDomain *d);
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
50
11980
fe5c2c58508c [gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11952
diff changeset
51 void ml_init_internal_calls(void);
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
52
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
53 MonoObject* ml_object_from_purple_type(PurpleType type, gpointer data);
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
54
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
55 MonoObject* ml_object_from_purple_subtype(PurpleSubType type, gpointer data);
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
56
11996
858bd928831c [gaim-migrate @ 14289]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11980
diff changeset
57 MonoObject* ml_create_api_object(char *class_name);
858bd928831c [gaim-migrate @ 14289]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11980
diff changeset
58
11980
fe5c2c58508c [gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11952
diff changeset
59 void ml_set_api_image(MonoImage *image);
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
60
12323
f52908fb23b0 [gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents: 11996
diff changeset
61 MonoImage* ml_get_api_image(void);
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
62
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
63 /* hash table stuff; probably don't need it anymore */
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
64
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
65 void ml_add_plugin(PurpleMonoPlugin *plugin);
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
66
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
67 gboolean ml_remove_plugin(PurpleMonoPlugin *plugin);
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
68
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
69 gpointer ml_find_plugin(PurpleMonoPlugin *plugin);
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
70
11980
fe5c2c58508c [gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents: 11952
diff changeset
71 gpointer ml_find_plugin_by_class(MonoClass *klass);
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
72
12323
f52908fb23b0 [gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents: 11996
diff changeset
73 GHashTable* ml_get_plugin_hash(void);
11660
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
74
a7cf8f7d43b3 [gaim-migrate @ 13945]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
diff changeset
75 #endif

mercurial