This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
objc/3110: Followup to bug 3072, maybe 3019 too
- To: gcc-gnats at gcc dot gnu dot org
- Subject: objc/3110: Followup to bug 3072, maybe 3019 too
- From: jones dot peter at uqam dot ca
- Date: Sun, 10 Jun 2001 17:21:57 -0400 (EDT)
- Cc: jones dot peter at uqam dot ca
- Reply-To: jones dot peter at uqam dot ca
>Number: 3110
>Category: objc
>Synopsis: Followup to bug 3072, maybe 3019 too
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Jun 10 14:26:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Swarm
>Release: 3.0 20010528 (prerelease)
>Organization:
>Environment:
System: Linux localhost.localdomain 2.4.2-2 #1 Sun Apr 8 20:41:30 EDT 2001 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure
>Description:
Compiling attached mff.mi file gives ICE
>How-To-Repeat:
1) Download gcc snapshot from www.codesourcery.com
2) Install
3) /usr/local/bin/gcc -v
4) /usr/local/bin/gcc mff.mi
>Fix:
------ File gcc386.out ------ begins
gcc command is /usr/local/bin/gcc --save-temps
Compiler version:
Reading specs from /usr/local/bin/../lib/gcc-lib/i386-pc-linux-gnu/3.0/specs
Configured with: ../configure --prefix=/tmp/gcc-20010604-root/usr/local --enable-shared --enable-threads --disable-checking i386-pc-linux-gnu
Thread model: posix
gcc version 3.0 20010604 (prerelease)
mff.mi: In function `mframe_decode_return':
mff.mi:2591: Internal compiler error in make_decl_rtl, at varasm.c:591
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
--------------------- File ends -------------------
In the following file, I have introduced an extra new-line in the file
as produced by gcc, in routing compare_strings
------ File mff.mi ------ begins
typedef int ptrdiff_t;
typedef unsigned int size_t;
typedef long int wchar_t;
typedef unsigned char BOOL;
typedef const struct objc_selector
{
void *sel_id;
const char *sel_types;
} *SEL;
inline static BOOL
sel_eq (SEL s1, SEL s2)
{
if (s1 == 0 || s2 == 0)
return s1 == s2;
else
return s1->sel_id == s2->sel_id;
}
typedef struct objc_object {
struct objc_class* class_pointer;
} *id;
typedef id (*IMP)(id, SEL, ...);
typedef char *STR;
typedef struct objc_class *MetaClass;
typedef struct objc_class *Class;
struct objc_class {
MetaClass class_pointer;
struct objc_class* super_class;
const char* name;
long version;
unsigned long info;
long instance_size;
struct objc_ivar_list* ivars;
struct objc_method_list* methods;
struct sarray * dtable;
struct objc_class* subclass_list;
struct objc_class* sibling_class;
struct objc_protocol_list *protocols;
void* gc_object_type;
};
@class Protocol;
typedef void* retval_t;
typedef void(*apply_t)(void);
typedef union {
char *arg_ptr;
char arg_regs[sizeof (char*)];
} *arglist_t;
IMP objc_msg_lookup (id receiver, SEL op);
extern void *memcpy (void *__restrict __dest,
__const void *__restrict __src, size_t __n) ;
extern void *memmove (void *__dest, __const void *__src, size_t __n)
;
extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
int __c, size_t __n)
;
extern void *memset (void *__s, int __c, size_t __n) ;
extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
__attribute__ ((__pure__));
extern void *memchr (__const void *__s, int __c, size_t __n)
__attribute__ ((__pure__));
extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
;
extern char *strncpy (char *__restrict __dest,
__const char *__restrict __src, size_t __n) ;
extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
;
extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
size_t __n) ;
extern int strcmp (__const char *__s1, __const char *__s2)
__attribute__ ((__pure__));
extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
__attribute__ ((__pure__));
extern int strcoll (__const char *__s1, __const char *__s2)
__attribute__ ((__pure__));
extern size_t strxfrm (char *__restrict __dest,
__const char *__restrict __src, size_t __n) ;
extern char *strdup (__const char *__s) __attribute__ ((__malloc__));
extern char *strchr (__const char *__s, int __c) __attribute__ ((__pure__));
extern char *strrchr (__const char *__s, int __c) __attribute__ ((__pure__));
extern size_t strcspn (__const char *__s, __const char *__reject)
__attribute__ ((__pure__));
extern size_t strspn (__const char *__s, __const char *__accept)
__attribute__ ((__pure__));
extern char *strpbrk (__const char *__s, __const char *__accept)
__attribute__ ((__pure__));
extern char *strstr (__const char *__haystack, __const char *__needle)
__attribute__ ((__pure__));
extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
;
extern char *__strtok_r (char *__restrict __s,
__const char *__restrict __delim,
char **__restrict __save_ptr) ;
extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
char **__restrict __save_ptr) ;
extern size_t strlen (__const char *__s) __attribute__ ((__pure__));
extern char *strerror (int __errnum) ;
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) ;
extern void __bzero (void *__s, size_t __n) ;
extern void bcopy (__const void *__src, void *__dest, size_t __n) ;
extern void bzero (void *__s, size_t __n) ;
extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
__attribute__ ((__pure__));
extern char *index (__const char *__s, int __c) __attribute__ ((__pure__));
extern char *rindex (__const char *__s, int __c) __attribute__ ((__pure__));
extern int ffs (int __i) __attribute__ ((const));
extern int strcasecmp (__const char *__s1, __const char *__s2)
__attribute__ ((__pure__));
extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
__attribute__ ((__pure__));
extern char *strsep (char **__restrict __stringp,
__const char *__restrict __delim) ;
typedef unsigned char __u_char;
typedef unsigned short __u_short;
typedef unsigned int __u_int;
typedef unsigned long __u_long;
__extension__ typedef unsigned long long int __u_quad_t;
__extension__ typedef long long int __quad_t;
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;
__extension__ typedef signed long long int __int64_t;
__extension__ typedef unsigned long long int __uint64_t;
typedef __quad_t *__qaddr_t;
typedef __u_quad_t __dev_t;
typedef __u_int __uid_t;
typedef __u_int __gid_t;
typedef __u_long __ino_t;
typedef __u_int __mode_t;
typedef __u_int __nlink_t;
typedef long int __off_t;
typedef __quad_t __loff_t;
typedef int __pid_t;
typedef int __ssize_t;
typedef __u_long __rlim_t;
typedef __u_quad_t __rlim64_t;
typedef __u_int __id_t;
typedef struct
{
int __val[2];
} __fsid_t;
typedef int __daddr_t;
typedef char *__caddr_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __swblk_t;
typedef long int __clock_t;
typedef int __clockid_t;
typedef int __timer_t;
typedef int __key_t;
typedef unsigned short int __ipc_pid_t;
typedef long int __blksize_t;
typedef long int __blkcnt_t;
typedef __quad_t __blkcnt64_t;
typedef __u_long __fsblkcnt_t;
typedef __u_quad_t __fsblkcnt64_t;
typedef __u_long __fsfilcnt_t;
typedef __u_quad_t __fsfilcnt64_t;
typedef __u_quad_t __ino64_t;
typedef __loff_t __off64_t;
typedef long int __t_scalar_t;
typedef unsigned long int __t_uscalar_t;
typedef int __intptr_t;
typedef unsigned int __socklen_t;
struct __sched_param
{
int __sched_priority;
};
struct _pthread_fastlock
{
long int __status;
int __spinlock;
};
typedef struct _pthread_descr_struct *_pthread_descr;
typedef struct __pthread_attr_s
{
int __detachstate;
int __schedpolicy;
struct __sched_param __schedparam;
int __inheritsched;
int __scope;
size_t __guardsize;
int __stackaddr_set;
void *__stackaddr;
size_t __stacksize;
} pthread_attr_t;
typedef struct
{
struct _pthread_fastlock __c_lock;
_pthread_descr __c_waiting;
} pthread_cond_t;
typedef struct
{
int __dummy;
} pthread_condattr_t;
typedef unsigned int pthread_key_t;
typedef struct
{
int __m_reserved;
int __m_count;
_pthread_descr __m_owner;
int __m_kind;
struct _pthread_fastlock __m_lock;
} pthread_mutex_t;
typedef struct
{
int __mutexkind;
} pthread_mutexattr_t;
typedef int pthread_once_t;
typedef unsigned long int pthread_t;
extern void *__rawmemchr (const void *__s, int __c);
extern __inline char *__strcpy_small (char *, __uint16_t, __uint16_t,
__uint32_t, __uint32_t, size_t);
extern __inline char *
__strcpy_small (char *__dest,
__uint16_t __src0_2, __uint16_t __src4_2,
__uint32_t __src0_4, __uint32_t __src4_4,
size_t __srclen)
{
union {
__uint32_t __ui;
__uint16_t __usi;
unsigned char __uc;
} *__u = (void *) __dest;
switch ((unsigned int) __srclen)
{
case 1:
__u->__uc = '\0';
break;
case 2:
__u->__usi = __src0_2;
break;
case 3:
__u->__usi = __src0_2;
__u = __extension__ ((void *) __u + 2);
__u->__uc = '\0';
break;
case 4:
__u->__ui = __src0_4;
break;
case 5:
__u->__ui = __src0_4;
__u = __extension__ ((void *) __u + 4);
__u->__uc = '\0';
break;
case 6:
__u->__ui = __src0_4;
__u = __extension__ ((void *) __u + 4);
__u->__usi = __src4_2;
break;
case 7:
__u->__ui = __src0_4;
__u = __extension__ ((void *) __u + 4);
__u->__usi = __src4_2;
__u = __extension__ ((void *) __u + 2);
__u->__uc = '\0';
break;
case 8:
__u->__ui = __src0_4;
__u = __extension__ ((void *) __u + 4);
__u->__ui = __src4_4;
break;
}
return __dest;
}
extern __inline size_t __strcspn_c1 (__const char *__s, char __reject);
extern __inline size_t
__strcspn_c1 (__const char *__s, char __reject)
{
register size_t __result = 0;
while (__s[__result] != '\0' && __s[__result] != __reject)
++__result;
return __result;
}
extern __inline size_t __strcspn_c2 (__const char *__s, char __reject1,
char __reject2);
extern __inline size_t
__strcspn_c2 (__const char *__s, char __reject1, char __reject2)
{
register size_t __result = 0;
while (__s[__result] != '\0' && __s[__result] != __reject1
&& __s[__result] != __reject2)
++__result;
return __result;
}
extern __inline size_t __strcspn_c3 (__const char *__s, char __reject1,
char __reject2, char __reject3);
extern __inline size_t
__strcspn_c3 (__const char *__s, char __reject1, char __reject2,
char __reject3)
{
register size_t __result = 0;
while (__s[__result] != '\0' && __s[__result] != __reject1
&& __s[__result] != __reject2 && __s[__result] != __reject3)
++__result;
return __result;
}
extern __inline size_t __strspn_c1 (__const char *__s, char __accept);
extern __inline size_t
__strspn_c1 (__const char *__s, char __accept)
{
register size_t __result = 0;
while (__s[__result] == __accept)
++__result;
return __result;
}
extern __inline size_t __strspn_c2 (__const char *__s, char __accept1,
char __accept2);
extern __inline size_t
__strspn_c2 (__const char *__s, char __accept1, char __accept2)
{
register size_t __result = 0;
while (__s[__result] == __accept1 || __s[__result] == __accept2)
++__result;
return __result;
}
extern __inline size_t __strspn_c3 (__const char *__s, char __accept1,
char __accept2, char __accept3);
extern __inline size_t
__strspn_c3 (__const char *__s, char __accept1, char __accept2, char __accept3)
{
register size_t __result = 0;
while (__s[__result] == __accept1 || __s[__result] == __accept2
|| __s[__result] == __accept3)
++__result;
return __result;
}
extern __inline char *__strpbrk_c2 (__const char *__s, int __accept1,
int __accept2);
extern __inline char *
__strpbrk_c2 (__const char *__s, int __accept1, int __accept2)
{
while (*__s != '\0' && *__s != __accept1 && *__s != __accept2)
++__s;
return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s;
}
extern __inline char *__strpbrk_c3 (__const char *__s, int __accept1,
int __accept2, int __accept3);
extern __inline char *
__strpbrk_c3 (__const char *__s, int __accept1, int __accept2,
int __accept3)
{
while (*__s != '\0' && *__s != __accept1 && *__s != __accept2
&& *__s != __accept3)
++__s;
return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s;
}
extern __inline char *__strtok_r_1c (char *__s, char __sep, char **__nextp);
extern __inline char *
__strtok_r_1c (char *__s, char __sep, char **__nextp)
{
char *__result;
if (__s == ((void *)0))
__s = *__nextp;
while (*__s == __sep)
++__s;
if (*__s == '\0')
__result = ((void *)0);
else
{
__result = __s;
while (*__s != '\0' && *__s != __sep)
++__s;
if (*__s == '\0')
*__nextp = __s;
else
{
*__s = '\0';
*__nextp = __s + 1;
}
}
return __result;
}
extern __inline char *__strsep_1c (char **__s, char __reject);
extern __inline char *
__strsep_1c (char **__s, char __reject)
{
register char *__retval = *__s;
if (__retval == ((void *)0))
return *__s = ((void *)0);
if (*__retval == __reject)
*(*__s)++ = '\0';
else
if ((*__s = (__extension__ (__builtin_constant_p (__reject) && (__reject) == '\0' ? (char *) __rawmemchr (__retval, __reject) : strchr (__retval, __reject)))) != ((void *)0))
*(*__s)++ = '\0';
else
*__s = ((void *)0);
return __retval;
}
extern __inline char *__strsep_2c (char **__s, char __reject1, char __reject2);
extern __inline char *
__strsep_2c (char **__s, char __reject1, char __reject2)
{
register char *__retval = *__s;
if (__retval == ((void *)0))
return *__s = ((void *)0);
if (*__retval == __reject1 || *__retval == __reject2)
*(*__s)++ = '\0';
else
{
register char *__cp = __retval;
while (*__cp != '\0' && *__cp != __reject1 && *__cp != __reject2)
++__cp;
if (*__cp != '\0')
{
*__s = __cp;
*(*__s)++ = '\0';
}
else
*__s = ((void *)0);
}
return __retval;
}
extern __inline char *__strsep_3c (char **__s, char __reject1, char __reject2,
char __reject3);
extern __inline char *
__strsep_3c (char **__s, char __reject1, char __reject2, char __reject3)
{
register char *__retval = *__s;
if (__retval == ((void *)0))
return *__s = ((void *)0);
if (*__retval == __reject1 || *__retval == __reject2
|| *__retval == __reject3)
*(*__s)++ = '\0';
else
{
register char *__cp = __retval;
while (*__cp != '\0' && *__cp != __reject1 && *__cp != __reject2
&& *__cp != __reject3)
++__cp;
if (*__cp != '\0')
{
*__s = __cp;
*(*__s)++ = '\0';
}
else
*__s = ((void *)0);
}
return __retval;
}
extern __inline char *__strsep_g (char **__s, __const char *__reject);
extern __inline char *
__strsep_g (char **__s, __const char *__reject)
{
register char *__retval = *__s;
if (__retval == ((void *)0))
return ((void *)0);
if ((*__s = __extension__ ({ char __a0, __a1, __a2; (__builtin_constant_p (__reject) && ((size_t)(const void *)((__reject) + 1) - (size_t)(const void *)(__reject) == 1) ? ((__a0 = ((__const char *) (__reject))[0], __a0 == '\0') ? ((void) (__retval), ((void *)0)) : ((__a1 = ((__const char *) (__reject))[1], __a1 == '\0') ? (__extension__ (__builtin_constant_p (__a0) && (__a0) == '\0' ? (char *) __rawmemchr (__retval, __a0) : strchr (__retval, __a0))) : ((__a2 = ((__const char *) (__reject))[2], __a2 == '\0') ? __strpbrk_c2 (__retval, __a0, __a1) : (((__const char *) (__reject))[3] == '\0' ? __strpbrk_c3 (__retval, __a0, __a1, __a2) : strpbrk (__retval, __reject))))) : strpbrk (__retval, __reject)); })) != ((void *)0))
*(*__s)++ = '\0';
return __retval;
}
extern void *malloc (size_t __size) __attribute__ ((__malloc__));
extern void *calloc (size_t __nmemb, size_t __size)
__attribute__ ((__malloc__));
extern char *__strdup (__const char *__string) __attribute__ ((__malloc__));
extern char *__strndup (__const char *__string, size_t __n)
__attribute__ ((__malloc__));
typedef struct cache_node
{
struct cache_node *next;
const void *key;
void *value;
} *node_ptr;
typedef unsigned int (*hash_func_type)(void *, const void *);
typedef int (*compare_func_type)(const void *, const void *);
typedef struct
{
node_ptr *node_table;
unsigned int size;
unsigned int used;
unsigned int mask;
unsigned int last_bucket;
hash_func_type hash_func;
compare_func_type compare_func;
} cache_t;
typedef cache_t *cache_ptr;
extern cache_ptr module_hash_table, class_hash_table;
cache_ptr hash_new (unsigned int size,
hash_func_type hash_func,
compare_func_type compare_func);
void hash_delete (cache_ptr cache);
void hash_add (cache_ptr *cachep, const void *key, void *value);
void hash_remove (cache_ptr cache, const void *key);
node_ptr hash_next (cache_ptr cache, node_ptr node);
void *hash_value_for_key (cache_ptr cache, const void *key);
BOOL hash_is_key_in_hash (cache_ptr cache, const void *key);
static inline unsigned int
hash_ptr (cache_ptr cache, const void *key)
{
return ((size_t)key / sizeof (void *)) & cache->mask;
}
static inline unsigned int
hash_string (cache_ptr cache, const void *key)
{
unsigned int ret = 0;
unsigned int ctr = 0;
while (*(char*)key) {
ret ^= *(char*)key++ << ctr;
ctr = (ctr + 1) % sizeof (void *);
}
return ret & cache->mask;
}
static inline int
compare_ptrs (const void *k1, const void *k2)
{
return !(k1 - k2);
}
static inline int
compare_strings (const void *k1, const void *k2)
{
if (k1 == k2)
return 1;
else if (k1 == 0 || k2 == 0)
return 0;
else
return !__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (k1) && __builtin_constant_p (k2) && (__s1_len = strlen (k1), __s2_len = strlen (k2), (!((size_t)(const void *)((k1) + 1) - (size_t)(const void *)(k1) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((k2) + 1) - (size_t)(const void *)(k2) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) (k1), (__const char *) (k2), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p (k1) && ((size_t)(const void *)((k1) + 1) - (size_t)(const void *)(k1) == 1) && (__s1_len = strlen (k1), __s1_len < 4) ? (__builtin_constant_p (k2) && ((size_t)(const void *)((k2) + 1) - (size_t)(const void *)(k2) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (k1))[0] - ((__const unsigned char *) (__const char *)(k2))[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (k1))[1] - ((__const unsigned char *) (__const !
char *) (k2))[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (k1))[2] - ((__const unsigned char *) (__const char *) (k2))[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (k1))[3] - ((__const unsigned char *) (__const char *) (k2))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) (k2); register int __result = (((__const unsigned char *) (__const char *) (k1))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *)
(__const char *) (k1))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (k1))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (k1))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (k2) && ((size_t)(const void *)((k2) + 1) - (size_t)(const void *)(k2) == 1) && (__s2_len = strlen (k2), __s2_len < 4) ? (__builtin_constant_p (k1) && ((size_t)(const void *)((k1) + 1) - (size_t)(const void *)(k1) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (k1))[0] - ((__const unsigned char *) (__const char *)(k2))[0]); if (__s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (k1))[1] - ((__const unsigned char *) (__const char *) (k2))[1]); if (__s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (k1))[2] - ((__const unsigned char *) (__const char *) (!
k2))[2]); if (__s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (k1))[3] - ((__const unsigned char *) (__const char *) (k2))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (k1); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) (k2))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) (k2))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) (k2))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) (k2))[3]); } } __result; }))) : strcmp (k1, k2)))); });
}
extern int __objc_thread_exit_status;
typedef void * objc_thread_t;
struct objc_mutex
{
volatile objc_thread_t owner;
volatile int depth;
void * backend;
};
typedef struct objc_mutex *objc_mutex_t;
struct objc_condition
{
void * backend;
};
typedef struct objc_condition *objc_condition_t;
objc_mutex_t objc_mutex_allocate(void);
int objc_mutex_deallocate(objc_mutex_t mutex);
int objc_mutex_lock(objc_mutex_t mutex);
int objc_mutex_unlock(objc_mutex_t mutex);
int objc_mutex_trylock(objc_mutex_t mutex);
objc_condition_t objc_condition_allocate(void);
int objc_condition_deallocate(objc_condition_t condition);
int objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex);
int objc_condition_signal(objc_condition_t condition);
int objc_condition_broadcast(objc_condition_t condition);
objc_thread_t objc_thread_detach(SEL selector, id object, id argument);
void objc_thread_yield(void);
int objc_thread_exit(void);
int objc_thread_set_priority(int priority);
int objc_thread_get_priority(void);
void * objc_thread_get_data(void);
int objc_thread_set_data(void *value);
objc_thread_t objc_thread_id(void);
typedef void (*objc_thread_callback)();
objc_thread_callback objc_set_thread_callback(objc_thread_callback func);
int __objc_init_thread_system(void);
int __objc_fini_thread_system(void);
int __objc_mutex_allocate(objc_mutex_t mutex);
int __objc_mutex_deallocate(objc_mutex_t mutex);
int __objc_mutex_lock(objc_mutex_t mutex);
int __objc_mutex_trylock(objc_mutex_t mutex);
int __objc_mutex_unlock(objc_mutex_t mutex);
int __objc_condition_allocate(objc_condition_t condition);
int __objc_condition_deallocate(objc_condition_t condition);
int __objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex);
int __objc_condition_broadcast(objc_condition_t condition);
int __objc_condition_signal(objc_condition_t condition);
objc_thread_t __objc_thread_detach(void (*func)(void *arg), void *arg);
int __objc_thread_set_priority(int priority);
int __objc_thread_get_priority(void);
void __objc_thread_yield(void);
int __objc_thread_exit(void);
objc_thread_t __objc_thread_id(void);
int __objc_thread_set_data(void *value);
void * __objc_thread_get_data(void);
typedef struct _IO_FILE FILE;
typedef struct _IO_FILE __FILE;
typedef unsigned int wint_t;
typedef struct
{
int __count;
union
{
wint_t __wch;
char __wchb[4];
} __value;
} __mbstate_t;
typedef struct
{
__off_t __pos;
__mbstate_t __state;
} _G_fpos_t;
typedef struct
{
__off64_t __pos;
__mbstate_t __state;
} _G_fpos64_t;
enum
{
__GCONV_OK = 0,
__GCONV_NOCONV,
__GCONV_NODB,
__GCONV_NOMEM,
__GCONV_EMPTY_INPUT,
__GCONV_FULL_OUTPUT,
__GCONV_ILLEGAL_INPUT,
__GCONV_INCOMPLETE_INPUT,
__GCONV_ILLEGAL_DESCRIPTOR,
__GCONV_INTERNAL_ERROR
};
enum
{
__GCONV_IS_LAST = 0x0001,
__GCONV_IGNORE_ERRORS = 0x0002
};
struct __gconv_step;
struct __gconv_step_data;
struct __gconv_loaded_object;
struct __gconv_trans_data;
typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *,
__const unsigned char **, __const unsigned char *,
unsigned char **, size_t *, int, int);
typedef int (*__gconv_init_fct) (struct __gconv_step *);
typedef void (*__gconv_end_fct) (struct __gconv_step *);
typedef int (*__gconv_trans_fct) (struct __gconv_step *,
struct __gconv_step_data *, void *,
__const unsigned char *,
__const unsigned char **,
__const unsigned char *, unsigned char **,
size_t *);
typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *,
__const unsigned char *,
unsigned char *, unsigned char *);
typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***,
size_t *);
typedef int (*__gconv_trans_init_fct) (void **, const char *);
typedef void (*__gconv_trans_end_fct) (void *);
struct __gconv_trans_data
{
__gconv_trans_fct __trans_fct;
__gconv_trans_context_fct __trans_context_fct;
__gconv_trans_end_fct __trans_end_fct;
void *__data;
struct __gconv_trans_data *__next;
};
struct __gconv_step
{
struct __gconv_loaded_object *__shlib_handle;
__const char *__modname;
int __counter;
char *__from_name;
char *__to_name;
__gconv_fct __fct;
__gconv_init_fct __init_fct;
__gconv_end_fct __end_fct;
int __min_needed_from;
int __max_needed_from;
int __min_needed_to;
int __max_needed_to;
int __stateful;
void *__data;
};
struct __gconv_step_data
{
unsigned char *__outbuf;
unsigned char *__outbufend;
int __flags;
int __invocation_counter;
int __internal_use;
__mbstate_t *__statep;
__mbstate_t __state;
struct __gconv_trans_data *__trans;
};
typedef struct __gconv_info
{
size_t __nsteps;
struct __gconv_step *__steps;
__extension__ struct __gconv_step_data __data [];
} *__gconv_t;
typedef union
{
struct __gconv_info __cd;
struct
{
struct __gconv_info __cd;
struct __gconv_step_data __data;
} __combined;
} _G_iconv_t;
typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
typedef __builtin_va_list __gnuc_va_list;
struct _IO_jump_t; struct _IO_FILE;
typedef void _IO_lock_t;
struct _IO_marker {
struct _IO_marker *_next;
struct _IO_FILE *_sbuf;
int _pos;
};
enum __codecvt_result
{
__codecvt_ok,
__codecvt_partial,
__codecvt_error,
__codecvt_noconv
};
struct _IO_FILE {
int _flags;
char* _IO_read_ptr;
char* _IO_read_end;
char* _IO_read_base;
char* _IO_write_base;
char* _IO_write_ptr;
char* _IO_write_end;
char* _IO_buf_base;
char* _IO_buf_end;
char *_IO_save_base;
char *_IO_backup_base;
char *_IO_save_end;
struct _IO_marker *_markers;
struct _IO_FILE *_chain;
int _fileno;
int _blksize;
__off_t _old_offset;
unsigned short _cur_column;
signed char _vtable_offset;
char _shortbuf[1];
_IO_lock_t *_lock;
__off64_t _offset;
void *__pad1;
void *__pad2;
int _mode;
char _unused2[15 * sizeof (int) - 2 * sizeof (void *)];
};
typedef struct _IO_FILE _IO_FILE;
struct _IO_FILE_plus;
extern struct _IO_FILE_plus _IO_2_1_stdin_;
extern struct _IO_FILE_plus _IO_2_1_stdout_;
extern struct _IO_FILE_plus _IO_2_1_stderr_;
typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
size_t __n);
typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
typedef int __io_close_fn (void *__cookie);
extern int __underflow (_IO_FILE *) ;
extern int __uflow (_IO_FILE *) ;
extern int __overflow (_IO_FILE *, int) ;
extern wint_t __wunderflow (_IO_FILE *) ;
extern wint_t __wuflow (_IO_FILE *) ;
extern wint_t __woverflow (_IO_FILE *, wint_t) ;
extern int _IO_getc (_IO_FILE *__fp) ;
extern int _IO_putc (int __c, _IO_FILE *__fp) ;
extern int _IO_feof (_IO_FILE *__fp) ;
extern int _IO_ferror (_IO_FILE *__fp) ;
extern int _IO_peekc_locked (_IO_FILE *__fp) ;
extern void _IO_flockfile (_IO_FILE *) ;
extern void _IO_funlockfile (_IO_FILE *) ;
extern int _IO_ftrylockfile (_IO_FILE *) ;
extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
__gnuc_va_list, int *__restrict) ;
extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
__gnuc_va_list) ;
extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t) ;
extern size_t _IO_sgetn (_IO_FILE *, void *, size_t) ;
extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int) ;
extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int) ;
extern void _IO_free_backup_area (_IO_FILE *) ;
typedef _G_fpos_t fpos_t;
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;
extern int remove (__const char *__filename) ;
extern int rename (__const char *__old, __const char *__new) ;
extern FILE *tmpfile (void) ;
extern char *tmpnam (char *__s) ;
extern char *tmpnam_r (char *__s) ;
extern char *tempnam (__const char *__dir, __const char *__pfx)
__attribute__ ((__malloc__));
extern int fclose (FILE *__stream) ;
extern int fflush (FILE *__stream) ;
extern int fflush_unlocked (FILE *__stream) ;
extern FILE *fopen (__const char *__restrict __filename,
__const char *__restrict __modes) ;
extern FILE *freopen (__const char *__restrict __filename,
__const char *__restrict __modes,
FILE *__restrict __stream) ;
extern FILE *fdopen (int __fd, __const char *__modes) ;
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) ;
extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
int __modes, size_t __n) ;
extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
size_t __size) ;
extern void setlinebuf (FILE *__stream) ;
extern int fprintf (FILE *__restrict __stream,
__const char *__restrict __format, ...) ;
extern int printf (__const char *__restrict __format, ...) ;
extern int sprintf (char *__restrict __s,
__const char *__restrict __format, ...) ;
extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
__gnuc_va_list __arg) ;
extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg)
;
extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
__gnuc_va_list __arg) ;
extern int snprintf (char *__restrict __s, size_t __maxlen,
__const char *__restrict __format, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
extern int vsnprintf (char *__restrict __s, size_t __maxlen,
__const char *__restrict __format, __gnuc_va_list __arg)
__attribute__ ((__format__ (__printf__, 3, 0)));
extern int fscanf (FILE *__restrict __stream,
__const char *__restrict __format, ...) ;
extern int scanf (__const char *__restrict __format, ...) ;
extern int sscanf (__const char *__restrict __s,
__const char *__restrict __format, ...) ;
extern int fgetc (FILE *__stream) ;
extern int getc (FILE *__stream) ;
extern int getchar (void) ;
extern int getc_unlocked (FILE *__stream) ;
extern int getchar_unlocked (void) ;
extern int fgetc_unlocked (FILE *__stream) ;
extern int fputc (int __c, FILE *__stream) ;
extern int putc (int __c, FILE *__stream) ;
extern int putchar (int __c) ;
extern int fputc_unlocked (int __c, FILE *__stream) ;
extern int putc_unlocked (int __c, FILE *__stream) ;
extern int putchar_unlocked (int __c) ;
extern int getw (FILE *__stream) ;
extern int putw (int __w, FILE *__stream) ;
extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
;
extern char *gets (char *__s) ;
extern int fputs (__const char *__restrict __s, FILE *__restrict __stream)
;
extern int puts (__const char *__s) ;
extern int ungetc (int __c, FILE *__stream) ;
extern size_t fread (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) ;
extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __s) ;
extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) ;
extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) ;
extern int fseek (FILE *__stream, long int __off, int __whence) ;
extern long int ftell (FILE *__stream) ;
extern void rewind (FILE *__stream) ;
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos)
;
extern int fsetpos (FILE *__stream, __const fpos_t *__pos) ;
extern void clearerr (FILE *__stream) ;
extern int feof (FILE *__stream) ;
extern int ferror (FILE *__stream) ;
extern void clearerr_unlocked (FILE *__stream) ;
extern int feof_unlocked (FILE *__stream) ;
extern int ferror_unlocked (FILE *__stream) ;
extern void perror (__const char *__s) ;
extern int sys_nerr;
extern __const char *__const sys_errlist[];
extern int fileno (FILE *__stream) ;
extern int fileno_unlocked (FILE *__stream) ;
extern FILE *popen (__const char *__command, __const char *__modes) ;
extern int pclose (FILE *__stream) ;
extern char *ctermid (char *__s) ;
extern void flockfile (FILE *__stream) ;
extern int ftrylockfile (FILE *__stream) ;
extern void funlockfile (FILE *__stream) ;
extern __inline int
vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg)
{
return vfprintf (stdout, __fmt, __arg);
}
extern __inline int
getchar (void)
{
return _IO_getc (stdin);
}
extern __inline int
getc_unlocked (FILE *__fp)
{
return ((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
}
extern __inline int
getchar_unlocked (void)
{
return ((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++);
}
extern __inline int
putchar (int __c)
{
return _IO_putc (__c, stdout);
}
extern __inline int
fputc_unlocked (int __c, FILE *__stream)
{
return (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
}
extern __inline int
putc_unlocked (int __c, FILE *__stream)
{
return (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
}
extern __inline int
putchar_unlocked (int __c)
{
return (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c)));
}
extern __inline int
feof_unlocked (FILE *__stream)
{
return (((__stream)->_flags & 0x10) != 0);
}
extern __inline int
ferror_unlocked (FILE *__stream)
{
return (((__stream)->_flags & 0x20) != 0);
}
typedef __gnuc_va_list va_list;
struct objc_method_description
{
SEL name;
char *types;
};
extern void objc_error (id object, int code, const char* fmt, ...);
extern void objc_verror (id object, int code, const char* fmt, va_list ap);
typedef BOOL (*objc_error_handler) (id, int code, const char *fmt, va_list ap);
objc_error_handler objc_set_error_handler (objc_error_handler func);
struct objc_static_instances
{
char *class_name;
id instances[0];
};
typedef struct objc_symtab {
unsigned long sel_ref_cnt;
SEL refs;
unsigned short cls_def_cnt;
unsigned short cat_def_cnt;
void *defs[1];
} Symtab, *Symtab_t;
typedef struct objc_module {
unsigned long version;
unsigned long size;
const char* name;
Symtab_t symtab;
} Module, *Module_t;
typedef struct objc_ivar* Ivar_t;
typedef struct objc_ivar_list {
int ivar_count;
struct objc_ivar {
const char* ivar_name;
const char* ivar_type;
int ivar_offset;
} ivar_list[1];
} IvarList, *IvarList_t;
struct objc_method {
SEL method_name;
const char* method_types;
IMP method_imp;
};
typedef struct objc_method Method;
typedef Method* Method_t;
typedef struct objc_method_list {
struct objc_method_list* method_next;
int method_count;
struct objc_method method_list[1];
} MethodList, *MethodList_t;
struct objc_protocol_list {
struct objc_protocol_list *next;
int count;
Protocol *list[1];
};
typedef struct objc_category {
const char* category_name;
const char* class_name;
MethodList_t instance_methods;
MethodList_t class_methods;
struct objc_protocol_list *protocols;
} Category, *Category_t;
typedef struct objc_super {
id self;
Class class;
} Super, *Super_t;
IMP objc_msg_lookup_super(Super_t super, SEL sel);
retval_t objc_msg_sendv(id, SEL, arglist_t);
extern Class (*_objc_lookup_class) (const char *name);
extern void (*_objc_load_callback) (Class class, Category* category);
extern id (*_objc_object_alloc) (Class class);
extern id (*_objc_object_copy) (id object);
extern id (*_objc_object_dispose) (id object);
void *objc_malloc (size_t size);
void *objc_atomic_malloc (size_t size);
void *objc_valloc (size_t size);
void *objc_realloc (void *mem, size_t size);
void *objc_calloc (size_t nelem, size_t size);
void objc_free (void *mem);
extern void *(*_objc_malloc) (size_t);
extern void *(*_objc_atomic_malloc) (size_t);
extern void *(*_objc_valloc) (size_t);
extern void *(*_objc_realloc) (void *, size_t);
extern void *(*_objc_calloc) (size_t, size_t);
extern void (*_objc_free) (void *);
Method_t class_get_class_method (MetaClass class, SEL aSel);
Method_t class_get_instance_method (Class class, SEL aSel);
Class class_pose_as (Class impostor, Class superclass);
Class objc_get_class (const char *name);
Class objc_lookup_class (const char *name);
Class objc_next_class (void **enum_state);
const char *sel_get_name (SEL selector);
const char *sel_get_type (SEL selector);
SEL sel_get_uid (const char *name);
SEL sel_get_any_uid (const char *name);
SEL sel_get_any_typed_uid (const char *name);
SEL sel_get_typed_uid (const char *name, const char*);
SEL sel_register_name (const char *name);
SEL sel_register_typed_name (const char *name, const char*type);
BOOL sel_is_mapped (SEL aSel);
extern id class_create_instance (Class class);
static inline const char *
class_get_class_name (Class class)
{
return ((class)&&((((class)->info) & 0x1L) == 0x1L))?class->name:((class==(Class)0)?"Nil":0);
}
static inline long
class_get_instance_size (Class class)
{
return ((class)&&((((class)->info) & 0x1L) == 0x1L)) ? class->instance_size : 0;
}
static inline MetaClass
class_get_meta_class (Class class)
{
return ((class)&&((((class)->info) & 0x1L) == 0x1L)) ? class->class_pointer : (Class)0;
}
static inline Class
class_get_super_class (Class class)
{
return ((class)&&((((class)->info) & 0x1L) == 0x1L)) ? class->super_class : (Class)0;
}
static inline int
class_get_version (Class class)
{
return ((class)&&((((class)->info) & 0x1L) == 0x1L)) ? class->version : -1;
}
static inline BOOL
class_is_class (Class class)
{
return ((class)&&((((class)->info) & 0x1L) == 0x1L));
}
static inline BOOL
class_is_meta_class (Class class)
{
return ((class)&&((((class)->info) & 0x2L) == 0x2L));
}
static inline void
class_set_version (Class class, long version)
{
if (((class)&&((((class)->info) & 0x1L) == 0x1L)))
class->version = version;
}
static inline void *
class_get_gc_object_type (Class class)
{
return ((class)&&((((class)->info) & 0x1L) == 0x1L)) ? class->gc_object_type : ((void *)0);
}
extern void class_ivar_set_gcinvisible (Class class,
const char* ivarname,
BOOL gcInvisible);
static inline IMP
method_get_imp (Method_t method)
{
return (method != (Method_t)0) ? method->method_imp : (IMP) 0;
}
IMP get_imp (Class class, SEL sel);
id object_copy (id object);
id object_dispose (id object);
static inline Class
object_get_class (id object)
{
return ((object != (id)0)
? (((object->class_pointer)&&((((object->class_pointer)->info) & 0x1L) == 0x1L))
? object->class_pointer
: (((object->class_pointer)&&((((object->class_pointer)->info) & 0x2L) == 0x2L))
? (Class) object
: (Class)0))
: (Class)0);
}
static inline const char *
object_get_class_name (id object)
{
return ((object!=(id)0) ? (((object->class_pointer)&&((((object->class_pointer)->info) & 0x1L) == 0x1L))
? object->class_pointer->name
: ((Class) object)->name)
:"Nil");
}
static inline MetaClass
object_get_meta_class(id object)
{
return ((object!=(id)0) ? (((object->class_pointer)&&((((object->class_pointer)->info) & 0x1L) == 0x1L))
? object->class_pointer->class_pointer
: (((object->class_pointer)&&((((object->class_pointer)->info) & 0x2L) == 0x2L))
? object->class_pointer
:(Class)0))
: (Class)0);
}
static inline Class
object_get_super_class (id object)
{
return ((object!=(id)0) ? (((object->class_pointer)&&((((object->class_pointer)->info) & 0x1L) == 0x1L))
? object->class_pointer->super_class
: (((object->class_pointer)&&((((object->class_pointer)->info) & 0x2L) == 0x2L))
?((Class) object)->super_class
: (Class)0))
: (Class)0);
}
static inline BOOL
object_is_class (id object)
{
return (((Class) object)&&(((((Class) object)->info) & 0x1L) == 0x1L));
}
static inline BOOL
object_is_instance(id object)
{
return (object != (id)0) && ((object->class_pointer)&&((((object->class_pointer)->info) & 0x1L) == 0x1L));
}
static inline BOOL
object_is_meta_class (id object)
{
return (((Class) object)&&(((((Class) object)->info) & 0x2L) == 0x2L));
}
struct sarray* objc_get_uninstalled_dtable (void);
BOOL sel_types_match (const char* t1, const char* t2);
typedef struct
{
int quot;
int rem;
} div_t;
typedef struct
{
long int quot;
long int rem;
} ldiv_t;
extern size_t __ctype_get_mb_cur_max (void) ;
extern double atof (__const char *__nptr) __attribute__ ((__pure__));
extern int atoi (__const char *__nptr) __attribute__ ((__pure__));
extern long int atol (__const char *__nptr) __attribute__ ((__pure__));
__extension__ extern long long int atoll (__const char *__nptr)
__attribute__ ((__pure__));
extern double strtod (__const char *__restrict __nptr,
char **__restrict __endptr) ;
extern long int strtol (__const char *__restrict __nptr,
char **__restrict __endptr, int __base) ;
extern unsigned long int strtoul (__const char *__restrict __nptr,
char **__restrict __endptr, int __base)
;
__extension__
extern long long int strtoq (__const char *__restrict __nptr,
char **__restrict __endptr, int __base) ;
__extension__
extern unsigned long long int strtouq (__const char *__restrict __nptr,
char **__restrict __endptr, int __base)
;
__extension__
extern long long int strtoll (__const char *__restrict __nptr,
char **__restrict __endptr, int __base) ;
__extension__
extern unsigned long long int strtoull (__const char *__restrict __nptr,
char **__restrict __endptr, int __base)
;
extern double __strtod_internal (__const char *__restrict __nptr,
char **__restrict __endptr, int __group)
;
extern float __strtof_internal (__const char *__restrict __nptr,
char **__restrict __endptr, int __group)
;
extern long double __strtold_internal (__const char *__restrict __nptr,
char **__restrict __endptr,
int __group) ;
extern long int __strtol_internal (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base, int __group) ;
extern unsigned long int __strtoul_internal (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base, int __group) ;
__extension__
extern long long int __strtoll_internal (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base, int __group) ;
__extension__
extern unsigned long long int __strtoull_internal (__const char *
__restrict __nptr,
char **__restrict __endptr,
int __base, int __group)
;
extern __inline double
strtod (__const char *__restrict __nptr, char **__restrict __endptr)
{
return __strtod_internal (__nptr, __endptr, 0);
}
extern __inline long int
strtol (__const char *__restrict __nptr, char **__restrict __endptr,
int __base)
{
return __strtol_internal (__nptr, __endptr, __base, 0);
}
extern __inline unsigned long int
strtoul (__const char *__restrict __nptr, char **__restrict __endptr,
int __base)
{
return __strtoul_internal (__nptr, __endptr, __base, 0);
}
__extension__ extern __inline long long int
strtoq (__const char *__restrict __nptr, char **__restrict __endptr,
int __base)
{
return __strtoll_internal (__nptr, __endptr, __base, 0);
}
__extension__ extern __inline unsigned long long int
strtouq (__const char *__restrict __nptr, char **__restrict __endptr,
int __base)
{
return __strtoull_internal (__nptr, __endptr, __base, 0);
}
__extension__ extern __inline long long int
strtoll (__const char *__restrict __nptr, char **__restrict __endptr,
int __base)
{
return __strtoll_internal (__nptr, __endptr, __base, 0);
}
__extension__ extern __inline unsigned long long int
strtoull (__const char * __restrict __nptr, char **__restrict __endptr,
int __base)
{
return __strtoull_internal (__nptr, __endptr, __base, 0);
}
extern __inline double
atof (__const char *__nptr)
{
return strtod (__nptr, (char **) ((void *)0));
}
extern __inline int
atoi (__const char *__nptr)
{
return (int) strtol (__nptr, (char **) ((void *)0), 10);
}
extern __inline long int
atol (__const char *__nptr)
{
return strtol (__nptr, (char **) ((void *)0), 10);
}
__extension__ extern __inline long long int
atoll (__const char *__nptr)
{
return strtoll (__nptr, (char **) ((void *)0), 10);
}
extern char *l64a (long int __n) ;
extern long int a64l (__const char *__s) __attribute__ ((__pure__));
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
typedef __loff_t loff_t;
typedef __ino_t ino_t;
typedef __dev_t dev_t;
typedef __gid_t gid_t;
typedef __mode_t mode_t;
typedef __nlink_t nlink_t;
typedef __uid_t uid_t;
typedef __off_t off_t;
typedef __pid_t pid_t;
typedef __id_t id_t;
typedef __ssize_t ssize_t;
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
typedef __key_t key_t;
typedef __time_t time_t;
typedef __clockid_t clockid_t;
typedef __timer_t timer_t;
typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;
typedef int int8_t __attribute__ ((__mode__ (__QI__)));
typedef int int16_t __attribute__ ((__mode__ (__HI__)));
typedef int int32_t __attribute__ ((__mode__ (__SI__)));
typedef int int64_t __attribute__ ((__mode__ (__DI__)));
typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
typedef int register_t __attribute__ ((__mode__ (__word__)));
typedef int __sig_atomic_t;
typedef struct
{
unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
typedef __sigset_t sigset_t;
struct timespec
{
long int tv_sec;
long int tv_nsec;
};
struct timeval
{
__time_t tv_sec;
__suseconds_t tv_usec;
};
typedef long int __fd_mask;
typedef struct
{
__fd_mask __fds_bits[1024 / (8 * sizeof (__fd_mask))];
} fd_set;
typedef __fd_mask fd_mask;
extern int select (int __nfds, fd_set *__restrict __readfds,
fd_set *__restrict __writefds,
fd_set *__restrict __exceptfds,
struct timeval *__restrict __timeout) ;
typedef __blkcnt_t blkcnt_t;
typedef __fsblkcnt_t fsblkcnt_t;
typedef __fsfilcnt_t fsfilcnt_t;
extern long int random (void) ;
extern void srandom (unsigned int __seed) ;
extern char *initstate (unsigned int __seed, char *__statebuf,
size_t __statelen) ;
extern char *setstate (char *__statebuf) ;
struct random_data
{
int32_t *fptr;
int32_t *rptr;
int32_t *state;
int rand_type;
int rand_deg;
int rand_sep;
int32_t *end_ptr;
};
extern int random_r (struct random_data *__restrict __buf,
int32_t *__restrict __result) ;
extern int srandom_r (unsigned int __seed, struct random_data *__buf) ;
extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
size_t __statelen,
struct random_data *__restrict __buf) ;
extern int setstate_r (char *__restrict __statebuf,
struct random_data *__restrict __buf) ;
extern int rand (void) ;
extern void srand (unsigned int __seed) ;
extern int rand_r (unsigned int *__seed) ;
extern double drand48 (void) ;
extern double erand48 (unsigned short int __xsubi[3]) ;
extern long int lrand48 (void) ;
extern long int nrand48 (unsigned short int __xsubi[3]) ;
extern long int mrand48 (void) ;
extern long int jrand48 (unsigned short int __xsubi[3]) ;
extern void srand48 (long int __seedval) ;
extern unsigned short int *seed48 (unsigned short int __seed16v[3]) ;
extern void lcong48 (unsigned short int __param[7]) ;
struct drand48_data
{
unsigned short int __x[3];
unsigned short int __old_x[3];
unsigned short int __c;
unsigned short int __init;
unsigned long long int __a;
};
extern int drand48_r (struct drand48_data *__restrict __buffer,
double *__restrict __result) ;
extern int erand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
double *__restrict __result) ;
extern int lrand48_r (struct drand48_data *__restrict __buffer,
long int *__restrict __result) ;
extern int nrand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
long int *__restrict __result) ;
extern int mrand48_r (struct drand48_data *__restrict __buffer,
long int *__restrict __result) ;
extern int jrand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
long int *__restrict __result) ;
extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
;
extern int seed48_r (unsigned short int __seed16v[3],
struct drand48_data *__buffer) ;
extern int lcong48_r (unsigned short int __param[7],
struct drand48_data *__buffer) ;
extern void *realloc (void *__ptr, size_t __size) __attribute__ ((__malloc__));
extern void free (void *__ptr) ;
extern void cfree (void *__ptr) ;
extern void *alloca (size_t __size) ;
extern void *valloc (size_t __size) __attribute__ ((__malloc__));
extern void abort (void) __attribute__ ((__noreturn__));
extern int atexit (void (*__func) (void)) ;
extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
;
extern void exit (int __status) __attribute__ ((__noreturn__));
extern char *getenv (__const char *__name) ;
extern char *__secure_getenv (__const char *__name) ;
extern int putenv (char *__string) ;
extern int setenv (__const char *__name, __const char *__value, int __replace)
;
extern int unsetenv (__const char *__name) ;
extern int clearenv (void) ;
extern char *mktemp (char *__template) ;
extern int mkstemp (char *__template) ;
extern char *mkdtemp (char *__template) ;
extern int system (__const char *__command) ;
extern char *realpath (__const char *__restrict __name,
char *__restrict __resolved) ;
typedef int (*__compar_fn_t) (__const void *, __const void *);
extern void *bsearch (__const void *__key, __const void *__base,
size_t __nmemb, size_t __size, __compar_fn_t __compar);
extern void qsort (void *__base, size_t __nmemb, size_t __size,
__compar_fn_t __compar);
extern int abs (int __x) __attribute__ ((__const__));
extern long int labs (long int __x) __attribute__ ((__const__));
extern div_t div (int __numer, int __denom)
__attribute__ ((__const__));
extern ldiv_t ldiv (long int __numer, long int __denom)
__attribute__ ((__const__));
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign) ;
extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign) ;
extern char *gcvt (double __value, int __ndigit, char *__buf) ;
extern char *qecvt (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign) ;
extern char *qfcvt (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf) ;
extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign, char *__restrict __buf,
size_t __len) ;
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign, char *__restrict __buf,
size_t __len) ;
extern int qecvt_r (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign,
char *__restrict __buf, size_t __len) ;
extern int qfcvt_r (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign,
char *__restrict __buf, size_t __len) ;
extern int mblen (__const char *__s, size_t __n) ;
extern int mbtowc (wchar_t *__restrict __pwc,
__const char *__restrict __s, size_t __n) ;
extern int wctomb (char *__s, wchar_t __wchar) ;
extern size_t mbstowcs (wchar_t *__restrict __pwcs,
__const char *__restrict __s, size_t __n) ;
extern size_t wcstombs (char *__restrict __s,
__const wchar_t *__restrict __pwcs, size_t __n)
;
extern int rpmatch (__const char *__response) ;
extern int getloadavg (double __loadavg[], int __nelem) ;
typedef struct {
int offset;
unsigned size;
const char *type;
unsigned align;
unsigned qual;
BOOL isReg;
} NSArgumentInfo;
int objc_aligned_size (const char* type);
int objc_sizeof_type (const char* type);
int objc_alignof_type (const char* type);
int objc_aligned_size (const char* type);
int objc_promoted_size (const char* type);
const char* objc_skip_type_qualifiers (const char* type);
const char* objc_skip_typespec (const char* type);
const char* objc_skip_offset (const char* type);
const char* objc_skip_argspec (const char* type);
int method_get_number_of_arguments (struct objc_method*);
int method_get_sizeof_arguments (struct objc_method*);
char* method_get_first_argument (struct objc_method*,
arglist_t argframe,
const char** type);
char* method_get_next_argument (arglist_t argframe,
const char **type);
char* method_get_nth_argument (struct objc_method* m,
arglist_t argframe,
int arg,
const char **type);
unsigned objc_get_type_qualifiers (const char* type);
struct objc_struct_layout
{
const char *original_type;
const char *type;
const char *prev_type;
unsigned int record_size;
unsigned int record_align;
};
void objc_layout_structure (const char *type,
struct objc_struct_layout *layout);
BOOL objc_layout_structure_next_member (struct objc_struct_layout *layout);
void objc_layout_finish_structure (struct objc_struct_layout *layout,
unsigned int *size,
unsigned int *align);
void objc_layout_structure_get_info (struct objc_struct_layout *layout,
unsigned int *offset,
unsigned int *align,
const char **type);
extern const char* __objc_sparse2_id;
extern int nbuckets;
extern int nindices;
extern int narrays;
extern int idxsize;
extern void __assert_fail (__const char *__assertion, __const char *__file,
unsigned int __line, __const char *__function)
__attribute__ ((__noreturn__));
extern void __assert_perror_fail (int __errnum, __const char *__file,
unsigned int __line,
__const char *__function)
__attribute__ ((__noreturn__));
extern void __assert (const char *__assertion, const char *__file, int __line)
__attribute__ ((__noreturn__));
typedef size_t sidx;
struct soffset {
unsigned int boffset : (sizeof(size_t)*8)/2;
unsigned int eoffset : (sizeof(size_t)*8)/2;
};
union sofftype {
struct soffset off;
sidx idx;
};
union sversion {
int version;
void *next_free;
};
struct sbucket {
void* elems[(1<<5)];
union sversion version;
};
struct sarray {
struct sbucket** buckets;
struct sbucket* empty_bucket;
union sversion version;
short ref_count;
struct sarray* is_copy_of;
size_t capacity;
};
struct sarray* sarray_new(int, void* default_element);
void sarray_free(struct sarray*);
struct sarray* sarray_lazy_copy(struct sarray*);
void sarray_realloc(struct sarray*, int new_size);
void sarray_at_put(struct sarray*, sidx index, void* elem);
void sarray_at_put_safe(struct sarray*, sidx index, void* elem);
struct sarray* sarray_hard_copy(struct sarray*);
void sarray_remove_garbage(void);
static inline unsigned int
soffset_decode(sidx index)
{
union sofftype x;
x.idx = index;
return x.off.eoffset + (x.off.boffset*(1<<5));
}
static inline sidx
soffset_encode(size_t offset)
{
union sofftype x;
x.off.eoffset = offset%(1<<5);
x.off.boffset = offset/(1<<5);
return (sidx)x.idx;
}
static inline void* sarray_get(struct sarray* array, sidx index)
{
union sofftype x;
x.idx = index;
return array->buckets[x.off.boffset]->elems[x.off.eoffset];
}
static inline void* sarray_get_safe(struct sarray* array, sidx index)
{
if(soffset_decode(index) < array->capacity)
return sarray_get(array, index);
else
return (array->empty_bucket->elems[0]);
}
BOOL
mframe_dissect_call (arglist_t argframe, const char *types,
void (*encoder)(int,void*,const char*,int));
BOOL
mframe_dissect_call_opts (arglist_t argframe, const char *types,
void (*encoder)(int,void*,const char*,int),
BOOL pass_pointers);
void
mframe_do_call (const char *encoded_types,
void(*decoder)(int,void*,const char*),
void(*encoder)(int,void*,const char*,int));
void
mframe_do_call_opts (const char *encoded_types,
void(*decoder)(int,void*,const char*),
void(*encoder)(int,void*,const char*,int),
BOOL pass_pointers);
retval_t
mframe_build_return (arglist_t argframe, const char *types,
BOOL out_parameters,
void(*decoder)(int,void*,const char*,int));
retval_t
mframe_build_return_opts (arglist_t argframe, const char *types,
BOOL out_parameters,
void(*decoder)(int,void*,const char*,int),
BOOL pass_pointers);
BOOL
mframe_decode_return(const char *type, void* buffer, void* retframe);
void*
mframe_handle_return(const char* type, void* retval, arglist_t argFrame);
const char *
mframe_next_arg(const char *typePtr, NSArgumentInfo *info);
char*
mframe_build_signature(const char *typePtr, int *size, int *narg, char *buf);
arglist_t
mframe_create_argframe(const char *types, void** retbuf);
void
mframe_destroy_argframe(const char *types, arglist_t argframe);
inline static void*
mframe_arg_addr(arglist_t argf, NSArgumentInfo *info)
{
int offset = info->offset;
if (info->isReg)
{
return(argf->arg_regs + offset);
}
else
{
return(argf->arg_ptr + offset);
}
}
inline static void
mframe_get_arg(arglist_t argf, NSArgumentInfo *info, void* buffer)
{
memcpy(buffer, mframe_arg_addr(argf, info), info->size);
}
inline static void
mframe_set_arg(arglist_t argf, NSArgumentInfo *info, void* buffer)
{
memcpy(mframe_arg_addr(argf, info), buffer, info->size);
}
inline static void
mframe_cpy_arg(arglist_t dst, arglist_t src, NSArgumentInfo *info)
{
memcpy(mframe_arg_addr(dst, info), mframe_arg_addr(src, info), info->size);
}
void *__builtin_alloca (size_t);
char*
mframe_build_signature(const char *typePtr, int *size, int *narg, char *buf)
{
int cum;
BOOL doMalloc = (BOOL)0;
const char *types;
char *start;
char *dest;
int total = 0;
int count = 0;
if (buf == 0)
{
doMalloc = (BOOL)1;
buf = __builtin_alloca ((strlen(typePtr)+1)*16);
}
types = objc_skip_typespec(typePtr);
(__extension__ (__builtin_constant_p (typePtr) && __builtin_constant_p (types - typePtr) ? (strlen (typePtr) + 1 >= ((size_t) (types - typePtr)) ? (char *) memcpy (buf, typePtr, types - typePtr) : strncpy (buf, typePtr, types - typePtr)) : strncpy (buf, typePtr, types - typePtr)));
buf[types-typePtr] = '\0';
types = objc_skip_type_qualifiers(typePtr);
((cum) = (*(types)=='{' || *(types)=='(' || *(types)=='[') ? sizeof(void*) : 0);
types = objc_skip_typespec(types);
if (*types == '+')
{
types++;
}
while (({ char _ch = *types; (_ch >= '0' && _ch <= '9'); }))
types++;
start = &buf[strlen(buf)+10];
dest = start;
while (types && *types)
{
const char *qual = types;
types = objc_skip_type_qualifiers(types);
while (qual < types)
{
*dest++ = *qual++;
}
({ const char* type = (types); int align = objc_alignof_type(type); int size = objc_sizeof_type(type); (cum) = ({ typeof((cum)) __v=((cum)); typeof(align) __a=(align); __a*((__v+__a-1)/__a); }); (types) = objc_skip_typespec(type); sprintf((dest), "%.*s%d", (types)-type, type, (cum)); if (*(types) == '+') { (types)++; } while (({ char _ch = *(types); (_ch >= '0' && _ch <= '9'); })) { (types)++; } (dest)=&(dest)[strlen(dest)]; if ((*type=='{'||*type=='('||*type=='[')&&size>2) { (total) = (cum) + ({ typeof(size) __v=(size); typeof(align) __a=(align); __a*((__v+__a-1)/__a); }); } else { (total) = (cum) + size; } (cum) += ({ typeof(size) __v=(size); typeof(sizeof(void*)) __a=(sizeof(void*)); __a*((__v+__a-1)/__a); }); });
count++;
}
*dest = '\0';
sprintf(&buf[strlen(buf)], "%d", total);
dest = &buf[strlen(buf)];
while (*start)
{
*dest++ = *start++;
}
*dest = '\0';
if (doMalloc)
{
char *tmp = objc_malloc(dest - buf + 1);
(__extension__ (__builtin_constant_p (buf) ? (((size_t)(const void *)((buf) + 1) - (size_t)(const void *)(buf) == 1) && strlen (buf) + 1 <= 8 ? __strcpy_small (tmp, __extension__ (((__const unsigned char *) (__const char *) (buf))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) (buf))[0]), __extension__ (((__const unsigned char *) (__const char *) (buf))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) (buf))[4]), __extension__ (((((__const unsigned char *) (__const char *) (buf))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) (buf))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) (buf))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) (buf))[0]), __extension__ (((((__const unsigned char *) (__const char *) (buf))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) (buf))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) (buf))[4 + 1]) << 8 | ((__const unsigned char *) (__const char *) (buf))[4]), strlen!
(buf) + 1) : (char *) memcpy (tmp, buf, strlen (buf) + 1)) : strcpy (tmp, buf)));
buf = tmp;
}
if (size)
{
*size = total;
}
if (narg)
{
*narg = count;
}
return buf;
}
const char *
mframe_next_arg(const char *typePtr, NSArgumentInfo *info)
{
NSArgumentInfo local;
BOOL flag;
if (info == 0)
{
info = &local;
}
flag = (BOOL)1;
info->qual = 0;
while (flag)
{
switch (*typePtr)
{
case 'r': info->qual |= 0x01; break;
case 'n': info->qual |= 0x01; break;
case 'N': info->qual |= 0x03; break;
case 'o': info->qual |= 0x02; break;
case 'O': info->qual |= 0x04; break;
case 'R': info->qual |= 0x08; break;
case 'V': info->qual |= 0x10; break;
default: flag = (BOOL)0;
}
if (flag)
{
typePtr++;
}
}
info->type = typePtr;
switch (*typePtr++)
{
case '@':
info->size = sizeof(id);
info->align = __alignof__(id);
break;
case '#':
info->size = sizeof(Class);
info->align = __alignof__(Class);
break;
case ':':
info->size = sizeof(SEL);
info->align = __alignof__(SEL);
break;
case 'c':
info->size = sizeof(char);
info->align = __alignof__(char);
break;
case 'C':
info->size = sizeof(unsigned char);
info->align = __alignof__(unsigned char);
break;
case 's':
info->size = sizeof(short);
info->align = __alignof__(short);
break;
case 'S':
info->size = sizeof(unsigned short);
info->align = __alignof__(unsigned short);
break;
case 'i':
info->size = sizeof(int);
info->align = __alignof__(int);
break;
case 'I':
info->size = sizeof(unsigned int);
info->align = __alignof__(unsigned int);
break;
case 'l':
info->size = sizeof(long);
info->align = __alignof__(long);
break;
case 'L':
info->size = sizeof(unsigned long);
info->align = __alignof__(unsigned long);
break;
case 'q':
info->size = sizeof(long long);
info->align = __alignof__(long long);
break;
case 'Q':
info->size = sizeof(unsigned long long);
info->align = __alignof__(unsigned long long);
break;
case 'f':
info->size = sizeof(float);
info->align = __alignof__(float);
break;
case 'd':
info->size = sizeof(double);
info->align = __alignof__(double);
break;
case '^':
info->size = sizeof(char*);
info->align = __alignof__(char*);
if (*typePtr == '?')
{
typePtr++;
}
else
{
typePtr = mframe_next_arg(typePtr, &local);
info->isReg = local.isReg;
info->offset = local.offset;
}
break;
case '%':
case '*':
info->size = sizeof(char*);
info->align = __alignof__(char*);
break;
case '[':
{
int length = atoi(typePtr);
while (({ char _ch = *typePtr; (_ch >= '0' && _ch <= '9'); }))
typePtr++;
typePtr = mframe_next_arg(typePtr, &local);
info->size = length * ({ typeof(local.size) __v=(local.size); typeof(local.align) __a=(local.align); __a*((__v+__a-1)/__a); });
info->align = local.align;
typePtr++;
}
break;
case '{':
{
struct { int x; double y; } fooalign;
int acc_size = 0;
int acc_align = __alignof__(fooalign);
while (*typePtr != '}')
{
if (*typePtr++ == '=')
{
break;
}
}
if (*typePtr != '}')
{
typePtr = mframe_next_arg(typePtr, &local);
if (typePtr == 0)
{
return 0;
}
acc_size = ({ typeof(acc_size) __v=(acc_size); typeof(local.align) __a=(local.align); __a*((__v+__a-1)/__a); });
acc_size += local.size;
acc_align = (((local.align)>(__alignof__(fooalign)))?(local.align):(__alignof__(fooalign)));
}
while (*typePtr != '}')
{
typePtr = mframe_next_arg(typePtr, &local);
if (typePtr == 0)
{
return 0;
}
acc_size = ({ typeof(acc_size) __v=(acc_size); typeof(local.align) __a=(local.align); __a*((__v+__a-1)/__a); });
acc_size += local.size;
}
info->size = acc_size;
info->align = acc_align;
typePtr++;
}
break;
case '(':
{
int max_size = 0;
int max_align = 0;
while (*typePtr != ')')
{
if (*typePtr++ == '=')
{
break;
}
}
while (*typePtr != ')')
{
typePtr = mframe_next_arg(typePtr, &local);
if (typePtr == 0)
{
return 0;
}
max_size = (((max_size)>(local.size))?(max_size):(local.size));
max_align = (((max_align)>(local.align))?(max_align):(local.align));
}
info->size = max_size;
info->align = max_align;
typePtr++;
}
break;
case 'v':
info->size = 0;
info->align = __alignof__(char*);
break;
default:
return 0;
}
if (typePtr == 0)
{
return 0;
}
if (info->type[0] != '^' || info->type[1] == '?')
{
BOOL negFlag = (BOOL)0;
if (*typePtr == '-')
{
typePtr++;
negFlag = (BOOL)1;
info->isReg = (BOOL)0;
}
else if (*typePtr == '+')
{
typePtr++;
info->isReg = (BOOL)1;
}
else
info->isReg = (BOOL)0;
info->offset = 0;
while (({ char _ch = *typePtr; (_ch >= '0' && _ch <= '9'); }))
info->offset = info->offset * 10 + (*typePtr++ - '0');
if (negFlag)
info->offset *= -1;
}
return typePtr;
}
int
method_types_get_number_of_arguments (const char *type)
{
int i = 0;
while (*type)
{
type = objc_skip_argspec (type);
i += 1;
}
return i - 1;
}
int
method_types_get_size_of_stack_arguments (const char *type)
{
type = objc_skip_typespec (type);
return atoi (type);
}
int
method_types_get_size_of_register_arguments(const char *types)
{
const char* type = strrchr(types, '+');
if (type)
{
return atoi(++type) + sizeof(void*);
}
else
{
return 0;
}
}
char*
method_types_get_next_argument (arglist_t argf, const char **type)
{
const char *t = objc_skip_argspec (*type);
arglist_t argframe;
argframe = (void*)argf;
if (*t == '\0')
{
return 0;
}
*type = t;
t = objc_skip_typespec (t);
if (*t == '+')
{
return argframe->arg_regs + atoi(++t);
}
else
{
return argframe->arg_ptr + atoi(t);
}
}
BOOL
mframe_dissect_call_opts (arglist_t argframe, const char *type,
void (*encoder)(int,void*,const char*,int),
BOOL pass_pointers)
{
unsigned flags;
char *datum;
int argnum;
BOOL out_parameters = (BOOL)0;
if (*type == '{' || *type == '(' || *type == '[') {
datum = __builtin_alloca ((strlen(type)+1)*10);
type = mframe_build_signature(type, 0, 0, datum);
}
for (datum = method_types_get_next_argument(argframe, &type), argnum=0;
datum;
datum = method_types_get_next_argument(argframe, &type), argnum++)
{
flags = objc_get_type_qualifiers(type);
type = objc_skip_type_qualifiers(type);
switch (*type)
{
case '*':
if ((flags & 0x02) || !(flags & 0x01))
out_parameters = (BOOL)1;
if ((flags & 0x01) || !(flags & 0x02))
(*encoder) (argnum, datum, type, flags);
break;
case '^':
if ((flags & 0x02) || !(flags & 0x01))
out_parameters = (BOOL)1;
if (pass_pointers) {
if ((flags & 0x01) || !(flags & 0x02))
(*encoder) (argnum, datum, type, flags);
}
else {
type++;
if ((flags & 0x01) || !(flags & 0x02))
(*encoder) (argnum, *(void**)datum, type, flags);
}
break;
case '{':
case '(':
case '[':
(*encoder) (argnum, datum, type, flags);
break;
default:
(*encoder) (argnum, datum, type, flags);
}
}
return out_parameters;
}
BOOL
mframe_dissect_call (arglist_t argframe, const char *type,
void (*encoder)(int,void*,const char*,int))
{
return mframe_dissect_call_opts(argframe, type, encoder, (BOOL)0);
}
void
mframe_do_call_opts (const char *encoded_types,
void(*decoder)(int,void*,const char*),
void(*encoder)(int,void*,const char*,int),
BOOL pass_pointers)
{
const char *type;
const char *tmptype;
const char *etmptype;
id object;
SEL selector;
IMP method_implementation;
int stack_argsize;
int reg_argsize;
arglist_t argframe;
char *datum;
unsigned flags;
int argnum;
void *retframe;
BOOL out_parameters = (BOOL)0;
float retframe_float (void *rframe)
{
__builtin_return (rframe);
}
double retframe_double (void *rframe)
{
__builtin_return (rframe);
}
char retframe_char (void *rframe)
{
__builtin_return (rframe);
}
short retframe_short (void *rframe)
{
__builtin_return (rframe);
}
(*decoder) (0, &object, @encode(id));
((void) ((object) ? 0 : (__assert_fail ("object", "/home/swarm/swarm-2001-06-06/libobjc/mframe.m", 824, __PRETTY_FUNCTION__), 0)));
(*decoder) (1, &selector, ":");
((void) ((selector) ? 0 : (__assert_fail ("selector", "/home/swarm/swarm-2001-06-06/libobjc/mframe.m", 830, __PRETTY_FUNCTION__), 0)));
type = sel_get_type (selector);
((void) ((type) ? 0 : (__assert_fail ("type", "/home/swarm/swarm-2001-06-06/libobjc/mframe.m", 862, __PRETTY_FUNCTION__), 0)));
((void) ((sel_types_match(encoded_types, type)) ? 0 : (__assert_fail ("sel_types_match(encoded_types, type)", "/home/swarm/swarm-2001-06-06/libobjc/mframe.m", 863, __PRETTY_FUNCTION__), 0)));
if (*type == '{' || *type == '(' || *type == '[') {
tmptype = __builtin_alloca ((strlen(type)+1)*10);
type = mframe_build_signature(type, 0, 0, (char*)tmptype);
}
stack_argsize = method_types_get_size_of_stack_arguments (type);
reg_argsize = method_types_get_size_of_register_arguments (type);
argframe = (arglist_t) __builtin_alloca (sizeof(char*) + reg_argsize);
if (stack_argsize)
argframe->arg_ptr = __builtin_alloca (stack_argsize);
else
argframe->arg_ptr = 0;
if (*type == '{' || *type == '(' || *type == '[')
{
void *buf;
buf = __builtin_alloca (objc_sizeof_type(type));
({if (*(type)=='{' || *(type)=='(' || *(type)=='[') *(void**)(argframe)->arg_ptr = (buf);});
}
tmptype = type;
etmptype = objc_skip_argspec (encoded_types);
datum = method_types_get_next_argument (argframe, &tmptype);
((void) ((datum) ? 0 : (__assert_fail ("datum", "/home/swarm/swarm-2001-06-06/libobjc/mframe.m", 908, __PRETTY_FUNCTION__), 0)));
((void) ((*tmptype == '@') ? 0 : (__assert_fail ("*tmptype == '@'", "/home/swarm/swarm-2001-06-06/libobjc/mframe.m", 909, __PRETTY_FUNCTION__), 0)));
*(id*)datum = object;
etmptype = objc_skip_argspec(etmptype);
datum = method_types_get_next_argument(argframe, &tmptype);
((void) ((datum) ? 0 : (__assert_fail ("datum", "/home/swarm/swarm-2001-06-06/libobjc/mframe.m", 916, __PRETTY_FUNCTION__), 0)));
((void) ((*tmptype == ':') ? 0 : (__assert_fail ("*tmptype == ':'", "/home/swarm/swarm-2001-06-06/libobjc/mframe.m", 917, __PRETTY_FUNCTION__), 0)));
*(SEL*)datum = selector;
for (datum = method_types_get_next_argument (argframe, &tmptype),
etmptype = objc_skip_argspec (etmptype), argnum = 2;
datum;
datum = method_types_get_next_argument (argframe, &tmptype),
etmptype = objc_skip_argspec (etmptype), argnum++)
{
flags = objc_get_type_qualifiers (etmptype);
tmptype = objc_skip_type_qualifiers(tmptype);
switch (*tmptype)
{
case '*':
if ((flags & 0x02) || !(flags & 0x01))
out_parameters = (BOOL)1;
if ((flags & 0x01) || !(flags & 0x02))
(*decoder) (argnum, datum, tmptype);
break;
case '^':
if ((flags & 0x02) || !(flags & 0x01))
out_parameters = (BOOL)1;
if (pass_pointers)
{
if ((flags & 0x01) || !(flags & 0x02))
(*decoder) (argnum, datum, tmptype);
}
else
{
tmptype++;
*(void**)datum = __builtin_alloca (objc_sizeof_type (tmptype));
if ((flags & 0x01) || !(flags & 0x02))
(*decoder) (argnum, *(void**)datum, tmptype);
}
break;
case '{':
case '(':
case '[':
(*decoder) (argnum, datum, tmptype);
break;
default:
(*decoder) (argnum, datum, tmptype);
}
}
(*decoder) (-1, 0, 0);
method_implementation = objc_msg_lookup (object, selector);
((void) ((method_implementation) ? 0 : (__assert_fail ("method_implementation", "/home/swarm/swarm-2001-06-06/libobjc/mframe.m", 1041, __PRETTY_FUNCTION__), 0)));
retframe = __builtin_apply((void(*)(void))method_implementation,
argframe,
stack_argsize);
flags = objc_get_type_qualifiers (encoded_types);
etmptype = objc_skip_type_qualifiers (encoded_types);
tmptype = objc_skip_type_qualifiers (type);
switch (*tmptype)
{
case 'v':
if ((flags & 0x10) == 0)
{
int dummy = 0;
(*encoder) (-1, (void*)&dummy, @encode(int), 0);
}
break;
case '^':
if (pass_pointers)
{
(*encoder) (-1, retframe, tmptype, flags);
}
else
{
tmptype++;
(*encoder) (-1, *(void**)retframe, tmptype, flags);
}
break;
case '{':
case '(':
case '[':
(*encoder)(-1, ((*(tmptype)=='{' || *(tmptype)=='(' || *(tmptype)=='[') ? *(void**)(argframe)->arg_ptr : (void*)0), tmptype, flags);
break;
case 'f':
{
float ret = retframe_float (retframe);
(*encoder) (-1, &ret, tmptype, flags);
break;
}
case 'd':
{
double ret = retframe_double (retframe);
(*encoder) (-1, &ret, tmptype, flags);
break;
}
case 's':
case 'S':
{
short ret = retframe_short (retframe);
(*encoder) (-1, &ret, tmptype, flags);
break;
}
case 'c':
case 'C':
{
char ret = retframe_char (retframe);
(*encoder) (-1, &ret, tmptype, flags);
break;
}
default:
(*encoder) (-1, retframe, tmptype, flags);
}
if (out_parameters)
{
for (datum = method_types_get_next_argument (argframe, &tmptype),
argnum = 1,
etmptype = objc_skip_argspec (etmptype);
datum;
datum = method_types_get_next_argument (argframe, &tmptype),
argnum++,
etmptype = objc_skip_argspec (etmptype))
{
flags = objc_get_type_qualifiers(etmptype);
tmptype = objc_skip_type_qualifiers (tmptype);
if ((*tmptype == '^')
&& ((flags & 0x02) || !(flags & 0x01)))
{
tmptype++;
(*encoder) (argnum, *(void**)datum, tmptype, flags);
}
else if (*tmptype == '*'
&& ((flags & 0x02) || !(flags & 0x01)))
{
(*encoder) (argnum, datum, tmptype, flags);
}
}
}
return;
}
void
mframe_do_call (const char *encoded_types,
void(*decoder)(int,void*,const char*),
void(*encoder)(int,void*,const char*,int))
{
mframe_do_call_opts(encoded_types, decoder, encoder, (BOOL)0);
}
retval_t
mframe_build_return_opts (arglist_t argframe,
const char *type,
BOOL out_parameters,
void(*decoder)(int,void*,const char*,int),
BOOL pass_pointers)
{
retval_t retframe = ((void *)0);
int retsize;
int argnum;
int flags;
const char *tmptype;
void *datum;
const char *rettype;
typedef struct { id many[8];} __big;
__big return_block (void* data)
{
return *(__big*)data;
}
char return_char (char data)
{
return data;
}
double return_double (double data)
{
return data;
}
float return_float (float data)
{
return data;
}
short return_short (short data)
{
return data;
}
retval_t apply_block(void* data)
{
void* args = __builtin_apply_args();
return __builtin_apply((apply_t)return_block, args, sizeof(void*));
}
retval_t apply_char(char data)
{
void* args = __builtin_apply_args();
return __builtin_apply((apply_t)return_char, args, sizeof(void*));
}
retval_t apply_float(float data)
{
void* args = __builtin_apply_args();
return __builtin_apply((apply_t)return_float, args, sizeof(float));
}
retval_t apply_double(double data)
{
void* args = __builtin_apply_args();
return __builtin_apply((apply_t)return_double, args, sizeof(double));
}
retval_t apply_short(short data)
{
void* args = __builtin_apply_args();
return __builtin_apply((apply_t)return_short, args, sizeof(void*));
}
if (*type == '{' || *type == '(' || *type == '[')
{
tmptype = __builtin_alloca ((strlen(type)+1)*10);
type = mframe_build_signature(type, 0, 0, (char*)tmptype);
}
flags = objc_get_type_qualifiers(type);
tmptype = objc_skip_type_qualifiers(type);
rettype = tmptype;
if (out_parameters || *tmptype != 'v' || (flags & 0x10) == 0)
{
if (*tmptype != 'v' || (flags & 0x10) == 0)
{
if (*tmptype == 'v')
retsize = sizeof(void*);
else
retsize = objc_sizeof_type (tmptype);
retframe = __builtin_alloca ((((retsize)>(sizeof(void*)*4))?(retsize):(sizeof(void*)*4)));
switch (*tmptype)
{
case '^':
if (pass_pointers)
{
(*decoder) (-1, retframe, tmptype, flags);
}
else
{
unsigned retLength;
tmptype++;
retLength = objc_sizeof_type(tmptype);
*(void**)retframe =
objc_malloc (retLength);
(*decoder) (-1, *(void**)retframe, tmptype, flags);
}
break;
case '{':
case '(':
case '[':
*(void**)retframe = ((*(tmptype)=='{' || *(tmptype)=='(' || *(tmptype)=='[') ? *(void**)(argframe)->arg_ptr : (void*)0);
(*decoder) (-1, *(void**)retframe, tmptype, flags);
break;
case 'f':
case 'd':
(*decoder) (-1, ((char*)retframe), tmptype, flags);
break;
case 'v':
{
(*decoder) (-1, retframe, @encode(int), 0);
}
break;
default:
if (retsize < sizeof(void*))
{
(*decoder) (-1, retframe, tmptype, flags);
}
else
{
(*decoder) (-1, retframe, tmptype, flags);
}
}
}
if (out_parameters)
{
for (datum = method_types_get_next_argument(argframe, &tmptype),
argnum=0;
datum;
(datum = method_types_get_next_argument(argframe, &tmptype)),
argnum++)
{
flags = objc_get_type_qualifiers(tmptype);
tmptype = objc_skip_type_qualifiers(tmptype);
if (*tmptype == '^'
&& ((flags & 0x02) || !(flags & 0x01)))
{
tmptype++;
(*decoder) (argnum, *(void**)datum, tmptype, flags);
}
else if (*tmptype == '*'
&& ((flags & 0x02) || !(flags & 0x01)))
{
(*decoder) (argnum, datum, tmptype, flags);
}
}
}
(*decoder) (0, 0, 0, 0);
}
else
{
retframe = __builtin_alloca (sizeof(void*));
}
switch (*rettype) {
case 'c':
case 'C':
return apply_char(*(char*)retframe);
case 'd':
return apply_double(*(double*)retframe);
case 'f':
return apply_float(*(float*)retframe);
case 's':
case 'S':
return apply_short(*(short*)retframe);
}
return retframe;
}
retval_t
mframe_build_return (arglist_t argframe,
const char *type,
BOOL out_parameters,
void(*decoder)(int,void*,const char*,int))
{
return mframe_build_return_opts(argframe,type,out_parameters,decoder,(BOOL)0);
}
arglist_t
mframe_create_argframe(const char *types, void** retbuf)
{
arglist_t argframe = objc_calloc(8, 1);
const char* rtype = objc_skip_type_qualifiers(types);
int stack_argsize = atoi(objc_skip_typespec(rtype));
if (stack_argsize)
{
argframe->arg_ptr = objc_calloc(stack_argsize, 1);
}
else
{
argframe->arg_ptr = 0;
}
if (*rtype == '{' || *rtype == '(' || *rtype == '[')
{
if (*retbuf == 0)
{
*retbuf = objc_calloc(objc_sizeof_type(rtype), 1);
}
({if (*(rtype)=='{' || *(rtype)=='(' || *(rtype)=='[') *(void**)(argframe)->arg_ptr = (*retbuf);});
}
return argframe;
}
void
mframe_destroy_argframe(const char *types, arglist_t argframe)
{
const char* rtype = objc_skip_type_qualifiers(types);
int stack_argsize = atoi(objc_skip_typespec(rtype));
if (stack_argsize)
{
objc_free(argframe->arg_ptr);
}
objc_free(argframe);
}
static void
getSizeAndAlignment(const char *typePtr, unsigned *sizep, unsigned *alignp)
{
NSArgumentInfo info;
typePtr = mframe_next_arg(typePtr, &info);
if (sizep)
*sizep = info.size;
if (alignp)
*alignp = info.align;
}
BOOL
mframe_decode_return (const char *type, void* buffer, void* retframe)
{
int size = 0;
type = objc_skip_type_qualifiers(type);
getSizeAndAlignment(type, &size, 0);
switch (*type)
{
case '@':
{
inline id retframe_id(void *rframe)
{
__builtin_return (rframe);
}
*(id*)buffer = retframe_id(retframe);
break;
}
case '#':
{
inline Class retframe_Class(void *rframe)
{
__builtin_return (rframe);
}
*(Class*)buffer = retframe_Class(retframe);
break;
}
case ':':
{
inline SEL retframe_SEL(void *rframe)
{
__builtin_return (rframe);
}
*(SEL*)buffer = retframe_SEL(retframe);
break;
}
case 'c':
case 'C':
{
inline unsigned char retframe_char(void *rframe)
{
__builtin_return (rframe);
}
*(unsigned char*)buffer = retframe_char(retframe);
break;
}
case 's':
case 'S':
{
inline unsigned short retframe_short(void *rframe)
{
__builtin_return (rframe);
}
*(unsigned short*)buffer = retframe_short(retframe);
break;
}
case 'i':
case 'I':
{
inline unsigned int retframe_int(void *rframe)
{
__builtin_return (rframe);
}
*(unsigned int*)buffer = retframe_int(retframe);
break;
}
case 'l':
case 'L':
{
inline unsigned long retframe_long(void *rframe)
{
__builtin_return (rframe);
}
*(unsigned long*)buffer = retframe_long(retframe);
break;
}
case 'q':
case 'Q':
{
inline unsigned long long retframe_longlong(void *rframe)
{
__builtin_return (rframe);
}
*(unsigned long long*)buffer = retframe_longlong(retframe);
break;
}
case 'f':
{
inline float retframe_float(void *rframe)
{
__builtin_return (rframe);
}
*(float*)buffer = retframe_float(retframe);
break;
}
case 'd':
{
inline double retframe_double(void *rframe)
{
__builtin_return (rframe);
}
*(double*)buffer = retframe_double(retframe);
break;
}
case '^':
case '%':
case '*':
{
inline char* retframe_pointer(void *rframe)
{
__builtin_return (rframe);
}
*(char**)buffer = retframe_pointer(retframe);
break;
}
case '[':
case '{':
case '(':
{
typedef struct {
char val[size];
} block;
inline block retframe_block(void *rframe)
{
__builtin_return (rframe);
}
*(block *) buffer = retframe_block (retframe);
break;
}
case 'v':
break;
default:
return (BOOL)0;
}
return (BOOL)1;
}
void*
mframe_handle_return(const char* type, void* retval, arglist_t argframe)
{
retval_t retframe;
typedef struct { id many[8];} __big;
__big return_block (void* data)
{
return *(__big*)data;
}
char return_char (char data)
{
return data;
}
double return_double (double data)
{
return data;
}
float return_float (float data)
{
return data;
}
short return_short (short data)
{
return data;
}
retval_t apply_block(void* data)
{
void* args = __builtin_apply_args();
return __builtin_apply((apply_t)return_block, args, sizeof(void*));
}
retval_t apply_char(char data)
{
void* args = __builtin_apply_args();
return __builtin_apply((apply_t)return_char, args, sizeof(void*));
}
retval_t apply_float(float data)
{
void* args = __builtin_apply_args();
return __builtin_apply((apply_t)return_float, args, sizeof(float));
}
retval_t apply_double(double data)
{
void* args = __builtin_apply_args();
return __builtin_apply((apply_t)return_double, args, sizeof(double));
}
retval_t apply_short(short data)
{
void* args = __builtin_apply_args();
return __builtin_apply((apply_t)return_short, args, sizeof(void*));
}
retframe = __builtin_alloca (116);
switch (*type)
{
case 'v':
break;
case 'c':
case 'C':
return apply_char(*(char*)retval);
case 'd':
return apply_double(*(double*)retval);
case 'f':
return apply_float(*(float*)retval);
case 's':
case 'S':
return apply_short(*(short*)retval);
case '[':
case '(':
case '{':
{
int size = objc_sizeof_type(type);
void *dest;
dest = ((*(type)=='{' || *(type)=='(' || *(type)=='[') ? *(void**)(argframe)->arg_ptr : (void*)0);
memcpy(dest, retval, size);
break;
}
default:
memcpy(retframe, retval, objc_sizeof_type(type));
break;
}
return retframe;
}
--------------------- File ends -------------------
End of Report
>Release-Note:
>Audit-Trail:
>Unformatted:
--- Note ---
This is second try; qmail at sourceware gave reject because To: header
was missing, but then I also got a tracking ID of 3019. So, I'm sending
again, just in case.
--- End of note ---
Synopsis:ICE in compiling a .mi file
Class: ice-on-illegal-code