Index: runtime/include/dart_api.h |
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h |
index 2ac024ad2383f7717443b4c4e11cb12166064d6f..b75db3c3f9708c5b07f41a03ed1e92b58bf4e3f6 100755 |
--- a/runtime/include/dart_api.h |
+++ b/runtime/include/dart_api.h |
@@ -942,6 +942,11 @@ DART_EXPORT bool Dart_Post(Dart_Port port_id, Dart_Handle object); |
* representation as a Dart_CObject. |
* |
* The string encoding in the 'value.as_string' is UTF-8. |
+ * |
+ * All the different types from dart:typeddata are all expopsed as |
Mads Ager (google)
2013/04/12 09:03:46
are all expopsed -> are exposed
Søren Gjesse
2013/04/15 09:14:34
Done.
|
+ * type kByteArray. The specific type from dart:typeddata is in the |
+ * as_byte_array structure. No matter what specific type the byte |
Mads Ager (google)
2013/04/12 09:03:46
Maybe shorten the last sentence to just: "The leng
Søren Gjesse
2013/04/15 09:14:34
Done.
|
+ * array has the specified length is always in bytes. |
*/ |
typedef struct _Dart_CObject { |
enum Type { |
@@ -953,11 +958,20 @@ typedef struct _Dart_CObject { |
kDouble, |
kString, |
kArray, |
- kUint8Array, |
- kExternalUint8Array, |
+ kByteArray, |
+ kExternalByteArray, |
kUnsupported, |
kNumberOfTypes |
} type; |
+ |
+ enum ByteArrayType { |
+ kInt8Array = 0, |
+ kUint8Array, |
+ kInt16Array, |
+ kUint16Array, |
+ kNumberOfByteArrayTypes |
+ }; |
+ |
union { |
bool as_bool; |
int32_t as_int32; |
@@ -970,10 +984,12 @@ typedef struct _Dart_CObject { |
struct _Dart_CObject** values; |
} as_array; |
struct { |
+ ByteArrayType type; |
int length; |
uint8_t* values; |
} as_byte_array; |
struct { |
+ ByteArrayType type; |
int length; |
uint8_t* data; |
void* peer; |