From fe54b1315ba4fa5507d84c21df35d64c5cbd9f46 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Fri, 19 Feb 2016 13:58:45 +0900 Subject: [PATCH] pic_obj_alloc is not a public api --- extlib/benz/include/picrin.h | 9 ++++----- extlib/benz/include/picrin/object.h | 3 +++ extlib/benz/state.c | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/extlib/benz/include/picrin.h b/extlib/benz/include/picrin.h index 0a4ea451..03d5b6f0 100644 --- a/extlib/benz/include/picrin.h +++ b/extlib/benz/include/picrin.h @@ -196,8 +196,6 @@ struct pic_data *pic_data_value(pic_state *, void *ptr, const pic_data_type *typ #define pic_port_p(pic, v) (pic_type(pic, v) == PIC_TYPE_PORT) #define pic_sym_p(pic,v) (pic_type(pic,v) == PIC_TYPE_SYMBOL) -#include "picrin/type.h" - int pic_type(pic_state *, pic_value); const char *pic_typename(pic_state *, int); @@ -217,7 +215,7 @@ pic_value pic_cdar(pic_state *, pic_value); pic_value pic_cddr(pic_state *, pic_value); /* list */ -pic_value pic_nil_value(pic_state *); +PIC_INLINE pic_value pic_nil_value(pic_state *); bool pic_list_p(pic_state *, pic_value); pic_value pic_make_list(pic_state *, int n, pic_value *argv); pic_value pic_list(pic_state *, int n, ...); @@ -266,8 +264,11 @@ struct pic_string *pic_str_sub(pic_state *, struct pic_string *, int, int); int pic_str_cmp(pic_state *, struct pic_string *, struct pic_string *); int pic_str_hash(pic_state *, struct pic_string *); + /* extra stuff */ + +#include "picrin/type.h" #include "picrin/state.h" #include "picrin/cont.h" @@ -280,8 +281,6 @@ void *pic_default_allocf(void *, void *, size_t); pic_errorf(pic, "expected " #type ", but got ~s", v); \ } -struct pic_object *pic_obj_alloc(pic_state *, size_t, int type); - struct pic_port *pic_make_port(pic_state *, xFILE *file); void pic_close_port(pic_state *, struct pic_port *port); diff --git a/extlib/benz/include/picrin/object.h b/extlib/benz/include/picrin/object.h index a15b1def..c4762df4 100644 --- a/extlib/benz/include/picrin/object.h +++ b/extlib/benz/include/picrin/object.h @@ -10,6 +10,9 @@ extern "C" { #endif +struct pic_object *pic_obj_alloc(pic_state *, size_t, int type); + + /* symbol & identifier */ struct pic_id { diff --git a/extlib/benz/state.c b/extlib/benz/state.c index 1cd7c969..d8dc6378 100644 --- a/extlib/benz/state.c +++ b/extlib/benz/state.c @@ -3,6 +3,7 @@ */ #include "picrin.h" +#include "picrin/object.h" static void pic_init_features(pic_state *pic)