X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fconcord.git;a=blobdiff_plain;f=cos.h;h=475e355ddc4d413ded272fb1056c20e367f26fed;hp=dfd96799d747d8b27f275e9ba0c86cc8336b7213;hb=e99e93e4773c5f3472b088db2659f7a848cbcc21;hpb=3568b4b3840dc6e7968c0949b16507b250a0365f diff --git a/cos.h b/cos.h index dfd9679..475e355 100644 --- a/cos.h +++ b/cos.h @@ -28,6 +28,9 @@ extern "C" { } #endif +#include + + typedef void* COS_object; typedef struct COS_Object_ent COS_Object_ent; @@ -40,13 +43,13 @@ int cos_release_object (COS_object obj); typedef intptr_t COS_C_Int; COS_object cos_make_int (COS_C_Int num); -COS_C_Int cos_int_value (COS_object obj); int cos_int_p (COS_object obj); +COS_C_Int cos_int_value (COS_object obj); COS_object cos_make_char (int code); -int cos_char_id (COS_object obj); int cos_char_p (COS_object obj); +int cos_char_id (COS_object obj); typedef struct COS_String_ent COS_String_ent; @@ -55,6 +58,8 @@ typedef struct COS_String_ent* COS_String; COS_String cos_make_string (char* str, size_t size); COS_String cos_build_string (char* str); +int cos_string_p (COS_object obj); + size_t cos_string_size (COS_String string); char* cos_string_data (COS_String string); @@ -64,8 +69,30 @@ typedef struct COS_Symbol_ent* COS_Symbol; COS_Symbol cos_intern (COS_object name); +int cos_symbol_p (COS_object obj); + COS_String cos_symbol_name (COS_Symbol symbol); +extern COS_Symbol cos_Qnil; +extern COS_Symbol cos_Qt; +extern COS_Symbol cos_Qcomposition; + +#define COS_NIL cos_Qnil +#define COS_T cos_Qt +#define COS_COMPOSITION cos_Qcomposition + + +typedef struct COS_Cons_ent COS_Cons_ent; +typedef struct COS_Cons_ent* COS_Cons; + +COS_Cons cos_cons (COS_object car, COS_object cdr); +int cos_cons_p (COS_object obj); +COS_object cos_car (COS_Cons pair); +COS_object cos_cdr (COS_Cons pair); + +COS_Cons cos_assoc (COS_object key, COS_Cons alist); +COS_object cos_alist_get (COS_Cons alist, COS_object key); + typedef struct COS_Container_ent COS_Container_ent; typedef struct COS_Container_ent* COS_Container; @@ -78,6 +105,9 @@ typedef struct COS_Sexp_ent* COS_Sexp; typedef struct COS_Binary_ent COS_Binary_ent; typedef struct COS_Binary_ent* COS_Binary; + +void cos_print_object (COS_object obj); + #if 0 { #endif