mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-12 23:37:38 +02:00
Issue #374 - Allow full access to open-binary prims
This commit is contained in:
parent
8a115df516
commit
81d2e70037
4 changed files with 38 additions and 0 deletions
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -1,5 +1,17 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.18 - TBD
|
||||||
|
|
||||||
|
Features
|
||||||
|
|
||||||
|
- Added the `(cyclone foreign)` library to make it easier to integrate with C code using the FFI.
|
||||||
|
|
||||||
|
Bug Fixes
|
||||||
|
|
||||||
|
- Allow `open-binary-input-file` and `open-binary-output-file` to be accessible via the REPL.
|
||||||
|
- Fix `bytevector?` predicate which was accidentally aliased to `vector?`.
|
||||||
|
- Fix `list-copy` to return a non-list object instead of raising an error, per R7RS.
|
||||||
|
|
||||||
## 0.17 - April 6, 2020
|
## 0.17 - April 6, 2020
|
||||||
|
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
|
|
|
@ -714,6 +714,8 @@ extern const object primitive_string_127;
|
||||||
extern const object primitive_symbol_127;
|
extern const object primitive_symbol_127;
|
||||||
extern const object primitive_open_91input_91file;
|
extern const object primitive_open_91input_91file;
|
||||||
extern const object primitive_open_91output_91file;
|
extern const object primitive_open_91output_91file;
|
||||||
|
extern const object primitive_open_91binary_91input_91file;
|
||||||
|
extern const object primitive_open_91binary_91output_91file;
|
||||||
extern const object primitive_close_91port;
|
extern const object primitive_close_91port;
|
||||||
extern const object primitive_close_91input_91port;
|
extern const object primitive_close_91input_91port;
|
||||||
extern const object primitive_close_91output_91port;
|
extern const object primitive_close_91output_91port;
|
||||||
|
|
22
runtime.c
22
runtime.c
|
@ -5412,6 +5412,22 @@ void _open_91output_91file(void *data, object cont, object args)
|
||||||
return_closcall1(data, cont, &p);
|
return_closcall1(data, cont, &p);
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
void _open_91binary_91input_91file(void *data, object cont, object args)
|
||||||
|
{
|
||||||
|
Cyc_check_num_args(data, "open-binary-input-file", 1, args);
|
||||||
|
{
|
||||||
|
port_type p = Cyc_io_open_binary_input_file(data, car(args));
|
||||||
|
return_closcall1(data, cont, &p);
|
||||||
|
}}
|
||||||
|
|
||||||
|
void _open_91binary_91output_91file(void *data, object cont, object args)
|
||||||
|
{
|
||||||
|
Cyc_check_num_args(data, "open-binary-output-file", 1, args);
|
||||||
|
{
|
||||||
|
port_type p = Cyc_io_open_binary_output_file(data, car(args));
|
||||||
|
return_closcall1(data, cont, &p);
|
||||||
|
}}
|
||||||
|
|
||||||
void _close_91port(void *data, object cont, object args)
|
void _close_91port(void *data, object cont, object args)
|
||||||
{
|
{
|
||||||
Cyc_check_num_args(data, "close-port", 1, args);
|
Cyc_check_num_args(data, "close-port", 1, args);
|
||||||
|
@ -6370,6 +6386,10 @@ static primitive_type open_91input_91file_primitive =
|
||||||
{ {0}, primitive_tag, "open-input-file", &_open_91input_91file };
|
{ {0}, primitive_tag, "open-input-file", &_open_91input_91file };
|
||||||
static primitive_type open_91output_91file_primitive =
|
static primitive_type open_91output_91file_primitive =
|
||||||
{ {0}, primitive_tag, "open-output-file", &_open_91output_91file };
|
{ {0}, primitive_tag, "open-output-file", &_open_91output_91file };
|
||||||
|
static primitive_type open_91binary_91input_91file_primitive =
|
||||||
|
{ {0}, primitive_tag, "open-binary-input-file", &_open_91binary_91input_91file };
|
||||||
|
static primitive_type open_91binary_91output_91file_primitive =
|
||||||
|
{ {0}, primitive_tag, "open-binary-output-file", &_open_91binary_91output_91file };
|
||||||
static primitive_type close_91port_primitive =
|
static primitive_type close_91port_primitive =
|
||||||
{ {0}, primitive_tag, "close-port", &_close_91port };
|
{ {0}, primitive_tag, "close-port", &_close_91port };
|
||||||
static primitive_type close_91input_91port_primitive =
|
static primitive_type close_91input_91port_primitive =
|
||||||
|
@ -6525,6 +6545,8 @@ const object primitive_bytevector_127 = &bytevector_127_primitive;
|
||||||
const object primitive_symbol_127 = &symbol_127_primitive;
|
const object primitive_symbol_127 = &symbol_127_primitive;
|
||||||
const object primitive_open_91input_91file = &open_91input_91file_primitive;
|
const object primitive_open_91input_91file = &open_91input_91file_primitive;
|
||||||
const object primitive_open_91output_91file = &open_91output_91file_primitive;
|
const object primitive_open_91output_91file = &open_91output_91file_primitive;
|
||||||
|
const object primitive_open_91binary_91input_91file = &open_91binary_91input_91file_primitive;
|
||||||
|
const object primitive_open_91binary_91output_91file = &open_91binary_91output_91file_primitive;
|
||||||
const object primitive_close_91port = &close_91port_primitive;
|
const object primitive_close_91port = &close_91port_primitive;
|
||||||
const object primitive_close_91input_91port = &close_91input_91port_primitive;
|
const object primitive_close_91input_91port = &close_91input_91port_primitive;
|
||||||
const object primitive_close_91output_91port = &close_91output_91port_primitive;
|
const object primitive_close_91output_91port = &close_91output_91port_primitive;
|
||||||
|
|
|
@ -320,6 +320,8 @@
|
||||||
(list 'symbol? symbol?)
|
(list 'symbol? symbol?)
|
||||||
(list 'open-input-file open-input-file)
|
(list 'open-input-file open-input-file)
|
||||||
(list 'open-output-file open-output-file)
|
(list 'open-output-file open-output-file)
|
||||||
|
(list 'open-binary-input-file open-binary-input-file)
|
||||||
|
(list 'open-binary-output-file open-binary-output-file)
|
||||||
(list 'close-port close-port)
|
(list 'close-port close-port)
|
||||||
(list 'close-input-port close-input-port)
|
(list 'close-input-port close-input-port)
|
||||||
(list 'close-output-port close-output-port)
|
(list 'close-output-port close-output-port)
|
||||||
|
|
Loading…
Add table
Reference in a new issue