@@ -61,10 +61,11 @@ if {$err != "" || $v == 1} { error "\[test4\] did not return the expected error" } # New API +## Simple test set handle [tcc4tcl::new] $handle cproc test5 {int i} int { return(i + 42); } if {[$handle code] == ""} { error "[list $handle code] did not give code output" } @@ -71,16 +72,27 @@ $handle cproc test6 {int i} int { return(i + 42); } $handle go puts [test5 1] puts [test6 1] +## Delete without performing +set handle [tcc4tcl::new] +$handle delete + +# External functions (requires .a files) set handle [tcc4tcl::new] $handle ccode {const char *curl_version(void);} $handle cproc curl_version {} char* $handle add_library_path /usr/lib64 $handle add_library_path /usr/lib $handle add_library curl $handle go puts [curl_version] +# wide values set handle [tcc4tcl::new] -$handle delete +$handle cproc wideTest {Tcl_WideInt x} Tcl_WideInt { + return(x); +} +$handle go +puts [wideTest 30] +