forked from wdmchaft/iSpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TypeDescription.h
36 lines (32 loc) · 1.29 KB
/
TypeDescription.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// NSBlock+TypedDescription.h
// BlockTypeDescription
//
// Created by Conrad Kramer on 3/17/13.
// Copyright (c) 2013 Kramer Software Productions, LLC. All rights reserved.
//
// Taken directly from http://clang.llvm.org/docs/Block-ABI-Apple.html#high-level, and prefixed with 'TD'
struct TD_Block_literal_1 {
void *isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock
int flags;
int reserved;
void (*invoke)(void *, ...);
struct TD_Block_descriptor_1 {
unsigned long int reserved; // NULL
unsigned long int size; // sizeof(struct TD_Block_literal_1)
// optional helper functions
void (*copy_helper)(void *dst, void *src); // IFF (1<<25)
void (*dispose_helper)(void *src); // IFF (1<<25)
// required ABI.2010.3.16
const char *signature; // IFF (1<<30)
} *descriptor;
// imported variables
};
enum {
TD_BLOCK_HAS_COPY_DISPOSE = (1 << 25),
TD_BLOCK_HAS_CTOR = (1 << 26), // helpers have C++ code
TD_BLOCK_IS_GLOBAL = (1 << 28),
TD_BLOCK_HAS_STRET = (1 << 29), // IFF TD_BLOCK_HAS_SIGNATURE
TD_BLOCK_HAS_SIGNATURE = (1 << 30),
};
extern NSString *TDFormattedStringForBlockSignature(id block);