Restore Haiku support
[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 /* Define header for team_info */
19 #include <os/kernel/OS.h>
20 #else
21 #define USE_DEFAULT_BACKEND
22 #endif
23
24 typedef struct {
25         gpointer address_start;
26         gpointer address_end;
27         gchar *perms;
28         gpointer address_offset;
29         guint64 device;
30         guint64 inode;
31         gchar *filename;
32 } MonoW32ProcessModule;
33
34 gchar*
35 mono_w32process_get_name (pid_t pid);
36
37 GSList*
38 mono_w32process_get_modules (pid_t pid);
39
40 static void
41 mono_w32process_module_free (MonoW32ProcessModule *module)
42 {
43         g_free (module->perms);
44         g_free (module->filename);
45         g_free (module);
46 }
47
48 /*
49  * Used to look through the GSList* returned by mono_w32process_get_modules
50  */
51 static gint
52 mono_w32process_module_equals (gconstpointer a, gconstpointer b)
53 {
54         MonoW32ProcessModule *want = (MonoW32ProcessModule *)a;
55         MonoW32ProcessModule *compare = (MonoW32ProcessModule *)b;
56         return (want->device == compare->device && want->inode == compare->inode) ? 0 : 1;
57 }
58
59 #endif /* _MONO_METADATA_W32PROCESS_UNIX_INTERNALS_H_ */