| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef INCLUDE_DART_API_H_ | 5 #ifndef INCLUDE_DART_API_H_ |
| 6 #define INCLUDE_DART_API_H_ | 6 #define INCLUDE_DART_API_H_ |
| 7 | 7 |
| 8 /** \mainpage Dart Embedding API Reference | 8 /** \mainpage Dart Embedding API Reference |
| 9 * | 9 * |
| 10 * Dart is a class-based programming language for creating structured | 10 * Dart is a class-based programming language for creating structured |
| (...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1409 // --- Message encoding/decoding ---- | 1409 // --- Message encoding/decoding ---- |
| 1410 | 1410 |
| 1411 /** | 1411 /** |
| 1412 * A Dart_CObject is used for representing Dart objects as native C | 1412 * A Dart_CObject is used for representing Dart objects as native C |
| 1413 * data outside the Dart heap. These objects are totally detached from | 1413 * data outside the Dart heap. These objects are totally detached from |
| 1414 * the Dart heap. Only a subset of the Dart objects have a | 1414 * the Dart heap. Only a subset of the Dart objects have a |
| 1415 * representation as a Dart_CObject. | 1415 * representation as a Dart_CObject. |
| 1416 */ | 1416 */ |
| 1417 struct Dart_CObject { | 1417 struct Dart_CObject { |
| 1418 enum Type { | 1418 enum Type { |
| 1419 kNull, | 1419 kNull = 0, |
| 1420 kBool, | 1420 kBool, |
| 1421 kInt32, | 1421 kInt32, |
| 1422 kDouble, | 1422 kDouble, |
| 1423 kString, | 1423 kString, |
| 1424 kArray | 1424 kArray, |
| 1425 kNumberOfTypes |
| 1425 }; | 1426 }; |
| 1426 Type type; | 1427 Type type; |
| 1427 union { | 1428 union { |
| 1428 bool as_bool; | 1429 bool as_bool; |
| 1429 int32_t as_int32; | 1430 int32_t as_int32; |
| 1430 double as_double; | 1431 double as_double; |
| 1431 char* as_string; | 1432 char* as_string; |
| 1432 struct { | 1433 struct { |
| 1433 int length; | 1434 int length; |
| 1434 Dart_CObject** values; | 1435 Dart_CObject** values; |
| 1435 } as_array; | 1436 } as_array; |
| 1436 } value; | 1437 } value; |
| 1437 }; | 1438 }; |
| 1438 | 1439 |
| 1439 /** | 1440 /** |
| 1440 * A Dart_CMessage is used for encoding and decoding messages from native code. | 1441 * A Dart_CMessage is used for encoding and decoding messages from native code. |
| 1441 */ | 1442 */ |
| 1442 struct Dart_CMessage { | 1443 struct Dart_CMessage { |
| 1443 Dart_CObject** message; | 1444 Dart_CObject** message; |
| 1444 }; | 1445 }; |
| 1445 | 1446 |
| 1446 #endif // INCLUDE_DART_API_H_ | 1447 #endif // INCLUDE_DART_API_H_ |
| OLD | NEW |