| 23 | } |
| 24 | |
| 25 | void init_decode_table() { |
| 26 | for (int i = 0; i < 256; i++) { |
| 27 | char ch = (char)i; |
| 28 | char code = -1; |
| 29 | if (ch >= 'A' && ch <= 'Z') code = ch - 0x41; |
| 30 | if (ch >= 'a' && ch <= 'z') code = ch - 0x47; |
| 31 | if (ch >= '0' && ch <= '9') code = ch + 0x04; |
| 32 | if (ch == '+' || ch == '-') code = 0x3E; |
| 33 | if (ch == '/' || ch == '_') code = 0x3F; |
| 34 | decode_table[i] = code; |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | #define next_char(x) char x = decode_table[(unsigned char)*str++]; if (x < 0) return 1; |
| 39 |