/*
* Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
* for details. All rights reserved. Use of this source code is governed by a
* BSD-style license that can be found in the LICENSE file.
*/
#ifndef RUNTIME_INCLUDE_DART_API_H_
#define RUNTIME_INCLUDE_DART_API_H_
/** \mainpage Dart Embedding API Reference
*
* This reference describes the Dart Embedding API, which is used to embed the
* Dart Virtual Machine within C/C++ applications.
*
* This reference is generated from the header include/dart_api.h.
*/
#ifdef __cplusplus
#define DART_EXTERN_C extern "C"
#else
#define DART_EXTERN_C
#endif
#if defined(__CYGWIN__)
#error Tool chain and platform not supported.
#elif defined(_WIN32)
// Define bool if necessary.
#ifndef __cplusplus
typedef unsigned __int8 bool;
#endif
// Define integer types.
typedef signed __int8 int8_t;
typedef signed __int16 int16_t;
typedef signed __int32 int32_t;
typedef signed __int64 int64_t;
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
#if defined(DART_SHARED_LIB)
#define DART_EXPORT DART_EXTERN_C __declspec(dllexport)
#else
#define DART_EXPORT DART_EXTERN_C
#endif
#else
/* __STDC_FORMAT_MACROS has to be defined before including <inttypes.h> to
* enable platform independent printf format specifiers. */
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#endif
#include <inttypes.h>
#include <stdbool.h>
#if __GNUC__ >= 4
#if defined(DART_SHARED_LIB)
#define DART_EXPORT \
DART_EXTERN_C __attribute__((visibility("default"))) __attribute((used))
#else
#define DART_EXPORT DART_EXTERN_C
#endif
#else
#error Tool chain not supported.
#endif
#endif
#if __GNUC__
#define DART_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#elif _MSC_VER
#define DART_WARN_UNUSED_RESULT _Check_return_
#else
#define DART_WARN_UNUSED_RESULT
#endif
#include <assert.h>
/*
* =======
* Handles
* =======
*/
/**
* An isolate is the unit of concurrency in Dart. Each isolate has
* its own memory and thread of control. No state is shared between
* isolates. Instead, isolates communicate by message passing.
*
* Each thread keeps track of its current isolate, which is the
* isolate which is ready to execute on the current thread. The
* current isolate may be NULL, in which case no isolate is ready to
* execute. Most of the Dart apis require there to be a current
* isolate in order to function without error. The current isolate is
* set by any call to Dart_CreateIsolate or Dart_EnterIsolate.
*/
typedef struct _Dart_Isolate* Dart_Isolate;
/**
* An object reference managed by the Dart VM garbage collector.
*
* Because the garbage collector may move objects, it is unsafe to
* refer to objects directly. Instead, we refer to objects through
* handles, which are known to the garbage collector and updated
* automatically when the object is moved. Handles should be passed
* by value (except in cases like out-parameters) and should never be
* allocated on the heap.
*
* Most functions in the Dart Embedding API return a handle. When a
* function completes normally, this will be a valid handle to an
* object in the Dart VM heap. This handle may represent the result of
* the operation or it may be a special valid handle used merely to
* indicate successful completion. Note that a valid handle may in
* some cases refer to the null object.
*
* --- Error handles ---
*
* When a function encounters a problem that prevents it from
* completing normally, it returns an error handle (See Dart_IsError).
* An error handle has an associated error message that gives more
* details about the problem (See Dart_GetError).
*
* There are four kinds of error handles that can be produced,
* depending on what goes wrong:
*
* - Api error handles are produced when an api function is misused.
* This happens when a Dart embedding api function is called with
* invalid arguments or in an invalid context.
*
* - Unhandled exception error handles are produced when, during the
* execution of Dart code, an exception is thrown but not caught.
* Prototypically this would occur during a call to Dart_Invoke, but
* it can occur in any function which triggers the execution of Dart
* code (for example, Dart_ToString).
*
* An unhandled exception error provides access to an exception and
* stacktrace via the functions Dart_ErrorGetException and
* Dart_ErrorGetStackTrace.
*
* - Compilation error handles are produced when, during the execution
* of Dart code, a compile-time error occurs. As above, this can
* occur in any function which triggers the execution of Dart code.
*
* - Fatal error handles are produced when the system wants to shut
* down the current isolate.
*
* --- Propagating errors ---
*
* When an error handle is returned from the top level invocation of
* Dart code in a program, the embedder must handle the error as they
* see fit. Often, the embedder will print the error message produced
* by Dart_Error and exit the program.
*
* When an error is returned while in the body of a native function,
* it can be propagated up the call stack by calling
* Dart_PropagateError, Dart_SetReturnValue, or Dart_ThrowException.
* Errors should be propagated unless there is a specific reason not
* to. If an error is not propagated then it is ignored. For
* example, if an unhandled exception error is ignored, that
* effectively "catches" the unhandled exception. Fatal errors must
* always be propagated.
*
* When an error is propagated, any current scopes created by
* Dart_EnterScope will be exited.
*
* Using Dart_SetReturnValue to propagate an exception is somewhat
* more convenient than using Dart_PropagateError, and should be
* preferred for reasons discussed below.
*
* Dart_PropagateError and Dart_ThrowException do not return. Instead
* they transfer control non-locally using a setjmp-like mechanism.
* This can be inconvenient if you have resources that you need to
* clean up before propagating the error.
*
* When relying on Dart_PropagateError, we often return error handles
* rather than propagating them from helper functions. Consider the
* following contrived example:
*
* 1 Dart_Handle isLongStringHelper(Dart_Handle arg) {
* 2 intptr_t* length = 0;
* 3 result = Dart_StringLength(arg, &length);
* 4 if (Dart_IsError(result)) {
* 5 return result
* 6 }
* 7 return Dart_NewBoolean(length > 100);
* 8 }
* 9
* 10 void NativeFunction_isLongString(Dart_NativeArguments args) {
* 11 Dart_EnterScope();
* 12 AllocateMyResource();
* 13 Dart_Handle arg = Dart_GetNativeArgument(args, 0);
* 14 Dart_Handle result = isLongStringHelper(arg);
* 15 if (Dart_IsError(result)) {
* 16 FreeMyResource();
* 17 Dart_PropagateError(result);
* 18 abort(); // will not reach here
* 19 }
* 20 Dart_SetReturnValue(result);
* 21 FreeMyResource();
* 22 Dart_ExitScope();
* 23 }
*
* In this example, we have a native function which calls a helper
* function to do its work. On line 5, the helper function could call
* Dart_PropagateError, but that would not give the native function a
* chance to call FreeMyResource(), causing a leak. Instead, the
* helper function returns the error handle to the caller, giving the
* caller a chance to clean up before propagating the error handle.
*
* When an error is propagated by calling Dart_SetReturnValue, the
* native function will be allowed to complete normally and then the
* exception will be propagated only once the native call
* returns. This can be convenient, as it allows the C code to clean
* up normally.
*
* The example can be written more simply using Dart_SetReturnValue to
* propagate the error.
*
* 1 Dart_Handle isLongStringHelper(Dart_Handle arg) {
没有合适的资源?快使用搜索试试~ 我知道了~
Flutter SDK 1.0.0发布版
共14938个文件
dart:6104个
expect:4400个
png:731个
5星 · 超过95%的资源 需积分: 0 31 下载量 19 浏览量
更新于2018-12-10
收藏 320.66MB ZIP 举报
Flutter SDK安装包,解压后即可直接使用,关于Flutter环境搭建请看:
https://blog.csdn.net/yuzhiqiang_1993/article/details/84939634
收起资源包目录
Flutter SDK 1.0.0发布版 (14938个子文件)
_CoqProject 153B
_packages 38B
_packages 14B
_packages 13B
_packages 8B
.analysis_options 2KB
Appfile 339B
Appfile 40B
araxis 358B
material_en.arb 12KB
material_ta.arb 4KB
material_km.arb 3KB
material_ru.arb 3KB
material_uk.arb 3KB
material_hi.arb 3KB
material_ar.arb 3KB
material_sr.arb 3KB
material_mr.arb 3KB
material_el.arb 3KB
material_bg.arb 3KB
material_th.arb 3KB
material_he.arb 3KB
material_ur.arb 3KB
material_sk.arb 3KB
material_lt.arb 3KB
material_mn.arb 3KB
material_cs.arb 3KB
material_fa.arb 3KB
material_pl.arb 3KB
material_ro.arb 3KB
material_sl.arb 3KB
material_pt.arb 3KB
material_bs.arb 3KB
material_hr.arb 3KB
material_lv.arb 2KB
material_sr_Latn.arb 2KB
material_fr.arb 2KB
material_ja.arb 2KB
material_vi.arb 2KB
material_de.arb 2KB
material_es.arb 2KB
material_hu.arb 2KB
material_ps.arb 2KB
material_gsw.arb 2KB
material_de_CH.arb 2KB
material_es_US.arb 2KB
material_es_BO.arb 2KB
material_es_HN.arb 2KB
material_es_SV.arb 2KB
material_es_PR.arb 2KB
material_es_GT.arb 2KB
material_es_PE.arb 2KB
material_es_CR.arb 2KB
material_es_419.arb 2KB
material_es_MX.arb 2KB
material_es_UY.arb 2KB
material_es_EC.arb 2KB
material_es_CO.arb 2KB
material_es_PY.arb 2KB
material_es_PA.arb 2KB
material_es_CL.arb 2KB
material_es_VE.arb 2KB
material_es_AR.arb 2KB
material_es_NI.arb 2KB
material_es_DO.arb 2KB
material_fil.arb 2KB
material_tl.arb 2KB
material_nl.arb 2KB
material_ca.arb 2KB
material_pt_PT.arb 2KB
material_it.arb 2KB
material_ko.arb 2KB
material_et.arb 2KB
material_ms.arb 2KB
material_fi.arb 2KB
material_zh_HK.arb 2KB
material_zh_TW.arb 2KB
material_tr.arb 2KB
material_sv.arb 2KB
material_id.arb 2KB
material_en_SG.arb 2KB
material_en_IN.arb 2KB
material_en_AU.arb 2KB
material_en_CA.arb 2KB
material_en_ZA.arb 2KB
material_en_GB.arb 2KB
material_en_IE.arb 2KB
material_zh.arb 2KB
material_da.arb 2KB
material_nb.arb 2KB
stocks_es.arb 442B
stocks_en.arb 441B
app_translation_getfromthelocale.arb 114B
component_translation_fr.arb 114B
material_fr_CA.arb 77B
AUTHORS 1KB
AUTHORS 1KB
AUTHORS 646B
AUTHORS 405B
AUTHORS 304B
共 14938 条
- 1
- 2
- 3
- 4
- 5
- 6
- 150
资源推荐
资源预览
资源评论
196 浏览量
2018-12-25 上传
2020-02-05 上传
133 浏览量
5星 · 资源好评率100%
2022-05-13 上传
107 浏览量
164 浏览量
167 浏览量
2023-05-08 上传
2021-05-01 上传
153 浏览量
193 浏览量
125 浏览量
110 浏览量
2021-07-08 上传
146 浏览量
102 浏览量
2019-05-14 上传
2021-05-06 上传
149 浏览量
113 浏览量
101 浏览量
2024-08-28 上传
资源评论
- 叶落无痕522019-03-07蛮不错的,可以正常使用!
- 智能座舱搬砖工2019-04-13还没来得及使用,不小心误删了
喻志强(Xeon)
- 粉丝: 6257
- 资源: 57
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 某名企年度培训计划.doc
- 年度培训计划表.doc
- 年度培训预算制订的几个困惑.doc
- 年度培训计划制定五步曲.doc
- 培训制度.doc
- 企业集团员工培训计划(2016年度)(DOC 5页).doc
- 企业如何做培训规划.doc
- 企业年度培训计划制定实务.doc
- 新人入职15天强化培训计划(DOC 7页).doc
- 傻瓜式开展年度培训规划工作.doc
- 宇辉2015培训方案(管理人员)(DOC 8页).doc
- 逸阳服饰2015年培训规划.doc
- 2024年中国经济复苏与出口新动能研究报告
- 通过python实现一个堆排序示例代码.zip
- 02助代-集团消费品经营理念(ppt 15)).PPT
- 03助代-营业人员专业准则.PPT
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功