1typedef __SIZE_TYPE__ size_t; 2typedef const struct objc_selector 3{ 4 void *sel_id; 5} 6 *SEL; 7typedef struct objc_object 8{ 9} 10 *id; 11typedef struct objc_class *Class; 12struct objc_class 13{ 14 struct sarray *dtable; 15}; 16typedef size_t sidx; 17struct soffset 18{ 19 unsigned int boffset:(sizeof (size_t) * 8) / 2; 20 unsigned int eoffset:(sizeof (size_t) * 8) / 2; 21}; 22union sofftype 23{ 24 struct soffset off; 25 sidx idx; 26}; 27struct sarray 28{ 29 size_t capacity; 30}; 31static __inline__ unsigned int 32soffset_decode (sidx indx) 33{ 34 union sofftype x; 35 x.idx = indx; 36 return x.off.eoffset + (x.off.boffset * (1 << 5)); 37} 38static __inline__ void * 39sarray_get_safe (struct sarray *array, sidx indx) 40{ 41 if (soffset_decode (indx) < array->capacity) 42 return (void *)sarray_get (array, indx); 43} 44void * 45get_imp (Class class, SEL sel) 46{ 47 void *res = sarray_get_safe (class->dtable, (size_t) sel->sel_id); 48 if (res == 0) 49 { 50 { 51 res = get_imp (class, sel); 52 } 53 } 54} 55