From 0fe6e3dc7bb843e45a90be516a7d2dd5cbabbc2b Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sun, 14 Sep 2014 18:14:23 +0900 Subject: [PATCH] add pic_import_library --- include/picrin.h | 1 + lib.c | 6 ++++++ 2 files changed, 7 insertions(+) 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) {