Merge pull request #10 from gunyarakun/fix-invalid-return
[cocotron.git] / objc / objc-class.h
blob4c2fbedf60f5f0d2f1ee8f3bc1f474d5971604d4
1 /* Copyright (c) 2007 Christopher J. W. Lloyd
3 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
9 #import <objc/objc-export.h>
10 #import <objc/objc.h>
11 #import <stdint.h>
13 enum {
14 _C_ID = '@',
15 _C_CHR = 'c',
16 _C_UCHR = 'C',
17 _C_INT = 'i',
18 _C_UINT = 'I',
19 _C_FLT = 'f',
20 _C_DBL = 'd',
21 _C_VOID = 'v',
22 _C_UNDEF = '?',
23 _C_CLASS = '#',
24 _C_SEL = ':',
25 _C_CHARPTR = '*',
26 _C_SHT = 's',
27 _C_USHT = 'S',
28 _C_LNG = 'l',
29 _C_ULNG = 'L',
30 _C_LNGLNG = 'q',
31 _C_LNG_LNG = _C_LNGLNG,
32 _C_ULNGLNG = 'Q',
33 _C_ULNG_LNG = _C_ULNGLNG,
34 _C_BFLD = 'b',
35 _C_ARY_B = '[',
36 _C_STRUCT_B = '{',
37 _C_UNION_B = '(',
38 _C_ARY_E = ']',
39 _C_STRUCT_E = '}',
40 _C_UNION_E = ')',
41 _C_PTR = '^',
42 _C_CONST = 'r',
43 _C_IN = 'n',
44 _C_INOUT = 'N',
45 _C_OUT = 'o',
46 _C_BYCOPY = 'R',
47 _C_ONEWAY = 'V',
50 struct objc_ivar {
51 char *ivar_name;
52 char *ivar_type;
53 int ivar_offset;
56 struct objc_ivar_list {
57 int ivar_count;
58 struct objc_ivar ivar_list[1];
61 struct objc_method {
62 SEL method_name;
63 char *method_types;
64 IMP method_imp;
67 struct objc_method_description {
68 SEL name;
69 char *types;
72 struct objc_method_list {
73 struct objc_method_list *obsolete;
74 int method_count;
75 struct objc_method method_list[1];
78 struct objc_protocol {
79 Class isa;
80 const char *nameCString;
81 struct objc_protocol_list *childProtocols;
82 struct OBJCMethodDescriptionList *instanceMethods;
83 struct OBJCMethodDescriptionList *classMethods;
86 #ifdef __OBJC__
87 @class Protocol;
88 #else
89 typedef struct objc_protocol Protocol;
90 #endif
92 struct objc_protocol_list {
93 struct objc_protocol_list *next;
94 int count;
95 Protocol *list[1];
98 struct objc_category {
99 const char *name;
100 const char *className;
101 struct objc_method_list *instanceMethods;
102 struct objc_method_list *classMethods;
103 struct objc_protocol_list *protocols;
106 struct objc_property {
107 const char *const name;
108 const char *const attributes;
111 struct objc_prop_list_t {
112 uint32_t size;
113 uint32_t prop_count;
114 struct objc_property prop_list[1];
117 struct objc_class_extension {
118 uint32_t size;
119 const char *weak_ivar_layout;
120 struct objc_prop_list_t *properties;
123 struct objc_class {
124 struct objc_class *isa;
125 struct objc_class *super_class;
126 const char *name;
127 long version;
128 long info;
129 long instance_size;
130 struct objc_ivar_list *ivars;
131 struct objc_method_list **methodLists;
132 struct objc_cache *cache;
133 struct objc_protocol_list *protocols;
134 const char *ivar_layout;
135 struct objc_class_extension *ext;