Tweak the type encoding stuff a bit.

main
theraven 16 years ago
parent 5885fd196a
commit 0177ef56e1

@ -43,8 +43,10 @@ libobjc_HEADER_FILES_INSTALL_DIR = objc
ifneq ($(install_headers), no)
libobjc_HEADER_FILES = \
Availability.h\
Object.h\
blocks_runtime.h\
capabilities.h\
encoding.h\
hooks.h\
runtime.h\
slot.h\

@ -418,14 +418,14 @@ unsigned objc_get_type_qualifiers (const char *type)
switch (*(type++))
{
default: return flags;
// Byref is implicit
case 'R': break;
MAP('r', 1)
MAP('n', 2)
MAP('n', 1)
MAP('o', 2)
MAP('N', 3)
MAP('o', 4)
MAP('O', 5)
MAP('R', 6)
MAP('V', 7)
MAP('!', 8)
MAP('O', 4)
MAP('V', 8)
}
} while (1);
}

@ -0,0 +1,66 @@
#ifndef __LIBOBJC_ENCODING_H_INCLUDED__
#define __LIBOBJC_ENCODING_H_INCLUDED__
const char *objc_skip_type_qualifiers (const char *type);
const char *objc_skip_typespec(const char *type);
const char *objc_skip_argspec(const char *type);
size_t objc_sizeof_type(const char *type);
size_t objc_alignof_type(const char *type);
size_t objc_aligned_size(const char *type);
void method_getReturnType(Method method, char *dst, size_t dst_len);
const char *method_getTypeEncoding(Method method);
void method_getArgumentType(Method method,
unsigned int index,
char *dst,
size_t dst_len);
unsigned method_getNumberOfArguments(Method method);
unsigned method_get_number_of_arguments(struct objc_method *method);
char * method_copyArgumentType(Method method, unsigned int index);
char * method_copyReturnType(Method method);
////////////////////////////////////////////////////////////////////////////////
// Deprecated functions - do not use functions below this line in new code.
////////////////////////////////////////////////////////////////////////////////
unsigned objc_get_type_qualifiers (const char *type);
struct objc_struct_layout
{
const char *original_type;
const char *type;
const char *prev_type;
unsigned int record_size;
unsigned int record_align;
};
// Note: The implementations of these functions is horrible.
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_structure_get_info (struct objc_struct_layout *layout,
unsigned int *offset,
unsigned int *align,
const char **type);
#define _F_IN 0x01
#define _F_OUT 0x02
#define _F_INOUT 0x03
#define _F_BYCOPY 0x04
#define _F_ONEWAY 0x08
#define _F_CONST 0x01
#endif // __LIBOBJC_ENCODING_H_INCLUDED__

@ -367,5 +367,11 @@ static const id self = nil;
#define _C_COMPLEX 'j'
#define _C_CONST 'r'
#define _C_IN 'n'
#define _C_INOUT 'N'
#define _C_OUT 'o'
#define _C_BYCOPY 'O'
#define _C_ONEWAY 'V'
#endif // __LIBOBJC_RUNTIME_H_INCLUDED__

Loading…
Cancel
Save