Mark Thom
d7d5dfe059
Merge pull request #3108 from Skgland/issue-3073
...
emit a more appropriate error when passing the wrong argument count when constructing an ffi struct with the wrong argument count
2025-10-02 23:43:13 -07:00
Skgland
f8b9944f5c
update documentation
2025-09-28 19:50:21 +02:00
Skgland
6e7dbfc75e
consistently treat bool as i8
2025-09-28 18:29:20 +02:00
Skgland
1add5a9a75
add ffi types for non-fixed-sized integers
2025-09-28 18:17:35 +02:00
Skgland
9376bc6369
fix mthom/scryer-prolog#3073
2025-09-27 22:48:05 +02:00
Thierry Marianne
042631cb4c
run rustfmt
...
Signed-off-by: Thierry Marianne <thierry@marianne.io >
2025-09-21 22:52:12 +02:00
Thierry Marianne
32b6458deb
dereferencing registers to access stack variables
...
deref register to access stack variable for `directory_exists/1`
deref register to access stack variable for `directory_files/2`
deref register to access stack variable for `delete_directory/1`
deref register to access stack variable for `delete_file/1`
deref registers to access stack variable for `file_copy/2`
deref register to access stack variable for `file_exists/1`
deref register to access stack variable for `file_size/2`
deref register to access stack variable from `file_time` function
deref register to access stack variable for `make_directory/1`
deref register to access stack variable for `make_directory_path/1`
deref register to access stack variable for `path_canonical/2`
deref registers to access stack variables for `rename_file/2`
Signed-off-by: Thierry Marianne <thierry@marianne.io >
2025-09-21 22:52:12 +02:00
Mark Thom
e9ff1348b1
Merge pull request #3084 from thierrymarianne/set_stream
...
Prevent top-level from panicking when calling `set_input/1` with `Stream` variants.
2025-09-17 22:20:10 -07:00
Mark Thom
fc6e007ad1
add missing P increment to GetPartialString ( #3089 )
2025-09-17 20:31:03 -07:00
Mark Thom
7637a0f7d4
push cyclic pstr's tail to iterator stack of printer ( #3086 )
2025-09-17 20:21:54 -07:00
Mark Thom
ba7b54e8f8
fix attempted bind to bound StackVar ( #3089 )
2025-09-17 19:43:37 -07:00
Mark Thom
012e3de3a1
do not use self.fail in compare_term_test
2025-09-16 21:23:23 -07:00
Mark Thom
72cdba82f5
implement unify_ginteger to address FIXME in skip_max_list_cycle
2025-09-15 21:58:38 -07:00
Mark Thom
24f431e2ca
fix off-by-one lam loop ( #3081 )
2025-09-15 21:52:43 -07:00
Thierry Marianne
8afcc7742b
handle Stream variants qualified as input stream by is_input_stream
...
Signed-off-by: Thierry Marianne <thierry@marianne.io >
2025-09-15 08:33:47 +02:00
Thierry Marianne
e9834ffa3e
throw permission_error when non-input stream is read
...
Signed-off-by: Thierry Marianne <thierry@marianne.io >
2025-09-15 08:28:23 +02:00
Thierry Marianne
28ec457159
merge if let, match structures
...
Signed-off-by: Thierry Marianne <thierry@marianne.io >
2025-09-14 20:10:44 +02:00
Thierry Marianne
1ece558a71
match against Stream HttpRead(), InputFile(_) and NamedTcp(_) variants in read_term_from_user_input
...
Signed-off-by: Thierry Marianne <thierry@marianne.io >
2025-09-14 19:19:26 +02:00
Thierry Marianne
be18eda696
do not reset user input Stream of kind different from Readline(_), Byte(_)
...
Signed-off-by: Thierry Marianne <thierry@marianne.io >
2025-09-14 19:19:21 +02:00
Thierry Marianne
fdbaf6ac9d
handle named tcp and http read stream on term reading from user input
2025-09-14 17:02:09 +02:00
Thierry Marianne
5c341ce371
handle input file stream on term reading from user input
2025-09-14 17:02:09 +02:00
Mark Thom
dc05526c71
add FIXME for (presently inert & never invoked) race condition
2025-09-12 00:19:52 -07:00
Mark Thom
ffea37d899
fix f64 indexing, introduce bespoke F64Table type ( #3065 )
2025-09-11 23:58:36 -07:00
Mark Thom
368c9fd9dd
Merge pull request #3063 from Skgland/ffi++
...
ffi API extension and fixes
2025-08-28 20:49:41 -07:00
Skgland
c067bfa832
allow 3rd argument of ffi:read_ptr to not be a variable
2025-08-29 00:36:35 +02:00
Mark Thom
aa3d8b8fba
Merge pull request #3059 from pmikkelsen/raw-input
...
Don't use "readline" input functionality for certain builtins
2025-08-26 23:09:18 -07:00
Skgland
14ce052bf2
export array_type/3
2025-08-26 00:33:16 +02:00
Skgland
252361fc20
fix left over todo
2025-08-26 00:15:13 +02:00
Skgland
78c08b87b6
cleanup ffi error handling and use Atom instead of &str in appropriate places
2025-08-26 00:01:35 +02:00
Peter Mikkelsen
eb91b3c1fb
Style tweak
2025-08-25 20:47:29 +02:00
Skgland
a140720c6f
use representation_error rather than resource_error
2025-08-25 20:14:14 +02:00
Skgland
6f3f66c407
fix builds without ffi feature
2025-08-24 21:08:52 +02:00
Skgland
1f7a60dec9
add meta_predicate declaration for with_locals/2
2025-08-24 20:25:47 +02:00
Skgland
ce9b41815d
add documentation
2025-08-24 20:23:17 +02:00
Skgland
80bf276e09
run rustfmt
2025-08-24 19:57:54 +02:00
Skgland
8bc8171ec7
fix define_foreign_struct
2025-08-24 19:56:26 +02:00
Skgland
3b5b768f4a
make ffi error structure not found point to the correct culprit
2025-08-24 19:56:26 +02:00
Skgland
176858ad42
fix map_ffi_arg
2025-08-24 19:56:26 +02:00
Skgland
eba681786d
make map_ffi_args a method and throw an instantiation error when encountering a variable
2025-08-24 19:56:25 +02:00
Skgland
f4297e365f
don't crash on empty list and differentiate list head not being string like
2025-08-24 19:56:25 +02:00
Skgland
cd777294b9
use setup_call_cleanup/3 for with_locals
...
as suggested by triska
2025-08-24 19:56:25 +02:00
Skgland
d1356db7e3
include a culprit in ffi_error
2025-08-24 19:56:24 +02:00
Skgland
7b2bf73ba1
fix with_locals
2025-08-24 19:56:24 +02:00
Skgland
edd6d44bd6
require array_length to be > 0
...
C does not have 0-sized types
2025-08-24 19:56:24 +02:00
Skgland
4b5e4a2745
fix some things in ffi.pl
...
thanks triska for pointing out most of these
2025-08-24 19:56:23 +02:00
Skgland
3a4dfc46da
add ffi helpers
2025-08-24 19:56:23 +02:00
Skgland
d8346b1651
don't place allocate, read_ptr and deallocate between use_foreign_module and its helper predicates
2025-08-24 19:56:23 +02:00
Skgland
20d52c093a
add ffi:{allocate,read_ptr,deallocate}
2025-08-24 19:56:23 +02:00
Peter Mikkelsen
90e6e84312
Update src/read.rs
...
Co-authored-by: Bennet Bleßmann <3877590+Skgland@users.noreply.github.com >
2025-08-24 14:27:33 +02:00
Mark Thom
cd501beb0b
very small cargo fmt
2025-08-23 14:57:56 -07:00