OSDN Git Service

Correct the lexicographical function, add debug_pddr.
[pf3gnuchains/gcc-fork.git] / libobjc / objc / encoding.h
1 /* Encoding of types for Objective C.
2    Copyright (C) 1993, 1997, 2002, 2004, 2009 Free Software Foundation, Inc.
3
4 Author: Kresten Krab Thorup
5
6 This file is part of GCC.
7
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
12
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 Under Section 7 of GPL version 3, you are granted additional
19 permissions described in the GCC Runtime Library Exception, version
20 3.1, as published by the Free Software Foundation.
21
22 You should have received a copy of the GNU General Public License and
23 a copy of the GCC Runtime Library Exception along with this program;
24 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
25 <http://www.gnu.org/licenses/>.  */
26
27
28 #ifndef __encoding_INCLUDE_GNU
29 #define __encoding_INCLUDE_GNU
30
31 #include "objc-api.h"
32 #include <ctype.h>
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif /* __cplusplus */
37
38 #define _C_CONST        'r'
39 #define _C_IN           'n'
40 #define _C_INOUT        'N'
41 #define _C_OUT          'o'
42 #define _C_BYCOPY       'O'
43 #define _C_BYREF        'R'
44 #define _C_ONEWAY       'V'
45 #define _C_GCINVISIBLE  '!'
46
47 #define _F_CONST        0x01
48 #define _F_IN           0x01
49 #define _F_OUT          0x02
50 #define _F_INOUT        0x03
51 #define _F_BYCOPY       0x04
52 #define _F_BYREF        0x08
53 #define _F_ONEWAY       0x10
54 #define _F_GCINVISIBLE  0x20
55
56 int objc_aligned_size (const char *type);
57 int objc_sizeof_type (const char *type);
58 int objc_alignof_type (const char *type);
59 int objc_aligned_size (const char *type);
60 int objc_promoted_size (const char *type);
61
62 const char *objc_skip_type_qualifiers (const char *type);
63 const char *objc_skip_typespec (const char *type);
64 const char *objc_skip_offset (const char *type);
65 const char *objc_skip_argspec (const char *type);
66 int method_get_number_of_arguments (struct objc_method *);
67 int method_get_sizeof_arguments (struct objc_method *);
68
69 char *method_get_first_argument (struct objc_method *,
70                                  arglist_t argframe, 
71                                  const char **type);
72 char *method_get_next_argument (arglist_t argframe, 
73                                 const char **type);
74 char *method_get_nth_argument (struct objc_method *m, 
75                                arglist_t argframe,
76                                int arg, 
77                                const char **type);
78
79 unsigned objc_get_type_qualifiers (const char *type);
80
81
82 struct objc_struct_layout 
83 {
84   const char *original_type;
85   const char *type;
86   const char *prev_type;
87   unsigned int record_size;
88   unsigned int record_align;
89 };
90
91 void objc_layout_structure (const char *type,
92                             struct objc_struct_layout *layout);
93 BOOL  objc_layout_structure_next_member (struct objc_struct_layout *layout);
94 void objc_layout_finish_structure (struct objc_struct_layout *layout,
95                                    unsigned int *size,
96                                    unsigned int *align);
97 void objc_layout_structure_get_info (struct objc_struct_layout *layout,
98                                      unsigned int *offset,
99                                      unsigned int *align,
100                                      const char **type);
101
102 #ifdef __cplusplus
103 }
104 #endif /* __cplusplus */
105
106 #endif /* __encoding_INCLUDE_GNU */