Commit 646a588e8ca458a01b89e3b284d9c94e60dfbf22

Thomas de Grivel 2024-01-23T21:53:56

dlopen

diff --git a/.ic3_history b/.ic3_history
index 19dcf54..afdab9c 100644
--- a/.ic3_history
+++ b/.ic3_history
@@ -1,20 +1,3 @@
-123 + 123
-123.123
-123.123f
-123
-123.123
-123.123f
-123.0
-123.123
-123.0
-123.123f
-123.0f
-123f
-1.0
-1.0f
-1.0
-1.0f
-1.00f
 1.001f
 1.0010f
 1.00010f
@@ -97,3 +80,20 @@ U8[1]
 (U8[]) { 1, 2, 3 }
 (U8[]) {1, 2, 3}
 (U8[]) {0}
+(U8[]) {1, 2, 3}
+dlopen
+dlopen("libc3/window/sdl2/.libs/libc3_window_sdl2.so.0.0", 0)
+dlopen("libc3/window/sdl2/.libs/libc3_window_sdl2.so.0.0", (U32) 0)
+dlopen("libc3/window/sdl2/.libs/libc3_window_sdl2.so.0.0", (U32) 1)
+dlopen("libc3/window/sdl2/.libs/libc3_window_sdl2.so.0.0", (U32) 2)
+dlopen("libc3/window/sdl2/.libs/libc3_window_sdl2.so.0.0", (U32) 0)
+dlopen("libc3/window/.libs/libc3_window.so.0.0", (U32) 0)
+dlopen("libc3/window/.libs/libc3_window.so.0.0", (U32) 4)
+dlopen("libc3/window/.libs/libc3_window.so.0.0", (U32) 1)
+dlopen("libc3/window/.libs/libc3_window.so.0.0", (U32) 2)
+dlopen("libc3/window/.libs/libc3_window.so.0.0", (U32) 4)
+dlopen("libc3/window/.libs/libc3_window.so.0.0", (U32) 8)
+dlopen("libc3/window/.libs/libc3_window.so.0.0", (U32) 16)
+dlopen("libc3/window/.libs/libc3_window.so.0.0", (U32) 32)
+dlopen("libc3/window/.libs/libc3_window.so.0.0", (U32) 0)
+dlopen("/home/dx/c/thodg/c3-lang/c3/libc3/window/.libs/libc3_window.so.0.0", (U32) 0)
diff --git a/lib/c3/0.1/c3.facts b/lib/c3/0.1/c3.facts
index 624abc4..cfd6439 100644
--- a/lib/c3/0.1/c3.facts
+++ b/lib/c3/0.1/c3.facts
@@ -188,3 +188,5 @@ replace {C3.fib, :fn, fn { (0) { 1 }
                            (x) { fib(x - 1) + fib(x - 2) } }}
 add {C3, :symbol, C3.facts_next_id}
 replace {C3.facts_next_id, :cfn, cfn Uw "c3_facts_next_id" (Result)}
+add {C3, :symbol, C3.dlopen}
+replace {C3.dlopen, :cfn, cfn Ptr "dlopen" (Char*, U32)}
diff --git a/libc3/sym.c b/libc3/sym.c
index 70e7384..c78b3ce 100644
--- a/libc3/sym.c
+++ b/libc3/sym.c
@@ -583,6 +583,10 @@ bool sym_to_ffi_type (const s_sym *sym, ffi_type *result_type,
     *dest = &ffi_type_uint8;
     return true;
   }
+  if (sym == &g_sym_Char__star) {
+    *dest = &ffi_type_pointer;
+    return true;
+  }
   if (sym == &g_sym_Character) {
     *dest = &ffi_type_uint32;
     return true;