Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Macros | Typedefs | Functions
dart_api_dl.h File Reference
#include "dart_api.h"
#include "dart_native_api.h"

Go to the source code of this file.

Macros

#define DART_NATIVE_API_DL_SYMBOLS(F)
 
#define DART_API_DL_SYMBOLS(F)
 
#define DART_API_DEPRECATED_DL_SYMBOLS(F)
 
#define DART_API_ALL_DL_SYMBOLS(F)
 
#define DART_API_DL_DECLARATIONS(name, R, A)
 

Typedefs

typedef int64_t Dart_Port_DL
 
typedef void(* Dart_NativeMessageHandler_DL) (Dart_Port_DL dest_port_id, Dart_CObject *message)
 

Functions

DART_EXPORT intptr_t Dart_InitializeApiDL (void *data)
 

Macro Definition Documentation

◆ DART_API_ALL_DL_SYMBOLS

#define DART_API_ALL_DL_SYMBOLS (   F)
Value:
DART_API_DL_SYMBOLS(F)
#define DART_NATIVE_API_DL_SYMBOLS(F)
Definition dart_api_dl.h:46
Definition SkMD5.cpp:120

Definition at line 116 of file dart_api_dl.h.

◆ DART_API_DEPRECATED_DL_SYMBOLS

#define DART_API_DEPRECATED_DL_SYMBOLS (   F)
Value:
F(Dart_UpdateExternalSize, void, \
(Dart_WeakPersistentHandle object, intptr_t external_allocation_size)) \
F(Dart_UpdateFinalizableExternalSize, void, \
(Dart_FinalizableHandle object, Dart_Handle strong_ref_to_object, \
intptr_t external_allocation_size))
#define F(x)
struct _Dart_Handle * Dart_Handle
Definition dart_api.h:258
struct _Dart_FinalizableHandle * Dart_FinalizableHandle
Definition dart_api.h:261
struct _Dart_WeakPersistentHandle * Dart_WeakPersistentHandle
Definition dart_api.h:260

Definition at line 109 of file dart_api_dl.h.

◆ DART_API_DL_DECLARATIONS

#define DART_API_DL_DECLARATIONS (   name,
  R,
  A 
)
Value:
typedef R(*name##_Type) A; \
DART_EXPORT_DL name##_Type name##_DL;
const char * name
Definition fuchsia.cc:50
#define R(r)

Definition at line 154 of file dart_api_dl.h.

◆ DART_API_DL_SYMBOLS

#define DART_API_DL_SYMBOLS (   F)

Definition at line 57 of file dart_api_dl.h.

◆ DART_NATIVE_API_DL_SYMBOLS

#define DART_NATIVE_API_DL_SYMBOLS (   F)
Value:
/***** dart_native_api.h *****/ \
/* Dart_Port */ \
F(Dart_PostInteger, bool, (Dart_Port_DL port_id, int64_t message)) \
(const char* name, Dart_NativeMessageHandler_DL handler, \
bool handle_concurrently)) \
F(Dart_CloseNativePort, bool, (Dart_Port_DL native_port_id))
void(* Dart_NativeMessageHandler_DL)(Dart_Port_DL dest_port_id, Dart_CObject *message)
Definition dart_api_dl.h:42
int64_t Dart_Port_DL
Definition dart_api_dl.h:40
DART_EXPORT bool Dart_PostInteger(Dart_Port port_id, int64_t message)
DART_EXPORT bool Dart_PostCObject(Dart_Port port_id, Dart_CObject *message)
DART_EXPORT Dart_Port Dart_NewNativePort(const char *name, Dart_NativeMessageHandler handler, bool handle_concurrently)
DART_EXPORT bool Dart_CloseNativePort(Dart_Port native_port_id)
Win32Message message

Definition at line 46 of file dart_api_dl.h.

Typedef Documentation

◆ Dart_NativeMessageHandler_DL

typedef void(* Dart_NativeMessageHandler_DL) (Dart_Port_DL dest_port_id, Dart_CObject *message)

Definition at line 42 of file dart_api_dl.h.

◆ Dart_Port_DL

typedef int64_t Dart_Port_DL

Definition at line 40 of file dart_api_dl.h.

Function Documentation

◆ Dart_InitializeApiDL()

DART_EXPORT intptr_t Dart_InitializeApiDL ( void *  data)

Definition at line 45 of file dart_api_dl.c.

45 {
46 DartApi* dart_api_data = (DartApi*)data;
47
48 if (dart_api_data->major != DART_API_DL_MAJOR_VERSION) {
49 // If the DartVM we're running on does not have the same version as this
50 // file was compiled against, refuse to initialize. The symbols are not
51 // compatible.
52 return -1;
53 }
54 // Minor versions are allowed to be different.
55 // If the DartVM has a higher minor version, it will provide more symbols
56 // than we initialize here.
57 // If the DartVM has a lower minor version, it will not provide all symbols.
58 // In that case, we leave the missing symbols un-initialized. Those symbols
59 // should not be used by the Dart and native code. The client is responsible
60 // for checking the minor version number himself based on which symbols it
61 // is using.
62 // (If we would error out on this case, recompiling native code against a
63 // newer SDK would break all uses on older SDKs, which is too strict.)
64
65 const DartApiEntry* dart_api_function_pointers = dart_api_data->functions;
66
67#define DART_API_DL_INIT(name, R, A) \
68 name##_DL = \
69 (name##_Type)(FindFunctionPointer(dart_api_function_pointers, #name));
71#undef DART_API_DL_INIT
72
73#define DART_API_DEPRECATED_DL_INIT(name, R, A) \
74 name##_DL = name##_Deprecated;
76#undef DART_API_DEPRECATED_DL_INIT
77
78 return 0;
79}
#define DART_API_DL_INIT(name, R, A)
#define DART_API_DEPRECATED_DL_INIT(name, R, A)
#define DART_API_ALL_DL_SYMBOLS(F)
#define DART_API_DEPRECATED_DL_SYMBOLS(F)
#define DART_API_DL_MAJOR_VERSION
const int major
const DartApiEntry *const functions