Greg
977a09e77e
Objective C type parameter declarations. Check Typedefs when determining if a Type is a pointer or a function.
60 lines
630 B
Objective-C
60 lines
630 B
Objective-C
#import "simple.h"
|
|
|
|
@implementation ClassOne
|
|
|
|
- (ClassOne*) init
|
|
{
|
|
ClassOne *ret;
|
|
ret = [ClassOne alloc];
|
|
ret->i1 = 12;
|
|
ret->p1 = malloc(sizeof(int));
|
|
*ret->p1 = 16;
|
|
ret->a1[0] = 4;
|
|
ret ->a1[1] = 5;
|
|
return ret;
|
|
}
|
|
|
|
- (int) geti1
|
|
{
|
|
return i1;
|
|
}
|
|
|
|
- (int *) getp1
|
|
{
|
|
return p1;
|
|
}
|
|
|
|
- (int (*)()) getf1
|
|
{
|
|
return f;
|
|
}
|
|
|
|
- (int) hi1:(struct stru)in
|
|
{
|
|
return in.a;
|
|
}
|
|
|
|
- (int) hi2:(struct stru*)in
|
|
{
|
|
return in->a;
|
|
}
|
|
|
|
- (struct stru) nstru1
|
|
{
|
|
struct stru ret;
|
|
ret.a = 7;
|
|
ret.b = 8;
|
|
return ret;
|
|
}
|
|
- (struct stru*) nstru2
|
|
{
|
|
struct stru* ret;
|
|
ret = malloc(sizeof(struct stru));
|
|
ret->a = 9;
|
|
ret->b = 10;
|
|
return ret;
|
|
}
|
|
|
|
@end
|
|
|