diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2025-01-21 07:24:17 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2025-01-21 07:24:17 -0800 |
commit | 6824735d879f42572778b40c323828f533b87248 (patch) | |
tree | b135841d76b1854936138e348355ae8f93001ee1 /autoload.c | |
parent | 519b05f5281572ef9f6f686844af25159ca5896e (diff) | |
download | txr-6824735d879f42572778b40c323828f533b87248.tar.gz txr-6824735d879f42572778b40c323828f533b87248.tar.bz2 txr-6824735d879f42572778b40c323828f533b87248.zip |
New function: get-csv.
* autloload.c (csv_set_entries, csv_instantiate): New
static funtions.
(autoload_init): Register autoload of stdlib/csv
module via new functions.
* stdlib/csv.tl: New file.
* tests/010/csv.tl: Likewise.
* txr.1: Documented.
Diffstat (limited to 'autoload.c')
-rw-r--r-- | autoload.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -1020,6 +1020,22 @@ static val enum_instantiate(void) return nil; } +static val csv_set_entries(val fun) +{ + val name[] = { + lit("get-csv"), + nil + }; + autoload_set(al_fun, name, fun); + return nil; +} + +static val csv_instantiate(void) +{ + load(scat2(stdlib_path, lit("csv"))); + return nil; +} + val autoload_reg(val (*instantiate)(void), val (*set_entries)(val)) { @@ -1092,6 +1108,7 @@ void autoload_init(void) autoload_reg(csort_instantiate, csort_set_entries); autoload_reg(glob_instantiate, glob_set_entries); autoload_reg(enum_instantiate, enum_set_entries); + autoload_reg(csv_instantiate, csv_set_entries); reg_fun(intern(lit("autoload-try-fun"), system_package), func_n1(autoload_try_fun)); } |