]> git.saurik.com Git - cycript.git/blame - Bridge.sh
Added support for @class protocol lists.
[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_;
22};
23
24%%
25EOF
26
27grep '^[CFV]' "$1" | sed -e 's/^C/0/;s/^F/1/;s/^V/2/' | sed -e 's/"/\\"/g;s/^\([^ ]*\) \([^ ]*\) \(.*\)$/\1\2, "\3"/';
28grep '^[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"/';
29grep '^:' "$1" | sed -e 's/^: \([^ ]*\) \(.*\)/6\1, "\2"/';