From ecedcc1ac0d1986c8a75fdf17e62930636c45b59 Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Tue, 16 Apr 2013 12:57:10 +0900 Subject: [PATCH] (enum COS_Object_Type): Add COS_Object_Type_Cons. (COS_OBJECT_CONS_P): New macro. (struct COS_Cons_ent): New structure. (COS_CAR): New macro. (COS_CDR): New macro. (cos_release_cons): New prototype. --- cos-i.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cos-i.h b/cos-i.h index 1468fd8..73450dc 100644 --- a/cos-i.h +++ b/cos-i.h @@ -101,6 +101,7 @@ enum COS_Object_Type { COS_Object_Type_char, COS_Object_Type_String, COS_Object_Type_Symbol, + COS_Object_Type_Cons, COS_Object_Type_Container, COS_Object_Type_Sexp, COS_Object_Type_Binary, @@ -154,6 +155,9 @@ COS_Object cos_allocate_object_0 (enum COS_Object_Type type, #define COS_OBJECT_SYMBOL_P(obj) \ COS_OBJECT_TYPE_P (obj, Symbol) +#define COS_OBJECT_CONS_P(obj) \ + COS_OBJECT_TYPE_P (obj, Cons) + #define COS_OBJECT_DS_P(obj) \ COS_OBJECT_TYPE_P (obj, DS) @@ -212,6 +216,22 @@ COS_Symbol cos_symbol_table_intern (COS_Symbol_Table table, COS_object name); +struct COS_Cons_ent +{ + COS_Object_Header header; + + COS_object car; + COS_object cdr; +}; + +#define COS_CAR(obj) \ + (((COS_Cons)(obj))->car) +#define COS_CDR(obj) \ + (((COS_Cons)(obj))->cdr) + +int cos_release_cons (COS_Object obj); + + struct COS_Container_ent { COS_Object_Header header; -- 1.7.10.4