Differences From Artifact [9b214e845e]:
- File src/runtime/ObjFW_RT.h — part of check-in [0509d7a844] at 2019-01-03 19:13:03 on branch trunk — Update copyright (user: js, size: 10630) [annotate] [blame] [check-ins using]
To Artifact [eecb74dd6c]:
- File
src/runtime/ObjFW_RT.h
— part of check-in
[ef6d69931e]
at
2019-02-07 00:46:41
on branch trunk
— Make style consistent between ObjFW and ObjFW_RT
ObjFW_RT used to be a separate project that followed the BSD style, as
it was written in pure C, while ObjFW's style is based on the BSD style
with changes to make it a better fit for Objective-C. This commit
changes ObjFW_RT to use the same style as ObjFW. (user: js, size: 10824) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
70 71 72 73 74 75 76 | struct objc_class { Class _Nonnull isa; Class _Nullable superclass; const char *_Nonnull name; unsigned long version; unsigned long info; | | | | | | | | | | | | | | | | | | | | | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | struct objc_class { Class _Nonnull isa; Class _Nullable superclass; const char *_Nonnull name; unsigned long version; unsigned long info; long instanceSize; struct objc_ivar_list *_Nullable iVars; struct objc_method_list *_Nullable methodList; struct objc_dtable *_Nonnull DTable; Class _Nullable *_Nullable subclassList; void *_Nullable siblingClass; struct objc_protocol_list *_Nullable protocols; void *_Nullable GCObjectType; unsigned long ABIVersion; int32_t *_Nonnull *_Nullable iVarOffsets; struct objc_property_list *_Nullable properties; }; enum objc_class_info { OBJC_CLASS_INFO_CLASS = 0x001, OBJC_CLASS_INFO_METACLASS = 0x002, OBJC_CLASS_INFO_NEW_ABI = 0x010, OBJC_CLASS_INFO_SETUP = 0x100, OBJC_CLASS_INFO_LOADED = 0x200, OBJC_CLASS_INFO_DTABLE = 0x400, OBJC_CLASS_INFO_INITIALIZED = 0x800 }; struct objc_object { Class _Nonnull isa; }; struct objc_selector { uintptr_t UID; const char *_Nullable typeEncoding; }; struct objc_super { id __unsafe_unretained _Nullable self; Class _Nonnull cls; }; struct objc_method { struct objc_selector selector; IMP _Nonnull implementation; }; struct objc_method_list { struct objc_method_list *_Nullable next; unsigned int count; struct objc_method methods[1]; }; struct objc_category { const char *_Nonnull categoryName; const char *_Nonnull className; struct objc_method_list *_Nullable instanceMethods; struct objc_method_list *_Nullable classMethods; struct objc_protocol_list *_Nullable protocols; }; struct objc_ivar { const char *_Nonnull name; const char *_Nonnull typeEncoding; unsigned int offset; }; struct objc_ivar_list { unsigned int count; struct objc_ivar iVars[1]; }; enum objc_property_attributes { OBJC_PROPERTY_READONLY = 0x01, OBJC_PROPERTY_GETTER = 0x02, OBJC_PROPERTY_ASSIGN = 0x04, OBJC_PROPERTY_READWRITE = 0x08, |
︙ | ︙ | |||
160 161 162 163 164 165 166 | OBJC_PROPERTY_WEAK = 0x8, OBJC_PROPERTY_STRONG = 0x10, OBJC_PROPERTY_UNSAFE_UNRETAINED = 0x20 }; struct objc_property { const char *_Nonnull name; | | | | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | OBJC_PROPERTY_WEAK = 0x8, OBJC_PROPERTY_STRONG = 0x10, OBJC_PROPERTY_UNSAFE_UNRETAINED = 0x20 }; struct objc_property { const char *_Nonnull name; unsigned char attributes, extendedAttributes; struct { const char *_Nullable name; const char *_Nullable typeEncoding; } getter, setter; }; struct objc_property_list { unsigned int count; struct objc_property_list *_Nullable next; struct objc_property properties[1]; |
︙ | ︙ | |||
185 186 187 188 189 190 191 | { @public #else typedef struct { #endif Class _Nonnull isa; const char *_Nonnull name; | | | | | | | | | > | > | > | | | | | | > | | | > | | | | | | | | 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | { @public #else typedef struct { #endif Class _Nonnull isa; const char *_Nonnull name; struct objc_protocol_list *_Nullable protocolList; struct objc_abi_method_description_list *_Nullable instanceMethods; struct objc_abi_method_description_list *_Nullable classMethods; #ifdef __OBJC__ } @end #else } Protocol; #endif struct objc_protocol_list { struct objc_protocol_list *_Nullable next; long count; Protocol *__unsafe_unretained _Nonnull list[1]; }; #ifdef __cplusplus extern "C" { #endif extern SEL _Nonnull sel_registerName(const char *_Nonnull name); extern const char *_Nonnull sel_getName(SEL _Nonnull selector); extern bool sel_isEqual(SEL _Nonnull selector1, SEL _Nonnull selector2); extern Class _Nonnull objc_allocateClassPair(Class _Nullable superclass, const char *_Nonnull name, size_t extraBytes); extern void objc_registerClassPair(Class _Nonnull cls); extern unsigned int objc_getClassList(Class _Nonnull *_Nullable buffer, unsigned int count); extern Class _Nonnull *_Nonnull objc_copyClassList( unsigned int *_Nullable length); extern bool class_isMetaClass(Class _Nullable cls); extern const char *_Nullable class_getName(Class _Nullable cls); extern Class _Nullable class_getSuperclass(Class _Nullable cls); extern unsigned long class_getInstanceSize(Class _Nullable cls); extern bool class_respondsToSelector(Class _Nullable cls, SEL _Nonnull selector); extern bool class_conformsToProtocol(Class _Nullable cls, Protocol *_Nonnull protocol); extern IMP _Nullable class_getMethodImplementation(Class _Nullable cls, SEL _Nonnull selector); extern IMP _Nullable class_getMethodImplementation_stret(Class _Nullable cls, SEL _Nonnull selector); extern const char *_Nullable class_getMethodTypeEncoding(Class _Nullable cls, SEL _Nonnull selector); extern bool class_addMethod(Class _Nonnull cls, SEL _Nonnull selector, IMP _Nonnull implementation, const char *_Nullable typeEncoding); extern IMP _Nullable class_replaceMethod(Class _Nonnull cls, SEL _Nonnull selector, IMP _Nonnull implementation, const char *_Nullable typeEncoding); extern Class _Nullable object_getClass(id _Nullable object); extern Class _Nullable object_setClass(id _Nullable object, Class _Nonnull cls); extern const char *_Nullable object_getClassName(id _Nullable object); extern const char *_Nonnull protocol_getName(Protocol *_Nonnull protocol); extern bool protocol_isEqual(Protocol *_Nonnull protocol1, Protocol *_Nonnull protocol2); extern bool protocol_conformsToProtocol(Protocol *_Nonnull protocol1, Protocol *_Nonnull protocol2); extern void objc_exit(void); extern _Nullable objc_uncaught_exception_handler objc_setUncaughtExceptionHandler( objc_uncaught_exception_handler _Nullable handler); extern void objc_setForwardHandler(IMP _Nullable forward, IMP _Nullable stretForward); extern void objc_setEnumerationMutationHandler( objc_enumeration_mutation_handler _Nullable handler); extern void objc_zero_weak_references(id _Nonnull value); /* * Used by the compiler, but can also be called manually. * * These declarations are also required to prevent Clang's implicit * declarations which include __declspec(dllimport) on Windows. */ extern void __objc_exec_class(void *_Nonnull module); extern IMP _Nonnull objc_msg_lookup(id _Nullable object, SEL _Nonnull selector); extern IMP _Nonnull objc_msg_lookup_stret(id _Nullable object, SEL _Nonnull selector); extern IMP _Nonnull objc_msg_lookup_super(struct objc_super *_Nonnull super, SEL _Nonnull selector); extern IMP _Nonnull objc_msg_lookup_super_stret( struct objc_super *_Nonnull super, SEL _Nonnull selector); extern Class _Nullable objc_lookUpClass(const char *_Nonnull name); extern Class _Nullable objc_getClass(const char *_Nonnull name); extern Class _Nonnull objc_getRequiredClass(const char *_Nonnull name); extern Class _Nullable objc_lookup_class(const char *_Nonnull name); extern Class _Nonnull objc_get_class(const char *_Nonnull name); extern void objc_exception_throw(id _Nullable object); extern int objc_sync_enter(id _Nullable object); |
︙ | ︙ | |||
283 284 285 286 287 288 289 | extern void objc_enumerationMutation(id _Nonnull object); #ifndef OBJC_NO_PERSONALITY_DECLARATION /* * No objfw-defs.h or config.h is available for the installed runtime headers, * so we don't know which exceptions we have. */ extern int __gnu_objc_personality_v0(int version, int actions, | | | | 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | extern void objc_enumerationMutation(id _Nonnull object); #ifndef OBJC_NO_PERSONALITY_DECLARATION /* * No objfw-defs.h or config.h is available for the installed runtime headers, * so we don't know which exceptions we have. */ extern int __gnu_objc_personality_v0(int version, int actions, uint64_t exClass, void *_Nonnull ex, void *_Nonnull ctx); extern int __gnu_objc_personality_sj0(int version, int actions, uint64_t exClass, void *_Nonnull ex, void *_Nonnull ctx); #endif extern id _Nullable objc_retain(id _Nullable object); extern id _Nullable objc_retainBlock(id _Nullable block); extern id _Nullable objc_retainAutorelease(id _Nullable object); extern void objc_release(id _Nullable object); extern id _Nullable objc_autorelease(id _Nullable object); extern id _Nullable objc_autoreleaseReturnValue(id _Nullable object); |
︙ | ︙ |