1414#include " xxhash.hh"
1515#include " startup-aware-lock.hh"
1616#include " jni-remapping.hh"
17+ #include " internal-pinvokes.hh"
1718
1819extern " C" {
1920 int _monodroid_getifaddrs (struct _monodroid_ifaddrs **ifap);
@@ -31,26 +32,26 @@ void* MonodroidRuntime::system_native_library_handle = nullptr;
3132void * MonodroidRuntime::system_security_cryptography_native_android_library_handle = nullptr ;
3233void * MonodroidRuntime::system_io_compression_native_library_handle = nullptr ;
3334
34- static unsigned int
35+ unsigned int
3536monodroid_get_log_categories ()
3637{
3738 return log_categories;
3839}
3940
40- static int
41+ int
4142monodroid_get_system_property (const char *name, char **value)
4243{
4344 return AndroidSystem::monodroid_get_system_property (name, value);
4445}
4546
46- static int
47+ int
4748monodroid_embedded_assemblies_set_assemblies_prefix (const char *prefix)
4849{
4950 embeddedAssemblies.set_assemblies_prefix (prefix);
5051 return 0 ;
5152}
5253
53- static void
54+ void
5455monodroid_log (LogLevel level, LogCategories category, const char *message)
5556{
5657 switch (level) {
@@ -84,99 +85,99 @@ monodroid_log (LogLevel level, LogCategories category, const char *message)
8485 }
8586}
8687
87- static void
88+ void
8889monodroid_free (void *ptr)
8990{
9091 free (ptr);
9192}
9293
93- static int
94+ int
9495_monodroid_max_gref_get ()
9596{
9697 return static_cast <int >(AndroidSystem::get_max_gref_count ());
9798}
9899
99- static int
100+ int
100101_monodroid_gref_get ()
101102{
102103 return osBridge.get_gc_gref_count ();
103104}
104105
105106
106- static void
107+ void
107108_monodroid_gref_log (const char *message)
108109{
109110 osBridge._monodroid_gref_log (message);
110111}
111112
112- static int
113+ int
113114_monodroid_gref_log_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable)
114115{
115116 return osBridge._monodroid_gref_log_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable);
116117}
117118
118- static void
119+ void
119120_monodroid_gref_log_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable)
120121{
121122 osBridge._monodroid_gref_log_delete (handle, type, threadName, threadId, from, from_writable);
122123}
123124
124- static int
125+ int
125126_monodroid_weak_gref_get ()
126127{
127128 return osBridge.get_gc_weak_gref_count ();
128129}
129130
130- static void
131+ void
131132_monodroid_weak_gref_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable)
132133{
133134 osBridge._monodroid_weak_gref_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable);
134135}
135136
136- static void
137+ void
137138_monodroid_weak_gref_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable)
138139{
139140 osBridge._monodroid_weak_gref_delete (handle, type, threadName, threadId, from, from_writable);
140141}
141142
142- static void
143+ void
143144_monodroid_lref_log_new (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable)
144145{
145146 osBridge._monodroid_lref_log_new (lrefc, handle, type, threadName, threadId, from, from_writable);
146147}
147148
148- static void
149+ void
149150_monodroid_lref_log_delete (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable)
150151{
151152 osBridge._monodroid_lref_log_delete (lrefc, handle, type, threadName, threadId, from, from_writable);
152153}
153154
154- static void
155+ void
155156_monodroid_gc_wait_for_bridge_processing ()
156157{
157158 mono_gc_wait_for_bridge_processing ();
158159}
159160
160- static int
161+ int
161162_monodroid_get_android_api_level ()
162163{
163164 return monodroidRuntime.get_android_api_level ();
164165}
165166
166- static void
167+ void
167168monodroid_clear_gdb_wait ()
168169{
169170 monodroidRuntime.set_monodroid_gdb_wait (false );
170171}
171172
172- static void *
173+ void *
173174_monodroid_get_identity_hash_code (JNIEnv *env, void *v)
174175{
175176 intptr_t rv = env->CallStaticIntMethod (monodroidRuntime.get_java_class_System (), monodroidRuntime.get_java_class_method_System_identityHashCode (), v);
176177 return (void *) rv;
177178}
178179
179- static void *
180+ void *
180181_monodroid_timezone_get_default_id ()
181182{
182183 JNIEnv *env = osBridge.ensure_jnienv ();
@@ -202,15 +203,15 @@ _monodroid_timezone_get_default_id ()
202203 return def_id;
203204}
204205
205- static void
206+ void
206207_monodroid_counters_dump ([[maybe_unused]] const char *format, [[maybe_unused]] va_list args)
207208{
208209#if !defined (NET)
209210 monodroidRuntime.dump_counters_v (format, args);
210211#endif // ndef NET
211212}
212213
213- static managed_timing_sequence*
214+ managed_timing_sequence*
214215monodroid_timing_start (const char *message)
215216{
216217 if (timing == nullptr )
@@ -225,7 +226,7 @@ monodroid_timing_start (const char *message)
225226 return ret;
226227}
227228
228- static void
229+ void
229230monodroid_timing_stop (managed_timing_sequence *sequence, const char *message)
230231{
231232 static constexpr const char DEFAULT_MESSAGE[] = " Managed Timing" ;
@@ -238,19 +239,19 @@ monodroid_timing_stop (managed_timing_sequence *sequence, const char *message)
238239 timing->release_sequence (sequence);
239240}
240241
241- static char **
242+ char **
242243monodroid_strsplit (const char *str, const char *delimiter, size_t max_tokens)
243244{
244245 return Util::monodroid_strsplit (str, delimiter, max_tokens);
245246}
246247
247- static void
248+ void
248249monodroid_strfreev (char **str_array)
249250{
250251 Util::monodroid_strfreev (str_array);
251252}
252253
253- static char *
254+ char *
254255monodroid_strdup_printf (const char *format, ...)
255256{
256257 va_list args;
@@ -262,65 +263,65 @@ monodroid_strdup_printf (const char *format, ...)
262263 return ret;
263264}
264265
265- static char *
266+ char *
266267monodroid_TypeManager_get_java_class_name (jclass klass)
267268{
268269 return monodroidRuntime.get_java_class_name_for_TypeManager (klass);
269270}
270271
271- static int
272+ int
272273monodroid_get_namespaced_system_property (const char *name, char **value)
273274{
274275 return static_cast <int >(AndroidSystem::monodroid_get_system_property (name, value));
275276}
276277
277- static FILE*
278+ FILE*
278279monodroid_fopen (const char * filename, const char * mode)
279280{
280281 return Util::monodroid_fopen (filename, mode);
281282}
282283
283- static int
284+ int
284285send_uninterrupted (int fd, void *buf, int len)
285286{
286287 if (len < 0 )
287288 len = 0 ;
288289 return Util::send_uninterrupted (fd, buf, static_cast <size_t >(len));
289290}
290291
291- static int
292+ int
292293recv_uninterrupted (int fd, void *buf, int len)
293294{
294295 if (len < 0 )
295296 len = 0 ;
296297 return static_cast <int >(Util::recv_uninterrupted (fd, buf, static_cast <size_t >(len)));
297298}
298299
299- static void
300+ void
300301set_world_accessable (const char *path)
301302{
302303 Util::set_world_accessable (path);
303304}
304305
305- static void
306+ void
306307create_public_directory (const char *dir)
307308{
308309 Util::create_public_directory (dir);
309310}
310311
311- static char *
312+ char *
312313path_combine (const char *path1, const char *path2)
313314{
314315 return Util::path_combine (path1, path2);
315316}
316317
317- static void *
318+ void *
318319monodroid_dylib_mono_new ([[maybe_unused]] const char *libmono_path)
319320{
320321 return nullptr ;
321322}
322323
323- static void
324+ void
324325monodroid_dylib_mono_free ([[maybe_unused]] void *mono_imports)
325326{
326327 // no-op
@@ -332,33 +333,33 @@ monodroid_dylib_mono_free ([[maybe_unused]] void *mono_imports)
332333
333334 it should also accept libmono_path = nullptr parameter
334335*/
335- static int
336+ int
336337monodroid_dylib_mono_init (void *mono_imports, [[maybe_unused]] const char *libmono_path)
337338{
338339 if (mono_imports == nullptr )
339340 return FALSE ;
340341 return TRUE ;
341342}
342343
343- static void *
344- monodroid_get_dylib (void )
344+ void *
345+ monodroid_get_dylib ()
345346{
346347 return nullptr ;
347348}
348349
349- static const char *
350+ const char *
350351_monodroid_lookup_replacement_type (const char *jniSimpleReference)
351352{
352353 return JniRemapping::lookup_replacement_type (jniSimpleReference);
353354}
354355
355- static const JniRemappingReplacementMethod*
356+ const JniRemappingReplacementMethod*
356357_monodroid_lookup_replacement_method_info (const char *jniSourceType, const char *jniMethodName, const char *jniMethodSignature)
357358{
358359 return JniRemapping::lookup_replacement_method_info (jniSourceType, jniMethodName, jniMethodSignature);
359360}
360361
361- static void
362+ void
362363monodroid_log_traces (uint32_t kind, const char *first_line)
363364{
364365 JNIEnv *env = osBridge.ensure_jnienv ();
0 commit comments