From 9b7eb2f9966bfc602133ebb52305485f8b2f23ea Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Thu, 28 May 2015 23:57:10 +0900 Subject: [PATCH] unify all headers into picrin.h --- contrib/03.callcc/callcc.c | 4 ---- contrib/03.file/src/file.c | 2 -- contrib/03.load/src/load.c | 3 --- contrib/03.mutable-string/mutable-string.c | 1 - contrib/03.system/src/system.c | 3 --- contrib/10.readline/src/readline.c | 3 --- contrib/10.regexp/src/regexp.c | 4 ---- docs/capi.rst | 1 - etc/mkloader.pl | 1 - extlib/benz/attr.c | 1 - extlib/benz/blob.c | 2 -- extlib/benz/bool.c | 4 ---- extlib/benz/codegen.c | 7 ------- extlib/benz/cont.c | 5 ----- extlib/benz/data.c | 1 - extlib/benz/debug.c | 3 --- extlib/benz/dict.c | 5 ----- extlib/benz/error.c | 7 ------- extlib/benz/eval.c | 1 - extlib/benz/gc.c | 17 ----------------- extlib/benz/include/picrin.h | 20 +++++++++++++++++++- extlib/benz/include/picrin/error.h | 2 -- extlib/benz/lib.c | 8 -------- extlib/benz/load.c | 2 -- extlib/benz/macro.c | 9 --------- extlib/benz/number.c | 3 --- extlib/benz/pair.c | 1 - extlib/benz/port.c | 5 ----- extlib/benz/proc.c | 3 --- extlib/benz/read.c | 9 --------- extlib/benz/record.c | 2 -- extlib/benz/state.c | 10 ---------- extlib/benz/string.c | 4 ---- extlib/benz/symbol.c | 2 -- extlib/benz/var.c | 2 -- extlib/benz/vector.c | 3 --- extlib/benz/vm.c | 13 ------------- extlib/benz/write.c | 9 --------- src/main.c | 2 -- 39 files changed, 19 insertions(+), 165 deletions(-) diff --git a/contrib/03.callcc/callcc.c b/contrib/03.callcc/callcc.c index 09746077..e6750347 100644 --- a/contrib/03.callcc/callcc.c +++ b/contrib/03.callcc/callcc.c @@ -1,8 +1,4 @@ #include "picrin.h" -#include "picrin/data.h" -#include "picrin/proc.h" -#include "picrin/pair.h" -#include "picrin/cont.h" struct pic_cont { jmp_buf jmp; diff --git a/contrib/03.file/src/file.c b/contrib/03.file/src/file.c index 8efd2a77..f0410f9d 100644 --- a/contrib/03.file/src/file.c +++ b/contrib/03.file/src/file.c @@ -3,8 +3,6 @@ */ #include "picrin.h" -#include "picrin/port.h" -#include "picrin/error.h" PIC_NORETURN static void file_error(pic_state *pic, const char *msg) diff --git a/contrib/03.load/src/load.c b/contrib/03.load/src/load.c index 93f832c6..5efb71c7 100644 --- a/contrib/03.load/src/load.c +++ b/contrib/03.load/src/load.c @@ -3,9 +3,6 @@ */ #include "picrin.h" -#include "picrin/pair.h" -#include "picrin/port.h" -#include "picrin/error.h" void pic_load(pic_state *pic, const char *filename) diff --git a/contrib/03.mutable-string/mutable-string.c b/contrib/03.mutable-string/mutable-string.c index 43679a29..6937b0f6 100644 --- a/contrib/03.mutable-string/mutable-string.c +++ b/contrib/03.mutable-string/mutable-string.c @@ -1,5 +1,4 @@ #include "picrin.h" -#include "picrin/string.h" void pic_str_set(pic_state *pic, pic_str *str, size_t i, char c) diff --git a/contrib/03.system/src/system.c b/contrib/03.system/src/system.c index 5ead4d9c..3265d876 100644 --- a/contrib/03.system/src/system.c +++ b/contrib/03.system/src/system.c @@ -5,9 +5,6 @@ #include #include "picrin.h" -#include "picrin/string.h" -#include "picrin/pair.h" -#include "picrin/cont.h" static pic_value pic_system_cmdline(pic_state *pic) diff --git a/contrib/10.readline/src/readline.c b/contrib/10.readline/src/readline.c index b516cb6c..fe831ddd 100644 --- a/contrib/10.readline/src/readline.c +++ b/contrib/10.readline/src/readline.c @@ -6,9 +6,6 @@ forget to use the C++ extern "C" to get it to compile. */ #include "picrin.h" -#include "picrin/pair.h" -#include "picrin/string.h" -#include "picrin/port.h" #if PIC_READLINE_INCLUDE_DIR_SUFFIX == readline #include diff --git a/contrib/10.regexp/src/regexp.c b/contrib/10.regexp/src/regexp.c index 3a358fab..ce54d65e 100644 --- a/contrib/10.regexp/src/regexp.c +++ b/contrib/10.regexp/src/regexp.c @@ -1,8 +1,4 @@ #include "picrin.h" -#include "picrin/data.h" -#include "picrin/pair.h" -#include "picrin/string.h" -#include "picrin/cont.h" #include diff --git a/docs/capi.rst b/docs/capi.rst index c4464114..a2c31320 100644 --- a/docs/capi.rst +++ b/docs/capi.rst @@ -51,7 +51,6 @@ When you use dynamic memory allocation inside C APIs, you must be caseful about /** foo.c **/ #include #include "picrin.h" - #include "picrin/data.h" /* * C-side API diff --git a/etc/mkloader.pl b/etc/mkloader.pl index 984f4709..3f5bcb41 100755 --- a/etc/mkloader.pl +++ b/etc/mkloader.pl @@ -12,7 +12,6 @@ print <xSTDERR->file) # define pic_fdebug(pic,obj,file) pic_fwrite(pic,obj,file) #endif +#include "picrin/blob.h" +#include "picrin/cont.h" +#include "picrin/data.h" +#include "picrin/dict.h" +#include "picrin/error.h" +#include "picrin/gc.h" +#include "picrin/irep.h" +#include "picrin/lib.h" +#include "picrin/macro.h" +#include "picrin/pair.h" +#include "picrin/port.h" +#include "picrin/proc.h" +#include "picrin/read.h" +#include "picrin/record.h" +#include "picrin/string.h" +#include "picrin/symbol.h" +#include "picrin/read.h" +#include "picrin/vector.h" + #if defined(__cplusplus) } #endif diff --git a/extlib/benz/include/picrin/error.h b/extlib/benz/include/picrin/error.h index efb12130..ddf14e85 100644 --- a/extlib/benz/include/picrin/error.h +++ b/extlib/benz/include/picrin/error.h @@ -9,8 +9,6 @@ extern "C" { #endif -#include "picrin/cont.h" - struct pic_error { PIC_OBJECT_HEADER pic_sym *type; diff --git a/extlib/benz/lib.c b/extlib/benz/lib.c index 30362ef2..5e364af0 100644 --- a/extlib/benz/lib.c +++ b/extlib/benz/lib.c @@ -3,14 +3,6 @@ */ #include "picrin.h" -#include "picrin/lib.h" -#include "picrin/pair.h" -#include "picrin/macro.h" -#include "picrin/error.h" -#include "picrin/string.h" -#include "picrin/proc.h" -#include "picrin/dict.h" -#include "picrin/symbol.h" struct pic_lib * pic_open_library(pic_state *pic, pic_value name) diff --git a/extlib/benz/load.c b/extlib/benz/load.c index a6f2eb8d..53220101 100644 --- a/extlib/benz/load.c +++ b/extlib/benz/load.c @@ -3,8 +3,6 @@ */ #include "picrin.h" -#include "picrin/port.h" -#include "picrin/error.h" void pic_load_port(pic_state *pic, struct pic_port *port) diff --git a/extlib/benz/macro.c b/extlib/benz/macro.c index f934cdd3..219c225d 100644 --- a/extlib/benz/macro.c +++ b/extlib/benz/macro.c @@ -3,15 +3,6 @@ */ #include "picrin.h" -#include "picrin/pair.h" -#include "picrin/string.h" -#include "picrin/proc.h" -#include "picrin/macro.h" -#include "picrin/lib.h" -#include "picrin/error.h" -#include "picrin/dict.h" -#include "picrin/cont.h" -#include "picrin/symbol.h" pic_sym * pic_add_rename(pic_state *pic, struct pic_senv *senv, pic_sym *sym) diff --git a/extlib/benz/number.c b/extlib/benz/number.c index 928ba50e..1f02ca0c 100644 --- a/extlib/benz/number.c +++ b/extlib/benz/number.c @@ -3,9 +3,6 @@ */ #include "picrin.h" -#include "picrin/string.h" -#include "picrin/cont.h" -#include "picrin/port.h" #if ! PIC_ENABLE_FLOAT static pic_value diff --git a/extlib/benz/pair.c b/extlib/benz/pair.c index 36400af2..17da2394 100644 --- a/extlib/benz/pair.c +++ b/extlib/benz/pair.c @@ -3,7 +3,6 @@ */ #include "picrin.h" -#include "picrin/pair.h" pic_value pic_cons(pic_state *pic, pic_value car, pic_value cdr) diff --git a/extlib/benz/port.c b/extlib/benz/port.c index 20879173..58bd0826 100644 --- a/extlib/benz/port.c +++ b/extlib/benz/port.c @@ -3,11 +3,6 @@ */ #include "picrin.h" -#include "picrin/proc.h" -#include "picrin/port.h" -#include "picrin/string.h" -#include "picrin/blob.h" -#include "picrin/error.h" pic_value pic_eof_object() diff --git a/extlib/benz/proc.c b/extlib/benz/proc.c index b1a9a795..2f7d2d11 100644 --- a/extlib/benz/proc.c +++ b/extlib/benz/proc.c @@ -3,9 +3,6 @@ */ #include "picrin.h" -#include "picrin/pair.h" -#include "picrin/proc.h" -#include "picrin/irep.h" struct pic_proc * pic_make_proc(pic_state *pic, pic_func_t func, const char *name) diff --git a/extlib/benz/read.c b/extlib/benz/read.c index ce60a995..c8cf6d70 100644 --- a/extlib/benz/read.c +++ b/extlib/benz/read.c @@ -3,15 +3,6 @@ */ #include "picrin.h" -#include "picrin/read.h" -#include "picrin/error.h" -#include "picrin/pair.h" -#include "picrin/string.h" -#include "picrin/vector.h" -#include "picrin/blob.h" -#include "picrin/port.h" -#include "picrin/proc.h" -#include "picrin/symbol.h" static pic_value read(pic_state *pic, struct pic_port *port, int c); static pic_value read_nullable(pic_state *pic, struct pic_port *port, int c); diff --git a/extlib/benz/record.c b/extlib/benz/record.c index 2a6e85cc..dc35e223 100644 --- a/extlib/benz/record.c +++ b/extlib/benz/record.c @@ -3,8 +3,6 @@ */ #include "picrin.h" -#include "picrin/record.h" -#include "picrin/dict.h" struct pic_record * pic_make_record(pic_state *pic, pic_value rectype) diff --git a/extlib/benz/state.c b/extlib/benz/state.c index 571c5155..c4207987 100644 --- a/extlib/benz/state.c +++ b/extlib/benz/state.c @@ -3,16 +3,6 @@ */ #include "picrin.h" -#include "picrin/gc.h" -#include "picrin/read.h" -#include "picrin/proc.h" -#include "picrin/macro.h" -#include "picrin/cont.h" -#include "picrin/port.h" -#include "picrin/error.h" -#include "picrin/dict.h" -#include "picrin/pair.h" -#include "picrin/lib.h" void pic_add_feature(pic_state *pic, const char *feature) diff --git a/extlib/benz/string.c b/extlib/benz/string.c index 95a32210..ee1f3527 100644 --- a/extlib/benz/string.c +++ b/extlib/benz/string.c @@ -3,10 +3,6 @@ */ #include "picrin.h" -#include "picrin/string.h" -#include "picrin/pair.h" -#include "picrin/port.h" -#include "picrin/error.h" struct pic_chunk { char *str; diff --git a/extlib/benz/symbol.c b/extlib/benz/symbol.c index 219ee25a..008c52b2 100644 --- a/extlib/benz/symbol.c +++ b/extlib/benz/symbol.c @@ -3,8 +3,6 @@ */ #include "picrin.h" -#include "picrin/symbol.h" -#include "picrin/string.h" pic_sym * pic_make_symbol(pic_state *pic, pic_str *str) diff --git a/extlib/benz/var.c b/extlib/benz/var.c index 7eb4e08a..e1b7ff06 100644 --- a/extlib/benz/var.c +++ b/extlib/benz/var.c @@ -3,8 +3,6 @@ */ #include "picrin.h" -#include "picrin/pair.h" -#include "picrin/proc.h" static pic_value var_lookup(pic_state *pic, pic_value var) diff --git a/extlib/benz/vector.c b/extlib/benz/vector.c index 46b02616..08d2f72a 100644 --- a/extlib/benz/vector.c +++ b/extlib/benz/vector.c @@ -3,9 +3,6 @@ */ #include "picrin.h" -#include "picrin/vector.h" -#include "picrin/string.h" -#include "picrin/pair.h" struct pic_vector * pic_make_vec(pic_state *pic, size_t len) diff --git a/extlib/benz/vm.c b/extlib/benz/vm.c index fa07c6d2..c6cb42b1 100644 --- a/extlib/benz/vm.c +++ b/extlib/benz/vm.c @@ -3,19 +3,6 @@ */ #include "picrin.h" -#include "picrin/pair.h" -#include "picrin/string.h" -#include "picrin/vector.h" -#include "picrin/proc.h" -#include "picrin/port.h" -#include "picrin/irep.h" -#include "picrin/blob.h" -#include "picrin/lib.h" -#include "picrin/macro.h" -#include "picrin/error.h" -#include "picrin/dict.h" -#include "picrin/record.h" -#include "picrin/symbol.h" #define GET_OPERAND(pic,n) ((pic)->ci->fp[(n)]) diff --git a/extlib/benz/write.c b/extlib/benz/write.c index c9e36553..d2c2a807 100644 --- a/extlib/benz/write.c +++ b/extlib/benz/write.c @@ -3,15 +3,6 @@ */ #include "picrin.h" -#include "picrin/port.h" -#include "picrin/pair.h" -#include "picrin/string.h" -#include "picrin/vector.h" -#include "picrin/blob.h" -#include "picrin/dict.h" -#include "picrin/record.h" -#include "picrin/proc.h" -#include "picrin/symbol.h" static bool is_tagged(pic_state *pic, pic_sym *tag, pic_value pair) diff --git a/src/main.c b/src/main.c index 5c70fd7f..fbdae10c 100644 --- a/src/main.c +++ b/src/main.c @@ -3,8 +3,6 @@ */ #include "picrin.h" -#include "picrin/pair.h" -#include "picrin/error.h" void pic_init_contrib(pic_state *); void pic_load_piclib(pic_state *);