Add write_simple_defaults() helper

This commit is contained in:
Lassi Kortela 2019-10-14 00:42:04 +03:00
parent f1248a3b5e
commit 874ffe9007
4 changed files with 12 additions and 3 deletions

View File

@ -15,7 +15,6 @@
#define BOOT_ENV_R7RS 1 #define BOOT_ENV_R7RS 1
#define BOOT_ENV_UNSTABLE 2 #define BOOT_ENV_UNSTABLE 2
extern void write_defaults_indent(struct ios *f, value_t v);
static value_t argv_list(int argc, char *argv[]) static value_t argv_list(int argc, char *argv[])
{ {

View File

@ -913,6 +913,14 @@ void display_defaults(struct ios *f, value_t v)
print_with_options(f, v, &opts); print_with_options(f, v, &opts);
} }
void write_simple_defaults(struct ios *f, value_t v)
{
struct printer_options opts;
memset(&opts, 0, sizeof(opts));
print_with_options(f, v, &opts);
}
void write_defaults_indent(struct ios *f, value_t v) void write_defaults_indent(struct ios *f, value_t v)
{ {
struct printer_options opts; struct printer_options opts;

View File

@ -715,6 +715,10 @@ value_t fl_toplevel_eval(value_t expr);
value_t fl_apply(value_t f, value_t l); value_t fl_apply(value_t f, value_t l);
value_t fl_applyn(uint32_t n, value_t f, ...); value_t fl_applyn(uint32_t n, value_t f, ...);
void display_defaults(struct ios *f, value_t v);
void write_simple_defaults(struct ios *f, value_t v);
void write_defaults_indent(struct ios *f, value_t v);
extern value_t printprettysym, printreadablysym, printwidthsym; extern value_t printprettysym, printreadablysym, printwidthsym;
// object model manipulation // object model manipulation

View File

@ -19,8 +19,6 @@
#include "scheme.h" #include "scheme.h"
extern void display_defaults(struct ios *f, value_t v);
value_t fl_stringp(value_t *args, uint32_t nargs) value_t fl_stringp(value_t *args, uint32_t nargs)
{ {
argcount("string?", nargs, 1); argcount("string?", nargs, 1);