| 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 BIN_EXTENSIONS_H_ | 5 #ifndef BIN_EXTENSIONS_H_ |
| 6 #define BIN_EXTENSIONS_H_ | 6 #define BIN_EXTENSIONS_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
| 10 | 10 |
| 11 namespace dart { | 11 namespace dart { |
| 12 namespace bin { | 12 namespace bin { |
| 13 | 13 |
| 14 class Extensions { | 14 class Extensions { |
| 15 public: | 15 public: |
| 16 // TODO(whesse): Make extension load from a relative path relative to | 16 // TODO(whesse): Make extension load from a relative path relative to |
| 17 // the library it is in. Currently loads from current working directory. | 17 // the library it is in. Currently loads from current working directory. |
| 18 static Dart_Handle LoadExtension(const char* extension_directory, | 18 static Dart_Handle LoadExtension(const char* extension_directory, |
| 19 const char* extension_name, | 19 const char* extension_name, |
| 20 Dart_Handle parent_library); | 20 Dart_Handle parent_library); |
| 21 | 21 |
| 22 // Platform-specific implementations. | 22 // Platform-specific implementations. |
| 23 static void* LoadExtensionLibrary(const char* library_file); | 23 static void* LoadExtensionLibrary(const char* library_file); |
| 24 static void* ResolveSymbol(void* lib_handle, const char* symbol); | 24 static void* ResolveSymbol(void* lib_handle, const char* symbol); |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 static Dart_Handle GetError(); | 27 static Dart_Handle GetError(); |
| 28 | 28 |
| 29 static void* MakePathAndResolve(const char* dir, const char* name); |
| 30 static void* ResolveAbsPathExtension(const char* extension_path); |
| 31 static void* ResolveExtension(const char* extensioion_directory, |
| 32 const char* extension_name); |
| 33 |
| 29 // The returned string is scope allocated. | 34 // The returned string is scope allocated. |
| 30 static const char* Concatenate(const char** strings); | 35 static const char* Concatenate(const char** strings); |
| 31 | 36 |
| 32 DISALLOW_ALLOCATION(); | 37 DISALLOW_ALLOCATION(); |
| 33 DISALLOW_IMPLICIT_CONSTRUCTORS(Extensions); | 38 DISALLOW_IMPLICIT_CONSTRUCTORS(Extensions); |
| 34 }; | 39 }; |
| 35 | 40 |
| 36 } // namespace bin | 41 } // namespace bin |
| 37 } // namespace dart | 42 } // namespace dart |
| 38 | 43 |
| 39 #endif // BIN_EXTENSIONS_H_ | 44 #endif // BIN_EXTENSIONS_H_ |
| OLD | NEW |