Merge pull request #2408 from tastywheattasteslikechicken/MoreInterfaceSupport
[mono.git] / mono / metadata / w32process-unix-internals.h
1
2 #ifndef _MONO_METADATA_W32PROCESS_UNIX_INTERNALS_H_
3 #define _MONO_METADATA_W32PROCESS_UNIX_INTERNALS_H_
4
5 #include <config.h>
6 #include <glib.h>
7
8 /*
9  * FOR EXCLUSIVE USE BY w32process-unix.c
10  */
11
12 #if defined(PLATFORM_MACOSX)
13 #define USE_OSX_BACKEND
14 #elif (defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(HAVE_LINK_H)
15 #define USE_BSD_BACKEND
16 #elif defined(__HAIKU__)
17 #define USE_HAIKU_BACKEND
18 #else
19 #define USE_DEFAULT_BACKEND
20 #endif
21
22 typedef struct {
23         gpointer address_start;
24         gpointer address_end;
25         gchar *perms;
26         gpointer address_offset;
27         guint64 device;
28         guint64 inode;
29         gchar *filename;
30 } MonoW32ProcessModule;
31
32 gchar*
33 mono_w32process_get_name (pid_t pid);
34
35 GSList*
36 mono_w32process_get_modules (pid_t pid);
37
38 static void
39 mono_w32process_module_free (MonoW32ProcessModule *module)
40 {
41         g_free (module->perms);
42         g_free (module->filename);
43         g_free (module);
44 }
45
46 /*
47  * Used to look through the GSList* returned by mono_w32process_get_modules
48  */
49 static gint
50 mono_w32process_module_equals (gconstpointer a, gconstpointer b)
51 {
52         MonoW32ProcessModule *want = (MonoW32ProcessModule *)a;
53         MonoW32ProcessModule *compare = (MonoW32ProcessModule *)b;
54         return (want->device == compare->device && want->inode == compare->inode) ? 0 : 1;
55 }
56
57 #endif /* _MONO_METADATA_W32PROCESS_UNIX_INTERNALS_H_ */