From patchwork Sun Dec 19 13:40:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Pero X-Patchwork-Id: 76127 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 55286B7093 for ; Mon, 20 Dec 2010 00:40:49 +1100 (EST) Received: (qmail 8668 invoked by alias); 19 Dec 2010 13:40:47 -0000 Received: (qmail 8655 invoked by uid 22791); 19 Dec 2010 13:40:46 -0000 X-SWARE-Spam-Status: No, hits=-0.4 required=5.0 tests=AWL, BAYES_20, SARE_SUB_ENC_UTF8, TW_BJ, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 19 Dec 2010 13:40:41 +0000 Received: from eggs.gnu.org ([140.186.70.92]:34137) by fencepost.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1PUJV6-0001hh-MF for gcc-patches@gnu.org; Sun, 19 Dec 2010 08:40:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PUJV7-00064r-I9 for gcc-patches@gnu.org; Sun, 19 Dec 2010 08:40:39 -0500 Received: from smtp181.iad.emailsrvr.com ([207.97.245.181]:44983) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PUJV7-00064Z-AP for gcc-patches@gnu.org; Sun, 19 Dec 2010 08:40:37 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp48.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 4C87E16850B for ; Sun, 19 Dec 2010 08:40:36 -0500 (EST) Received: from dynamic11.wm-web.iad.mlsrvr.com (dynamic11.wm-web.iad1a.rsapps.net [192.168.2.218]) by smtp48.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 399D9168472 for ; Sun, 19 Dec 2010 08:40:36 -0500 (EST) Received: from meta-innovation.com (localhost [127.0.0.1]) by dynamic11.wm-web.iad.mlsrvr.com (Postfix) with ESMTP id 2C3B8E0086 for ; Sun, 19 Dec 2010 08:40:36 -0500 (EST) Received: by www2.webmail.us (Authenticated sender: nicola.pero@meta-innovation.com, from: nicola.pero@meta-innovation.com) with HTTP; Sun, 19 Dec 2010 14:40:36 +0100 (CET) Date: Sun, 19 Dec 2010 14:40:36 +0100 (CET) Subject: =?UTF-8?Q?libobjc:=20header=20cleanup=20for=20new=20API=20(7)?= From: "Nicola Pero" To: "gcc-patches@gnu.org" MIME-Version: 1.0 X-Type: plain Message-ID: <1292766036.1794190@192.168.2.227> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This patch updates some comments, and marks with 'objc_EXPORT' a number of functions in objc/runtime.h which I had forgotten to mark. Committed. Thanks Index: ChangeLog =================================================================== --- ChangeLog (revision 168050) +++ ChangeLog (working copy) @@ -1,5 +1,24 @@ 2010-12-19 Nicola Pero + * objc/encoding.h: Updated comments. + * objc/runtime.h: Updated comments. + (objc_setGetUnknownClassHandler): Mark with objc_EXPORT. + (objc_sizeof_type): Same. + (objc_alignof_type): Same. + (objc_aligned_size): Same. + (objc_promoted_size): Same. + (objc_skip_type_qualifiers): Same. + (objc_skip_typespec): Same. + (objc_skip_offset): Same. + (objc_skip_argspec): Same. + (objc_get_type_qualifiers): Same. + (objc_layout_structure): Same. + (objc_layout_structure_next_member): Same. + (objc_layout_finish_structure): Same. + (objc_layout_structure_get_info): Same. + +2010-12-19 Nicola Pero + * init.c: Updated comments. * objc/objc-api.h: Updated comments. * objc/runtime.h (_objc_load_callback): Declare. Index: objc/runtime.h =================================================================== --- objc/runtime.h (revision 168050) +++ objc/runtime.h (working copy) @@ -410,6 +410,7 @@ typedef Class (*objc_get_unknown_class_handler)(co This function is not safe to call in a multi-threaded environment because other threads may be trying to use the get unknown class handler while you change it! */ +objc_EXPORT objc_get_unknown_class_handler objc_setGetUnknownClassHandler (objc_get_unknown_class_handler new_handler); @@ -971,21 +972,21 @@ objc_EXPORT void objc_free(void *mem); /* Return the size of a variable which has the specified 'type' encoding. */ -int objc_sizeof_type (const char *type); +objc_EXPORT int objc_sizeof_type (const char *type); /* Return the align of a variable which has the specified 'type' encoding. */ -int objc_alignof_type (const char *type); +objc_EXPORT int objc_alignof_type (const char *type); /* Return the aligned size of a variable which has the specified 'type' encoding. The aligned size is the size rounded up to the nearest alignment. */ -int objc_aligned_size (const char *type); +objc_EXPORT int objc_aligned_size (const char *type); /* Return the promoted size of a variable which has the specified 'type' encoding. This is the size rounded up to the nearest integral of the wordsize, taken to be the size of a void *. */ -int objc_promoted_size (const char *type); +objc_EXPORT int objc_promoted_size (const char *type); /* The following functions are used when parsing the type encoding of @@ -998,30 +999,30 @@ objc_EXPORT void objc_free(void *mem); /* Skip some type qualifiers (_C_CONST, _C_IN, etc). These may eventually precede typespecs occurring in method prototype encodings. */ -const char *objc_skip_type_qualifiers (const char *type); +objc_EXPORT const char *objc_skip_type_qualifiers (const char *type); /* Skip one typespec element (_C_CLASS, _C_SEL, etc). If the typespec is prepended by type qualifiers, these are skipped as well. */ -const char *objc_skip_typespec (const char *type); +objc_EXPORT const char *objc_skip_typespec (const char *type); /* Skip an offset. */ -const char *objc_skip_offset (const char *type); +objc_EXPORT const char *objc_skip_offset (const char *type); /* Skip an argument specification (ie, skipping a typespec, which may include qualifiers, and an offset too). */ -const char *objc_skip_argspec (const char *type); +objc_EXPORT const char *objc_skip_argspec (const char *type); /* Read type qualifiers (_C_CONST, _C_IN, etc) from string 'type' (stopping at the first non-type qualifier found) and return an unsigned int which is the logical OR of all the corresponding flags (_F_CONST, _F_IN etc). */ -unsigned objc_get_type_qualifiers (const char *type); +objc_EXPORT unsigned objc_get_type_qualifiers (const char *type); /* Note that the following functions work for very simple structures, but get easily confused by more complicated ones (for example, - containing vectors). A better solution is required. -*/ + containing vectors). A better solution is required. These + functions are likely to change in the next GCC release. */ /* The following three functions can be used to determine how a structure is laid out by the compiler. For example: @@ -1054,16 +1055,16 @@ struct objc_struct_layout unsigned int record_align; }; -void objc_layout_structure (const char *type, +objc_EXPORT 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); +objc_EXPORT BOOL objc_layout_structure_next_member (struct objc_struct_layout *layout); +objc_EXPORT void objc_layout_finish_structure (struct objc_struct_layout *layout, + unsigned int *size, + unsigned int *align); +objc_EXPORT void objc_layout_structure_get_info (struct objc_struct_layout *layout, + unsigned int *offset, + unsigned int *align, + const char **type); #ifdef __cplusplus } Index: objc/encoding.h =================================================================== --- objc/encoding.h (revision 168050) +++ objc/encoding.h (working copy) @@ -31,8 +31,7 @@ see the files COPYING3 and COPYING.RUNTIME respect /* This file is to be used with the "traditional" GNU Objective-C Runtime API (the one declared in objc/objc-api.h). If you are using the "modern" GNU Objective-C Runtime API, then the useful - functions from this file are declared in objc/runtime.h. -*/ + functions from this file are declared in objc/runtime.h. */ #include "objc-api.h" #include @@ -71,9 +70,15 @@ const char *objc_skip_type_qualifiers (const char const char *objc_skip_typespec (const char *type); const char *objc_skip_offset (const char *type); const char *objc_skip_argspec (const char *type); +unsigned objc_get_type_qualifiers (const char *type); + +/* The following functions are replaced, in the modern API, by + method_getNumberOfArguments(), method_getArgumentType(). */ int method_get_number_of_arguments (struct objc_method *); int method_get_sizeof_arguments (struct objc_method *); +/* The following functions are deprecated and they use arglist_t which + is deprecated. */ char *method_get_first_argument (struct objc_method *, arglist_t argframe, const char **type); @@ -84,10 +89,7 @@ char *method_get_nth_argument (struct objc_method int arg, const char **type); -unsigned objc_get_type_qualifiers (const char *type); - - -struct objc_struct_layout +struct objc_struct_layout { const char *original_type; const char *type;