Skip to content

Commit 7930573

Browse files
committed
Add file loader working properly.
1 parent 63518b1 commit 7930573

File tree

31 files changed

+442
-263
lines changed

31 files changed

+442
-263
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,20 @@ This section describes all programming languages that **METACALL** supports, if
9595
| [JavaScript](https://developer.mozilla.org/bm/docs/Web/JavaScript) | [V8](https://v8.dev/) | **5.1.117** | js |
9696
| [C#](https://dotnet.microsoft.com/) | [NetCore](https://github.com/dotnet/docs/blob/master/docs/core/tutorials/netcore-hosting.md) | **1.1.10** | cs |
9797
| [Ruby](https://ruby-lang.org/) | [Ruby C API](https://silverhammermba.github.io/emberb/c/) | **>= 2.1 <= 2.3** | rb |
98+
| [File](/source/loaders/file_loader) | **** | **0.1.0** | file |
9899
| [Mock](/source/loaders/mock_loader) | **** | **0.1.0** | mock |
99100

100101
- Languages and run-times under construction:
101102

102103
| Language | Runtime | Tag |
103104
|--------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|:----:|
104-
| [Java](https://www.java.com/) | [JNI](https://docs.oracle.com/javase/8/docs/technotes/guides/jni/) | java |
105+
| [WebAssembly](https://webassembly.org/) | [WebAssembly Virtual Machine](https://github.com/WAVM/WAVM) | wasm |
105106
| [C/C++](http://www.cplusplus.com/) | [Clang](https://clang.llvm.org/) - [LLVM](https://llvm.org/) - [libffi](http://sourceware.org/libffi/) | c |
106-
| [File](/source/loaders/file_loader) | **** | file |
107+
| [Java](https://www.java.com/) | [JNI](https://docs.oracle.com/javase/8/docs/technotes/guides/jni/) | java |
108+
| [PHP](https://php.net/) | [Zend](https://www.php.net/manual/en/internals2.ze1.zendapi.php) | php |
107109
| [Go](https://golang.org/) | Go Runtime | go |
108110
| [Haskell](https://www.haskell.org/) | [Haskell FFI](https://wiki.haskell.org/GHC/Using_the_FFI) | hs |
109111
| [JavaScript](https://developer.mozilla.org/bm/docs/Web/JavaScript) | [SpiderMonkey](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference) | jsm |
110-
| [WebAssembly](https://webassembly.org/) | [WebAssembly Virtual Machine](https://github.com/WAVM/WAVM) | wasm |
111112

112113
## 3. Use Cases
113114

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ services:
4343
METACALL_BASE_IMAGE: $METACALL_BASE_IMAGE
4444
METACALL_PATH: $METACALL_PATH
4545
METACALL_TOOLS_PATH: $METACALL_PATH/tools
46-
METACALL_INSTALL_OPTIONS: root base python ruby netcore v8rep51 nodejs rapidjson funchook swig pack # coverage
46+
METACALL_INSTALL_OPTIONS: root base python ruby netcore v8rep51 nodejs file rapidjson funchook swig pack # coverage
4747
environment:
4848
DEBIAN_FRONTEND: noninteractive
4949
LTTNG_UST_REGISTER_TIMEOUT: 0
@@ -60,7 +60,7 @@ services:
6060
args:
6161
METACALL_PATH: $METACALL_PATH
6262
METACALL_BUILD_TYPE: $METACALL_CORE_BUILD_TYPE
63-
METACALL_BUILD_OPTIONS: root python ruby netcore v8 nodejs examples distributable tests scripts ports dynamic install pack # coverage
63+
METACALL_BUILD_OPTIONS: root python ruby netcore v8 nodejs file examples distributable tests scripts ports dynamic install pack # coverage
6464
environment:
6565
DEBIAN_FRONTEND: noninteractive
6666
LTTNG_UST_REGISTER_TIMEOUT: 0
@@ -83,7 +83,7 @@ services:
8383
args:
8484
METACALL_PATH: $METACALL_PATH
8585
METACALL_BASE_IMAGE: $METACALL_BASE_IMAGE
86-
METACALL_RUNTIME_OPTIONS: root base python ruby netcore nodejs v8 ports clean
86+
METACALL_RUNTIME_OPTIONS: root base python ruby netcore v8 nodejs file ports clean
8787
environment:
8888
DEBIAN_FRONTEND: noninteractive
8989
LTTNG_UST_REGISTER_TIMEOUT: 0

source/loader/include/loader/loader_path.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ extern "C" {
3232
#include <stdlib.h>
3333

3434
LOADER_API size_t loader_path_get_name(const loader_naming_path path, loader_naming_name name);
35+
36+
LOADER_API size_t loader_path_get_fullname(const loader_naming_path path, loader_naming_name name);
3537

3638
LOADER_API size_t loader_path_get_extension(const loader_naming_path path, loader_naming_tag extension);
3739

source/loader/source/loader_path.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,26 @@ size_t loader_path_get_name(const loader_naming_path path, loader_naming_name na
6060
return last + 1;
6161
}
6262

63+
size_t loader_path_get_fullname(const loader_naming_path path, loader_naming_name name)
64+
{
65+
size_t i, count;
66+
67+
for (i = 0, count = 0; path[i] != '\0' &&
68+
i < LOADER_NAMING_PATH_SIZE /*&& count < LOADER_NAMING_NAME_SIZE*/; ++i)
69+
{
70+
name[count++] = path[i];
71+
72+
if (LOADER_PATH_SEPARATOR(path[i]))
73+
{
74+
count = 0;
75+
}
76+
}
77+
78+
name[count] = '\0';
79+
80+
return count + 1;
81+
}
82+
6383
size_t loader_path_get_extension(const loader_naming_path path, loader_naming_tag extension)
6484
{
6585
size_t i, count;

0 commit comments

Comments
 (0)