2016-04-21 15:19:32 +03:00
|
|
|
//
|
|
|
|
// shared.h: Shared native code between Xamarin.iOS and Xamarin.Mac.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Authors:
|
|
|
|
// Rolf Bjarne Kvinge <rolf@xamarin.com>
|
|
|
|
//
|
|
|
|
// Copyright 2013 Xamarin Inc.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef __SHARED_H__
|
|
|
|
#define __SHARED_H__
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
2019-09-27 08:15:59 +03:00
|
|
|
#include <stdatomic.h>
|
2016-04-21 15:19:32 +03:00
|
|
|
|
2021-02-11 10:18:38 +03:00
|
|
|
#include "xamarin/mono-runtime.h"
|
|
|
|
|
2016-04-21 15:19:32 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef void (init_cocoa_func) (void);
|
2018-11-21 19:48:15 +03:00
|
|
|
void xamarin_initialize_cocoa_threads (init_cocoa_func *func);
|
2016-04-21 15:19:32 +03:00
|
|
|
|
|
|
|
id xamarin_init_nsthread (id obj, bool is_direct, id target, SEL sel, id arg);
|
2016-05-11 14:27:51 +03:00
|
|
|
void xamarin_insert_dllmap ();
|
2016-04-21 15:19:32 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Block support
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct Xamarin_block_descriptor {
|
|
|
|
unsigned long int reserved; // NULL
|
|
|
|
unsigned long int size; // sizeof(struct Block_literal_1)
|
|
|
|
// optional helper functions
|
|
|
|
void (*copy_helper) (void *dst, void *src); // IFF (1<<25)
|
|
|
|
void (*dispose_helper)(void *src); // IFF (1<<25)
|
|
|
|
// required ABI.2010.3.16
|
|
|
|
const char *signature; // IFF (1<<30)
|
2019-09-27 08:15:59 +03:00
|
|
|
int _Atomic ref_count;
|
2016-04-21 15:19:32 +03:00
|
|
|
// variable-length string
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Block_literal {
|
|
|
|
void *isa;
|
|
|
|
int flags;
|
|
|
|
int reserved;
|
|
|
|
void (*invoke)(void *, ...);
|
|
|
|
struct Xamarin_block_descriptor *descriptor;
|
2021-02-11 10:18:38 +03:00
|
|
|
GCHandle local_handle;
|
|
|
|
GCHandle global_handle;
|
2016-04-21 15:19:32 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Xamarin_block_descriptor * xamarin_get_block_descriptor ();
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern "C" */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __SHARED_H__ */
|