#scope_export;

UInt :: u64;

Id    :: *object;
Class :: *class;
Sel   :: *selector;

Bool :: u8;

True  : Bool : 1;
False : Bool : 0;

msg_send       :: () #foreign objc "objc_msgSend";
msg_send_super :: () #foreign objc "objc_msgSend_super";
msg_send_fpret :: () #foreign objc "objc_msgSend_fpret";
msg_send_stret :: () #foreign objc "objc_msgSend_stret";

get_class :: (name: *u8) -> Class #foreign objc "objc_getClass";

sel_get_name :: (sel: Sel) -> *u8 #foreign objc "sel_getName";
sel_register_name :: (str: *u8) -> Sel #foreign objc "sel_registerName";
sel_get_uid :: (str: *u8) -> Sel #foreign objc "sel_getUid";

obj_get_class :: (obj: Id) -> Class #foreign objc "object_getClass";
obj_set_class :: (obj: Id, cls: Class) -> Class #foreign objc "object_setClass";
obj_is_class :: (obj: Id) -> Bool #foreign objc "object_isClass";
obj_get_class_name :: (obj: Id) -> *u8 #foreign objc "object_getClassName";
obj_copy :: (obj: Id, size: u64) -> Id #foreign objc "object_copy";
obj_dispose :: (obj: Id) -> Id #foreign objc "object_dispose";

class_get_name  :: (cls: Class) -> *u8 #foreign objc "class_getName";
class_get_super :: (cls: Class) -> Class #foreign objc "class_getSuperclass";

#scope_module;

class    :: struct {};
object   :: struct {};
method   :: struct {};
ivar     :: struct {};
category :: struct {};
protocol :: struct {};
selector :: struct {};

objc :: #library,system,link_always,no_dll "libobjc";

#import "jc";
