| 81 | #define IS(s) (strcmp(argv[i],s)==0) |
| 82 | |
| 83 | int Inject(GluaDecompileContextP ctx, Proto * fp, int functionnum) { |
| 84 | int f, i, c, n, at; |
| 85 | char number[255] = ""; |
| 86 | for (f = 0; f<2; f++) { |
| 87 | for (i = 0; i<255; i++) { |
| 88 | ctx->localdeclare[f][i] = -1; |
| 89 | } |
| 90 | } |
| 91 | f = 0; |
| 92 | i = 0; |
| 93 | c = 0; |
| 94 | n = 0; |
| 95 | at = 0; |
| 96 | while (LDS2[c] != '\0') { |
| 97 | switch (LDS2[c]) { |
| 98 | case '-': |
| 99 | if (n != 0) { |
| 100 | if (f == functionnum) { |
| 101 | ctx->localdeclare[at][i] = atoi(number); |
| 102 | } |
| 103 | } |
| 104 | at = 1; |
| 105 | n = 0; |
| 106 | break; |
| 107 | case ',': |
| 108 | if (n != 0) { |
| 109 | if (f == functionnum) { |
| 110 | ctx->localdeclare[at][i] = atoi(number); |
| 111 | } |
| 112 | } |
| 113 | i++; |
| 114 | n = 0; |
| 115 | at = 0; |
| 116 | break; |
| 117 | case ';': |
| 118 | if (n != 0) { |
| 119 | if (f == functionnum) { |
| 120 | ctx->localdeclare[at][i] = atoi(number); |
| 121 | } |
| 122 | } |
| 123 | i = 0; |
| 124 | n = 0; |
| 125 | at = 0; |
| 126 | f++; |
| 127 | break; |
| 128 | default: |
| 129 | number[n] = LDS2[c]; |
| 130 | n++; |
| 131 | number[n] = '\0'; |
| 132 | break; |
| 133 | } |
| 134 | c++; |
| 135 | } |
| 136 | if (n != 0) { |
| 137 | if (f == functionnum) { |
| 138 | ctx->localdeclare[at][i] = atoi(number); |
| 139 | } |
| 140 | } |