diff --git a/extlib/benz/include/picrin.h b/extlib/benz/include/picrin.h index 5f0c58f0..d0efcc9b 100644 --- a/extlib/benz/include/picrin.h +++ b/extlib/benz/include/picrin.h @@ -264,7 +264,6 @@ int pic_str_hash(pic_state *, struct pic_string *); #include "picrin/macro.h" #include "picrin/pair.h" #include "picrin/port.h" -#include "picrin/record.h" #include "picrin/symbol.h" void *pic_default_allocf(void *, void *, size_t); diff --git a/extlib/benz/include/picrin/blob.h b/extlib/benz/include/picrin/blob.h deleted file mode 100644 index 24ca9e2c..00000000 --- a/extlib/benz/include/picrin/blob.h +++ /dev/null @@ -1,16 +0,0 @@ -/** - * See Copyright Notice in picrin.h - */ - -#ifndef PICRIN_BLOB_H -#define PICRIN_BLOB_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#if defined(__cplusplus) -} -#endif - -#endif diff --git a/extlib/benz/include/picrin/object.h b/extlib/benz/include/picrin/object.h index 63473828..831b2c9b 100644 --- a/extlib/benz/include/picrin/object.h +++ b/extlib/benz/include/picrin/object.h @@ -122,6 +122,21 @@ struct pic_proc { struct pic_proc *pic_make_proc(pic_state *, pic_func_t, int, pic_value *); struct pic_proc *pic_make_proc_irep(pic_state *, struct pic_irep *, struct pic_context *); + +/* record */ + +struct pic_record { + PIC_OBJECT_HEADER + pic_value type; + pic_value datum; +}; + +#define pic_rec_p(pic, v) (pic_type(pic, v) == PIC_TYPE_RECORD) +#define pic_rec_ptr(v) ((struct pic_record *)pic_obj_ptr(v)) + +struct pic_record *pic_make_rec(pic_state *, pic_value, pic_value); + + #if defined(__cplusplus) } #endif diff --git a/extlib/benz/include/picrin/record.h b/extlib/benz/include/picrin/record.h deleted file mode 100644 index 0549fa90..00000000 --- a/extlib/benz/include/picrin/record.h +++ /dev/null @@ -1,30 +0,0 @@ -/** - * See Copyright Notice in picrin.h - */ - -#ifndef PICRIN_RECORD_H -#define PICRIN_RECORD_H - -#if defined(__cplusplus) -extern "C" { -#endif - -struct pic_record { - PIC_OBJECT_HEADER - pic_value type; - pic_value datum; -}; - -#define pic_rec_p(pic, v) (pic_type(pic, v) == PIC_TYPE_RECORD) -#define pic_rec_ptr(v) ((struct pic_record *)pic_obj_ptr(v)) - -struct pic_record *pic_make_rec(pic_state *, pic_value, pic_value); - -pic_value pic_rec_type(pic_state *, struct pic_record *); -pic_value pic_rec_datum(pic_state *, struct pic_record *); - -#if defined(__cplusplus) -} -#endif - -#endif diff --git a/extlib/benz/include/picrin/string.h b/extlib/benz/include/picrin/string.h deleted file mode 100644 index ac5d2ce8..00000000 --- a/extlib/benz/include/picrin/string.h +++ /dev/null @@ -1,16 +0,0 @@ -/** - * See Copyright Notice in picrin.h - */ - -#ifndef PICRIN_STRING_H -#define PICRIN_STRING_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#if defined(__cplusplus) -} -#endif - -#endif diff --git a/extlib/benz/record.c b/extlib/benz/record.c index c338989a..82d58fd8 100644 --- a/extlib/benz/record.c +++ b/extlib/benz/record.c @@ -3,6 +3,7 @@ */ #include "picrin.h" +#include "picrin/object.h" struct pic_record * pic_make_rec(pic_state *pic, pic_value type, pic_value datum) @@ -16,18 +17,6 @@ pic_make_rec(pic_state *pic, pic_value type, pic_value datum) return rec; } -pic_value -pic_rec_type(pic_state PIC_UNUSED(*pic), struct pic_record *rec) -{ - return rec->type; -} - -pic_value -pic_rec_datum(pic_state PIC_UNUSED(*pic), struct pic_record *rec) -{ - return rec->datum; -} - static pic_value pic_rec_make_record(pic_state *pic) { @@ -55,7 +44,7 @@ pic_rec_record_type(pic_state *pic) pic_get_args(pic, "r", &rec); - return pic_rec_type(pic, rec); + return rec->type; } static pic_value @@ -65,7 +54,7 @@ pic_rec_record_datum(pic_state *pic) pic_get_args(pic, "r", &rec); - return pic_rec_datum(pic, rec); + return rec->datum; } void