update.
[chise/concord.git] / cos.h
1 /* Types and functions of CONCORD Object System
2
3    Copyright (C) 2013 MORIOKA Tomohiko
4    This file is part of the CONCORD Library.
5
6    The CONCORD Library is free software; you can redistribute it and/or
7    modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
10
11    The CONCORD Library is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15
16    You should have received a copy of the GNU Lesser General Public
17    License along with the CONCORD Library; if not, write to the Free
18    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19    02111-1307 USA.  */
20
21 #ifndef _COS_H
22 #define _COS_H
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 #if 0
28 }
29 #endif
30
31 typedef void* COS_object;
32
33 typedef struct COS_Object_ent COS_Object_ent;
34 typedef COS_Object_ent* COS_Object;
35
36 COS_Object cos_retain_object (COS_Object obj);
37 int cos_release_object (COS_object obj);
38
39
40 typedef intptr_t COS_C_Int;
41
42 COS_object cos_make_int (COS_C_Int num);
43 COS_C_Int cos_int_value (COS_object obj);
44 int cos_int_p (COS_object obj);
45
46
47 COS_object cos_make_char (int code);
48 int cos_char_id (COS_object obj);
49 int cos_char_p (COS_object obj);
50
51
52 typedef struct COS_String_ent COS_String_ent;
53 typedef struct COS_String_ent* COS_String;
54
55 COS_String cos_make_string (char* str, size_t size);
56 COS_String cos_build_string (char* str);
57
58 size_t cos_string_size (COS_String string);
59 char* cos_string_data (COS_String string);
60
61
62 typedef struct COS_Symbol_ent COS_Symbol_ent;
63 typedef struct COS_Symbol_ent* COS_Symbol;
64
65 COS_Symbol cos_intern (COS_object name);
66
67 COS_String cos_symbol_name (COS_Symbol symbol);
68
69
70 typedef struct COS_Container_ent COS_Container_ent;
71 typedef struct COS_Container_ent* COS_Container;
72
73
74 typedef struct COS_Sexp_ent COS_Sexp_ent;
75 typedef struct COS_Sexp_ent* COS_Sexp;
76
77
78 typedef struct COS_Binary_ent COS_Binary_ent;
79 typedef struct COS_Binary_ent* COS_Binary;
80
81 #if 0
82 {
83 #endif
84 #ifdef __cplusplus
85 }
86 #endif
87
88 #endif /* !_COS_H */