Commit Graph

38 Commits

Author SHA1 Message Date
Ondřej Bílka cad10e055f class.c: Fix typos.
2013-07-21   Ondřej Bílka  <neleai@seznam.cz>

	* class.c: Fix typos.
	* encoding.c: Likewise.
	* init.c: Likewise.
	* objc-private/runtime.h: Likewise.
	* objc/runtime.h: Likewise.
	* objc-sync.c: Likewise.

From-SVN: r201097
2013-07-21 15:38:21 +00:00
Richard Sandiford ad2466aee4 Update copyright years in libobjc.
From-SVN: r195693
2013-02-03 11:16:21 +00:00
Jakub Jelinek 90d04a445c Update Copyright years for files modified in 2011 and/or 2012.
From-SVN: r194903
2013-01-04 13:49:55 +01:00
Nicola Pero 7c172073f5 In libobjc/: 2011-06-08 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2011-06-08  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc/README: Updated.
	* objc-private/selector.h: Updated comments.

From-SVN: r174791
2011-06-08 02:53:39 +00:00
Nicola Pero 0b0b41a89e In libobjc/: 2011-06-07 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2011-06-07  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-private/module-abi-8.h (class_get_instance_size): Removed.
	* objects.c (class_create_instance): Removed.
	* error.c (__USE_FIXED_PROTOTYPES__): Removed.
	* gc.c (__objc_generate_gc_type_description): Use
	class_getInstanceSize() instead of class_get_instance_size().
	* selector.c (sel_types_match): Made static.
	(sel_get_typed_uid): Removed.
	(sel_get_any_typed_uid): Removed.
	(sel_get_name): Removed.
	(sel_get_type): Removed.
	(sel_register_name): Removed.
	(sel_register_typed_name): Removed.
	(sel_get_uid): Removed.

From-SVN: r174773
2011-06-07 22:07:48 +00:00
Nicola Pero 80e4b9e501 In libobjc/: 2011-06-07 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2011-06-07  Nicola Pero  <nicola.pero@meta-innovation.com>

	Removed the Traditional Objective-C runtime public API.
	* Makefile.in (OBJC_DEPRECATED_H): Variable removed.
	(install-headers): Do not create the objc/deprecated directory and
	do not install the deprecated headers.
	(OBJC_H): Removed encoding.h and objc-api.h.
	* Object.m: Removed all methods with the exception of -class and
	-isEqual:.  Updated includes.  ([-class]): Use Modern API.
	* objc/Object.h: Do not include deprecated/Object.h.
	* objc/deprecated/Object.h: Removed.
	* linking.m (__objc_linking): Call [Object class] instead of
	[Object name].
	* Protocol.m: Removed all methods with the exception of -isEqual:.
	Updated includes.
	* objc/Protocol.h: Do not include deprecated/Protocol.h.
	* objc/deprecated/Protocol.h: Removed.
	* objc/deprecated/struct_objc_symtab.h: Removed.
	* objc/deprecated/struct_objc_module.h: Removed.
	* objc/deprecated/struct_objc_ivar.h: Removed.
	* objc/deprecated/struct_objc_ivar_list.h: Removed.
	* objc/deprecated/struct_objc_method.h: Removed.
	* objc/deprecated/struct_objc_method_list.h: Removed.
	* objc/deprecated/struct_objc_protocol_list.h: Removed.
	* objc/deprecated/struct_objc_category.h: Removed.
	* objc/deprecated/MetaClass.h: Removed.
	* objc/deprecated/objc_msg_sendv.h: Removed.  
	* objc/deprecated/README: Removed.
	* objc/deprecated/struct_objc_class.h: Removed.
	* objc/deprecated/struct_objc_protocol.h: Removed.
	* objc/deprecated/struct_objc_selector.h: Removed.
	* objc/encoding.h: Removed.
	* objc/message.h (struct objc_super): Removed the definition for
	the Traditional Objective-C runtime API.
	* objc/objc.h: Do not include objc/objc-decls.h.
	deprecated/struct_objc_selector.h, deprecated/MetaClass.h,
	deprecated/struct_objc_class.h, deprecated/struct_objc_protocol.h
	and deprecated/objc_msg_sendv.h.  Uncommented new definition of
	Protocol *.
	* objc/objc-api.h: Removed.
	* objc/runtime.h: Updated comments.  Removed check to detect
	concurrent usage of Traditional and Modern APIs.
	* objc-private/module-abi-8.h: Always define struct objc_class and
	struct objc_protocol.  (struct objc_protocol_list): Changed type
	of 'list' argument from 'Protocol *' to 'struct objc_protocol *'.
	(class_get_instance_size): Added.
	* objc-private/protocols.h (__objc_protocols_add_protocol): Take a
	'struct objc_protocol *' as argument, not a 'Protocol *'.
	* objc-private/runtime.h: Updated comments.
	* objc-private/selector.h (struct objc_selector, sel_eq): Added.
	* class.c: Include objc-private/selector.h.
	(objc_get_meta_class): Return a Class instead of a MetaClass.
	* encoding.c (method_get_next_argument): Removed.
	(method_get_first_argument): Removed.
	(method_get_nth_argument): Removed.
	* gc.c: Include objc/runtime.h instead of objc/encoding.h.
	Include objc-private/module-abi-8.h and ctype.h.
	* protocols.c (__objc_protocols_add_protocol): Take a 'struct
	objc_protocl *' as argument, not a 'Protocol *'.
	(class_addProtocol): Added casts to 'struct objc_protocol *' and
	'Protocol *'.
	(class_copyProtocolList): Likewise.
	(protocol_conformsToProtocol): Likewise.
	(protocol_copyProtocolList): Likewise.
	* sarray.c: Include objc-private/module-abi-8.h.
	* sendmsg.c (method_get_next_argument): Removed.
	(method_get_first_argument): Removed.
	(method_get_nth_argument): Removed.
	(objc_msg_sendv): Removed.
	(arglist_t, retval_t): New.  (class_get_class_method): Take a
	'Class', not 'MetaClass', argument.
	* thr.c: Include module-abi-8.h.

From-SVN: r174765
2011-06-07 19:37:35 +00:00
Nicola Pero dd3dba526f In libobjc/: 2011-06-03 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2011-06-03  Nicola Pero  <nicola.pero@meta-innovation.com>

	* Makefile.in (OBJC_H): Removed hash.h and sarray.h.
	(OBJC_DEPRECATED_H): Likewise.
	* libobjc.def (objc_hash_new, objc_hash_delete, objc_hash_add,
	objc_hash_remove, objc_hash_next, objc_hash_value_for_key,
	objc_hash_is_key_in_hash, hash_add, hash_delete, hash_new,
	hash_next, hash_remove, hash_value_for_key, hash_is_key_in_hash,
	sarray_at_put, sarray_at_put_safe, sarray_free, sarray_lazy_copy,
	sarray_new, sarray_realloc, sarray_remove_garbage): Removed.
	* objc/sarray.h: Removed.
	* objc/hash.h: Removed.
	* objc/deprecated/sarray.h: Removed.
	* objc/deprecated/hash.h: Removed.
	* objc/Object.h: Do not include objc/deprecated/hash.h
	* Object.m: Include string.h.
	* objc/objc-api.h: Do not include objc/deprecated/hash.h.
	* objc-private/common.h (GNU_LIBOBJC_COMPILING_LIBOBJC_ITSELF):
	Removed.

In gcc/testsuite/:
2011-06-03  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc.dg/headers.m: Do not include sarray.h and hash.h.

From-SVN: r174610
2011-06-03 17:59:14 +00:00
Nicola Pero 0bfe3fa10f In libobjc/: 2010-12-22 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-12-22  Nicola Pero  <nicola.pero@meta-innovation.com>

	* init.c (duplicate_classes): New.
	(__objc_exec_class): Initialize duplicate_classes.
	(__objc_create_classes_tree): Ignore classes in the
	duplicate_classes table.
	(__objc_call_load_callback): Same.
	(__objc_init_class): If a duplicate class is found, add it to
	duplicate_classes instead of aborting.  Return YES if the class is
	not a duplicate, and NO if it is.
	* objc-private/runtime.h (__objc_init_class): Updated prototype.

From-SVN: r168183
2010-12-22 23:05:13 +00:00
Nicola Pero 9fd553ccd9 In libobjc/: 2010-12-22 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-12-22  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-private/objc-list.h: Reindented file.  No code changes.
	* objc-private/sarray.h: Same change.

From-SVN: r168150
2010-12-22 00:17:21 +00:00
Nicola Pero 8637d320f1 In libobjc/: 2010-12-22 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-12-22  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-private/accessors.h: Removed 'extern "C"' guards.  This
	file is never compiled with C++.
	* objc-private/hash.h: Same change.
	* objc-private/objc-list.h: Same change.
	* objc-private/objc-sync.h: Same change.
	* objc-private/protocols.h: Same change.
	* objc-private/runtime.h: Same change.
	* objc-private/sarray.h: Same change.
	* objc-private/selector.h: Same change.

From-SVN: r168149
2010-12-22 00:05:57 +00:00
Nicola Pero 1575c9deae In libobjc/: 2010-12-21 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-12-21  Nicola Pero  <nicola.pero@meta-innovation.com>

	PR libobjc/18764
	* class.c (__objc_add_class_to_hash): Return YES if the class was
	added, and NO if it already existed.
	* init.c (__objc_init_class): If __objc_add_class_to_hash returns
	NO, then abort the program with an error message.
	* objc-private/runtime.h (__objc_add_class_to_hash): Updated
	declaration.

From-SVN: r168139
2010-12-21 22:49:37 +00:00
Nicola Pero df0820da97 In libobjc/: 2010-12-21 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-12-21  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-private/common.h: When DEBUG is defined, include <stdio.h>.
	Updated comments.
	* init.c (__objc_tree_insert_class): Use %p, not %x, when printing
	a pointer using DEBUG_PRINTF.

From-SVN: r168119
2010-12-21 14:56:18 +00:00
Nicola Pero 600cbba24e In libobjc/: 2010-12-21 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-12-21  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-private/module-abi-8.h (struct objc_symtab): Declare 'refs'
	to be 'struct objc_selector *' and not 'SEL'.
	* init.c (__objc_exec_class): Call
	__objc_register_selectors_from_module instead of iterating over
	each selector and calling __sel_register_typed_name for each.
	* objc-private/selector.h: Declare
	__objc_register_selectors_from_module instead of
	__sel_register_typed_name.
	* selector.c (__objc_register_selectors_from_module): New.
	(__sel_register_typed_name): Made static.

From-SVN: r168113
2010-12-21 12:49:26 +00:00
Nicola Pero 9c68c0e598 In libobjc/: 2010-12-21 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-12-21  Nicola Pero  <nicola.pero@meta-innovation.com>
	
	* objc-private/runtime.h (DEBUG_PRINTF): Moved from here ...
	* objc-private/common.h (DEBUG_PRINTF): To here.
	* hash.c: Do not include objc-private/runtime.h and objc/thr.h.

From-SVN: r168111
2010-12-21 11:50:14 +00:00
Nicola Pero f94e723ba7 In libobjc/: 2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-12-19  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-private/runtime.h (__objc_selector_max_index,
	__objc_init_selector_tables, __objc_register_selectors_from_class,
	__objc_register_selectors_from_list,
	__objc_register_selectors_from_description_list): Moved to ...
	* objc-private/selector.h: ... here.

From-SVN: r168067
2010-12-19 18:13:28 +00:00
Nicola Pero d9df33650f In libobjc/: 2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-12-19  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-private/runtime.h (__objc_class_links_resolved): Removed.
	(__objc_print_dtable_stats): Removed.
	(__sel_register_typed_name): Removed.
	* sendmsg.c (__objc_print_dtable_stats): Use 'void' as argument.

From-SVN: r168066
2010-12-19 18:01:47 +00:00
Nicola Pero 1af5b8f553 In libobjc/: 2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-12-19  Nicola Pero  <nicola.pero@meta-innovation.com>

	* init.c: Include objc-private/selector.h.  Do not declare
	__sel_register_typed_name.
	* objc-private/selector.h (__sel_register_typed_name): Declare.
	* selector.c: Include objc-private/selector.h.

From-SVN: r168039
2010-12-19 00:28:52 +00:00
Nicola Pero 114dae4330 In libobjc/: 2010-12-16 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-12-16  Nicola Pero  <nicola.pero@meta-innovation.com>

	* sendmsg.c: Include objc/runtime.h instead of objc/objc-api.h.
	Include objc-private/module-abi-8.h and objc-private/selector.h
	instead of objc/encoding.h.
	(objc_msg_lookup_super): Use super->super_class instead of
	super->class.
	(method_get_first_argument, method_get_next_argument): Declare
	locally.
	(class_get_instance_method): Declare before using.
	(objc_msg_sendv): Use 'struct objc_method' instead of 'Method'.
	(__objc_init_dispatch_tables, __objc_send_initialize): Use
	sel_registerName() instead of sel_register_name().
	(__objc_forward): Use sel_getName() instead of sel_get_name().
	(objc_get_uninstalled_dtable): Use 'void' as argument.
	* objc-private/selector.h: New.

From-SVN: r167961
2010-12-16 22:52:48 +00:00
Nicola Pero 375d1239a4 module-abi-8.h (struct objc_symtab): Updated description of sel_ref_cnt and refs.
2010-12-11  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-private/module-abi-8.h (struct objc_symtab): Updated
	description of sel_ref_cnt and refs.
	* objc/deprecated/struct_objc_symtab.h (objc_symtab): Same change.

From-SVN: r167710
2010-12-11 14:03:38 +00:00
Nicola Pero 682e805aaf Makefile.in (OBJC_SOURCE_FILES): Added accessors.m.
2010-10-24  Nicola Pero  <nicola.pero@meta-innovation.com>

        * Makefile.in (OBJC_SOURCE_FILES): Added accessors.m.
        * accessors.m: New.
        * init.c: Include objc-private/accessors.h.
        (__objc_exec_class): Call __objc_accessors_init.
        * objc-private/accessors.h: New.

From-SVN: r165903
2010-10-24 17:23:19 +00:00
Nicola Pero 6c5c7efd6b In libobjc/: 2010-10-16 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-10-16  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc/runtime.h: Updated comments.
        (class_addMethod): New.
        (class_addIvar): New.
        (class_replaceMethod): New.
        (objc_allocateClassPair): New.
        (objc_registerClassPair): New.
        (objc_disposeClassPair): New.
        * class.c (objc_allocateClassPair): New.
        (objc_registerClassPair): New.
        (objc_disposeClassPair): New.
        (class_getSuperclass): Return Nil if a class is in construction.
        * init.c (__objc_exec_class): Call __objc_init_class.
        (__objc_init_class): New.
        * ivars.c (class_copyIvarList): Return NULL if class is in
        construction.  Do not lock the runtime mutex.
        (class_getInstanceVariable): Return NULL if class is in
        construction.  Do not lock the runtime mutex.
        (class_addIvar): New.
        * sendmsg.c (class_addMethod): New.
        (class_replaceMethod): New.
        * objc-private/module-abi-8.h (__CLS_SETNOTINFO): New.
        (_CLS_IN_CONSTRUCTION): New.
        (CLS_IS_IN_CONSTRUCTION): New.
        (CLS_SET_IN_CONSTRUCTION): New.
        (CLS_SET_NOT_IN_CONSTRUCTION): New.
        * objc-private/runtime.h (__objc_init_class): New.

From-SVN: r165563
2010-10-16 21:26:59 +00:00
Nicola Pero 51194e8eb5 In libobjc/: 2010-10-15 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-10-15  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc-private/runtime.h (__objc_update_classes_with_methods): New.
        * class.c (__objc_update_classes_with_methods): New.
        (objc_getClassList): Do not lock the class lock.
        * methods.c (method_exchangeImplementations): New.
        (method_setImplementation): New.
        * objc/runtime.h (method_setImplementation): New.
        (method_exchangeImplementations): New.

From-SVN: r165525
2010-10-15 22:27:39 +00:00
Nicola Pero f7185d4791 In libobjc/: 2010-10-14 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-10-14  Nicola Pero  <nicola.pero@meta-innovation.com>

        * init.c (__objc_init_protocol): New function which fixes up a
        protocol's class pointer, registers it with the runtime, register
        all protocol selectors and registers associated protocols too.
        (objc_init_statics): Detect if we are initializing protocols, and
        if so, use __objc_init_protocol instead of only fixing up the
        class pointer.
        (__objc_init_protocls): Use __objc_init_protocol.
        * objc-private/module-abi-8.h: Updated comments.
        * objc-private/runtime.h
        (__objc_register_selectors_from_description_list): New.
        * selector.c (__objc_register_selectors_from_description_list):
        New.  (struct objc_method_description_list): Declare.
        * Protocol.m ([-descriptionForInstanceMethod:]): Use sel_get_name
        when accessing the name of a method, which is now correctly a SEL.
        ([-descriptionForClassMethod:]): Same change.
        * protocols.c (protocol_getMethodDescription): Same change.
        * objc/runtime.h: Updated comments.
        (sel_registerTypedName): Fixed typo in function name.

From-SVN: r165499
2010-10-15 10:35:00 +00:00
Nicola Pero be05b0f599 In libobjc/: 2010-10-12 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-10-12  Nicola Pero  <nicola.pero@meta-innovation.com>

        * class.c: Include objc/runtime.h and objc-private/module-abi-8.h
        instead of objc/objc-api.h.
        (objc_get_unknown_class_handler): Do not define.
        (class_isMetaClass): New.
        (class_getSuperclass): New.
        (class_getVersion): New.
        (class_setVersion): New.
        (class_getInstanceSize): New.
        * exceptions.c: Include objc/runtime.h instead of objc/objc-api.h.
        (is_kind_of_exception_matcher): Use objc_getSuperclass instead of
        objc_get_super_class.
        (get_ttype_entry): Use objc_getRequiredClass instead of
        objc_get_class.
        * ivars.c (class_getClassVariable): New.
        * objects.c: Include objc/runtime.h, objc/thr.h and
        objc-private/module-abi-8.h instead of objc/objc-api.h
        * objc/runtime.h (class_getClassVariable): New.
        (class_isMetaClass): New.
        (class_getSuperclass): New.
        (class_getVersion): New.
        (class_setVersion): New.
        (class_getInstanceSize): New.
        * objc-private/module-abi-8.h (HOST_BITS_PER_LONG): New (from
        objc/objc-api.h)
        (__CLS_INFO): Same.
        (__CLS_ISINFO): Same.
        (__CLS_SETINFO): Same.
        (CLS_ISMETA): Same.
        (CLS_ISCLASS): Same.
        (CLS_ISRESOLV): Same.
        (CLS_SETRESOLV): Same.
        (CLS_ISINITIALIZED): Same.
        (CLS_SETINITIALIZED): Same.
        (CLS_GETNUMBER): Same.
        (CLS_SETNUMBER): Same.

From-SVN: r165392
2010-10-12 18:43:54 +00:00
Nicola Pero 718a8e53dc archive.c: Do not include objc/objc.h.
2010-10-12  Nicola Pero  <nicola.pero@meta-innovation.com>

        * archive.c: Do not include objc/objc.h.
        * class.c: Do not include objc/objc.h.
        * encoding.c: Include objc/runtime.h, ctype.h and
        objc-private/module-abi-8.h instead of objc/objc-api.h and
        objc/encoding.h.
        * error.c: Do not include objc/objc.h.
        * gc.c: Include tconfig.h and objc/encoding.h only if
        OBJC_WITH_GC.
        * hash.c: Include objc/runtime.h and objc/thr.h instead of
        objc/objc-api.h.  Do not include objc/objc.h.
        * init.c: Do not include objc/objc.h.
        * ivars.c: Include objc/runtime.h, objc-private/module-abi-8.h and
        objc/thr.h instead of objc/objc-api.h.  Do not include
        objc/objc.h.
        * linking.m: Tidied comment.
        * memory.c: Include objc/runtime.h instead of objc/objc-api.h.
        Do not include objc/objc.h.
        * objects.c: Do not include objc/objc.h.
        * objc-sync.c: Include objc/runtime.h instead of objc/objc-api.h.
        * protocols.c: Do not include objc/objc.h.
        * sarray.c: Include objc/runtime.h instead of objc/objc-api.h.  Do
        not include objc/objc.h.
        * selector.c: Do not include objc/objc.h.
        * sendmsg.c: Do not include objc/objc.h.
        * thr.c: Include objc/runtime.h instead of objc/objc-api.h.
        Do not include objc/objc.h.
        * objc/objc-decls.h: Reindented code.
        * objc/runtime.h Include objc-decls.h.  Updated comments.
        (objc_malloc): New.
        (objc_atomic_malloc): New.
        (objc_calloc): New.
        (objc_realloc): New.
        (objc_free): New.
        * objc-private/runtime.h: Updated comments.

From-SVN: r165386
2010-10-12 16:17:18 +00:00
Nicola Pero debfbfeefc In libobjc/: 2010-10-12 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-10-12  Nicola Pero  <nicola.pero@meta-innovation.com>

        * Makefile.in (C_SOURCE_FILES): Added protocols.c.
        * objc-private/protocols.h: New.
        * protocols.c: New.
        * init.c: Include objc-private/protocols.h.
        (__objc_exec_class): Call __objc_protocols_init on startup.
        (__objc_init_protocols): Call __objc_protocols_add_protocol.
        * objc-private/runtime.h: Use (struct objc_method_list *) instead
        of MethodList_t, and (struct objc_method *) instead of Method_t.
        * objc/deprecated/struct_objc_class.h: Define
        __objc_STRUCT_OBJC_CLASS_defined.
        * objc-private/module-abi-8.h (struct
        objc_method_description_list): New.
        (struct objc_class): Only define if
        __objc_STRUCT_OBJC_CLASS_defined is undefined.
        * objc/runtime.h (class_getName): New.
        (objc_getProtocol): New.
        (objc_copyProtocolList): New.
        (class_addProtocol): New.
        (class_conformsToProtocol): New.
        (class_copyProtocolList): New.
        (protocol_conformsToProtocol): New.
        (protocol_isEqual): New.
        (protocol_getName): New.
        (protocol_getMethodDescription): New.
        (protocol_copyMethodDescriptionList): New.
        (protocol_getProperty): New.
        (protocol_copyPropertyList): New.
        (protocol_copyProtocolList): New.
        * class.c (class_getName): New.
        * selector.c (sel_isEqual): New.

From-SVN: r165349
2010-10-12 02:43:25 +00:00
Nicola Pero 524660d2e3 In libobjc/: 2010-10-12 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-10-12  Nicola Pero  <nicola.pero@meta-innovation.com>

        * selector.c (sel_getName): Return "<null selector>" for a NULL
        argument.
        (sel_get_name): Return 0 for a NULL argument.
        * objc/runtime.h (sel_getName): Updated documentation.

        * objc-private/hash.h (class_hash_table): Unused declaration
        removed.
        (module_hash_table): Same.
        * objc/deprecated/hash.h: Same changes.

From-SVN: r165348
2010-10-12 00:27:02 +00:00
Nicola Pero 90a2689f4d In libobjc/: 2010-10-11 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-10-11  Nicola Pero  <nicola.pero@meta-innovation.com>

        * class.c (objc_getClassList): New.
        (objc_getRequiredClass): New.
        (objc_getMetaClass): New.
        (objc_lookupClass): New.
        (objc_getClass): New.
        (__objc_get_unknown_class_handler): New.
        (objc_setGetUnknownClassHandler): New.
        (objc_get_class): Use __objc_get_unknown_class_handler.
        (objc_lookup_class): Call objc_getClass.
        * objc/objc-api.h: Updated comment and copyright notice.
        * objc/runtime.h: Updated comments.
        (objc_getClass): New.
        (objc_lookupClass): New.
        (objc_getMetaClass): New.
        (objc_getRequiredClass): New.
        (objc_getClassList): New.
        (objc_setGetUnknownClassHandler): New.
        (objc_get_unknown_class_handler): New.
        * objc-private/runtime.h: Use __objc_private_runtime_INCLUDE_GNU
        instead of __objc_runtime_INCLUDE_GNU as include guard.
        * objc-private/error.h (_objc_abort): Mark as noreturn.

From-SVN: r165326
2010-10-11 18:17:19 +00:00
Nicola Pero fdcbbfe70c In libobjc/: 2010-10-11 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-10-11  Nicola Pero  <nicola.pero@meta-innovation.com>

        * Makefile.in (C_SOURCE_FILES): Added ivars.c.
        * ivars.c: New.
        * objc/objc.h: Updated comments.
        * objc/runtime.h (object_getClass): New.
        (object_getClassName): New.
        (object_setClass): New.
        (class_getInstanceVariable): New.
        (object_getIndexedIvars): New.
        (object_getInstanceVariable): New.
        (object_setInstanceVariable): New.
        (object_getIvar): New.
        (object_setIvar): New.  
        (ivar_getName): New.
        (ivar_getOffset): New.
        (ivar_getTypeEncoding): New.
        * objc-private/module-abi-8.h (struct objc_class): Added.
        * objects.c (object_getClassName): New.
        (object_setClass): New.

From-SVN: r165269
2010-10-11 02:36:32 +00:00
Nicola Pero e4d508663e In libobjc/: 2010-10-10 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-10-10  Nicola Pero  <nicola.pero@meta-innovation.com>

        * objc/objc-api.h: Define Method, Method_t, Category and
        Category_t.  Prevent including this file at the same time as
        objc/runtime.h.  Updated comments.
        * objc/deprecated/struct_objc_method.h: Do not define Method,
        Method_t.
        * objc/deprecated/struct_objc_category.h: Do not define Category,
        Category_t.
        * objc-private/module-abi-8.h: New file containing a copy of all
        the structure definitions.  Not used yet.
        * objc/encoding.h (objc_aligned_size): Removed duplicate
        declaration.  Updated comments.
        * objc/runtime.h: Added Ivar, objc_property_t, Property, Method,
        Category, struct objc_method_description, _C_ID and similar,
        _C_CONST and similar and _F_CONST and similar.  Added
        objc_sizeof_type, objc_alignof_type, objc_aligned_size,
        objc_promoted_size, objc_skip_type_qualifier, objc_skip_typespec,
        objc_skip_offset, objc_skip_argspec, objc_get_type_qualifiers,
        struct objc_struct_layout, objc_layout_structure,
        objc_layout_structure_next_member, objc_layout_finish_structure,
        objc_layout_structure_get_info.  Prevent including this file at
        the same time as objc/objc-api.h.

From-SVN: r165256
2010-10-10 17:43:07 +00:00
Nicola Pero 5d3b14bd9a In libobjc/:
* hash.c: Include objc-private/hash.h instead of objc/hash.h.

        * objc/sarray.h: Moved into objc/deprecated/sarray.h;
        objc/sarray.h replaced with a placeholder including the file from
        the deprecated/ directory.
        * objc-private/sarray.h: New file (private copy of sarray.h).
        * hash.c: Include <assert.h> instead of "assert.h"
        * sarray.c: Include <assert.h> instead of "assert.h".  Include
        objc-private/sarray.h instead of objc/sarray.h.
        * selector.c: Include objc-private/sarray.h instead of
        objc/sarray.h.
        * sendmsg.c: Include <assert.h>.  Include objc-private/sarray.h
        instead of objc/sarray.h.
        * Makefile.in (OBJC_DEPRECATED_H): Added sarray.h.

From-SVN: r164389
2010-09-18 09:34:58 +00:00
Nicola Pero 349cfd93f4 In libobjc/:
* objc-private/objc-list.h (list_remove_elem): Unused function
        removed.  (list_nth): Unused function removed.  (list_find):
        Unused function removed.  (list_lenght): Unused function removed.

        Also, fixed an error in my last commit by adding back
        objc/hash.h and objc/objc-list.h that had not been committed.

From-SVN: r164374
2010-09-17 16:52:36 +00:00
Nicola Pero 5be9cdc112 In libobjc/:
* objc/hash.h: Moved into objc/deprecated/hash.h; objc/hash.h
        replaced with a placeholder including the file from the
        deprecated/ directory.
        * objc/objc-api.h: Updated includes.
        * objc/typedstream.h: Updated includes.
        * objc-private/hash.h: New file (private copy of hash.h).
        * objc/objc-list.h: Moved into objc/deprecated/objc-list.h;
        objc/objc-list.h replaced with a placeholder including the file
        from the deprecated/ directory.
        * objc-private/objc-list.h: New file (private copy of objc-list.h).
        * init.c: Include objc-private/hash.h and objc-private/objc-list.h
        instead of objc/hash.h and objc/objc-list.h.
        * selector.c: Same change.
        * class.c: Added include <string.h>, which used to be implicitly included
        when hash.h was included.
        * exception.c: Same change.
        * objects.c: Same change.
        * sarray.c: Same change.
        * sendmsg.c: Same change.
        * Makefile.in (OBJC_DEPRECATED_H): Added hash.h and objc-list.h.
        (OBJC_H): Removed hash.h and objc-list.h

From-SVN: r164373
2010-09-17 16:35:15 +00:00
Nicola Pero fd3125375f In libobjc/: Implemented objc_sync_enter() and objc_sync_exit(), which are required by @synchronized() to work.
In libobjc/:
       Implemented objc_sync_enter() and objc_sync_exit(), which are
       required by @synchronized() to work.
       * objc-sync.c: New file.
       * objc/objc-sync.h: New file.
       * objc-private/objc-sync.h: New file.
       * init.c (__objc_exec_class): Call __objc_sync_init() during the
       Objective-C runtime startup.
       * Makefile.in: Added objc-sync.c and objc-sync.h.
       * configure.ac: Added GCC_CHECK_TLS.
       * acinclude.m4: Include ../config/enable.m4 and ../config/tls.m4.
       * configure: Regenerated.
       * config.h.in: Regenerated.

From-SVN: r164276
2010-09-14 10:23:37 +00:00
Nicola Pero 7b86998664 In libobjc/:
* objc/deprecated/objc_error.h: New file.
        * objc/objc-api.h: Include deprecated/objc_error.h instead of
        defining objc_error and related.
        * error.c: New file.  Added _objc_abort function which replaces
        objc_error.  No change in functionality as they both print an
        error and abort.
        * misc.c: File removed.  Code moved into memory.c and error.c.
        * memory.c: New file.
        * objc-private/error.h: New file.
        * archive.c: Include objc-private/error.h and use _objc_abort
        instead of objc_error everywhere.
        * class.c: Same change.
        * encoding.c: Same change.
        * init.c: Same change, and simplified init_check_module_version.
        * memory.c: Same change.
        * sendmsg.c:  Same change.
        * thr.c: Same change.
        * Makefile.in (OBJ_DEPRECATED_H): Added objc_error.h.
        (OBJ_H): Reordered list.
        (OBJS): Removed misc.lo, added memory.lo and error.lo.
        (OBJS_GC): Removed misc_gc.lo, added memory_gc.lo and error_gc.lo.
        (misc_gc.lo): Rule removed.
        (error_gc.lo): Rule added.
        (memory_gc.lo): Rule added.

From-SVN: r164223
2010-09-12 00:43:15 +00:00
Nicola Pero 6dead247c9 In libobjc/:
* objc/objc.h (__GNU_LIBOBJC__): New #define providing an easy way
        to check the API version.  Added some comments.

        * objc-private/common.h: New file.
        * NXConstStr.m: Include objc-private/common.h.
        * Object.m: Same change.
        * Protocol.m: Same change.
        * archive.c: Same change.
        * class.c: Same change.
        * encoding.c: Same change.
        * exception.c: Same change.
        * gc.c: Same change.
        * hash.c: Same change.
        * init.c: Same change.
        * libobjc_entry.c: Same change.
        * linking.m: Same change.
        * misc.c: Same change (and added a comment).
        * nil_method.c: Same change.
        * objects.c: Same change.
        * sarray.c: Same change.
        * selector.c: Same change.
        * sendmsg.c: Same change.
        * thr.c: Same change.

From-SVN: r164218
2010-09-11 22:47:14 +00:00
Nicola Pero a19fac96a2 In libobjc/:
* objc/runtime.h: Moved to objc-private/runtime.h.  Do not include
        all the objc/*.h files.
        * objc-private/runtime.h: New file.
        * archive.c: Include objc-private/runtime.h (and required objc/*.h
        files) instead of objc/runtime.h.
        * class.c: Same change.
        * hash.c: Same change.
        * init.c: Same change.
        * misc.c: Same change.
        * nil_method.c: Same change.
        * objects.c: Same change.
        * sarray.c: Same change.
        * selector.c: Same change.
        * sendmsg.c: Same change.
        * thr.c: Same change.

From-SVN: r164213
2010-09-11 12:58:27 +00:00
Nicola Pero e976a775e2 deprecated: New directory.
* libobjc/objc/deprecated: New directory.
        * libobjc/objc/deprecated/README: New file.
        * libobjc/objc/README: New file.
        * libobjc/objc/typedstream.h: Moved into objc/deprecated/typedstream.h;
        objc/typedstream.h replaced with a placeholder including the file
        from the deprecated/ directory.
        * libobjc/objc/deprecated/objc-unexpected-exception.h: New file with the
        definition of _objc_unexpected_exception.       
        * libobjc/objc/objc-api.h: Include deprecated/objc-unexcepted-exception.h
        instead of defining _objc_unexpected_exception.
        * libobjc/objc/deprecated/Object.h: New file with the deprecated Object
        methods in a 'Deprecated' category.
        * libobjc/objc/Object.h Include deprecated/Object.h instead of defining
        the deprecated methods.
        * libobjc/Object.m: Moved deprecated methods into 'Deprecated' category.
        * libobjc/objc-private: New directory.
        * libobjc/objc-private/README: New file.
        * libobjc/Makefile.in (OBJC_DEPRECATED_H): New variable.
        (install-headers): Create installation directory for
        OBJC_DEPRECATED_H headers, and install them.

From-SVN: r164153
2010-09-10 09:56:40 +00:00