]> git.saurik.com Git - cycript.git/blame - Bridge.sh
Upgrade simulator compilation for Xcode 4.6 clang.
[cycript.git] / Bridge.sh
CommitLineData
2f51d6ab
JF
1#!/usr/bin/env bash
2
3cat << EOF
4%{
5#include <cstring>
6#include "Execute.hpp"
7%}
8
9%language=ANSI-C
10
11%define lookup-function-name CYBridgeHash_
12%define slot-name name_
13
14%struct-type
15%omit-struct-type
16
17%pic
18
19struct CYBridgeEntry {
20 int name_;
21 const char *value_;
1850a470 22 void *cache_;
2f51d6ab
JF
23};
24
25%%
26EOF
27
1850a470
JF
28grep '^[CFV]' "$1" | sed -e 's/^C/0/;s/^F/1/;s/^V/2/' | sed -e 's/"/\\"/g;s/^\([^ ]*\) \([^ ]*\) \(.*\)$/\1\2, "\3", NULL/';
29grep '^[EST]' "$1" | sed -e 's/^S/3/;s/^T/4/;s/^E/5/' | sed -e 's/^5\(.*\)$/4\1 i/;s/"/\\"/g' | sed -e 's/^\([^ ]*\) \([^ ]*\) \(.*\)$/\1\2, "\3", NULL/';
30grep '^:' "$1" | sed -e 's/^: \([^ ]*\) \(.*\)/6\1, "\2", NULL/';