| OLD | NEW |
| 1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Fletch 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 #ifndef SRC_VM_FFI_H_ | 5 #ifndef SRC_VM_FFI_H_ |
| 6 #define SRC_VM_FFI_H_ | 6 #define SRC_VM_FFI_H_ |
| 7 | 7 |
| 8 #include "src/shared/globals.h" | 8 #include "src/shared/globals.h" |
| 9 #include "src/shared/natives.h" | 9 #include "src/shared/natives.h" |
| 10 | 10 |
| 11 namespace fletch { | 11 namespace fletch { |
| 12 | 12 |
| 13 class DefaultLibraryEntry; | 13 class DefaultLibraryEntry; |
| 14 class Mutex; | 14 class Mutex; |
| 15 | 15 |
| 16 class ForeignFunctionInterface { | 16 class ForeignFunctionInterface { |
| 17 public: | 17 public: |
| 18 static void Setup(); | 18 static void Setup(); |
| 19 static void TearDown(); | 19 static void TearDown(); |
| 20 static void AddDefaultSharedLibrary(const char* library); | 20 static void AddDefaultSharedLibrary(const char* library); |
| 21 static void* LookupInDefaultLibraries(const char* symbol); | 21 static void* LookupInDefaultLibraries(const char* symbol); |
| 22 private: | 22 private: |
| 23 static DefaultLibraryEntry* libraries_; | 23 static DefaultLibraryEntry* libraries_; |
| 24 static Mutex* mutex_; | 24 static Mutex* mutex_; |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 // Platform specific ffi constants and methods. |
| 28 class ForeignUtils { |
| 29 public: |
| 30 // We construct default bundle library paths from a prefix and a postfix. |
| 31 static const char* kLibBundlePrefix; |
| 32 static const char* kLibBundlePostfix; |
| 33 |
| 34 // In preparation of supporting windows we have a function for this. |
| 35 static char* DirectoryName(char* path); |
| 36 }; |
| 37 |
| 27 } // namespace fletch | 38 } // namespace fletch |
| 28 | 39 |
| 29 #endif // SRC_VM_FFI_H_ | 40 #endif // SRC_VM_FFI_H_ |
| OLD | NEW |