diff --git a/include/picrin.h b/include/picrin.h index 8dcd87b5..a1428268 100644 --- a/include/picrin.h +++ b/include/picrin.h @@ -195,6 +195,7 @@ struct pic_lib *pic_find_library(pic_state *, pic_value); for ((prev_lib = pic->lib), pic_open_library(pic, pic_read_cstr(pic, spec)), pic_in_library(pic, pic_read_cstr(pic, spec)); ! i++; pic->lib = prev_lib) void pic_import(pic_state *, pic_value); +void pic_import_library(pic_state *, struct pic_lib *); void pic_export(pic_state *, pic_sym); noreturn void pic_abort(pic_state *, const char *); diff --git a/lib.c b/lib.c index 1a74221e..3d715907 100644 --- a/lib.c +++ b/lib.c @@ -190,6 +190,12 @@ pic_import(pic_state *pic, pic_value spec) import(pic, spec); } +void +pic_import_library(pic_state *pic, struct pic_lib *lib) +{ + import(pic, lib->name); +} + void pic_export(pic_state *pic, pic_sym sym) {