OLD | NEW |
---|---|
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #include <stdlib.h> | 5 #include <stdlib.h> |
6 #include <string.h> | 6 #include <string.h> |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 | 9 |
10 #include "bin/builtin.h" | 10 #include "bin/builtin.h" |
11 #include "bin/dartutils.h" | 11 #include "bin/dartutils.h" |
12 | 12 |
13 // The string on the next line will be filled in with the contents of the | 13 // The string on the next line will be filled in with the contents of the |
14 // builtin.dart file. | 14 // builtin.dart file. |
15 // This string forms the content of builtin functionality which is injected | 15 // This string forms the content of builtin functionality which is injected |
16 // into standalone dart to provide some test/debug functionality. | 16 // into standalone dart to provide some test/debug functionality. |
17 static const char Builtin_source_[] = { | 17 static const char Builtin_source_[] = { |
18 {{DART_SOURCE}} | 18 {{DART_SOURCE}} |
19 }; | 19 }; |
20 | 20 |
21 | 21 |
22 // List all native functions implemented in standalone dart that is used | 22 // List all native functions implemented in standalone dart that is used |
23 // to inject additional functionality e.g: Logger, file I/O, socket I/O etc. | 23 // to inject additional functionality e.g: Logger, file I/O, socket I/O etc. |
24 #define BUILTIN_NATIVE_LIST(V) \ | 24 #define BUILTIN_NATIVE_LIST(V) \ |
25 V(Directory_List, 7) \ | 25 V(Directory_List, 7) \ |
26 V(Directory_Exists, 2) \ | 26 V(Directory_Exists, 2) \ |
27 V(Directory_Create, 2) \ | 27 V(Directory_Create, 2) \ |
28 V(Directory_CreateTemp, 2) \ | |
Mads Ager (google)
2011/11/18 09:50:45
Align the '\' with the other ones.
Bill Hesse
2011/11/21 15:48:41
Done.
| |
28 V(Directory_Delete, 2) \ | 29 V(Directory_Delete, 2) \ |
29 V(EventHandler_Start, 1) \ | 30 V(EventHandler_Start, 1) \ |
30 V(EventHandler_SendData, 4) \ | 31 V(EventHandler_SendData, 4) \ |
31 V(Exit, 1) \ | 32 V(Exit, 1) \ |
32 V(File_Open, 2) \ | 33 V(File_Open, 2) \ |
33 V(File_Exists, 1) \ | 34 V(File_Exists, 1) \ |
34 V(File_Close, 1) \ | 35 V(File_Close, 1) \ |
35 V(File_ReadByte, 1) \ | 36 V(File_ReadByte, 1) \ |
36 V(File_WriteByte, 2) \ | 37 V(File_WriteByte, 2) \ |
37 V(File_WriteString, 2) \ | 38 V(File_WriteString, 2) \ |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 } | 145 } |
145 | 146 |
146 | 147 |
147 void Builtin_SetNativeResolver() { | 148 void Builtin_SetNativeResolver() { |
148 Dart_Handle url = Dart_NewString(DartUtils::kBuiltinLibURL); | 149 Dart_Handle url = Dart_NewString(DartUtils::kBuiltinLibURL); |
149 Dart_Handle builtin_lib = Dart_LookupLibrary(url); | 150 Dart_Handle builtin_lib = Dart_LookupLibrary(url); |
150 DART_CHECK_VALID(builtin_lib); | 151 DART_CHECK_VALID(builtin_lib); |
151 Dart_Handle result = Dart_SetNativeResolver(builtin_lib, native_lookup); | 152 Dart_Handle result = Dart_SetNativeResolver(builtin_lib, native_lookup); |
152 DART_CHECK_VALID(result); | 153 DART_CHECK_VALID(result); |
153 } | 154 } |
OLD | NEW |